mirror of
https://abf.rosa.ru/djam/miniupnpd.git
synced 2025-02-22 23:52:57 +00:00
Build with system optflags to fix debug package
Move some in-spec seds to patch Spec cleanup
This commit is contained in:
parent
de6a9d190d
commit
a59ff5d453
3 changed files with 75 additions and 45 deletions
3
.abf.yml
3
.abf.yml
|
@ -1,5 +1,2 @@
|
||||||
removed_sources:
|
|
||||||
miniupnpd-1.5.20110520.tar.gz: 7d4009daa5dd977be6d6c88fa9510a228978b7a6
|
|
||||||
miniupnpd-1.7.20121005.tar.gz: 4579c4711a8455bf455f3757ac9ce0dc40088901
|
|
||||||
sources:
|
sources:
|
||||||
miniupnpd-1.8.20140523.tar.gz: 1f29d76df57fcf4046c7cb9c7312d7fbc3f28e26
|
miniupnpd-1.8.20140523.tar.gz: 1f29d76df57fcf4046c7cb9c7312d7fbc3f28e26
|
||||||
|
|
38
miniupnpd-1.8.20140523-makefile.patch
Normal file
38
miniupnpd-1.8.20140523-makefile.patch
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
diff -urN miniupnpd-1.8.20140523/Makefile miniupnpd-1.8.20140523-patched/Makefile
|
||||||
|
--- miniupnpd-1.8.20140523/Makefile 2014-05-07 01:42:49.000000000 +1100
|
||||||
|
+++ miniupnpd-1.8.20140523-patched/Makefile 2016-06-10 12:56:48.084484795 +1000
|
||||||
|
@@ -112,11 +112,11 @@
|
||||||
|
TEST := $(shell test -f /usr/include/iptables/internal.h && grep -q "\#define IPTABLES_VERSION" /usr/include/iptables/internal.h && echo 1)
|
||||||
|
ifeq ($(TEST), 1)
|
||||||
|
CPPFLAGS := $(CPPFLAGS) -DIPTABLES_143
|
||||||
|
-LDLIBS = -liptc
|
||||||
|
+LDLIBS = -lip4tc
|
||||||
|
endif # ($(TEST), 1)
|
||||||
|
TEST_LIB := $(shell test -f /usr/lib$(ARCH)/libiptc.a && echo 1)
|
||||||
|
ifeq ($(TEST_LIB), 1)
|
||||||
|
-LDLIBS = -liptc /usr/lib$(ARCH)/libiptc.a
|
||||||
|
+LDLIBS = -lip4tc /usr/lib$(ARCH)/libiptc.a
|
||||||
|
endif # ($(TEST_LIB), 1)
|
||||||
|
endif # ($(TARGET_OPENWRT),)
|
||||||
|
else # ifdef IPTABLESPATH
|
||||||
|
@@ -125,7 +125,7 @@
|
||||||
|
TEST := $(shell test -f /usr/include/xtables.h && grep -q "XTABLES_VERSION_CODE" /usr/include/xtables.h && echo 1)
|
||||||
|
ifeq ($(TEST), 1)
|
||||||
|
CPPFLAGS := $(CPPFLAGS) -DIPTABLES_143
|
||||||
|
-LDLIBS = -liptc
|
||||||
|
+LDLIBS = -lip4tc
|
||||||
|
TESTIP4TC := $(shell test -f /lib/libip4tc.so && echo 1)
|
||||||
|
ifeq ($(TESTIP4TC), 1)
|
||||||
|
LDLIBS := $(LDLIBS) -lip4tc
|
||||||
|
@@ -191,9 +191,9 @@
|
||||||
|
# 'cat /proc/sys/kernel/random/uuid' could be also used
|
||||||
|
genuuid:
|
||||||
|
ifeq ($(TARGET_OPENWRT),)
|
||||||
|
- sed -i -e "s/^uuid=[-0-9a-f]*/uuid=`(genuuid||uuidgen||uuid) 2>/dev/null`/" miniupnpd.conf
|
||||||
|
+ sed -i -e "s/^uuid=[-0-9a-f]*/uuid=`(uuidgen||uuid) 2>/dev/null`/" miniupnpd.conf
|
||||||
|
else
|
||||||
|
- sed -i -e "s/^uuid=[-0-9a-f]*/uuid=`($(STAGING_DIR_HOST)/bin/genuuid||$(STAGING_DIR_HOST)/bin/uuidgen||$(STAGING_DIR_HOST)/bin/uuid) 2>/dev/null`/" miniupnpd.conf
|
||||||
|
+ sed -i -e "s/^uuid=[-0-9a-f]*/uuid=`($(STAGING_DIR_HOST)/bin/$(STAGING_DIR_HOST)/bin/uuidgen||$(STAGING_DIR_HOST)/bin/uuid) 2>/dev/null`/" miniupnpd.conf
|
||||||
|
endif
|
||||||
|
|
||||||
|
miniupnpd: $(BASEOBJS) $(LNXOBJS) $(NETFILTEROBJS)
|
|
@ -1,55 +1,33 @@
|
||||||
Summary: The UPNP & NAT-PMP implementation
|
Summary: The UPNP & NAT-PMP implementation
|
||||||
Name: miniupnpd
|
Name: miniupnpd
|
||||||
Version: 1.8.20140523
|
Version: 1.8.20140523
|
||||||
Release: 3
|
Release: 4
|
||||||
License: GPLv2
|
License: GPLv2+
|
||||||
Group: System/Servers
|
Group: System/Servers
|
||||||
URL: http://miniupnp.free.fr
|
Url: http://miniupnp.free.fr
|
||||||
Source0: http://miniupnp.free.fr/files/download.php?file=/%{name}-%{version}.tar.gz
|
Source0: http://miniupnp.free.fr/files/download.php?file=/%{name}-%{version}.tar.gz
|
||||||
BuildRequires: iptables-ip4tc-devel
|
Source1: miniupnpd.service
|
||||||
|
Patch0: miniupnpd-1.8.20140523-makefile.patch
|
||||||
BuildRequires: iptables-devel
|
BuildRequires: iptables-devel
|
||||||
|
BuildRequires: iptables-ip4tc-devel
|
||||||
BuildRequires: pkgconfig(libiptc)
|
BuildRequires: pkgconfig(libiptc)
|
||||||
BuildRequires: pkgconfig(libnetfilter_conntrack)
|
BuildRequires: pkgconfig(libnetfilter_conntrack)
|
||||||
Requires: iptables
|
Requires: iptables
|
||||||
Source1: miniupnpd.service
|
Requires(post,preun,postun): systemd
|
||||||
|
|
||||||
%description
|
%description
|
||||||
The miniUPnP daemon is an UPnP IGD (internet gateway device)
|
The miniUPnP daemon is an UPnP IGD (internet gateway device)
|
||||||
which provide NAT traversal services to any UPnP enabled client on
|
which provide NAT traversal services to any UPnP enabled client on
|
||||||
the network.
|
the network.
|
||||||
|
|
||||||
See http://www.upnp.org/ for more details on UPnP.
|
See http://www.upnp.org/ for more details on UPnP.
|
||||||
|
|
||||||
%prep
|
%files
|
||||||
%setup -q
|
%doc README Changelog.txt
|
||||||
|
%config(noreplace) %{_sysconfdir}/miniupnpd/*
|
||||||
%build
|
%{_sbindir}/miniupnpd
|
||||||
mv Makefile.linux Makefile
|
%{_unitdir}/miniupnpd*
|
||||||
sed -i \
|
%{_mandir}/man*/*
|
||||||
-e "s#^CFLAGS = .*-D#CPPFLAGS += -I/usr/include -D#" \
|
|
||||||
-e '/^CFLAGS :=/s/CFLAGS/CPPFLAGS/g' \
|
|
||||||
-e "s/CFLAGS += -ansi/#CFLAGS += -ansi/g" \
|
|
||||||
-e "s/LIBS = -liptc/LIBS = -lip4tc/g" \
|
|
||||||
-e 's/genuuid||//' \
|
|
||||||
Makefile || die
|
|
||||||
sed -i \
|
|
||||||
-e 's/\(strncpy(\([->a-z.]\+\), "[a-zA-Z]\+", \)IPT_FUNCTION_MAXNAMELEN);/\1sizeof(\2));/' \
|
|
||||||
netfilter/iptcrdr.c || die
|
|
||||||
|
|
||||||
make config.h
|
|
||||||
|
|
||||||
sed -i \
|
|
||||||
-e 's/\/\*#define ENABLE_LEASEFILE\*\//#define ENABLE_LEASEFILE/g' \
|
|
||||||
config.h || die
|
|
||||||
|
|
||||||
%make CC=gcc
|
|
||||||
|
|
||||||
%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
|
|
||||||
|
|
||||||
%post
|
%post
|
||||||
%systemd_post %{name}.service
|
%systemd_post %{name}.service
|
||||||
|
@ -60,9 +38,26 @@ install -D -m 755 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service
|
||||||
%postun
|
%postun
|
||||||
%systemd_postun_with_restart %{name}.service
|
%systemd_postun_with_restart %{name}.service
|
||||||
|
|
||||||
%files
|
#----------------------------------------------------------------------------
|
||||||
%{_sbindir}/miniupnpd
|
|
||||||
%{_unitdir}/miniupnpd*
|
%prep
|
||||||
%doc %{_mandir}/man*/*
|
%setup -q
|
||||||
%config(noreplace) %{_sysconfdir}/miniupnpd/*
|
mv Makefile.linux Makefile
|
||||||
%doc README Changelog.txt
|
%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
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue