tech-pkg archive

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

Re: pkg/42328: setting PKG_SYSCONFDIR.minicom creates directory permission problems



On Sat, 21 Nov 2009, Steven Drake wrote:

> Perhaps the hole logic regarding how PKG_SYSCONFDIR and PKG_SYSCONFBASEDIR
> are set to be reworked?  
> 
> IMO create a new variable (eg. REQD_PKG_SYSCONFSUBDIR) and patch the few 
> packages (11 of them) that need it.
> 

So heres some patches to do just that.  The patches are well annotated and
probably more explanative than this email.

Adding REQD_PKG_SYSCONFSUBDIR has the effect of closing PR pkg/42327 as 
well as any similar problems in the future and partly closes PR pkg/42328.

-- 
Steven
Add REQD_PKG_SYSCONFSUBDIR variant of PKG_SYSCONFSUBDIR, in this case
if PKG_SYSCONFDIR.${PKG_SYSCONFVAR} will still get appended, but to be on
the safe side the PKG_SYSCONFSUBDIR is first remove to get PKG_SYSCONFBASEDIR
and then appended.  This has the affect that if the user puts
"PKG_SYSCONFDIR.package=/etc/package" or
"PKG_SYSCONFDIR.package=/etc"
in there mk.conf the result is the same.  In the latter case a warning is 
also given.

For all other when PKG_SYSCONFDIR.${PKG_SYSCONFVAR} and PKG_SYSCONFSUBDIR
are set PKG_SYSCONFSUBDIR will be reset, as suggested by OBATA Akio.

Index: mk/bsd.pkg.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/bsd.pkg.mk,v
retrieving revision 1.1959
diff -u -p -r1.1959 bsd.pkg.mk
--- mk/bsd.pkg.mk       10 Sep 2009 21:46:57 -0000      1.1959
+++ mk/bsd.pkg.mk       24 Nov 2009 01:34:14 -0000
@@ -352,7 +352,8 @@ FAIL?=                      ${SH} ${PKGSRCDIR}/mk/scripts/f
 # Config file related settings - see doc/pkgsrc.txt
 #
 PKG_SYSCONFVAR?=       ${PKGBASE}
-PKG_SYSCONFSUBDIR?=    # empty
+REQD_PKG_SYSCONFSUBDIR?=# empty
+PKG_SYSCONFSUBDIR?=    ${REQD_PKG_SYSCONFSUBDIR}
 .if ${PKG_INSTALLATION_TYPE} == "overwrite"
 PKG_SYSCONFDEPOTBASE=  # empty
 PKG_SYSCONFBASEDIR=    ${PKG_SYSCONFBASE}
