diff options
author | Alan Conway <aconway@apache.org> | 2013-04-10 19:37:32 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2013-04-10 19:37:32 +0000 |
commit | f10007aed0a335bef30c4582f5ef18908b26ff47 (patch) | |
tree | ad3a17bb09f960226e174992b51c64e5139908fa | |
parent | 0c3b10828436fba1986d3ade4e8f226377ee7816 (diff) | |
download | qpid-python-f10007aed0a335bef30c4582f5ef18908b26ff47.tar.gz |
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.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1466645 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | qpid/cpp/etc/CMakeLists.txt | 15 | ||||
-rw-r--r-- | qpid/cpp/etc/Makefile.am | 2 | ||||
-rwxr-xr-x | qpid/cpp/etc/qpidd-primary.in | 6 | ||||
-rwxr-xr-x | qpid/cpp/etc/qpidd.in | 12 |
4 files changed, 22 insertions, 13 deletions
diff --git a/qpid/cpp/etc/CMakeLists.txt b/qpid/cpp/etc/CMakeLists.txt index 5bea1351e2..f2dbc85386 100644 --- a/qpid/cpp/etc/CMakeLists.txt +++ b/qpid/cpp/etc/CMakeLists.txt @@ -17,23 +17,32 @@ # under the License. # -set (bindir ${QPID_INSTALL_BINDIR}) -set (sysconfdir ${SYSCONF_INSTALL_DIR}) +# Use automake variable names as these files are also configured by automake. +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) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qpidd-primary +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 ${QPID_INSTALL_CONFDIR}/rc.d/init.d COMPONENT ${QPID_COMPONENT_BROKER}) install(FILES qpidc.conf DESTINATION ${QPID_INSTALL_CONFDIR}/qpid 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} diff --git a/qpid/cpp/etc/Makefile.am b/qpid/cpp/etc/Makefile.am index aa41c65b37..5d0059c536 100644 --- a/qpid/cpp/etc/Makefile.am +++ b/qpid/cpp/etc/Makefile.am @@ -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 diff --git a/qpid/cpp/etc/qpidd-primary.in b/qpid/cpp/etc/qpidd-primary.in index 3088a643f2..ebb809dbf6 100755 --- a/qpid/cpp/etc/qpidd-primary.in +++ b/qpid/cpp/etc/qpidd-primary.in @@ -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 diff --git a/qpid/cpp/etc/qpidd.in b/qpid/cpp/etc/qpidd.in index 2b43625b7d..91448add02 100755 --- a/qpid/cpp/etc/qpidd.in +++ b/qpid/cpp/etc/qpidd.in @@ -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 } |