]> git.pld-linux.org Git - packages/corosync.git/blobdiff - corosync.spec
- systemd unit files added
[packages/corosync.git] / corosync.spec
index 493a4fa805f2f5f8579234227b09d2a85d66674a..4149f2a15219325910348b51abfb5a378373f346 100644 (file)
@@ -9,11 +9,17 @@ Summary:      Corosync - OSI Certified implementation of a complete cluster engine
 Summary(pl.UTF-8):     Corosync - implementacja silnika klastrowego certyfikowana przez OSI
 Name:          corosync
 Version:       1.4.3
-Release:       2
+Release:       2.2
 License:       BSD
 Group:         Base
 Source0:       ftp://ftp:downloads@corosync.org/downloads/%{name}-%{version}/%{name}-%{version}.tar.gz
 # Source0-md5: 9e9943a7d9eb90fabd52d12b215c699c
+Source1:       %{name}.init
+Source2:       %{name}-notifyd.init
+Source3:       %{name}-notifyd.sysconfig
+Source4:       %{name}.service
+Source5:       %{name}-notifyd.service
+Source6:       %{name}.target
 Patch0:                %{name}-makefile.patch
 URL:           http://www.corosync.org/
 BuildRequires: autoconf >= 2.61
@@ -117,6 +123,7 @@ Dane SNMP MIB dla Corosync.
 
 %install
 rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,/etc/sysconfig,%{systemdunitdir}}
 
 %{__make} install \
        DESTDIR=$RPM_BUILD_ROOT
@@ -129,9 +136,39 @@ sed -e 's/^/#/' $RPM_BUILD_ROOT%{_sysconfdir}/corosync/corosync.conf.example \
 
 %{?with_apidocs:install doc/api/man/man3/* $RPM_BUILD_ROOT%{_mandir}/man3}
 
+install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
+install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-notifyd
+install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name}-notifyd
+install %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
+install %{SOURCE5} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-notifyd.service
+install %{SOURCE6} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.target
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%post
+/sbin/chkconfig --add %{name}
+/sbin/chkconfig --add %{name}-notifyd
+%service %{name} restart
+%service %{name}-notifyd restart
+%systemd_post %{name}.service
+%systemd_post %{name}-notifyd.service
+%systemd_post %{name}.target
+
+%preun
+if [ "$1" = "0" ]; then
+       %service -q %{name} stop
+       /sbin/chkconfig --del %{name}
+       %service -q %{name}-notifyd stop
+       /sbin/chkconfig --del %{name}-notifyd
+fi
+%systemd_preun %{name}.service
+%systemd_preun %{name}-notifyd.service
+%systemd_preun %{name}.target
+
+%postun
+%systemd_reload
+
 %post  libs -p /sbin/ldconfig
 %postun        libs -p /sbin/ldconfig
 
@@ -140,6 +177,10 @@ rm -rf $RPM_BUILD_ROOT
 %doc AUTHORS ChangeLog LICENSE README.devmap README.recovery SECURITY TODO conf/corosync.conf.example*
 %attr(754,root,root) /etc/rc.d/init.d/corosync
 %attr(754,root,root) /etc/rc.d/init.d/corosync-notifyd
+%{systemdunitdir}/%{name}.service
+%{systemdunitdir}/%{name}-notifyd.service
+%{systemdunitdir}/%{name}.target
+%verify(not md5 mtime size) %config(noreplace) /etc/sysconfig/%{name}-notifyd
 %dir %{_sysconfdir}/corosync
 %verify(not md5 mtime size) %config(noreplace) %{_sysconfdir}/corosync/corosync.conf
 %attr(755,root,root) %{_bindir}/corosync-blackbox
This page took 0.180315 seconds and 4 git commands to generate.