From d1c63791b4427df5da3e17c4e4ea4ddeb4cab7b6 Mon Sep 17 00:00:00 2001 From: Frederic Lepied Date: Wed, 19 Mar 2003 21:09:19 +0000 Subject: added support for standard rpm and localrpm targets. --- Makefile | 55 ++++++++++++++++++++++++++++++++++++++++++------------- ldetect-lst.spec | 4 ++-- 2 files changed, 44 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 46c64de2..6b158272 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,11 @@ include Makefile.config -RPM ?= $(HOME)/rpm +PACKAGE = ldetect-lst +VERSION := $(shell rpm -q --qf '%{VERSION}\n' --specfile $(PACKAGE).spec | head -1) +RELEASE := $(shell rpm -q --qf '%{RELEASE}\n' --specfile $(PACKAGE).spec | head -1) +TAG := $(shell echo "V$(VERSION)_$(RELEASE)" | tr -- '-.' '__') + +FILES = AUTHORS ChangeLog Makefile Makefile.config convert err ldetect-lst.spec lst update-ldetect-lst build: make -C lst build @@ -18,20 +23,44 @@ install: build install update-ldetect-lst $(sbindir) install convert/merge2pcitable.pl $(bindir) -rpm: srpm - rpm -bb --clean --rmsource --rmspec $(RPM)/SPECS/$(project).spec - cvs commit +# rules to build a test rpm + +localrpm: localdist buildrpm + +localdist: cleandist dir localcopy tar + +cleandist: + rm -rf $(PACKAGE)-$(VERSION) $(PACKAGE)-$(VERSION).tar.bz2 + +dir: + mkdir $(PACKAGE)-$(VERSION) + +localcopy: + tar c $(FILES) | tar x -C $(PACKAGE)-$(VERSION) -srpm: check clean $(RPM) - cvs update - (echo "# !! DON'T MODIFY HERE, MODIFY IN THE CVS !!" ; \ - cat $(project).spec \ - ) > $(RPM)/SPECS/$(project).spec +tar: + tar cvf $(PACKAGE)-$(VERSION).tar $(PACKAGE)-$(VERSION) + bzip2 -9vf $(PACKAGE)-$(VERSION).tar + rm -rf $(PACKAGE)-$(VERSION) - (cd .. ; tar cfj $(RPM)/SOURCES/$(project).tar.bz2 $(project)) - rpm -bs $(RPM)/SPECS/$(project).spec +buildrpm: + rpm -ta $(PACKAGE)-$(VERSION).tar.bz2 -changelog: - cvs2cl -U ../common/username -I ChangeLog -W 400 +# rules to build a distributable rpm + +rpm: changelog cvstag dist buildrpm + +dist: cleandist dir export tar + +export: + cvs export -d $(PACKAGE)-$(VERSION) -r $(TAG) $(PACKAGE) + +cvstag: + cvs tag $(CVSTAGOPT) $(TAG) + +changelog: ../common/username + cvs2cl -U ../common/username -I ChangeLog rm -f ChangeLog.bak cvs commit -m "Generated by cvs2cl the `date '+%d_%b'`" ChangeLog + +# Makefile ends here diff --git a/ldetect-lst.spec b/ldetect-lst.spec index ae45d9c5..a7ab426e 100644 --- a/ldetect-lst.spec +++ b/ldetect-lst.spec @@ -7,7 +7,7 @@ Version: %{version} Release: %{release} Summary: Hardware list for the light detection library URL: http://cvs.mandrakesoft.com/cgi-bin/cvsweb.cgi/soft/ldetect-lst/ -Source: %{name}.tar.bz2 +Source: %{name}-%{version}.tar.bz2 Group: System/Libraries BuildRoot: %{_tmppath}/%{name}-buildroot License: GPL @@ -29,7 +29,7 @@ table to get hardware autodetection see ldetect-lst %prep -%setup -q -n %{name} +%setup -q %build %make -- cgit v1.2.1