Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPM spec updates #83

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 9 additions & 18 deletions spec
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ Packager: Bruce Guenter <bruce@untroubled.org>
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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -65,31 +61,26 @@ 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}/*/*
%attr(04711,nullmail,nullmail) /usr/sbin/nullmailer-queue
/usr/sbin/nullmailer-send
/usr/sbin/sendmail
%dir /var/log/nullmailer
/var/service/nullmailer
/var/spool/nullmailer