diff options
author | astokes_rhn <astokes_rhn@ef72aa8b-4018-0410-8976-d6e080ef94d8> | 2007-07-25 15:10:20 +0000 |
---|---|---|
committer | astokes_rhn <astokes_rhn@ef72aa8b-4018-0410-8976-d6e080ef94d8> | 2007-07-25 15:10:20 +0000 |
commit | 7e9c9b84a6449f70c768a2334c1a68ce73499cd0 (patch) | |
tree | 7072d53ee8d1ac0aa4d848dfc47640a6bbcde2ce /trunk/src/Makefile | |
parent | 28f13dc4aec9d474447a5021eb45409bcba81182 (diff) | |
download | sos-7e9c9b84a6449f70c768a2334c1a68ce73499cd0.tar.gz |
branching off for stokes work
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/sos/trunk@223 ef72aa8b-4018-0410-8976-d6e080ef94d8
Diffstat (limited to 'trunk/src/Makefile')
-rw-r--r-- | trunk/src/Makefile | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/trunk/src/Makefile b/trunk/src/Makefile new file mode 100644 index 00000000..99d2ed5d --- /dev/null +++ b/trunk/src/Makefile @@ -0,0 +1,95 @@ +# +# Makefile for sos system support tools +# + +NAME = sos +VERSION = $(shell awk '/^%define version / { print $$3 }' sos.spec) +REPO = https://sos.108.redhat.com/svn/sos +SVNTAG = r$(subst .,-,$(VERSION)) +SRCDIR = $(PWD) +TOPDIR = $(PWD)/build/rpm-$(NAME)-$(VERSION) + + +all: + +.PHONY: tag-release tarball release install version clean + +diff-tag: + svn diff $(REPO)/trunk/src $(REPO)/tags/$(SVNTAG) + +tag: + @if ( svn list $(REPO)/tags/$(SVNTAG)/Makefile &> /dev/null ); then \ + echo "The repository already contains a tag for version $(VERSION)"; \ + exit 1; \ + fi + @svn copy $(REPO)/trunk/src $(REPO)/tags/$(SVNTAG) \ + -m "Tagging the $(SVNTAG) release of the sos project" + @echo "Tagged as $(SVNTAG)" + +tag-force: + @echo svn del $(REPO)/tags/$(SVNTAG) + @echo make diff-tag + +tarball: clean + @echo "Creating an archive from HEAD of development" + @rm -rf /tmp/$(NAME) + @svn export -q $(REPO)/trunk/src /tmp/$(NAME) \ + || echo GRRRrrrrr -- ignore [export aborted] + @mv /tmp/$(NAME) /tmp/$(NAME)-$(VERSION) + @cd /tmp; tar --bzip2 -cSpf $(NAME)-$(VERSION).tar.bz2 $(NAME)-$(VERSION) + @rm -rf /tmp/$(NAME)-$(VERSION) + @mv /tmp/$(NAME)-$(VERSION).tar.bz2 . + @echo " " + @echo "The final archive is ./$(NAME)-$(VERSION).tar.bz2." + +release: clean + @if ( ! svn list $(REPO)/tags/$(SVNTAG)/Makefile &> /dev/null ); then \ + echo "There is no tag in the repository for this version, must be tagged before release"; \ + exit 1; \ + fi + @echo "Creating an archive from tag $(SVNTAG)" + @rm -rf /tmp/$(NAME) + @svn export -q $(REPO)/tags/$(SVNTAG) /tmp/$(NAME) \ + || echo GRRRrrrrr -- ignore [export aborted] + @mv /tmp/$(NAME) /tmp/$(NAME)-$(VERSION) + @cd /tmp; tar --bzip2 -cSpf $(NAME)-$(VERSION).tar.bz2 $(NAME)-$(VERSION) + @rm -rf /tmp/$(NAME)-$(VERSION) + @cp /tmp/$(NAME)-$(VERSION).tar.bz2 . + @rm -f /tmp/$(NAME)-$(VERSION).tar.bz2 + @echo " " + @echo "The final archive is ./$(NAME)-$(VERSION).tar.bz2." + +install:mo + python setup.py install + +version: + @echo "The version is $(NAME)-$(VERSION)" + +clean: + @rm -fv *~ .*~ changenew ChangeLog.old $(NAME)-$(VERSION).tar.bz2 sosreport.1.gz + +rpm: mo + @test -f sos.spec + @mkdir -p $(TOPDIR)/SOURCES $(TOPDIR)/SRPMS $(TOPDIR)/RPMS $(TOPDIR)/BUILD + +# this builds an RPM from the current working copy + @cd $(TOPDIR)/BUILD ; \ + rm -rf $(NAME)-$(VERSION) ; \ + ln -s $(SRCDIR) $(NAME)-$(VERSION) ; \ + tar --gzip --exclude=.svn --exclude=svn-commit.tmp --exclude=$(NAME)-$(VERSION)/build --exclude=$(NAME)-$(VERSION)/dist \ + -chSpf $(TOPDIR)/SOURCES/$(NAME)-$(VERSION).tar.gz $(NAME)-$(VERSION) ; \ + rm -f $(NAME)-$(VERSION) + +# this builds an RPM from HEAD +# @rm -rf $(TOPDIR)/BUILD/$(NAME)-$(VERSION) +# @svn export -q $(REPO)/trunk/src $(TOPDIR)/BUILD/$(NAME)-$(VERSION) +# @cd $(TOPDIR)/BUILD ; tar --gzip -cSpf $(TOPDIR)/SOURCES/$(NAME)-$(VERSION).tar.gz $(NAME)-$(VERSION); rm -rf $(NAME)-$(VERSION) + + rpmbuild -ba --define="_topdir $(TOPDIR)" sos.spec + @mv $(TOPDIR)/RPMS/noarch/$(NAME)-$(VERSION)*.rpm $(TOPDIR)/SRPMS/$(NAME)-$(VERSION)*.rpm $(TOPDIR)/SOURCES/$(NAME)-$(VERSION).tar.gz dist/ + +pot: + python tools/pygettext.py -o locale/sos.pot sosreport + +mo: + python tools/msgfmt.py locale/*/LC_MESSAGES/sos.po |