From 7ec92c0a43be9e5934b35565a7f46eb83e36f6d1 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Wed, 20 Dec 2006 14:40:09 +0000 Subject: make rpm in cpp directory builds qpidc RPMs in default locations. Note: you need to chown or chmod the directories under /usr/src/redhat/RPMS/i386 to be writable for this to work, there is probably a better solution. Building RPMs as root is a Bad Idea. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@489103 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/Makefile.am | 17 +++++++--- cpp/README.txt | 16 +++++++++- cpp/docs/api/Makefile.am | 2 +- cpp/etc/init.d/qpidd | 83 ------------------------------------------------ cpp/etc/qpidd | 83 ++++++++++++++++++++++++++++++++++++++++++++++++ cpp/qpidc.spec | 70 +++++++++++++++++++++++++++------------- 6 files changed, 160 insertions(+), 111 deletions(-) delete mode 100755 cpp/etc/init.d/qpidd create mode 100755 cpp/etc/qpidd (limited to 'cpp') diff --git a/cpp/Makefile.am b/cpp/Makefile.am index 17803f6b80..9bcec9b312 100644 --- a/cpp/Makefile.am +++ b/cpp/Makefile.am @@ -1,10 +1,7 @@ AUTOMAKE_OPTIONS = 1.9.2 foreign ACLOCAL_AMFLAGS = -I m4 -EXTRA_DIST = README.txt README-dev DESIGN LICENSE.txt NOTICE.txt README.rhel3 -dist_doc_DATA = README.txt - -dist_sysconf_DATA = etc/init.d/qpidd +EXTRA_DIST = README-dev DESIGN LICENSE.txt NOTICE.txt README.rhel3 README.txt etc/qpidd SUBDIRS = gen lib tests src docs/api docs/man @@ -12,3 +9,15 @@ SUBDIRS = gen lib tests src docs/api docs/man libtool: $(LIBTOOL_DEPS) $(SHELL) ./config.status --recheck +# Convenience targets for making RPMs. +RPM_TAR=/usr/src/redhat/SOURCES/$(distdir).tar.gz + +$(RPM_TAR): dist-gzip + cp $(distdir).tar.gz $(RPM_TAR) + rpmbuild -bs -v qpidc.spec + +srpm: $(RPM_TAR) + rpmbuild -bs -v qpidc.spec + +rpm: $(RPM_TAR) + rpmbuild -ba -v qpidc.spec diff --git a/cpp/README.txt b/cpp/README.txt index 2498bbb495..4703d7538e 100644 --- a/cpp/README.txt +++ b/cpp/README.txt @@ -1 +1,15 @@ -TODO: Fill in this readme! + +Qpid C++ is a C++ implementation of the AMQP protcol described at +http://amqp.org/ + +For instructions on using the Qpid broker daemon see man qpidd(1) + +For information on the C++ client API see ./html/index.html + +Note the daemon and client API can be installed separately. + +The Qpid project also provides Java, Ruby and Python implementations. + +For additional software or information on the Qpid project go to: + http://incubator.apache.org/qpid/index.html + diff --git a/cpp/docs/api/Makefile.am b/cpp/docs/api/Makefile.am index 3f64ce6f46..6845ec0b0d 100644 --- a/cpp/docs/api/Makefile.am +++ b/cpp/docs/api/Makefile.am @@ -3,7 +3,7 @@ html: doxygen.tstamp dist-hook: html -nobase_dist_doc_DATA=$(wildcard html/*) +EXTRA_DIST=html SOURCES = \ $(wildcard $(topsrcdir)/gen/*.h) \ diff --git a/cpp/etc/init.d/qpidd b/cpp/etc/init.d/qpidd deleted file mode 100755 index 0c6041b063..0000000000 --- a/cpp/etc/init.d/qpidd +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/bash -# -# qpidd Startup script for the Qpid messaging daemon. -# -# chkconfig: - 85 15 -# description: Qpidd is an AMQP broker. It receives, stores and routes -# messages sent using the AMQP protcol. -# processname: qpidd -# pidfile: /var/run/qpidd.pid -# -# NB: add config: entries here when qpidd gets a config file. - -# Source function library. -. /etc/rc.d/init.d/functions - -if [ -f /etc/sysconfig/qpidd ]; then - . /etc/sysconfig/qpidd -fi - -# Start qpidd in the C locale by default. -QPIDD_LANG=${QPIDD_LANG-"C"} - -qpidd=${QPIDD-/usr/sbin/qpidd} -prog=qpidd -pidfile=${PIDFILE-/var/run/qpidd.pid} -lockfile=${LOCKFILE-/var/lock/subsys/qpidd} -RETVAL=0 - -start() { - echo -n $"Starting $prog: " - LANG=$QPIDD_LANG daemon $qpidd $OPTIONS - RETVAL=$? - echo - [ $RETVAL = 0 ] && touch ${lockfile} - return $RETVAL -} - -stop() { - echo -n $"Stopping $prog: " - killproc 2 $qpidd - RETVAL=$? - echo - [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile} -} - -reload() { - echo -n $"Reloading $prog: " - killproc $qpidd -HUP - RETVAL=$? - echo -} - -# See how we were called. -case "$1" in - start) - start - ;; - stop) - stop - ;; - status) - status $qpidd - RETVAL=$? - ;; - restart) - stop - start - ;; - condrestart) - if [ -f ${pidfile} ] ; then - stop - start - fi - ;; - reload) - reload - ;; - *) - echo $"Usage: $prog {start|stop|restart|condrestart|reload|status}" - exit 1 -esac - -exit $RETVAL diff --git a/cpp/etc/qpidd b/cpp/etc/qpidd new file mode 100755 index 0000000000..0c6041b063 --- /dev/null +++ b/cpp/etc/qpidd @@ -0,0 +1,83 @@ +#!/bin/bash +# +# qpidd Startup script for the Qpid messaging daemon. +# +# chkconfig: - 85 15 +# description: Qpidd is an AMQP broker. It receives, stores and routes +# messages sent using the AMQP protcol. +# processname: qpidd +# pidfile: /var/run/qpidd.pid +# +# NB: add config: entries here when qpidd gets a config file. + +# Source function library. +. /etc/rc.d/init.d/functions + +if [ -f /etc/sysconfig/qpidd ]; then + . /etc/sysconfig/qpidd +fi + +# Start qpidd in the C locale by default. +QPIDD_LANG=${QPIDD_LANG-"C"} + +qpidd=${QPIDD-/usr/sbin/qpidd} +prog=qpidd +pidfile=${PIDFILE-/var/run/qpidd.pid} +lockfile=${LOCKFILE-/var/lock/subsys/qpidd} +RETVAL=0 + +start() { + echo -n $"Starting $prog: " + LANG=$QPIDD_LANG daemon $qpidd $OPTIONS + RETVAL=$? + echo + [ $RETVAL = 0 ] && touch ${lockfile} + return $RETVAL +} + +stop() { + echo -n $"Stopping $prog: " + killproc 2 $qpidd + RETVAL=$? + echo + [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile} +} + +reload() { + echo -n $"Reloading $prog: " + killproc $qpidd -HUP + RETVAL=$? + echo +} + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + status) + status $qpidd + RETVAL=$? + ;; + restart) + stop + start + ;; + condrestart) + if [ -f ${pidfile} ] ; then + stop + start + fi + ;; + reload) + reload + ;; + *) + echo $"Usage: $prog {start|stop|restart|condrestart|reload|status}" + exit 1 +esac + +exit $RETVAL diff --git a/cpp/qpidc.spec b/cpp/qpidc.spec index f82974e216..6c23227be6 100644 --- a/cpp/qpidc.spec +++ b/cpp/qpidc.spec @@ -1,9 +1,14 @@ +# +# Spec file for Qpid C++ packages: qpidc qpidc-devel, qpidd +# +%define daemon qpidd + Name: qpidc Version: 0.1 Release: 1%{?dist} -Summary: Libraries for Qpid C++ client applications. -Group: System Environment/Libraries -License: Apache +Summary: Libraries for Qpid C++ client applications +Group: System Environment/Libraries +License: Apache Software License URL: http://incubator.apache.org/qpid/ # FIXME: Source must be a URL pointing to where the tarball can be downloaded Source0: %{name}-%{version}.tar.gz @@ -26,6 +31,11 @@ Requires: apr Requires: boost +Requires(post):/sbin/chkconfig +Requires(preun):/sbin/chkconfig +Requires(preun):/sbin/service +Requires(postun): /sbin/service + %description Run-time libraries for AMQP client applications developed using Qpid C++. Clients exchange messages with an AMQP message broker using @@ -34,7 +44,7 @@ the AMQP protocol. %package devel Summary: Header files and documentation for developing Qpid C++ clients. Group: Development/System -Requires: %name-client = %version-%release +Requires: %name = %version-%release Requires: libtool Requires: apr-devel Requires: boost-devel @@ -45,13 +55,12 @@ Requires: cppunit-devel Libraries, header files and documentation for developing AMQP clients in C++ using Qpid. Qpid implements the AMQP messaging specification. -%define daemon qpidd %package -n %{daemon} Summary: An AMQP message broker daemon. Group: System Environment/Daemons -Requires: %name-client = %version-%release +Requires: %name = %version-%release -%description %{daemon} +%description -n %{daemon} A message broker daemon that receives stores and routes messages using the open AMQP messaging protocol. @@ -63,44 +72,61 @@ the open AMQP messaging protocol. make %{?_smp_mflags} %install -rm -rf $RPM_BUILD_ROOT -make install DESTDIR=$RPM_BUILD_ROOT -rm -f $RPM_BUILD_ROOT%_libdir/*.a -rm -f $RPM_BUILD_ROOT%_libdir/*.la +rm -rf %{buildroot} +make install DESTDIR=%{buildroot} +install -Dp -m0755 etc/qpidd %{buildroot}%{_initrddir}/qpidd +rm -f %{buildroot}%_libdir/*.a +rm -f %{buildroot}%_libdir/*.la + %clean -rm -rf $RPM_BUILD_ROOT +rm -rf %{buildroot} %check make check -%files %{name} +%files %defattr(-,root,root,-) -%doc LICENSE.txt NOTICE.txt -%doc %_docdir/html/* +%doc LICENSE.txt NOTICE.txt README.txt %_libdir/libqpidcommon.so.0 %_libdir/libqpidcommon.so.0.1.0 %_libdir/libqpidclient.so.0 %_libdir/libqpidclient.so.0.1.0 -%files %{name}-devel +%files devel %defattr(-,root,root,-) -%_includedir/qpid/*.h +%_includedir/qpidc %_libdir/libqpidcommon.so %_libdir/libqpidclient.so +%doc docs/api/html -%files %{daemon} +%files -n %{daemon} +%_libdir/libqpidbroker.so %_libdir/libqpidbroker.so.0 %_libdir/libqpidbroker.so.0.1.0 %_sbindir/%{daemon} +%{_initrddir}/qpidd %doc %_mandir/man1/%{daemon}.* -#FIXME: Fix Makefile.am to install etc/init.d/%{daemon} properly: -%_sysconfdir/init.d/%{daemon} +%post +# This adds the proper /etc/rc*.d links for the script +/sbin/chkconfig --add qpidd + +%preun +# Check that this is actual deinstallation, not just removing for upgrade. +if [ $1 = 0 ]; then + /sbin/service qpidd stop >/dev/null 2>&1 || : + /sbin/chkconfig --del qpidd +fi + +%postun +if [ "$1" -ge "1" ]; then + /sbin/service qpidd condrestart >/dev/null 2>&1 || : +fi %changelog -* Mon Dec 11 2006 Alan Conway - 0.1-1 -- Second cut, still needs work and testing. +* Mon Dec 19 2006 Alan Conway - 0.1-1 +- Fixed problems with qpidd init script and doc files. * Fri Dec 8 2006 David Lutterkort - 0.1-1 - Initial version based on Jim Meyering's sketch and discussions with Alan -- cgit v1.2.1