diff --git a/atheme.spec b/atheme.spec index be6cd59..a40e14f 100644 --- a/atheme.spec +++ b/atheme.spec @@ -40,7 +40,9 @@ BuildRequires: fdupes BuildRequires: libopenssl-devel BuildRequires: openldap2-devel BuildRequires: pkgconfig +%if 0%{?suse_version} >= 1210 BuildRequires: systemd +%endif BuildRequires: pkgconfig(libmowgli-2) >= 2.0.0 BuildRequires: pkgconfig(libpcre) %define atheme_home /var/lib/atheme @@ -117,7 +119,7 @@ install -m 0644 contrib/*.php contrib/*.pl TODO "$b/%_docdir/%name" install -Dm 0755 "%{S:1}" "$b/%_sysconfdir/init.d/%name"; ln -sf "%_sysconfdir/init.d/%name" "$b/%_sbindir/rc%name"; -%if %{?_unitdir:1} +%if 0%{?_unitdir:1} mkdir -p "$b/%_unitdir" "$b/%_libexecdir/tmpfiles.d"; install -pm0644 "%{S:2}" "$b/%_unitdir/"; install -pm0644 "%{S:3}" "$b/%_libexecdir/tmpfiles.d/atheme.conf"; @@ -136,26 +138,26 @@ cp -v "$b/%_sysconfdir/%name"/atheme.motd{.example,} /usr/bin/getent passwd atheme >/dev/null 2>/dev/null || \ /usr/sbin/useradd -r -g atheme -s /bin/false \ -c "%name daemon" -d "%atheme_home" atheme >/dev/null || :; -%if %{?_unitdir:1} +%if 0%{?_unitdir:1} %service_add_pre atheme.service %endif %post %fillup_and_insserv %name -%if %{?_unitdir:1} +%if 0%{?_unitdir:1} %service_add_post atheme.service %endif %preun %stop_on_removal %name -%if %{?_unitdir:1} +%if 0%{?_unitdir:1} %service_del_preun atheme.service %endif %postun %restart_on_update %name %insserv_cleanup -%if %{?_unitdir:1} +%if 0%{?_unitdir:1} %service_del_postun atheme.service %endif @@ -178,7 +180,7 @@ cp -v "$b/%_sysconfdir/%name"/atheme.motd{.example,} %doc %_docdir/%name %dir %attr(750,atheme,atheme) %atheme_home %dir %attr(750,atheme,atheme) %atheme_log -%if %{?_unitdir:1} +%if 0%{?_unitdir:1} %_unitdir/*.service %_libexecdir/tmpfiles.d %else