pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: DESTDIR support for www/apache22



On Fri, 20 Jun 2008 06:27:44 +0900, OBATA Akio <obache%netbsd.org@localhost> 
wrote:

> One issue remains.
>
> If apache22 is already installed and make package with USE_DESTDIR=yes,
> Then pkg_add -u apache-2.2.9.tgz shows the following warning.
>
> original MD5 checksum failed, not deleting: 
> /usr/pkg/share/httpd/build/config_vars.mk

This issue is fixed with attached new patch.
OK to commit it, or wait until "pre-2008Q3" to keep pullup to 2008Q2 easy?

-- 
"Of course I love NetBSD":-)
OBATA Akio / obache%NetBSD.org@localhost
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/www/apache22/Makefile,v
retrieving revision 1.28
diff -u -r1.28 Makefile
--- Makefile    9 Aug 2008 22:16:44 -0000       1.28
+++ Makefile    20 Aug 2008 09:18:02 -0000
@@ -9,6 +9,8 @@
 HOMEPAGE=      http://httpd.apache.org/
 COMMENT=       Apache HTTP (Web) server, version 2
 
+PKG_DESTDIR_SUPPORT=   user-destdir
+
 CONFLICTS=     apache-{,*ssl}-[0-9]* apache6-[0-9]*
 
 BUILD_DEFS+=   IPV6_READY
@@ -178,7 +180,7 @@
 # so we fix after install to reference the installed path
 SUBST_CLASSES+=                abs_srcdir
 SUBST_STAGE.abs_srcdir=        post-install
-SUBST_FILES.abs_srcdir=        ${PREFIX}/share/httpd/build/config_vars.mk
+SUBST_FILES.abs_srcdir=        
${DESTDIR}${PREFIX}/share/httpd/build/config_vars.mk
 SUBST_SED.abs_srcdir=  -e 's|^\(abs_srcdir =\) .*|\1 ${PREFIX}/share/httpd|'
 SUBST_MESSAGE.abs_srcdir=      Fixing abs_srcdir
 
@@ -221,13 +223,12 @@
        ${SED} "s#@PKG_SYSCONFDIR@#${PKG_SYSCONFDIR}#g"                 \
                < ${FILESDIR}/mkcert.sh > ${WRKDIR}/mkcert
 
-pre-install:
-       cd ${WRKSRC} && ${SETENV} ${MAKE_ENV}                           \
-               ${MAKE_PROGRAM} install-conf sysconfdir="${EGDIR}"
+INSTALL_TARGET=                install-conf install
+INSTALL_MAKE_FLAGS+=   sysconfdir="${EGDIR}"
 
 post-install:
-       ${LN} -sf ${LOCALBASE}/libexec/apr/libtool ${PREFIX}/share/httpd/build
-       cd ${EGDIR} &&                                                  \
+       ${LN} -sf ${LOCALBASE}/libexec/apr/libtool 
${DESTDIR}${PREFIX}/share/httpd/build
+       cd ${DESTDIR}${EGDIR} &&                                        \
        for file in                                                     \
                httpd.conf                                              \
                extra/httpd-ssl.conf;                                   \
@@ -246,26 +247,26 @@
                ${MV} -f $${file}.new $${file};                         \
        done
 
-       ${LN} -sf ${SBINDIR}/envvars-std ${SBINDIR}/envvars
+       ${LN} -sf ${SBINDIR}/envvars-std ${DESTDIR}${SBINDIR}/envvars
 
-       ${INSTALL_SCRIPT} ${WRKDIR}/mkcert ${PREFIX}/sbin
+       ${INSTALL_SCRIPT} ${WRKDIR}/mkcert ${DESTDIR}${PREFIX}/sbin
 
        for file in ${FIX_PERMS}; do \
-               ${CHOWN} ${BINOWN}:${BINGRP} ${PREFIX}/sbin/$$file && \
-               ${CHMOD} ${BINMODE} ${PREFIX}/sbin/$$file; \
+               ${CHOWN} ${BINOWN}:${BINGRP} ${DESTDIR}${PREFIX}/sbin/$$file && 
\
+               ${CHMOD} ${BINMODE} ${DESTDIR}${PREFIX}/sbin/$$file; \
        done
 
