diff options
author | Frederic Lepied <flepied@mandriva.com> | 2005-08-31 06:44:54 +0000 |
---|---|---|
committer | Frederic Lepied <flepied@mandriva.com> | 2005-08-31 06:44:54 +0000 |
commit | d7d0ad0543193d066d3ca7278ba4cfa84a063f21 (patch) | |
tree | cc9d339ecdd0bad2faaae498c978611c7e7589a8 /Makefile | |
parent | 0f6d92a74ab0074bc4338043913092e84c1556b9 (diff) | |
download | drakpxelinux-d7d0ad0543193d066d3ca7278ba4cfa84a063f21.tar drakpxelinux-d7d0ad0543193d066d3ca7278ba4cfa84a063f21.tar.gz drakpxelinux-d7d0ad0543193d066d3ca7278ba4cfa84a063f21.tar.bz2 drakpxelinux-d7d0ad0543193d066d3ca7278ba4cfa84a063f21.tar.xz drakpxelinux-d7d0ad0543193d066d3ca7278ba4cfa84a063f21.zip |
added standard rules to build packages.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 70 |
1 files changed, 50 insertions, 20 deletions
@@ -1,10 +1,14 @@ -VERSION = $(shell awk '/define version/ { print $$3 }' $(NAME).spec) -NAME = drakpxelinux +PACKAGE=drakpxelinux +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 -- '-.' '__') + +RPMOPT = --clean --rmspec + #SUBDIRS = po localedir = $(prefix)/usr/share/locale -RPM=$(HOME)/rpm -override CFLAGS += -DPACKAGE=\"$(NAME)\" -DLOCALEDIR=\"$(localedir)\" +override CFLAGS += -DPACKAGE=\"$(PACKAGE\" -DLOCALEDIR=\"$(localedir)\" all: drakpxelinux.pl # for d in $(SUBDIRS); do ( cd $$d ; make $@ ) ; done @@ -17,21 +21,47 @@ clean: install: all $(MAKE) -C po $@ - install -d $(RPM_BUILD_ROOT)/usr/bin/,share/drakpxelinux/} - install -s -m755 $(NAME).pl $(RPM_BUILD_ROOT)/usr/bin/drakpxelinux + install -d $(RPM_BUILD_ROOT)/usr/{bin/,share/drakpxelinux/} + install -s -m755 $(PACKAGE).pl $(RPM_BUILD_ROOT)/usr/bin/drakpxelinux # for d in $(SUBDIRS); do ( cd $$d ; make $@ ) ; done -dis: clean - rm -rf $(NAME)-$(VERSION) ../$(NAME)-$(VERSION).tar* - 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: localdist buildrpm + +localdist: cleandist dir localcopy tar + +cleandist: + rm -rf $(PACKAGE)-$(VERSION) $(PACKAGE)-$(VERSION).tar.bz2 + +dir: + mkdir $(PACKAGE)-$(VERSION) + +localcopy: + find . -not -name "$(PACKAGE)-$(VERSION)"|cpio -pd $(PACKAGE)-$(VERSION)/ + find $(PACKAGE)-$(VERSION) -type d -name CVS -o -name .cvsignore |xargs rm -rf + +tar: + tar cvf $(PACKAGE)-$(VERSION).tar $(PACKAGE)-$(VERSION) + bzip2 -9vf $(PACKAGE)-$(VERSION).tar + rm -rf $(PACKAGE)-$(VERSION) + +buildrpm: + rpm -ta $(RPMOPT) $(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 |