aboutsummaryrefslogtreecommitdiffstats
path: root/src/Makefile
diff options
context:
space:
mode:
authorshnavid <shnavid@ef72aa8b-4018-0410-8976-d6e080ef94d8>2007-07-10 09:28:25 +0000
committershnavid <shnavid@ef72aa8b-4018-0410-8976-d6e080ef94d8>2007-07-10 09:28:25 +0000
commit843800689e68efd5a53ca43b0e1188ab5d628edb (patch)
tree90288f8d34d1d81c3548c383ae5252d859b50d57 /src/Makefile
parentc0fa22c1b56507aae456665d19f4bd2155413d63 (diff)
downloadsos-843800689e68efd5a53ca43b0e1188ab5d628edb.tar.gz
* simplified rpm build procedure in Makefile with "make rpm"
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/sos/trunk@184 ef72aa8b-4018-0410-8976-d6e080ef94d8
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/Makefile b/src/Makefile
index 6d918865..057060fd 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -3,9 +3,11 @@
#
NAME = sos
-VERSION = $(shell grep -e 'version = ' setup.py |cut -d \' -f 2)
+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:
@@ -63,4 +65,21 @@ clean:
@rm -fv *~ .*~ changenew ChangeLog.old $(NAME)-$(VERSION).tar.bz2 sosreport.1.gz
rpm:
- rpmbuild -ba sos.spec
+ @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/