diff --git a/spec b/spec index dd39e01..e8a6953 100644 --- a/spec +++ b/spec @@ -11,10 +11,11 @@ Packager: Bruce Guenter Provides: smtpdaemon Conflicts: sendmail Conflicts: qmail -Requires: supervise-scripts >= 3.2 Requires: gnutls BuildRequires: gnutls-devel +BuildRequires: systemd-rpm-macros Requires(pre,preun): shadow-utils +Requires(postun,preun): systemd %description Nullmailer is a mail transport agent designed to only relay all its @@ -34,13 +35,11 @@ make rm -fr $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/etc mkdir -p $RPM_BUILD_ROOT/usr/lib -mkdir -p $RPM_BUILD_ROOT/var/service/nullmailer/log mkdir -p $RPM_BUILD_ROOT/var/log/nullmailer -make DESTDIR=$RPM_BUILD_ROOT install-strip +make DESTDIR=$RPM_BUILD_ROOT install ln -s ../sbin/sendmail $RPM_BUILD_ROOT/usr/lib/sendmail -install scripts/nullmailer.run $RPM_BUILD_ROOT/var/service/nullmailer/run -install scripts/nullmailer-log.run $RPM_BUILD_ROOT/var/service/nullmailer/log/run +install -D scripts/nullmailer.service $RPM_BUILD_ROOT/usr/lib/systemd/system/nullmailer.service %clean rm -rf $RPM_BUILD_ROOT @@ -50,13 +49,10 @@ PATH="/sbin:/usr/sbin:$PATH" export PATH if [ "$1" = 1 ]; then # pre-install instructions grep ^nullmail: /etc/group >/dev/null || groupadd -r nullmail - grep ^nullmail: /etc/passwd >/dev/null || useradd -d /var/lock/svc/nullmailer -g nullmail -M -r -s /bin/true nullmail + grep ^nullmail: /etc/passwd >/dev/null || useradd -d /var/spool/nullmailer -g nullmail -M -r -s /bin/false nullmail fi %post -if ! [ -L /service/nullmailer ]; then - svc-add /var/service/nullmailer -fi if ! [ -s /etc/nullmailer/me ]; then /bin/hostname --fqdn >/etc/nullmailer/me fi @@ -65,25 +61,21 @@ if ! [ -s /etc/nullmailer/defaultdomain ]; then fi %preun -if [ "$1" = 0 ]; then - svc-remove nullmailer -fi +%systemd_preun nullmailer.service %postun -if [ "$1" = 0 ]; then - # post-erase instructions - /usr/sbin/userdel nullmail - /usr/sbin/groupdel nullmail -fi +%systemd_postun_with_restart nullmailer.service %files %defattr(-,nullmail,nullmail) %doc AUTHORS BUGS ChangeLog COPYING INSTALL NEWS README TODO doc/DIAGRAM %dir /etc/nullmailer %attr(04711,nullmail,nullmail) /usr/bin/mailq +/usr/bin/nullmailer-dsn /usr/bin/nullmailer-inject /usr/bin/nullmailer-smtpd /usr/lib/sendmail +/usr/lib/systemd/system/nullmailer.service %dir /usr/libexec/nullmailer /usr/libexec/nullmailer/* %{_mandir}/*/* @@ -91,5 +83,4 @@ fi /usr/sbin/nullmailer-send /usr/sbin/sendmail %dir /var/log/nullmailer -/var/service/nullmailer /var/spool/nullmailer