Hi,

same set of changes that did hit corosync, now ported to openais.

Note that we do change the toplevel Makefile as well (trunk/../).

Fabio
Index: trunk/openais.spec.in
===================================================================
--- trunk/openais.spec.in	(revision 0)
+++ trunk/openais.spec.in	(revision 0)
@@ -0,0 +1,158 @@
+%define alphatag @alphatag@
+
+Name: openais
+Summary: The openais Standards-Based Cluster Framework executive and APIs
+Version: @version@
+Release: 1%{?alphatag:.%{alphatag}}%{?dist}
+License: BSD
+Group: System Environment/Base
+URL: http://developer.osdl.org/dev/openais/
+Source0: http://www.osdl.org/downloads/openais-%{version}/openais-%{version}.tar.gz
+
+# Runtime bits
+Requires(post): /sbin/chkconfig
+Requires(preun): /sbin/chkconfig
+Requires: corosync
+Requires: openaislib = %{version}-%{release}
+Conflicts: openais-devel <= 0.89
+
+# Setup/build bits
+BuildRequires: corosynclib-devel
+
+%define buildtrunk 0
+%{?_with_buildtrunk: %define buildtrunk 1}
+
+%if %{buildtrunk}
+BuildRequires: autoconf automake
+%endif
+
+BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
+
+%prep
+%setup -q -n openais-%{version}
+
+%if %{buildtrunk}
+./autogen.sh
+%endif
+
+%{_configure}	CFLAGS="$(echo '%{optflags}')" \
+		--prefix=/usr \
+		--localstatedir=/var \
+		--sysconfdir=/etc \
+		--with-lcrso-dir=$(pkg-config corosync --variable lcrsodir) \
+		--libdir=%{_libdir}
+
+%build
+make %{_smp_mflags}
+
+%install
+rm -rf %{buildroot}
+
+make install DESTDIR=%{buildroot}
+mkdir -p %{buildroot}%{_initrddir}
+install -m 755 init/redhat %{buildroot}%{_initrddir}/openais
+
+## tree fixup
+# drop static libs
+rm -f %{buildroot}%{_libdir}/*.a
+# drop docs and html docs for now
+rm -rf %{buildroot}%{_docdir}/*
+
+%clean
+rm -rf %{buildroot}
+
+%description 
+This package contains the openais service handlers, default configuration
+files and init script.
+
+%post
+/sbin/chkconfig --add openais || :
+
+%preun
+if [ $1 -eq 0 ]; then
+    %{_initrddir}/openais stop &>/dev/null || :
+    /sbin/chkconfig --del openais || :
+fi
+
+%postun
+[ "$1" -ge "1" ] && %{_initrddir}/openais condrestart &>/dev/null || :
+
+%files 
+%defattr(-,root,root,-)
+%doc LICENSE README.amf
+%dir /etc/corosync
+%config(noreplace) /etc/corosync/amf.conf.example
+%{_initrddir}/openais
+%dir %{_libexecdir}/lcrso
+%{_libexecdir}/lcrso/openaisserviceenable.lcrso
+%{_libexecdir}/lcrso/service_amf.lcrso
+%{_libexecdir}/lcrso/service_ckpt.lcrso
+%{_libexecdir}/lcrso/service_clm.lcrso
+%{_libexecdir}/lcrso/service_evt.lcrso
+%{_libexecdir}/lcrso/service_lck.lcrso
+%{_libexecdir}/lcrso/service_msg.lcrso
+%{_libexecdir}/lcrso/service_tmr.lcrso
+%{_mandir}/man8/openais_overview.8*
+%{_mandir}/man5/openais.conf.5*
+%{_mandir}/man5/amf.conf.5*
+%{_sbindir}/aisexec
+%{_sbindir}/openais-instantiate
+
+%package -n openaislib
+Summary: The openais Standards-Based Cluster Framework libraries
+Group: System Environment/Libraries
+Conflicts: openais < 0.91-6
+
+%description -n openaislib
+This package contains openais libraries. 
+
+%files -n openaislib
+%defattr(-,root,root,-)
+%doc LICENSE
+%{_libdir}/libSaAmf.so.*
+%{_libdir}/libSaCkpt.so.*
+%{_libdir}/libSaClm.so.*
+%{_libdir}/libSaEvt.so.*
+%{_libdir}/libSaLck.so.*
+%{_libdir}/libSaMsg.so.*
+%{_libdir}/libSaTmr.so.*
+
+%post -n openaislib -p /sbin/ldconfig
+
+%postun -n openaislib -p /sbin/ldconfig
+
+%package -n openaislib-devel
+Summary: The openais Standards-Based Cluster Framework libraries
+Group: Development/Libraries
+Requires: openaislib = %{version}-%{release}
+Requires: pkgconfig
+Provides: openais-devel = %{version}
+Obsoletes: openais-devel < 0.91-6
+
+%description -n openaislib-devel
+This package contains the include files used to develop using openais APIs.
+
+%files -n openaislib-devel
+%defattr(-,root,root,-)
+%doc LICENSE
+%dir %{_includedir}/openais/
+%{_includedir}/openais/saAis.h
+%{_includedir}/openais/saAmf.h
+%{_includedir}/openais/saCkpt.h
+%{_includedir}/openais/saClm.h
+%{_includedir}/openais/saEvt.h
+%{_includedir}/openais/saLck.h
+%{_includedir}/openais/saMsg.h
+%{_includedir}/openais/saTmr.h
+%{_libdir}/libSaAmf.so
+%{_libdir}/libSaCkpt.so
+%{_libdir}/libSaClm.so
+%{_libdir}/libSaEvt.so
+%{_libdir}/libSaLck.so
+%{_libdir}/libSaMsg.so
+%{_libdir}/libSaTmr.so
+%{_libdir}/pkgconfig/*.pc
+
+%changelog
+* @date@ Autotools generated version <[email protected]> - @vers...@-1.@alphatag@
+- Autotools generated version
Index: trunk/configure.ac
===================================================================
--- trunk/configure.ac	(revision 2009)
+++ trunk/configure.ac	(working copy)
@@ -4,7 +4,7 @@
 # bootstrap / init
 AC_PREREQ([2.61])
 
-AC_INIT([openais], [trunk], [[email protected]])
+AC_INIT([openais], [0.97], [[email protected]])
 AM_INIT_AUTOMAKE([-Wno-portability])
 
 AC_CONFIG_SRCDIR([lib/clm.c])
Index: trunk/Makefile.am
===================================================================
--- trunk/Makefile.am	(revision 2009)
+++ trunk/Makefile.am	(working copy)
@@ -29,9 +29,12 @@
 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 # THE POSSIBILITY OF SUCH DAMAGE.
 
-EXTRA_DIST		= autogen.sh \
-			  conf/amf.conf.example
+SPEC			= $(PACKAGE_NAME).spec
 
+TARFILE			= $(PACKAGE_NAME)-$(VERSION).tar.gz
+
+EXTRA_DIST		= autogen.sh conf/amf.conf.example $(SPEC).in
+
 AUTOMAKE_OPTIONS	= foreign
 
 MAINTAINERCLEANFILES	= Makefile.in aclocal.m4 configure depcomp \
@@ -53,7 +56,38 @@
 	mkdir -p doc/api && doxygen
 
 dist-clean-local:
-	rm -f autoconf automake autoheader $(TARFILE)
+	rm -f autoconf automake autoheader
 
 clean-generic:
-	rm -rf doc/api
+	rm -rf doc/api $(SPEC) $(TARFILE)
+
+## make rpm/srpm section.
+
+$(SPEC): $(SPEC).in
+	rm -f $...@-t $@
+	LC_ALL=C date="$(shell date "+%a %b %d %Y")" && \
+	alphatag="$(shell svnversion | sed -e "s#.*:##g" -e "s#[MS]##g")" && \
+	sed \
+		-e "s...@alphatag@#r$$alphatag#g" \
+		-e "s...@version@#$(VERSION)#g" \
+		-e "s...@date@#$$date#g" \
+	$< > $...@-t
+	chmod a-w $...@-t
+	mv $...@-t $@
+
+$(TARFILE):
+	$(MAKE) dist
+
+RPMBUILDOPTS	= --define "_sourcedir $(abs_builddir)" \
+		  --define "_specdir $(abs_builddir)" \
+		  --define "_builddir $(abs_builddir)" \
+		  --define "_srcrpmdir $(abs_builddir)" \
+		  --define "_rpmdir $(abs_builddir)"
+
+srpm: clean
+	$(MAKE) $(SPEC) $(TARFILE)
+	rpmbuild $(RPMBUILDOPTS) --nodeps -bs $(SPEC)
+
+rpm: clean
+	$(MAKE) $(SPEC) $(TARFILE)
+	rpmbuild $(RPMBUILDOPTS) -ba $(SPEC)
Index: Makefile
===================================================================
--- Makefile	(revision 2008)
+++ Makefile	(working copy)
@@ -29,16 +29,22 @@
 
 	## prepare the tarball
 	# set the correct version in configure.ac
-	sed -i -e 's#\[trunk\]#\['$(RELVERSION)'\]#' \
+	sed -i 's/\(AC_INIT[^,]*, \[\)[0-9.]*\(\].*\)/\1'$(RELVERSION)'\2/' \
 		trunk/configure.ac
 
 	# generate makefiles to have dist and distcheck targets
-	cd trunk ; ./autogen.sh ; ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=/usr/lib
-
 	# create tarball and test it
-	cd trunk ; make distcheck
+	cd trunk && \
+		./autogen.sh && \
+		./configure --prefix=/usr \
+			    --sysconfdir=/etc \
+			    --localstatedir=/var \
+			    --libdir=/usr/lib && \
+		make distcheck
 
 	## tag handling
+	cd trunk && \
+		svn commit -m "Bumping version to $(RELVERSION)"
 
 	# copy the tree from trunk
 	svn copy trunk tags/openais-$(RELVERSION)
@@ -48,10 +54,13 @@
 	svn add tags/openais-$(RELVERSION)/CHANGELOG
 
 	# set version
-	echo "#define RELEASE_RELVERSION \"subrev $(REV) openais version $(RELVERSION)\"" > tags/openais-$(RELVERSION)/version.h
+	echo "#define RELEASE_RELVERSION \"subrev $(REV) openais version $(RELVERSION)\"" \
+		> tags/openais-$(RELVERSION)/version.h
 
 	# make sure all files in the tarball are added to svn
-	cd tags ; tar -tf ../trunk/openais-$(RELVERSION).tar.gz | xargs svn add
+	cd tags && \
+		tar -tf ../trunk/corosync-$(RELVERSION).tar.gz | \
+			xargs svn add
 
 	# create the final tarball from svn
 	svn export tags/openais-$(RELVERSION) openais-$(RELVERSION)
@@ -63,13 +72,8 @@
 	ssh developer.osdl.org chmod -R 755 /home/www/public_html/dev/openais/downloads/openais-$(RELVERSION)
 
 	## clean up after the process
-	cd trunk; make maintainer-clean
-	sed -i -e 's#\['$(RELVERSION)'\]#\[trunk\]#' \
-		trunk/configure.ac
-	rm -f trunk/openais-$(RELVERSION).tar.gz
+	cd trunk && \
+		make maintainer-clean
+	rm -f trunk/corosync-$(RELVERSION).tar.gz
 
-	# be paranoid
-	@echo testing possible leftovers. the output of the following commands MUST be null
-	cd trunk; svn status
-
 .PHONY: trunk
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to