From 1b6281ab55613ba30a42c8888226098b108aa3d6 Mon Sep 17 00:00:00 2001 From: Jeremy Katz Date: Tue, 19 Jun 2007 13:54:21 -0400 Subject: [PATCH] add install and clean targets to makefile. make the spec file be normal instead of doing everything manually --- Makefile | 9 +++++++++ redhat-rpm-config.spec | 13 ++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 39c20ce..4325bb2 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,15 @@ CVSTAG = REDHAT_RPM_CONFIG_$(subst .,_,$(VERSION)) all: +clean: + rm -f *~ + +install: + mkdir -p $(DESTDIR)/usr/lib/rpm/redhat + cp -pr * $(DESTDIR)/usr/lib/rpm/redhat/ + rm -f $(DESTDIR)/usr/lib/rpm/redhat/Makefile + rm -f $(DESTDIR)/usr/lib/rpm/redhat/redhat-rpm-config.spec + tag-archive: git-tag -a $(CVSTAG) diff --git a/redhat-rpm-config.spec b/redhat-rpm-config.spec index 64388c2..549b1fa 100644 --- a/redhat-rpm-config.spec +++ b/redhat-rpm-config.spec @@ -4,10 +4,9 @@ Version: 8.1.0 Release: 1 License: GPL Group: Development/System -Source: redhat-rpm-config-%{version}.tar.gz +Source: redhat-rpm-config-%{version}.tar.bz2 BuildArch: noarch -#Requires: rpmbuild(VendorConfig) <= 4.1 -#Requires: mktemp +Requires: mktemp BuildRoot: %{_tmppath}/%{name}-root # rpmrc passes -mtune which first appeared in gcc 3.4 %ifarch i386 i686 sparc @@ -18,14 +17,10 @@ Conflicts: gcc < 3.4 Red Hat specific rpm configuration files. %prep +%setup -q %install -rm -rf ${RPM_BUILD_ROOT} -mkdir -p ${RPM_BUILD_ROOT}%{_prefix}/lib/rpm -( cd ${RPM_BUILD_ROOT}%{_prefix}/lib/rpm; tar xzf %{SOURCE0}; mv %{name}-%{version} redhat; rm -f redhat/*.spec ) - -# fix perms of config.{guess,sub} -chmod a+x ${RPM_BUILD_ROOT}%{_prefix}/lib/rpm/redhat/config.{guess,sub} +make DESTDIR=${RPM_BUILD_ROOT} install %clean rm -rf ${RPM_BUILD_ROOT}