summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxtraeme <xtraeme>2004-11-17 19:30:12 +0000
committerxtraeme <xtraeme>2004-11-17 19:30:12 +0000
commit7a9795922bd3ecc0d9510157e61373661065a0f3 (patch)
treea0b21336d636f1ecd8a376cf67f6ac9ec750b4d2
parent88239250a3cee433eb00188362944246ea0d96c0 (diff)
downloadpkgsrc-7a9795922bd3ecc0d9510157e61373661065a0f3.tar.gz
Convert to use bsd.options.mk and use subst.mk instead of using
sed(1)/mv(1). # XXX Support for the following variables will be removed after the # XXX pkgsrc-2004Q3 branch is released: # XXX # XXX APR_USE_DB4 # XXX APR_USE_OPENLDAP
-rw-r--r--devel/apr/Makefile37
-rw-r--r--devel/apr/buildlink3.mk7
-rw-r--r--devel/apr/options.mk34
3 files changed, 46 insertions, 32 deletions
diff --git a/devel/apr/Makefile b/devel/apr/Makefile
index 3b7eff3dae9..66b3035e682 100644
--- a/devel/apr/Makefile
+++ b/devel/apr/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.27 2004/11/10 18:09:07 epg Exp $
+# $NetBSD: Makefile,v 1.28 2004/11/17 19:30:12 xtraeme Exp $
PKGNAME= apr-${APR_VERSION}.${APACHE_VERSION}
PKGREVISION= 1
@@ -23,13 +23,6 @@ CONFIGURE_ENV+= CFLAGS="${CFLAGS}" LIBS="${LDFLAGS}"
LDFLAGS.SunOS+= -lnsl
-pre-configure:
-.for f in apr/config.layout apr-util/config.layout
- ${SED} -e 's|@PREFIX@|${PREFIX}|g' < ${WRKSRC}/$f > ${WRKSRC}/$f.new
- ${MV} ${WRKSRC}/$f.new ${WRKSRC}/$f
-.endfor
-.undef f
-
APR_CONFIGURE_ARGS= \
--prefix=${PREFIX} \
--with-devrandom=/dev/urandom \
@@ -42,15 +35,7 @@ APU_CONFIGURE_ARGS= \
--without-gdbm
.include "../../mk/bsd.prefs.mk"
-
-BUILD_DEFS+= APR_USE_OPENLDAP APR_USE_DB4
-
-.if !empty(APR_USE_DB4:M[Yy][Ee][Ss])
-APU_CONFIGURE_ARGS+=\
- --with-berkeley-db=${BUILDLINK_PREFIX.db4}/include:${LOCALBASE}
-.else
-APU_CONFIGURE_ARGS+= --with-dbm=sdbm
-.endif
+.include "options.mk"
do-configure:
@cd ${WRKSRC}/apr && ${SETENV} ${CONFIGURE_ENV} ./configure \
@@ -65,18 +50,12 @@ post-install:
@${CHMOD} ${PKGDIRMODE} ${PREFIX}/include/apr-0
@${CHOWN} -R ${SHAREOWN}:${SHAREGRP} ${PREFIX}/include/apr-0/
-.include "../../www/apache2/Makefile.common"
-
-.if !empty(APR_USE_DB4:M[Yy][Ee][Ss])
-.include "../../databases/db4/buildlink3.mk"
-.endif
-
-# Enable OpenLDAP support
-.if !empty(APR_USE_OPENLDAP:M[Yy][Ee][Ss])
-APU_CONFIGURE_ARGS+= --with-ldap
-APR_CONFIGURE_ARGS+= --with-ldap
-.include "../../databases/openldap/buildlink3.mk"
-.endif
+SUBST_CLASSES+= conf
+SUBST_STAGE.conf= pre-configure
+SUBST_FILES.conf= apr/config.layout apr-util/config.layout
+SUBST_SED.conf= -e "s,@PREFIX@,${PREFIX},g"
+SUBST_MESSAGE.conf= "Fixing harcoded paths."
+.include "../../www/apache2/Makefile.common"
.include "../../textproc/expat/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/devel/apr/buildlink3.mk b/devel/apr/buildlink3.mk
index 9d4f0a17e10..b849daeae7f 100644
--- a/devel/apr/buildlink3.mk
+++ b/devel/apr/buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.8 2004/10/26 04:57:12 xtraeme Exp $
+# $NetBSD: buildlink3.mk,v 1.9 2004/11/17 19:30:12 xtraeme Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
APR_BUILDLINK3_MK:= ${APR_BUILDLINK3_MK}+
@@ -22,10 +22,11 @@ BUILDLINK_FILES.apr+= bin/apu-config
BUILDLINK_FILES.apr+= lib/*.exp
.endif # APR_BUILDLINK3_MK
-.if !empty(APR_USE_DB4:M[yY][eE][sS])
+.if !empty(PKG_OPTIONS.apr:Mdb4)
. include "../../databases/db4/buildlink3.mk"
.endif
-.if !empty(APR_USE_OPENLDAP:M[Yy][Ee][Ss])
+
+.if !empty(PKG_OPTIONS.apr:Mopenldap)
. include "../../databases/openldap/buildlink3.mk"
.endif
diff --git a/devel/apr/options.mk b/devel/apr/options.mk
new file mode 100644
index 00000000000..ae6d2844fb9
--- /dev/null
+++ b/devel/apr/options.mk
@@ -0,0 +1,34 @@
+# $NetBSD: options.mk,v 1.1 2004/11/17 19:30:12 xtraeme Exp $
+#
+# XXX Support for the following variables will be removed after the
+# XXX pkgsrc-2004Q3 branch is released:
+# XXX
+# XXX APR_USE_DB4
+# XXX APR_USE_OPENLDAP
+
+.if defined(APR_USE_DB4) && !empty(APR_USE_DB4:M[Yy][Ee][Ss])
+PKG_DEFAULT_OPTIONS+= db4
+.endif
+
+.if defined(APR_USE_OPENLDAP) && !empty(APR_USE_OPENLDAP:M[Yy][Ee][Ss])
+PKG_DEFAULT_OPTIONS+= openldap
+.endif
+
+PKG_OPTIONS_VAR= PKG_OPTIONS.apr
+PKG_SUPPORTED_OPTIONS= db4 openldap
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Mdb4)
+APU_CONFIGURE_ARGS+= \
+ --with-berkeley-db=${BUILDLINK_PREFIX.db4}/include:${LOCALBASE}
+. include "../../databases/db4/buildlink3.mk"
+.else
+APU_CONFIGURE_ARGS+= --with-dbm=sdbm
+.endif
+
+.if !empty(PKG_OPTIONS:Mopenldap)
+APU_CONFIGURE_ARGS+= --with-ldap
+APR_CONFIGURE_ARGS+= --with-ldap
+. include "../../databases/openldap/buildlink3.mk"
+.endif