miniupnpd/miniupnpd.spec
Andrey Bondrov a59ff5d453 Build with system optflags to fix debug package
Move some in-spec seds to patch
Spec cleanup
2016-06-10 13:04:39 +10:00

63 lines
1.5 KiB
RPMSpec

Summary: The UPNP & NAT-PMP implementation
Name: miniupnpd
Version: 1.8.20140523
Release: 4
License: GPLv2+
Group: System/Servers
Url: http://miniupnp.free.fr
Source0: http://miniupnp.free.fr/files/download.php?file=/%{name}-%{version}.tar.gz
Source1: miniupnpd.service
Patch0: miniupnpd-1.8.20140523-makefile.patch
BuildRequires: iptables-devel
BuildRequires: iptables-ip4tc-devel
BuildRequires: pkgconfig(libiptc)
BuildRequires: pkgconfig(libnetfilter_conntrack)
Requires: iptables
Requires(post,preun,postun): systemd
%description
The miniUPnP daemon is an UPnP IGD (internet gateway device)
which provide NAT traversal services to any UPnP enabled client on
the network.
See http://www.upnp.org/ for more details on UPnP.
%files
%doc README Changelog.txt
%config(noreplace) %{_sysconfdir}/miniupnpd/*
%{_sbindir}/miniupnpd
%{_unitdir}/miniupnpd*
%{_mandir}/man*/*
%post
%systemd_post %{name}.service
%preun
%systemd_preun %{name}.service
%postun
%systemd_postun_with_restart %{name}.service
#----------------------------------------------------------------------------
%prep
%setup -q
mv Makefile.linux Makefile
%patch0 -p1
%build
make config.h
sed -i \
-e 's/\/\*#define ENABLE_LEASEFILE\*\//#define ENABLE_LEASEFILE/g' \
config.h || die
%make CC=gcc CFLAGS="%{optflags}"
%install
mkdir -p %{buildroot}%{_mandir}/man8/
make install PREFIX="%{buildroot}" STRIP="true"
rm -f %{buildroot}%{_sysconfdir}/init.d/miniupnpd
rm -f %{buildroot}%{_sysconfdir}/miniupnpd/miniupnpd.conf~
install -D -m 755 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service