pkgsrc-Bugs archive

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

Re: pkg/50075 (Making dbus actually work on FreeBSD, DragonFly, and probably more)



The following reply was made to PR pkg/50075; it has been noted by GNATS.

From: David Shao <davshao%gmail.com@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: pkg/50075 (Making dbus actually work on FreeBSD, DragonFly, and
 probably more)
Date: Mon, 7 Sep 2015 20:40:56 -0700

 The following patches allow the user in mk.conf to specify using
 DBUS_USER
 DBUS_GROUP
 DBUS_SYSTEM_PID_FILE
 the value of all of these for dbus.  Dbus needs this flexibility
 because for example on various systems DBUS_SYSTEM_PID_FILE can be any
 of pid, dbus.pid, or messagebus.pid.
 
 I found myself forced to make two controversial decisions.  One was to
 replace the substitution variables for files in subdirectory /files by
 adding a _SH suffix to them to produce
 
 DBUS_USER_SH
 DBUS_GROUP_SH
 DBUS_SYSTEM_PID_FILE_SH
 
 The reason I did this was to leave no chance of conflicting with
 dbus's own substitution variables, @DBUS_USER@ and
 @DBUS_SYSTEM_PID_FILE@, and dbus has its own configure options
 allowing them to be set.
 
 Unfortunately replacing these file substitution variables required
 making two changes to files under subdirectory /files/smf.
 
 diff -Nurb dbus.rcvar/Makefile dbus.user/Makefile
 --- dbus.rcvar/Makefile    2015-09-07 15:42:01.358482000 -0700
 +++ dbus.user/Makefile    2015-09-07 18:52:16.625900000 -0700
 @@ -18,7 +18,7 @@
 
  PKGCONFIG_OVERRIDE=    dbus-1.pc.in
 
 -BUILD_DEFS+=        VARBASE
 +BUILD_DEFS+=        VARBASE DBUS_USER DBUS_GROUP DBUS_SYSTEM_PID_FILE
 
  OWN_DIRS_PERMS+=    ${VARBASE}/db/dbus ${DBUS_USER} ${DBUS_GROUP} 0755
  SPECIAL_PERMS+=        libexec/dbus-daemon-launch-helper
 ${REAL_ROOT_USER} ${DBUS_GROUP} 4511
 @@ -57,6 +57,7 @@
 
  CONFIGURE_ARGS+=    --with-dbus-user=${DBUS_USER}
  CONFIGURE_ARGS+=    --with-test-socket-dir=${WRKDIR:Q}
 +CONFIGURE_ARGS+=
 --with-system-pid-file=${VARBASE}/run/dbus/${DBUS_SYSTEM_PID_FILE}
 
  PTHREAD_AUTO_VARS=    yes
 
 @@ -79,8 +80,9 @@
  PKG_GECOS.${DBUS_USER}=    System message bus
  PKG_HOME.${DBUS_USER}=    ${VARBASE}/run/dbus
 
 -FILES_SUBST+=        DBUS_USER=${DBUS_USER}
 -FILES_SUBST+=        DBUS_GROUP=${DBUS_GROUP}
 +FILES_SUBST+=        DBUS_USER_SH=${DBUS_USER}
 +FILES_SUBST+=        DBUS_GROUP_SH=${DBUS_GROUP}
 +FILES_SUBST+=        DBUS_SYSTEM_PID_FILE_SH=${DBUS_SYSTEM_PID_FILE}
 
  BUILDLINK_TRANSFORM+=    rm:-Wl,--gc-sections
  # Package tries to use these if gcc accepts them, but that doesn't
 diff -Nurb dbus.rcvar/files/dbus.sh dbus.user/files/dbus.sh
 --- dbus.rcvar/files/dbus.sh    2015-09-07 16:39:16.527612000 -0700
 +++ dbus.user/files/dbus.sh    2015-09-07 19:10:12.806257000 -0700
 @@ -12,7 +12,7 @@
  rcvar="@DBUS_RCVAR@"
  command="@PREFIX@/bin/dbus-daemon"
  command_args="--system"
 -pidfile="@VARBASE@/run/dbus/pid"
 +pidfile="@VARBASE@/run/dbus/@DBUS_SYSTEM_PID_FILE_SH@"
  start_precmd=dbus_prestart
 
  dbus_prestart() {
 @@ -20,7 +20,7 @@
      if @TEST@ ! -d $dir; then
          @MKDIR@ $dir
          @CHMOD@ 0755 $dir
 -        @CHOWN@ @DBUS_USER@:@DBUS_GROUP@ $dir
 +        @CHOWN@ @DBUS_USER_SH@:@DBUS_GROUP_SH@ $dir
      fi
      @PREFIX@/bin/dbus-uuidgen --ensure
  }
 diff -Nurb dbus.rcvar/files/smf/dbus.sh dbus.user/files/smf/dbus.sh
 --- dbus.rcvar/files/smf/dbus.sh    2015-07-05 08:21:50.000000000 -0700
 +++ dbus.user/files/smf/dbus.sh    2015-09-07 18:40:30.704480000 -0700
 @@ -20,7 +20,7 @@
      if ! [ -d $dir ]; then
          @MKDIR@ $dir
          @CHMOD@ 0755 $dir
 -        @CHOWN@ @DBUS_USER@:@DBUS_GROUP@ $dir
 +        @CHOWN@ @DBUS_USER_SH@:@DBUS_GROUP_SH@ $dir
      elif [ -f $pidfile ]; then
          rm -f $pidfile
      fi
 diff -Nurb dbus.rcvar/files/smf/manifest.xml dbus.user/files/smf/manifest.xml
 --- dbus.rcvar/files/smf/manifest.xml    2015-07-05 08:21:50.000000000 -0700
 +++ dbus.user/files/smf/manifest.xml    2015-09-07 19:10:57.715712000 -0700
 @@ -19,7 +19,7 @@
          exec='@PREFIX@/@SMF_METHOD_FILE.dbus@ start'
          timeout_seconds='30'>
          <method_context>
 -            <method_credential user='root' group='@DBUS_GROUP@' />
 +            <method_credential user='root' group='@DBUS_GROUP_SH@' />
          </method_context>
      </exec_method>
      <exec_method
 
 --- mk.conf.orig    2015-09-07 16:58:33.690220000 -0700
 +++ mk.conf    2015-09-07 20:12:57.900641000 -0700
 @@ -803,16 +803,21 @@
  # Possible: any user name
  # Default: cyrus
 
 -DBUS_GROUP?=    dbus
 -# Used in the dbus package to specify the group to run dbus as
 -# Possible: any group name
 -# Default: dbus
 -
  DBUS_USER?=    dbus
  # Used in the dbus package to specify the user to run dbus as
  # Possible: any user name
  # Default: dbus
 
 +DBUS_GROUP?=    dbus
 +# Used in the dbus package to specify the group to run dbus as
 +# Possible: any group name, but in practice set equal to ${DBUS_USER}
 +# Default: dbus
 +
 +DBUS_SYSTEM_PID_FILE?=    pid
 +# Used in the dbus package to specify the name of the pid file
 +# Possible: any pid file name such as pid, messagebus.pid, or dbus.pid
 +# Default: pid
 +
  DEFANG_GROUP?=    defang
  # Used in the mimedefang package to specify the group to run commands as
  # Possible: any group name
 


Home | Main Index | Thread Index | Old Index