Subject: identify packages that were custom built?
To: None <tech-pkg@netbsd.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-pkg
Date: 09/19/2007 10:53:28
Any generic way to identify packages that were built other than the 
defaults?

I don't see anything.

The reason I am asking is for a tool for doing package updates. I want it 
to warn or stop if the package installed or to-be installed isn't built 
with defaults (is custom built).

For example, my apache is built with suexec and custom 
APACHE_SUEXEC_DOCROOT. I do not want an update to think it is okay to 
replace a package with one that is built with defaults (without me 
overriding or asking first).

I don't think it is necessary to have fine-tuned checks, such as for 
PKG_OPTIONS=suexec or APACHE_SUEXEC_DOCROOT (which is not even recorded in 
binary).

But just something generic like:

CUSTOM=true

Maybe that could be set if PKG_SUGGESTED_OPTIONS doesn't match 
PKG_OPTIONS, but that may be hard if things are in different order.

And I don't know how to easily check if things like APACHE_SUEXEC_DOCROOT 
are defined pkgsrc-wide. So individually do things like:
.ifdef APACHE_SUEXEC_DOCROOT
CUSTOM=true
BUILD_DEFS+=	CUSTOM
.endif

Any comments?

  Jeremy C. Reed

p.s. Okay to commit the following (even though 
APACHE_SUEXEC_CONFIGURE_ARGS includes APACHE_SUEXEC_DOCROOT)?

Index: www/apache/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/www/apache/Makefile,v
retrieving revision 1.191
diff -u -r1.191 Makefile
--- www/apache/Makefile	4 Jul 2007 20:55:02 -0000	1.191
+++ www/apache/Makefile	19 Sep 2007 15:47:49 -0000
@@ -80,6 +80,7 @@
 			${APACHE_SUEXEC_CONFIGURE_ARGS:M--suexec-*}
 PLIST_SRC=		${PKGDIR}/PLIST.suexec
 BUILD_DEFS+=		APACHE_SUEXEC_CONFIGURE_ARGS
+BUILD_DEFS+=	`	APACHE_SUEXEC_DOCROOT
 .endif
 
 # Note that there is NO static compile module hook here.  This is intentional.
@@ -130,7 +131,7 @@
 .  endif
 .endif
 
-BUILD_DEFS+=		APACHE_CUSTOM_CFLAGS
+BUILD_DEFS+=		APACHE_CUSTOM_CFLAGS APACHE_USER APACHE_GROUP
 
 EGDIR=		${PREFIX}/share/examples/httpd