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

Revision 12518, 5.6 KB checked in by tomop, 3 years ago (diff)

updated 2 packages

pam-1.5.1-1

postsrsd-1.10-1

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