From 086ab0600807bcc419f37dbf9698c87b1cd6bb6a Mon Sep 17 00:00:00 2001 From: "Paul W. Frields" Date: Sat, 4 Feb 2006 02:49:33 +0000 Subject: Build packages correctly for FE standards --- Makefile | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index b520cde..9debb31 100644 --- a/Makefile +++ b/Makefile @@ -9,20 +9,18 @@ DOCBASE = fedora-doc-common ###################################################### # Some packaging specific vars -VERSION = 0.1 -RELEASE = cvs$(shell date +"%Y%m%d") DATE = $(shell date +"%Y-%m-%d") NOW = $(shell date +"%a %b %e %Y") SPECIN = ../docs-common/packaging/$(DOCBASE).spec +VERSION = $(shell rpm -q --specfile --queryformat '%{version}\n' $(SPECIN)) +RELEASE = $(shell rpm -q --specfile --queryformat '%{release}\n' $(SPECIN)) DOCSPEC = $(shell rpm ${RPMFLAGS} --eval '%{_specdir}')/$(DOCBASE).spec -DOCSRCTAR = $(shell rpm ${RPMFLAGS} --eval '%{_sourcedir}')/$(DOCBASE)-$(RELEASE).src.tar.gz +DOCSRCTAR = $(shell rpm ${RPMFLAGS} --eval '%{_sourcedir}')/$(DOCBASE)-$(VERSION).src.tar.gz TITLE = Fedora Documentation Project Shared Files ###################################################### # Some RPM flags... ###################################################### RPMFLAGS = --define "docbase $(DOCBASE)" \ - --define "version $(VERSION)" \ - --define "release $(RELEASE)" \ --define "_topdir $(PWD)/rpmbuild" RPM = rpm ${RPMFLAGS} @@ -39,7 +37,7 @@ update: clean rpm: update # # Make RPM-compliant tarball of source XML and other stuff - mkdir $(DOCBASE)-$(RELEASE) + mkdir $(DOCBASE)-$(VERSION) find . -maxdepth 1 -type d \( \ -name 'bin' -o \ -name 'common' -o \ @@ -51,21 +49,21 @@ rpm: update find {} -maxdepth 1 -type f ! \( \ -name '.*' -o -name '*~' -o \ -name '*.svg' -o -name '*.eps' \) | \ - cpio -pamdv $(DOCBASE)-$(RELEASE) + cpio -pamdv $(DOCBASE)-$(VERSION) # include Makefile.common for use in offline FDP doc building - cp Makefile.common $(DOCBASE)-$(RELEASE) + cp Makefile.common $(DOCBASE)-$(VERSION) # # Make RPM build tree; don't rely on local user's setup mkdir -p rpmbuild/{BUILD,RPMS/noarch,SOURCES,SPECS,SRPMS} - tar -zcvf $(DOCSRCTAR) $(DOCBASE)-$(RELEASE) + tar -zcvf $(DOCSRCTAR) $(DOCBASE)-$(VERSION) cp $(SPECIN) $(DOCSPEC) - rm -rf $(DOCBASE)-$(RELEASE)/ -# + rm -rf $(DOCBASE)-$(VERSION)/ +#FORGET THIS CRAP... replace with 'make clog' shortly # Make rpmlint happy with a changelog entry # FIXME: Maybe more magic would make this stickier; pity # I'm no magician... - sed 's/\(%changelog\)/\1\n* $(NOW) Fedora Docs Project - $(VERSION)-$(RELEASE)\n- Update to $(RELEASE)\n/' \ - $(SPECIN) > $(DOCSPEC) +# sed 's/\(%changelog\)/\1\n* $(NOW) Fedora Docs Project - $(VERSION)-$(RELEASE)\n- Update to $(RELEASE)\n/' \ +# $(SPECIN) > $(DOCSPEC) # # Do the build... # -- cgit