adapter, our cc/ldflags auto/th/dropwatch-1.4-1
authorElan Ruusamäe <glen@delfi.ee>
Fri, 10 Oct 2014 12:55:08 +0000 (15:55 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Fri, 10 Oct 2014 12:55:10 +0000 (15:55 +0300)
note: our eu-strip fails with this package

dropwatch.spec

index 82f903e..087c951 100644 (file)
@@ -2,16 +2,17 @@ Summary:      Kernel dropped packet monitor
 Name:          dropwatch
 Version:       1.4
 Release:       1
+License:       GPL v2+
+Group:         Applications/System
 Source0:       https://fedorahosted.org/releases/d/r/dropwatch/%{name}-%{version}.tbz2
 # Source0-md5: 5145753b3e9255bd9b190251ba4d3bbf
-License:       GPLv2+
-Group:         Applications/System
 URL:           http://fedorahosted.org/dropwatch
 BuildRequires: binutils-devel
 BuildRequires: libnl-devel
 BuildRequires: linux-libc-headers
 BuildRequires: pkgconfig
 BuildRequires: readline-devel
+BuildRequires: sed >= 4.0
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -21,17 +22,23 @@ dropped network packets.
 %prep
 %setup -q
 
-%build
 cd src
-export CFLAGS=$RPM_OPT_FLAGS
-%{__make}
+%{__sed} -i -e 's,gcc,$(CC),g' Makefile
+%{__sed} -i -e '/^CFLAGS/ s/$/ $(EXTRA_CFLAGS)/' Makefile
+%{__sed} -i -e '/^LDFLAGS/ s/$/ $(EXTRA_LDFLAGS)/' Makefile
+
+%build
+%{__make} -C src \
+       CC="%{__cc}"
+       EXTRA_CFLAGS="%{rpmcflags}" \
+       EXTRA_LDFLAGS="%{rpmldflags}" \
+       %{nil}
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{_bindir}
-install -d $RPM_BUILD_ROOT%{_mandir}/man1
-install src/dropwatch $RPM_BUILD_ROOT%{_bindir}
-install doc/dropwatch.1 $RPM_BUILD_ROOT%{_mandir}/man1
+install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1}
+install -p src/dropwatch $RPM_BUILD_ROOT%{_bindir}
+cp -p doc/dropwatch.1 $RPM_BUILD_ROOT%{_mandir}/man1
 
 %clean
 rm -rf $RPM_BUILD_ROOT
This page took 0.448751 seconds and 4 git commands to generate.