]>
Commit | Line | Data |
---|---|---|
1879faeb | 1 | # TODO: handle ip*tables_{init,removeall} in PLD init script? (see bundled one) |
4c64a32d | 2 | Summary: Small UPnP Daemon |
1993d69f | 3 | Summary(pl.UTF-8): Mały demon UPnP |
4c64a32d | 4 | Name: miniupnpd |
b5830ac3 | 5 | Version: 2.1 |
35921c48 | 6 | Release: 2 |
4c64a32d | 7 | License: BSD |
322a58cb | 8 | Group: Networking/Daemons |
3c1216d6 | 9 | Source0: http://miniupnp.tuxfamily.org/files/%{name}-%{version}.tar.gz |
b5830ac3 | 10 | # Source0-md5: 91d0524bba6a839c05c22c9484ed9d0f |
4c64a32d | 11 | Source1: %{name}.init |
12 | Source2: %{name}.sysconfig | |
13 | Source3: %{name}.conf | |
b5830ac3 | 14 | Patch0: %{name}-netfilter.patch |
3c1216d6 | 15 | URL: http://miniupnp.tuxfamily.org/ |
322a58cb | 16 | BuildRequires: iptables-devel >= 1.4.3 |
1879faeb JB |
17 | BuildRequires: libmnl-devel >= 1.0.3 |
18 | BuildRequires: libnetfilter_conntrack-devel >= 1.0.2 | |
19 | BuildRequires: libuuid-devel | |
20 | BuildRequires: openssl-devel | |
4c64a32d | 21 | BuildRequires: rpmbuild(macros) >= 1.228 |
22 | Requires(post): libuuid | |
3c1216d6 | 23 | Requires(post): sed >= 4.0 |
4c64a32d | 24 | Requires(post,preun): /sbin/chkconfig |
322a58cb | 25 | Requires: iptables-libs >= 1.4.3 |
1879faeb JB |
26 | Requires: libmnl >= 1.0.3 |
27 | Requires: libnetfilter_conntrack >= 1.0.2 | |
4c64a32d | 28 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
29 | ||
30 | %description | |
1993d69f JB |
31 | Small UPnP Daemon. |
32 | ||
33 | %description -l pl.UTF-8 | |
34 | Mały demon UPnP. | |
4c64a32d | 35 | |
36 | %prep | |
3c1216d6 | 37 | %setup -q |
b5830ac3 | 38 | %patch0 -p1 |
4c64a32d | 39 | |
40 | %build | |
1879faeb JB |
41 | CPPFLAGS="%{rpmcppflags}" \ |
42 | CFLAGS="%{rpmcflags}" \ | |
43 | LDFLAGS="%{rpmldflags}" \ | |
690f7f3a | 44 | %{__make} -f Makefile.linux -j1 \ |
1879faeb | 45 | CC="%{__cc}" |
4c64a32d | 46 | |
47 | %install | |
48 | rm -rf $RPM_BUILD_ROOT | |
1879faeb JB |
49 | |
50 | %{__make} -f Makefile.linux install \ | |
51 | DESTDIR=$RPM_BUILD_ROOT \ | |
52 | STRIP=: | |
53 | ||
54 | # replace init script and config file by PLD specific ones | |
55 | %{__rm} -r $RPM_BUILD_ROOT/etc/init.d | |
56 | install -Dp %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} | |
57 | install -Dp %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name} | |
58 | cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name} | |
4c64a32d | 59 | |
60 | %clean | |
61 | rm -rf $RPM_BUILD_ROOT | |
62 | ||
63 | %post | |
3c1216d6 | 64 | if [ ! -f %{_sysconfdir}/miniupnpd/uuid ]; then |
4c64a32d | 65 | echo "Generating UPnP uuid..." |
1879faeb | 66 | umask 077 |
4c64a32d | 67 | uuidgen > %{_sysconfdir}/miniupnpd/uuid |
68 | fi | |
69 | ||
3c1216d6 | 70 | if [ -f %{_sysconfdir}/miniupnpd/uuid ]; then |
4c64a32d | 71 | UUID=`cat %{_sysconfdir}/miniupnpd/uuid` |
72 | if [ -n "$UUID" ] ; then | |
73 | echo "Updating UUID in miniupnpd config file..." | |
3c1216d6 | 74 | %{__sed} -i -e "s/^uuid=[-0-9a-f]*/uuid=`cat %{_sysconfdir}/miniupnpd/uuid`/" %{_sysconfdir}/miniupnpd/miniupnpd.conf |
4c64a32d | 75 | fi |
76 | fi | |
77 | ||
78 | /sbin/chkconfig --add %{name} | |
79 | %service %{name} restart | |
80 | ||
81 | %preun | |
82 | if [ "$1" = "0" ]; then | |
83 | %service -q %{name} stop | |
84 | /sbin/chkconfig --del %{name} | |
85 | fi | |
86 | ||
87 | %files | |
88 | %defattr(644,root,root,755) | |
322a58cb | 89 | %doc Changelog.txt LICENSE README |
4c64a32d | 90 | %attr(755,root,root) %{_sbindir}/miniupnpd |
91 | %attr(754,root,root) /etc/rc.d/init.d/%{name} | |
92 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name} | |
93 | %dir %{_sysconfdir}/%{name} | |
94 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/%{name}.conf | |
1879faeb JB |
95 | %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/ip6tables_init.sh |
96 | %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/ip6tables_removeall.sh | |
97 | %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/iptables_init.sh | |
98 | %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/iptables_removeall.sh | |
b5830ac3 | 99 | %{_sysconfdir}/%{name}/miniupnpd_functions.sh |
1879faeb | 100 | %{_mandir}/man8/miniupnpd.8* |