summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin.dahyabhai@pobox.com>2010-02-02 12:21:25 -0500
committerNalin Dahyabhai <nalin.dahyabhai@pobox.com>2010-02-02 12:21:25 -0500
commit311de24245b80345c9eabbcac783cda9e0173292 (patch)
tree43274ae62924c8273000a082064a29f8ed7e2cb5
parent5029dfb4abd63bd4d7a983ec2db0be972a47e0db (diff)
downloadpomatic-311de24245b80345c9eabbcac783cda9e0173292.tar.gz
pomatic-311de24245b80345c9eabbcac783cda9e0173292.tar.xz
pomatic-311de24245b80345c9eabbcac783cda9e0173292.zip
- targets for making releases
-rw-r--r--Makefile.am41
-rw-r--r--pomatic.spec1
2 files changed, 42 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index b0e3d56..5997046 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,2 +1,43 @@
EXTRA_DIST = pomatic.spec
SUBDIRS = src
+SVERSION=$(shell awk '/^Version:/ {print $$NF}' $(top_srcdir)/pomatic.spec | sed 's,%.*,,' | head -n 1)
+SRELEASE=$(shell awk '/^Release:/ {print $$NF}' $(top_srcdir)/pomatic.spec | sed 's,%.*,,' | head -n 1)
+GITTAG=$(PACKAGE)-$(VERSION)
+distdir=$(GITTAG)
+
+tag:
+ test $(GITTAG) = $(PACKAGE)-$(SVERSION)
+ git tag $(GITTAG)
+
+force-tag:
+ git tag -f $(GITTAG)
+
+ORIGIN=$(shell git config remote.origin.url 2> /dev/null || /bin/pwd)
+ARCHIVEOUTDIR=$(shell cd $(top_srcdir) && pwd)
+
+local-archive:
+ $(MAKE) archive ORIGIN=$(ARCHIVEOUTDIR)
+
+archive:
+ repo=`pwd`; \
+ tmpdir=`mktemp -d /tmp/make_archive_XXXXXX`; \
+ if test -d "$$tmpdir" ; then \
+ git clone $(ORIGIN) $$tmpdir/pomatic;\
+ cd $$tmpdir/pomatic;\
+ git checkout $(GITTAG);\
+ ./autogen;\
+ make dist;\
+ mkdir -p $$tmpdir/rpm-build-top;\
+ rpmbuild \
+ --define "_topdir $$tmpdir/rpm-build-top" \
+ --define "_sourcedir $$tmpdir/rpm-build-top" \
+ --define "_specdir $$tmpdir/rpm-build-top" \
+ --define "_builddir $$tmpdir/rpm-build-top" \
+ --define "_srpmdir $$tmpdir/rpm-build-top" \
+ --define "_rpmdir $$tmpdir/rpm-build-top" \
+ --define "_rpmdir $$tmpdir/rpm-build-top" \
+ -tb $(distdir).tar.gz;\
+ cp -v $(distdir).tar.gz $(ARCHIVEOUTDIR)/;\
+ rm -fr $$tmpdir;\
+ fi
+
diff --git a/pomatic.spec b/pomatic.spec
index f7a291e..a98b66f 100644
--- a/pomatic.spec
+++ b/pomatic.spec
@@ -29,6 +29,7 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
+%doc LICENSE
%{_bindir}/*
%{_mandir}/*/*