[packages/rpm-specdump] move Makefile out of .spec
glen
glen at pld-linux.org
Mon Nov 24 20:19:38 CET 2014
commit fbfd746bccff24d48ea49cb3f053fd64a294fc8f
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Mon Nov 24 20:51:25 2014 +0200
move Makefile out of .spec
Makefile | 12 ++++++++++++
rpm-specdump.spec | 19 ++++++++-----------
2 files changed, 20 insertions(+), 11 deletions(-)
---
diff --git a/rpm-specdump.spec b/rpm-specdump.spec
index 08b1b35..c9210a4 100644
--- a/rpm-specdump.spec
+++ b/rpm-specdump.spec
@@ -6,6 +6,7 @@ Release: 2
License: GPL
Group: Applications/System
Source0: %{name}.c
+Source1: Makefile
BuildRequires: rpm-devel
# commented out due to mixed env on builders
#%requires_eq rpm-lib
@@ -18,19 +19,15 @@ Print RPM dump of specfile.
Narzędzie wypisujące RPM-owy zrzut (dump) pliku spec.
%prep
-%setup -q -c -T
-ln -s %{SOURCE0} rpm-specdump.c
-
-cat <<'EOF' > Makefile
-rpm-specdump: rpm-specdump.o
- %{__cc} %{rpmldflags} $< -o $@ -lrpm -lrpmdb -lrpmio -lrpmbuild
-
-rpm-specdump.o: rpm-specdump.c
- %{__cc} %{rpmcflags} -Wall -W -I/usr/include/rpm -Wall -c $< -o $@
-EOF
+%setup -qcT
+ln -s %{SOURCE0} .
+ln -s %{SOURCE1} .
%build
-%{__make}
+%{__make} \
+ CC="%{__cc}" \
+ LDFLAGS="%{rpmldflags}" \
+ CFLAGS="%{rpmcflags}"
%install
rm -rf $RPM_BUILD_ROOT
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..f5f3d0e
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,12 @@
+CC := gcc
+CFLAGS :=
+LDFLAGS :=
+CPPFLAGS :=
+INCLUDES := -I/usr/include/rpm
+LIBS := -lrpm -lrpmdb -lrpmio -lrpmbuild
+
+rpm-specdump: rpm-specdump.o
+ $(CC) $(LDFLAGS) $< -o $@ $(LIBS)
+
+rpm-specdump.o: rpm-specdump.c
+ $(CC) $(CFLAGS) $(INCLUDES) -W -Wall -c $< -o $@
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/rpm-specdump.git/commitdiff/b7abcb1b928bec336f3f0c013f0d623fd47c3136
More information about the pld-cvs-commit
mailing list