Requires(post,preun): /sbin/chkconfig
Requires: rc-scripts
%endif
+%if %{with systemd_service}
+BuildRequires: rpmbuild(macros) >= 1.647
+Requires(post,preun,postun): systemd-units >= 38
+Requires: systemd-units >= 0.38
+%endif
#BuildRequires: -
#BuildRequires: autoconf
#BuildRequires: automake
%endif
%if %{with initscript}
-%post init
+%post
/sbin/chkconfig --add %{name}
%service %{name} restart
-%preun init
+%preun
if [ "$1" = "0" ]; then
%service -q %{name} stop
/sbin/chkconfig --del %{name}
fi
%endif
+%if %{with systemd_service}
+%post
+%systemd_post %{name}.service
+
+%preun
+%systemd_preun %{name}.service
+
+%postun
+%systemd_reload
+%endif
+
%files
%defattr(644,root,root,755)
%doc AUTHORS CREDITS CHANGES ChangeLog NEWS README THANKS TODO
%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
%endif
+%if %{with systemd_service}
+%{systemdunitdir}/%{name}.service
+%endif
+
#%{_examplesdir}/%{name}-%{version}
%if %{with subpackage}