summaryrefslogtreecommitdiff
path: root/nullmailer-1.00RC5.spec
blob: aec3504960f7361fc835f9b5c4db7f6bc34d0250 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
Name: nullmailer
Summary: Simple relay-only mail transport agent
Version: 1.00RC5
Release: 1
Copyright: GPL
Group: Networking/Daemons
Source: http://em.ca/~bruceg/nullmailer/archive/%{version}/nullmailer-%{version}.tar.gz
BuildRoot: /tmp/nullmailer-root
URL: http://em.ca/~bruceg/nullmailer/
Packager: Bruce Guenter <bruceg@em.ca>
Provides: smtpdaemon
Conflicts: sendmail
Conflicts: qmail
Requires: supervise-scripts >= 3.2
PreReq: shadow-utils

%description
Nullmailer is a mail transport agent designed to only relay all its
messages through a fixed set of "upstream" hosts.  It is also designed
to be secure.

%prep
%setup

%build
CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" \
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var

make

%install
rm -fr $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/{usr/lib,etc/rc.d/init.d}
mkdir -p $RPM_BUILD_ROOT/var/nullmailer/service/log
mkdir -p $RPM_BUILD_ROOT/var/log/nullmailer

make DESTDIR=$RPM_BUILD_ROOT install-strip
ln -s ../sbin/sendmail $RPM_BUILD_ROOT/usr/lib/sendmail
install scripts/nullmailer.run $RPM_BUILD_ROOT/var/nullmailer/service/run
install scripts/nullmailer-log.run $RPM_BUILD_ROOT/var/nullmailer/service/log/run

%clean
rm -rf $RPM_BUILD_ROOT

%pre
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
fi

%post
if ! [ -L /service/nullmailer ]; then
	svc-add /var/nullmailer/service nullmailer
fi

%preun
if [ "$1" = 0 ]; then
	svc-remove nullmailer
fi

%postun
if [ "$1" = 0 ]; then
	# post-erase instructions
	/usr/sbin/userdel nullmail
	/usr/sbin/groupdel nullmail
fi

%files
%defattr(-,nullmail,nullmail)
%doc AUTHORS BUGS ChangeLog COPYING INSTALL NEWS README TODO YEAR2000
%dir /etc/nullmailer
%attr(04711,nullmail,nullmail) /usr/bin/mailq
/usr/bin/nullmailer-inject
/usr/lib/sendmail
%dir /usr/libexec/nullmailer
/usr/libexec/nullmailer/*
/usr/man/man1/*
/usr/man/man8/*
%attr(04711,nullmail,nullmail) /usr/sbin/nullmailer-queue
/usr/sbin/nullmailer-send
/usr/sbin/sendmail
%dir /var/log/nullmailer
/var/nullmailer