[Openais] corosync.spec

Vadym Chepkov vchepkov at gmail.com
Wed Jun 9 16:50:14 PDT 2010


Hi,

There are several issues with corosync spec file.

- configure script should be called in %build, not in %prep section.
- the macro used for init.d is wrong
- chckonfig --add should be called only when rpm is installed, not during upgrade, because it will overwrite the custom set priorities

I attached the patch:


--- corosync.spec.in	(revision 2942)
+++ corosync.spec.in	(working copy)
@@ -32,6 +32,7 @@
 %prep
 %setup -q -n %{name}-%{version}
 
+%build
 %if %{buildtrunk}
 ./autogen.sh
 %endif
@@ -43,9 +44,8 @@
 %{configure} \
 	--enable-nss \
 	--enable-rdma \
-	--with-initddir=%{_initddir}
+	--with-initddir=%{_initrddir}
 
-%build
 make %{_smp_mflags}
 
 %install
@@ -67,7 +67,9 @@
 APIs and libraries, default configuration files, and an init script.
 
 %post
-/sbin/chkconfig --add corosync || :
+if [ $1 -eq 1 ]; then
+	/sbin/chkconfig --add corosync || :
+fi
 
 %preun
 if [ $1 -eq 0 ]; then
@@ -90,7 +92,7 @@
 %dir %{_sysconfdir}/corosync/service.d
 %dir %{_sysconfdir}/corosync/uidgid.d
 %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example
-%{_initddir}/corosync
+%{_initrddir}/corosync
 %dir %{_libexecdir}/lcrso
 %{_libexecdir}/lcrso/coroparse.lcrso
 %{_libexecdir}/lcrso/objdb.lcrso





More information about the Openais mailing list