diff options
author | Frederic Lepied <flepied@mandriva.com> | 2002-10-11 17:15:26 +0000 |
---|---|---|
committer | Frederic Lepied <flepied@mandriva.com> | 2002-10-11 17:15:26 +0000 |
commit | 457db0de6ebf38c5fa280fd240cbb8dcb3ba2cd9 (patch) | |
tree | 5232eba17b970e40013356a1796b8d6b1e24baff | |
parent | a079a1481b26fbe80fe0f041dd900e2fa7ee5a87 (diff) | |
download | mgaonline-457db0de6ebf38c5fa280fd240cbb8dcb3ba2cd9.tar mgaonline-457db0de6ebf38c5fa280fd240cbb8dcb3ba2cd9.tar.gz mgaonline-457db0de6ebf38c5fa280fd240cbb8dcb3ba2cd9.tar.bz2 mgaonline-457db0de6ebf38c5fa280fd240cbb8dcb3ba2cd9.tar.xz mgaonline-457db0de6ebf38c5fa280fd240cbb8dcb3ba2cd9.zip |
added standard rules to build packages
-rw-r--r-- | Makefile | 62 |
1 files changed, 45 insertions, 17 deletions
@@ -1,10 +1,12 @@ -VERSION = $(shell awk '/define version/ { print $$3 }' $(NAME).spec) +PACKAGE = mdkonline +VERSION:=$(shell rpm -q --qf %{VERSION} --specfile $(PACKAGE).spec) +RELEASE:=$(shell rpm -q --qf %{RELEASE} --specfile $(PACKAGE).spec) +TAG := $(shell echo "V$(VERSION)_$(RELEASE)" | tr -- '-.' '__') NAME = mdkonline MDKUPDATE = mdkupdate #SCRIPTS = sshlogin.exp scpcall.exp SUBDIRS = po localedir = $(prefix)/usr/share/locale -RPM=$(HOME)/rpm override CFLAGS += -DPACKAGE=\"$(NAME)\" -DLOCALEDIR=\"$(localedir)\" @@ -15,6 +17,7 @@ clean: $(MAKE) -C po $@ rm -f core .#*[0-9] for d in $(SUBDIRS); do ( cd $$d ; make $@ ) ; done + find . -name '*~' | xargs rm -f install: all $(MAKE) -C po $@ @@ -26,18 +29,43 @@ install: all install -m644 *.txt $(RPM_BUILD_ROOT)/usr/share/mdkonline/ for d in $(SUBDIRS); do ( cd $$d ; make $@ ) ; done -dis: clean - rm -rf $(NAME)-$(VERSION) ../$(NAME)-$(VERSION).tar* -# cvs commit - mkdir -p $(NAME)-$(VERSION) - find . -not -name "$(NAME)-$(VERSION)"|cpio -pd $(NAME)-$(VERSION)/ - find $(NAME)-$(VERSION) -type d -name CVS -o -name .cvsignore |xargs rm -rf - tar cf ../$(NAME)-$(VERSION).tar $(NAME)-$(VERSION) - bzip2 -9f ../$(NAME)-$(VERSION).tar - rm -rf $(NAME)-$(VERSION) - -rpm: dis ../$(NAME)-$(VERSION).tar.bz2 $(RPM) - cp -f ../$(NAME)-$(VERSION).tar.bz2 $(RPM)/SOURCES - cp -f $(NAME).spec $(RPM)/SPECS/ - rpm -ba --clean --rmsource $(NAME).spec - rm -f ../$(NAME)-$(VERSION).tar.bz2 +# rules to build a test rpm + +localrpm: clean localdist buildrpm + +localdist: cleandist dir localcopy tar + +cleandist: + rm -rf $(PACKAGE)-$(VERSION) $(PACKAGE)-$(VERSION).tar.bz2 + +dir: + mkdir $(PACKAGE)-$(VERSION) + +localcopy: clean + find . -not -name "$(PACKAGE)-$(VERSION)" -a -not -name '*.bz2'|cpio -pd $(PACKAGE)-$(VERSION)/ + find $(PACKAGE)-$(VERSION) -type d -name CVS|xargs rm -rf + +tar: + tar cvf $(PACKAGE)-$(VERSION).tar $(PACKAGE)-$(VERSION) + bzip2 -9vf $(PACKAGE)-$(VERSION).tar + rm -rf $(PACKAGE)-$(VERSION) + +buildrpm: + rpm -ta $(PACKAGE)-$(VERSION).tar.bz2 + +# 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 |