-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsmtp-gated.spec
101 lines (72 loc) · 2.12 KB
/
smtp-gated.spec
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
%define user smtpgw
%define rpm_full 1.4.21
Summary: SMTP Transparent Proxy
Name: smtp-gated
Version: 1.4.21
Release: 1
Group: System Environment/Daemons
License: GNU GPL
Vendor: Bartlomiej Korupczynski <[email protected]>
Provides: smtp-proxy
Packager: Bartlomiej Korupczynski <[email protected]>
URL: https://vpithart.github.io/smtp-gated/
Source: %{name}-%{rpm_full}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-root
PreReq: /usr/bin/id /sbin/chkconfig
PreReq: %{_sbindir}/useradd %{_sbindir}/groupadd
%description
Transparent proxy for SMTP traffic.
%prep
#%setup -q
%setup -q -n %{name}-%{rpm_full}
%build
%configure
make RPM_OPT_FLAGS="$RPM_OPT_FLAGS"
%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
%makeinstall
install -d $RPM_BUILD_ROOT{/var/spool/%{name}/{msg,lock}}
install -d $RPM_BUILD_ROOT/var/run/%{name}
install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
install contrib/redhat.init $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
src/%{name} -t | sed 's/^\([^#]\)/; &/' > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.conf
pushd $RPM_BUILD_ROOT
mkdir -p var/spool/%{name}/msg
mkdir -p var/spool/%{name}/lock
mkdir -p var/run/%{name}
%files
%defattr(0644,root,root,0755)
%doc AUTHORS ChangeLog COPYING INSTALL README
%doc contrib/fixed.conf contrib/nat.conf
%config(noreplace) %{_sysconfdir}/%{name}.conf
%{_mandir}
%defattr(0755,root,root,0755)
%{_sbindir}/%{name}
/etc/rc.d/init.d/%{name}
%defattr(0750,smtpgw,smtpgw,0750)
/var/spool/%{name}
/var/run/%{name}
%pre
id %{user} >/dev/null 2>&1 && exit 0
groupadd -r -f %{user} || {
echo "Group %{user} account could not be created" >&2
exit 1
}
useradd -g %{user} -d /var/spool/%{name}/ -s /bin/false -c "SMTP Proxy" -M -n -r %{user} || {
echo "User %{user} account could not be created" >&2
exit 1
}
%post
chkconfig --add %{name}
/etc/rc.d/init.d/%{name} condrestart
%preun
if [ $1 == 0 ]; then
/etc/rc.d/init.d/%{name} stop >/dev/null 2>&1
chkconfig --del %{name}
fi
%postun
%changelog
* Fri Mar 04 2005 Bartlomiej Korupczynski <[email protected]>
- changed to spec.in template
* Thu Mar 03 2005 Bartlomiej Korupczynski <[email protected]>
- initial version