You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2013/04/17 22:02:06 UTC

svn commit: r1469050 - in /qpid/branches/0.22/qpid/cpp/etc: CMakeLists.txt Makefile.am qpidd-primary.in qpidd.in

Author: aconway
Date: Wed Apr 17 20:02:06 2013
New Revision: 1469050

URL: http://svn.apache.org/r1469050
Log:
QPID-4733: Fix cmake installation of init scripts

- Install both qpidd and qpidd-primary init scripts.
- Fix path substitution to use absolute paths.
- Fix substitution to work on cmake and automake.
- Set executable permissions for init scripts.
- Do init script install on Unix only.

Modified:
    qpid/branches/0.22/qpid/cpp/etc/CMakeLists.txt
    qpid/branches/0.22/qpid/cpp/etc/Makefile.am
    qpid/branches/0.22/qpid/cpp/etc/qpidd-primary.in
    qpid/branches/0.22/qpid/cpp/etc/qpidd.in

Modified: qpid/branches/0.22/qpid/cpp/etc/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/cpp/etc/CMakeLists.txt?rev=1469050&r1=1469049&r2=1469050&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/cpp/etc/CMakeLists.txt (original)
+++ qpid/branches/0.22/qpid/cpp/etc/CMakeLists.txt Wed Apr 17 20:02:06 2013
@@ -17,12 +17,37 @@
 # under the License.
 #
 
+if (UNIX)
+
+  # Use automake variable names as these files are also configured by automake.
+  # Use absolute paths as these are substituted into init scripts.
+  set_absolute_install_path (bindir ${QPID_INSTALL_BINDIR})
+  set_absolute_install_path (sysconfdir ${SYSCONF_INSTALL_DIR})
+  set_absolute_install_path (sbindir ${QPID_INSTALL_SBINDIR})
+
+  configure_file(qpidd.in
+    ${CMAKE_CURRENT_BINARY_DIR}/qpidd
+    @ONLY)
+
+  configure_file(qpidd-primary.in
+    ${CMAKE_CURRENT_BINARY_DIR}/qpidd-primary
+    @ONLY)
+
+endif (UNIX)
+
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qpidd ${CMAKE_CURRENT_BINARY_DIR}/qpidd-primary
+        PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
+        DESTINATION ${SYSCONF_INSTALL_DIR}/rc.d/init.d
+        COMPONENT ${QPID_COMPONENT_BROKER})
+
 install(FILES qpidc.conf
         DESTINATION ${QPID_INSTALL_CONFDIR}
         COMPONENT ${QPID_COMPONENT_CLIENT})
+
 install(FILES qpidd.conf
         DESTINATION ${QPID_INSTALL_CONFDIR}
         COMPONENT ${QPID_COMPONENT_BROKER})
+
 if (BUILD_SASL)
   install(FILES sasl2/qpidd.conf
           DESTINATION ${QPID_INSTALL_SASLDIR}

Modified: qpid/branches/0.22/qpid/cpp/etc/Makefile.am
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/cpp/etc/Makefile.am?rev=1469050&r1=1469049&r2=1469050&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/cpp/etc/Makefile.am (original)
+++ qpid/branches/0.22/qpid/cpp/etc/Makefile.am Wed Apr 17 20:02:06 2013
@@ -40,7 +40,7 @@ endif
 # We can't use autoconf substitution directly because it leaves
 #  ${prefix} and ${exec_prefix} unexpanded. Substitute with sed
 #  scripts.
-SUBST="s|!!sysconfdir!!|${sysconfdir}|;s|!!sbindir!!|${sbindir}|;s|!!bindir!!|${bindir}|"
+SUBST="s|@sysconfdir[@]|${sysconfdir}|;s|@sbindir[@]|${sbindir}|;s|@bindir[@]|${bindir}|"
 qpidd: qpidd.in
 	sed $(SUBST) $< > $@
 qpidd-primary: qpidd-primary.in

Modified: qpid/branches/0.22/qpid/cpp/etc/qpidd-primary.in
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/cpp/etc/qpidd-primary.in?rev=1469050&r1=1469049&r2=1469050&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/cpp/etc/qpidd-primary.in (original)
+++ qpid/branches/0.22/qpid/cpp/etc/qpidd-primary.in Wed Apr 17 20:02:06 2013
@@ -40,13 +40,13 @@ prog=qpidd
 # Source function library.
 . /etc/rc.d/init.d/functions
 
-if [ -f !!sysconfdir!!/sysconfig/$prog ] ; then
-    . !!sysconfdir!!/sysconfig/$prog
+if [ -f @sysconfdir@/sysconfig/$prog ] ; then
+    . @sysconfdir@/sysconfig/$prog
 fi
 
 # The following variables can be overridden in !!sysconfdir!!/sysconfig/$prog
 [[ $QPID_PORT ]] || QPID_PORT=5672
-[[ $QPID_HA ]]   || QPID_HA=!!bindir!!/qpid-ha
+[[ $QPID_HA ]]   || QPID_HA=@bindir@/qpid-ha
 export QPID_PORT
 
 RETVAL=0

Modified: qpid/branches/0.22/qpid/cpp/etc/qpidd.in
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/cpp/etc/qpidd.in?rev=1469050&r1=1469049&r2=1469050&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/cpp/etc/qpidd.in (original)
+++ qpid/branches/0.22/qpid/cpp/etc/qpidd.in Wed Apr 17 20:02:06 2013
@@ -40,8 +40,8 @@ lockfile=/var/lock/subsys/$prog
 pidfile=/var/run/qpidd.pid
 
 # Source configuration
-if [ -f !!sysconfdir!!/sysconfig/$prog ] ; then
-	. !!sysconfdir!!/sysconfig/$prog
+if [ -f @sysconfdir@/sysconfig/$prog ] ; then
+	. @sysconfdir@/sysconfig/$prog
 fi
 
 # Source function library.
@@ -50,8 +50,8 @@ fi
 RETVAL=0
 
 #ensure binary is present and executable
-if [[ !(-x !!sbindir!!/$prog) ]] ; then
-    echo "!!sbindir!!/$prog not found or not executable"
+if [[ !(-x @sbindir@/$prog) ]] ; then
+    echo "@sbindir@/$prog not found or not executable"
     exit 5
 fi
 
@@ -65,7 +65,7 @@ fi
 start() {
         [[ $QPID_DATA_DIR ]] || QPID_DATA_DIR=/var/lib/qpidd
         echo -n $"Starting Qpid AMQP daemon: "
-	daemon --pidfile $pidfile --check $prog --user qpidd !!sbindir!!/$prog --data-dir $QPID_DATA_DIR --daemon $QPIDD_OPTIONS
+	daemon --pidfile $pidfile --check $prog --user qpidd @sbindir@/$prog --data-dir $QPID_DATA_DIR --daemon $QPIDD_OPTIONS
 	RETVAL=$?
 	echo
 	[ $RETVAL = 0 ] && touch $lockfile
@@ -73,7 +73,7 @@ start() {
 	    touch $pidfile
 	    chown qpidd.qpidd $pidfile
             [ -x /sbin/restorecon ] && /sbin/restorecon $pidfile
-	    runuser - -s /bin/sh qpidd -c "!!sbindir!!/$prog --check > $pidfile"
+	    runuser - -s /bin/sh qpidd -c "@sbindir@/$prog --check > $pidfile"
 	fi
 	return $RETVAL
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org