@@ -373,8 +374,18 @@ DFLT_PKG_SYSCONFDIR:=      ${PKG_SYSCONFBASED
 .endif
 PKG_SYSCONFDIR=                ${DFLT_PKG_SYSCONFDIR}
 .if defined(PKG_SYSCONFDIR.${PKG_SYSCONFVAR})
+. if !empty(REQD_PKG_SYSCONFSUBDIR)
+# PKG_SYSCONFSUBDIR gets append weather the user wants it or not! 
+PKG_SYSCONFBASEDIR=    
${PKG_SYSCONFDIR.${PKG_SYSCONFVAR}:S/${PKG_SYSCONFSUBDIR}$//}
+PKG_SYSCONFDIR=                ${PKG_SYSCONFBASEDIR}/${PKG_SYSCONFSUBDIR}
+.   if !empty(PKG_SYSCONFDIR.${PKG_SYSCONFVAR}:C/^.*\/${PKG_SYSCONFSUBDIR}$//)
+WARNINGS+="[mk.conf] PKG_SYSCONFDIR.${PKG_SYSCONFVAR} MUST end with 
'/${PKG_SYSCONFSUBDIR}'"
+.   endif
+. else
 PKG_SYSCONFDIR=                ${PKG_SYSCONFDIR.${PKG_SYSCONFVAR}}
 PKG_SYSCONFBASEDIR=    ${PKG_SYSCONFDIR.${PKG_SYSCONFVAR}}
+PKG_SYSCONFSUBDIR=     # empty (reset!)
+. endif
 PKG_SYSCONFDEPOTBASE=  # empty
 .endif
 PKG_SYSCONFDIR_PERMS?= ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 755
Change PKG_SYSCONFSUBDIR to REQD_PKG_SYSCONFSUBDIR for those packages that
need it.

Index: inputmethod/tomoe/Makefile
===================================================================
--- inputmethod/tomoe/Makefile.orig     2008-06-05 01:01:36.000000000 +1200
+++ inputmethod/tomoe/Makefile  2009-11-21 17:35:28.000000000 +1300
@@ -17,7 +17,7 @@ USE_LIBTOOL=          yes
 USE_TOOLS+=            gmake pkg-config intltool msgfmt
 USE_PKGLOCALEDIR=      yes
 
-PKG_SYSCONFSUBDIR=     tomoe
+REQD_PKG_SYSCONFSUBDIR=        tomoe
 
 PKGCONFIG_OVERRIDE+=   bindings/python/pytomoe.pc.in
 PKGCONFIG_OVERRIDE+=   tomoe.pc.in
Index: net/freeradius/Makefile
===================================================================
--- net/freeradius/Makefile.orig        2009-10-13 14:54:27.000000000 +1300
+++ net/freeradius/Makefile     2009-11-21 17:35:34.000000000 +1300
@@ -31,7 +31,7 @@ MESSAGE_SUBST+=               CHOWN=${CHOWN:Q} CHMOD=
 MESSAGE_SUBST+=                RADIUS_USER=${RADIUS_USER:Q} XARGS=${XARGS:Q}
 MESSAGE_SUBST+=                RADIUS_GROUP=${RADIUS_GROUP:Q} FIND=${FIND:Q}
 
-PKG_SYSCONFSUBDIR=     raddb
+REQD_PKG_SYSCONFSUBDIR=        raddb
 RCD_SCRIPTS=           radiusd
 RADIUS_USER?=          radius
 RADIUS_GROUP?=         radius
Index: net/freeradius2/Makefile
===================================================================
--- net/freeradius2/Makefile.orig       2009-10-13 14:54:27.000000000 +1300
+++ net/freeradius2/Makefile    2009-11-21 17:35:41.000000000 +1300
@@ -28,7 +28,7 @@ MESSAGE_SUBST+=               CHOWN=${CHOWN:Q} CHMOD=
 MESSAGE_SUBST+=                RADIUS_USER=${RADIUS_USER} XARGS=${XARGS:Q}
 MESSAGE_SUBST+=                RADIUS_GROUP=${RADIUS_GROUP} FIND=${FIND:Q}
 
-PKG_SYSCONFSUBDIR=     raddb
+REQD_PKG_SYSCONFSUBDIR=        raddb
 RCD_SCRIPTS=           radiusd
 RADIUS_USER?=          radius
 RADIUS_GROUP?=         radius
Index: net/radiusclient-ng/Makefile
===================================================================
--- net/radiusclient-ng/Makefile.orig   2009-08-04 12:45:54.000000000 +1200
+++ net/radiusclient-ng/Makefile        2009-11-21 17:35:47.000000000 +1300
@@ -15,7 +15,7 @@ PKG_DESTDIR_SUPPORT=  user-destdir
 GNU_CONFIGURE=         YES
 USE_LIBTOOL=           YES
 
-PKG_SYSCONFSUBDIR=     radiusclient-ng
+REQD_PKG_SYSCONFSUBDIR=        radiusclient-ng
 EGDIR=                 ${PREFIX}/share/examples/radiusclient-ng
 
 CONFIGURE_ARGS+=        --sysconfdir=${PKG_SYSCONFBASEDIR:Q}
Index: net/tor/Makefile
===================================================================
--- net/tor/Makefile.orig       2009-10-13 14:55:18.000000000 +1300
+++ net/tor/Makefile    2009-11-21 17:35:52.000000000 +1300
@@ -27,7 +27,7 @@ TOR_USER?=            tor
 TOR_GROUP?=            tor
 PKG_HOME?=             ${VARBASE}/chroot/tor
 BUILD_DEFS+=           VARBASE
-PKG_SYSCONFSUBDIR=     tor
+REQD_PKG_SYSCONFSUBDIR=        tor
 
 PKG_GROUPS_VARS+=      TOR_GROUP
 PKG_USERS_VARS+=       TOR_USER
Index: print/cups/Makefile
===================================================================
--- print/cups/Makefile.orig    2009-10-13 14:55:35.000000000 +1300
+++ print/cups/Makefile 2009-11-21 17:36:03.000000000 +1300
@@ -77,7 +77,7 @@ BUILD_DEFS+=          VARBASE
 
 DOCDIR=                        ${PREFIX}/share/doc/cups
 EGDIR=                 ${PREFIX}/share/examples/cups
-PKG_SYSCONFSUBDIR=     cups
+REQD_PKG_SYSCONFSUBDIR=        cups
 CUPS_CONFDIR=          ${PKG_SYSCONFDIR}
 CUPS_LOGDIR=           ${VARBASE}/log/cups
 CUPS_REQUESTS=         ${VARBASE}/spool/cups
Index: security/libprelude/Makefile.common
===================================================================
--- security/libprelude/Makefile.common.orig    2009-10-08 08:40:41.000000000 
+1300
+++ security/libprelude/Makefile.common 2009-11-21 17:36:16.000000000 +1300
@@ -30,7 +30,7 @@ CONFIGURE_ARGS+=      --sysconfdir=${PKG_SYSC
 CONFIGURE_ARGS+=       --localstatedir=${VARBASE:Q}
 CONFIGURE_ARGS+=       --with-html-dir=${PREFIX}/share/doc
 CONFIGURE_ARGS+=       --enable-easy-bindings
-PKG_SYSCONFSUBDIR=     prelude
+REQD_PKG_SYSCONFSUBDIR=        prelude
 
 PRELUDE_USER?=         _prelude
 PRELUDE_GROUP?=                _prelude
Index: sysutils/gnome-vfs/Makefile.common
===================================================================
--- sysutils/gnome-vfs/Makefile.common.orig     2009-08-04 12:47:18.000000000 
+1200
+++ sysutils/gnome-vfs/Makefile.common  2009-11-21 17:36:23.000000000 +1300
@@ -38,7 +38,7 @@ MAKE_FLAGS+=          localedir=${PREFIX}/${PKGL
 INSTALL_MAKE_FLAGS+=   ${MAKE_FLAGS}
 INSTALL_MAKE_FLAGS+=   
modulesconfdir=${PREFIX}/share/examples/gnome-vfs-2.0/modules
 
-PKG_SYSCONFSUBDIR=     gnome-vfs-2.0
+REQD_PKG_SYSCONFSUBDIR=        gnome-vfs-2.0
 
 EGDIR=                 ${PREFIX}/share/examples/gnome-vfs-2.0
 .for f in ${EGFILES}
Index: wm/pekwm/Makefile
===================================================================
--- wm/pekwm/Makefile.orig      2009-10-13 14:57:49.000000000 +1300
+++ wm/pekwm/Makefile   2009-11-21 17:36:28.000000000 +1300
@@ -20,7 +20,7 @@ USE_LANGUAGES=        c c++
 
 CONFIGURE_ARGS+=       --sysconfdir=${PKG_SYSCONFBASEDIR}
 
-PKG_SYSCONFSUBDIR=     pekwm
+REQD_PKG_SYSCONFSUBDIR=        pekwm
 
 EGDIR=                 ${PREFIX}/share/examples/pekwm
 CONF_FILES=
Index: wm/windowmaker/Makefile
===================================================================
--- wm/windowmaker/Makefile.orig        2009-10-13 14:57:51.000000000 +1300
+++ wm/windowmaker/Makefile     2009-11-21 17:36:33.000000000 +1300
@@ -43,7 +43,7 @@ CONFIGURE_ENV+=               ac_cv_c_inline_asm=no
 GCC_REQD+=     3.0
 .endif
 
-PKG_SYSCONFSUBDIR=     WindowMaker
+REQD_PKG_SYSCONFSUBDIR=        WindowMaker
 EGDIR=                 ${PREFIX}/share/examples/WindowMaker
 CONF_FILES=
 .for f in WMGLOBAL WMRootMenu WMState WMWindowAttributes WindowMaker
Index: www/kahua/Makefile
===================================================================
--- www/kahua/Makefile.orig     2009-08-04 12:48:19.000000000 +1200
+++ www/kahua/Makefile  2009-11-21 17:36:40.000000000 +1300
@@ -20,7 +20,7 @@ CONFIGURE_ARGS+=--sysconfdir=${PKG_SYSCO
 CONFIGURE_ARGS+=--localstatedir=${DESTDIR}${VARBASE}
 BUILD_DEFS+=   VARBASE
 
-PKG_SYSCONFSUBDIR=     kahua
+REQD_PKG_SYSCONFSUBDIR=        kahua
 EGDIR=                 ${PREFIX}/share/examples/kahua
 CONF_FILES=            ${EGDIR}/kahua.conf ${PKG_SYSCONFDIR}/kahua.conf
 


Home | Main Index | Thread Index | Old Index