aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile65
1 files changed, 45 insertions, 20 deletions
diff --git a/Makefile b/Makefile
index 8145a08..e1f4b78 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,7 @@
-NAME = mandrake_desk
-VERSION = $(shell awk '/define version/ { print $$3 }' $(NAME).spec)
+PACKAGE = mandrake_desk
+VERSION:=$(shell grep 'Version:' $(PACKAGE).spec| cut -f 2)
+RELEASE:=$(shell grep 'Release:' $(PACKAGE).spec| cut -f 2)
+TAG := $(shell echo "V$(VERSION)_$(RELEASE)" | tr -- '-.' '__')
mandir=/usr/share/man
all:
@@ -31,7 +33,7 @@ install:
$(RPM_BUILD_ROOT)/usr/share/pixmaps/backgrounds/linux-mandrake/
install -m644 icons/mandrake*.xpm $(RPM_BUILD_ROOT)/usr/share/pixmaps/mdk/
-
+
install -m644 faces/* $(RPM_BUILD_ROOT)/usr/share/faces
install -m644 login/loging100.png $(RPM_BUILD_ROOT)/usr/share/pixmaps/mdk
@@ -40,21 +42,44 @@ install:
cp gnome/mandrake.links.sh $(RPM_BUILD_ROOT)/usr/lib/mc/desktop-scripts/mandrake.links.sh
chmod 0755 $(RPM_BUILD_ROOT)/usr/lib/mc/desktop-scripts/mandrake.links.sh
-dis:
- rm -rf $(NAME)-$(VERSION) ../$(NAME)-$(VERSION).tar*
+# 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 . | grep -v -- "$(PACKAGE)-$(VERSION)\|\.bz2\|CVS\|~" |cpio -pd $(PACKAGE)-$(VERSION)/
+
+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)
+ cd $(PACKAGE)-$(VERSION); autoconf
+
+cvstag:
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 -o -name unused |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 special/mandrake-small.xpm $(RPM)/SOURCES/
- cp -f $(NAME).spec $(RPM)/SPECS/
- -rpm -ba --clean --rmsource $(NAME).spec
- rm -f ../$(NAME)-$(VERSION).tar.bz2
- rm -f $(RPM)/SOURCES/mandrake-small.xpm
- rm -f $(RPM)/SPECS/$(NAME).spec
+ 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