-       ${CHOWN} -R ${BINOWN}:${BINGRP} ${PREFIX}/share/httpd
-       ${CHOWN} -R ${BINOWN}:${BINGRP} ${PREFIX}/include/httpd
-       ${CHOWN} -R ${BINOWN}:${BINGRP} ${PREFIX}/lib/httpd
-       ${CHOWN} ${BINOWN}:${BINGRP} ${PREFIX}/libexec/cgi-bin/test-cgi
-       ${CHOWN} ${BINOWN}:${BINGRP} ${PREFIX}/libexec/cgi-bin/printenv
+       ${CHOWN} -R ${BINOWN}:${BINGRP} ${DESTDIR}${PREFIX}/share/httpd
+       ${CHOWN} -R ${BINOWN}:${BINGRP} ${DESTDIR}${PREFIX}/include/httpd
+       ${CHOWN} -R ${BINOWN}:${BINGRP} ${DESTDIR}${PREFIX}/lib/httpd
+       ${CHOWN} ${BINOWN}:${BINGRP} 
${DESTDIR}${PREFIX}/libexec/cgi-bin/test-cgi
+       ${CHOWN} ${BINOWN}:${BINGRP} 
${DESTDIR}${PREFIX}/libexec/cgi-bin/printenv
 
        for file in ${FIX_MAN_PERMS}; do \
-               ${CHOWN} ${MANOWN}:${MANGRP} ${PREFIX}/${PKGMANDIR}/$$file; \
+               ${CHOWN} ${MANOWN}:${MANGRP} 
${DESTDIR}${PREFIX}/${PKGMANDIR}/$$file; \
        done
 
-       ${CHMOD} -x ${PREFIX}/sbin/envvars-std
-       ${TEST} ! -f ${PREFIX}/sbin/suexec || ${CHMOD} -w ${PREFIX}/sbin/suexec
+       ${CHMOD} -x ${DESTDIR}${PREFIX}/sbin/envvars-std
+       ${TEST} ! -f ${DESTDIR}${PREFIX}/sbin/suexec || ${CHMOD} -w 
${DESTDIR}${PREFIX}/sbin/suexec
 
 .include "../../mk/bsd.pkg.mk"
Index: PLIST
===================================================================
RCS file: /cvsroot/pkgsrc/www/apache22/PLIST,v
retrieving revision 1.6
diff -u -r1.6 PLIST
--- PLIST       18 Jun 2008 21:38:01 -0000      1.6
+++ PLIST       20 Aug 2008 09:18:03 -0000
@@ -1053,7 +1053,9 @@
 share/httpd/manual/vhosts/name-based.html.tr.utf8
 @unexec ${RMDIR} %D/libexec/cgi-bin 2>/dev/null || ${TRUE}
 @dirrm share/httpd/manual/vhosts
+@exec ${MKDIR} %D/share/httpd/manual/style/xsl/util
 @dirrm share/httpd/manual/style/xsl/util
+@exec ${MKDIR} %D/share/httpd/manual/style/xsl
 @dirrm share/httpd/manual/style/xsl
 @dirrm share/httpd/manual/style/latex
 @exec ${MKDIR} %D/share/httpd/manual/style/lang
Index: options.mk
===================================================================
RCS file: /cvsroot/pkgsrc/www/apache22/options.mk,v
retrieving revision 1.3
diff -u -r1.3 options.mk
--- options.mk  12 Apr 2008 22:43:13 -0000      1.3
+++ options.mk  20 Aug 2008 09:18:03 -0000
@@ -8,6 +8,7 @@
 PLIST_VARS+=           suexec
 .if !empty(PKG_OPTIONS:Msuexec)
 PKG_USERS_VARS+=       APACHE_USER
+PKG_GROUPS_VARS+=      APACHE_GROUP
 BUILD_DEFS+=           VARBASE APACHE_SUEXEC_PATH
 BUILD_DEFS+=           APACHE_SUEXEC_DOCROOT APACHE_SUEXEC_LOGFILE
 
@@ -25,4 +26,5 @@
 CONFIGURE_ARGS+=        ${APACHE_SUEXEC_CONFIGURE_ARGS:M--with-suexec-*}
 BUILD_DEFS+=            APACHE_SUEXEC_CONFIGURE_ARGS
 PLIST.suexec=          yes
+SPECIAL_PERMS+=                sbin/suexec ${REAL_ROOT_USER} ${APACHE_GROUP} 
4510
 .endif


Home | Main Index | Thread Index | Old Index