Name: miniupnpc Version: 1.4 Release: 5%{?dist} Summary: Library and command line tool to control NAT in UPnP-enabled routers as Linksys Group: System Environment/Libraries License: BSD URL: http://miniupnp.tuxfamily.org/ Source0: http://miniupnp.tuxfamily.org/files/%{name}-%{version}.tar.gz Source1: upnpnats Source2: upnpnats.conf Requires: avahi-tools BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires(post): chkconfig Requires(preun): chkconfig # This is for /sbin/service Requires(preun): initscripts #BuildRequires: %description Your home router can be remotely controled through UPnP. MiniUPnP is a library and command line tool to help you execute this task. It lets you define NATs in your router. %package devel Summary: Development files for MiniUPnP Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel Libraries and header files for you to embed NAT traversal intelligence via UPnP into your programs. %prep %setup -q %build make %{?_smp_mflags} CFLAGS="%{optflags} -DNDEBUG" CC="gcc %{optflags} -fPIC -DNDEBUG" %install rm -rf $RPM_BUILD_ROOT make PREFIX=$RPM_BUILD_ROOT install mkdir -p $RPM_BUILD_ROOT/%{_mandir} mkdir -p $RPM_BUILD_ROOT/%_initrddir mkdir -p $RPM_BUILD_ROOT/%_sysconfdir/sysconfig cp -r man3 $RPM_BUILD_ROOT/%{_mandir} cp %{S:1} $RPM_BUILD_ROOT/%_initrddir cp %{S:2} $RPM_BUILD_ROOT/%_sysconfdir/sysconfig/upnpnats %ifarch x86_64 mv $RPM_BUILD_ROOT/usr/lib $RPM_BUILD_ROOT/%{_libdir} %endif %clean rm -rf $RPM_BUILD_ROOT %post /sbin/ldconfig # This adds the proper /etc/rc*.d links for the script /sbin/chkconfig --add upnpnats %preun if [ $1 = 0 ] ; then /sbin/service upnpnats stop >/dev/null 2>&1 /sbin/chkconfig --del upnpnats fi %postun /sbin/ldconfig if [ "$1" -ge "1" ] ; then /sbin/service upnpnats condrestart >/dev/null 2>&1 || : fi %files %defattr(-,root,root,-) %doc README Changelog.txt LICENCE %{_bindir}/* %{_libdir}/lib*.so.* %_initrddir/* %config %_sysconfdir/sysconfig/upnpnats %files devel %defattr(-,root,root,-) %{_libdir}/lib*.a* %{_libdir}/lib*.so %{_includedir}/* %{_mandir}/man3/* %changelog * Sun Nov 30 2008 Avi Alkalay - 1.2-5.fc9 - Incorporated some comments from https://bugzilla.redhat.com/show_bug.cgi?id=473046#c13 * Sun Nov 30 2008 Avi Alkalay - 1.2-4.fc9 - Incorporated comments from https://bugzilla.redhat.com/show_bug.cgi?id=473046#c10 - Added the initscript plus its configuration file. * Fri Nov 28 2008 Avi Alkalay - 1.2-3.fc9 - Incorporated comments from https://bugzilla.redhat.com/show_bug.cgi?id=473046#c8 * Wed Nov 26 2008 Avi Alkalay - 1.2-2.fc9 - Initial build.