source: projects/specs/trunk/p/postsrsd/postsrsd-vl.spec @ 12369

Revision 12369, 5.0 KB checked in by tomop, 4 years ago (diff)

updated 2 packages

postforward-1.1.1-1

postsrsd-1.6-1

Line 
1%bcond_with systemd
2
3Name:           postsrsd
4Version:        1.6
5Release:        1%{?_dist_release}%{?with_systemd:.systemd}
6Summary:        Sender Rewriting Scheme (SRS) provider
7
8Vendor:         Project Vine
9Distribution:   Vine Linux
10
11License:        GPLv2+
12URL:            https://github.com/roehling/postsrsd
13Source0:        https://github.com/roehling/%{name}/archive/%{version}/%{name}-%{version}.tar.gz
14
15BuildRequires:  gcc
16BuildRequires:  cmake
17BuildRequires:  help2man
18
19%if %{with systemd}
20%{?systemd_requires}
21%else
22Requires(post): /sbin/chkconfig
23Requires(preun): /sbin/chkconfig
24Requires(preun): /sbin/service
25Requires(postun): /sbin/service
26%endif
27
28%description
29PostSRSd provides the Sender Rewriting Scheme (SRS) via TCP-based lookup tables for Postfix.
30SRS is needed if your mail server acts as forwarder.
31
32
33%prep
34%autosetup -n %{name}-%{version}
35mkdir build
36cd build && %cmake \
37%if %{with systemd}
38        -DINIT_FLAVOR=systemd \
39%else
40        -DINIT_FLAVOR=sysv-redhat \
41%endif
42        -DGENERATE_SRS_SECRET=OFF \
43        -DUSE_SELINUX=OFF \
44        ..
45
46
47%build
48%make_build -C build
49
50
51%install
52rm -rf %{buildroot}
53%make_install -C build
54
55%if %{with systemd}
56mkdir -p %{buildroot}/%{_unitdir}
57mv -f %{buildroot}/%{_sysconfdir}/systemd/system/%{name}.service \
58        %{buildroot}%{_unitdir}/
59%else
60mkdir -p %{buildroot}/%{_initdir}
61mv -f %{buildroot}/%{_sysconfdir}/init.d/postsrsd %{buildroot}%{_initdir}/
62%endif
63
64# %%ghost file requires it is present in the build root
65touch %{buildroot}/%{_sysconfdir}/postsrsd.secret
66
67# chroot directory
68# (also move default config which is in the way)
69sed -i 's/^CHROOT=.*/CHROOT=\/run\/postsrsd/' %{buildroot}/%{_sysconfdir}/default/%{name}
70
71
72%files
73%license LICENSE
74%ghost %{_sysconfdir}/postsrsd.secret
75%config(noreplace) %{_sysconfdir}/default/%{name}
76%if %{with systemd}
77%{_unitdir}/postsrsd.service
78%else
79%{_initdir}/postsrsd
80%endif
81%{_sbindir}/postsrsd
82%{_docdir}/%{name}
83%{_mandir}/man8/postsrsd.8.gz
84
85
86%post
87[ -f %{_sysconfdir}/postsrsd.secret ] || dd if=/dev/urandom bs=18 count=1 2>/dev/null | base64 >%{_sysconfdir}/postsrsd.secret
88%if %{with systemd}
89%systemd_post %{name}.service
90%else
91/sbin/chkconfig --add postsrsd
92%endif
93
94%preun
95%if %{with systemd}
96%systemd_preun %{name}.service
97%else
98if [ $1 -eq 0 -o -x /bin/systemctl ]; then
99        /sbin/service %{name} stop
100        /sbin/chkconfig --del %{name}
101fi
102%endif
103
104%postun
105%if %{with systemd}
106%systemd_postun_with_restart %{name}.service
107%else
108if [ "$1" -ge "1" -a ! -x /bin/systemctl ]; then
109  /sbin/service %{name} condrestart
110fi
111%endif
112
113
114%changelog
115* Thu Apr 09 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 1.6-1
116- new upstream release.
117- added systemd support (disabled as default).
118
119* Sat Jan 26 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 1.5-1
120- initial build for Vine Linux.
121- new upstream release.
122
123* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.4-11.20170118gita77bf99
124- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
125
126* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.4-10.20170118gita77bf99
127- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
128
129* Wed Oct 04 2017 Marc Dequènes (Duck) <duck@redhat.com> - 1.4-9.20170118gita77bf99
130- use the %%ghost feature to ensure the secret file is owned by the package
131- it is then not necessary to handle its removal in %%postun
132
133* Thu Sep 28 2017 Marc Dequènes (Duck) <duck@redhat.com> - 1.4-8.20170118gita77bf99
134- Thanks Matthias Runge Mauchin for the review
135- break description line too long
136- build dependency on gcc is not needed
137
138* Wed Sep 27 2017 Marc Dequènes (Duck) <duck@redhat.com> - 1.4-7.20170118gita77bf99
139- make the changelog more readable
140- stop recreating buildroot, it is made clean already
141
142* Wed Aug 23 2017 Marc Dequènes (Duck) <duck@redhat.com> - 1.4-6.20170118gita77bf99
143- remove unnecessary Requires on make
144- use _sysconfdir macro
145- use name macro when it makes sense
146- remove unnecessary %%doc as the buildsys already populates docdir
147
148* Tue Aug 22 2017 Marc Dequènes (Duck) <duck@redhat.com> - 1.4-5.20170118gita77bf99
149- remove %%clean section, not needed in Fedora
150
151* Tue Aug 22 2017 Marc Dequènes (Duck) <duck@redhat.com> - 1.4-4.20170118gita77bf99
152- don't remove secret file during upgrade
153- start service at the end of post scriptlet
154- improve SELinux rules handling (now requires a running SELinux)
155
156* Tue Aug 22 2017 Marc Dequènes (Duck) <duck@redhat.com> - 1.4-3.20170118gita77bf99
157- Thanks Robert-André Mauchin for the review
158- snapshot is packaged to get this necessary fix: https://github.com/roehling/postsrsd/pull/65
159- fixed version
160- fixed source URL
161- use macros for standard paths and build steps
162- add missing systemd scriptlets
163- specify doc and license files
164- remove unnecessary Requires on base64
165- remove Group information unsupported in Fedora
166
167* Fri Apr 14 2017 Marc Dequènes (Duck) <duck@redhat.com> - 1.4-2
168- create /etc/postsrsd.secret if missing
169- move systemd config into directory for packages
170- move chroot directory into /run
171- autocreate chroot directory
172
173* Thu Mar 30 2017 Marc Dequènes (Duck) <duck@redhat.com> - 1.4-1
174- initial packaging
175
Note: See TracBrowser for help on using the repository browser.