[Pkg-cgit-commits] [pkg-cgit] 16/18: Add get-orig-source target to pack orig tarball

Peter Colberg peter at colberg.org
Thu Jun 16 01:59:56 UTC 2016


This is an automated email from the git hooks/post-receive script.

pc-guest pushed a commit to branch master
in repository pkg-cgit.

commit 9ef6d629ef34cad41032b8dbbde1c70276d335e8
Author: Peter Colberg <peter at colberg.org>
Date:   Fri Jun 10 10:52:56 2016 -0400

    Add get-orig-source target to pack orig tarball
---
 debian/rules | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/debian/rules b/debian/rules
index c32bde1..64ceb8b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -32,3 +32,24 @@ override_dh_auto_test:
 override_dh_fixperms:
 	dh_fixperms
 	chown www-data:www-data debian/cgit/var/cache/cgit
+
+# pack orig tarball including git
+CGIT_VERSION = $(shell dpkg-parsechangelog -S Version | grep -oP '^\d[.\d]+(?=\+git)')
+CGIT_URL     = $(shell grep -oP '(?<=^Homepage: ).+' debian/control)
+GIT_VERSION  = $(shell grep -oP '(?<=^GIT_VER = )\d[.\d]+' $(CGIT_DIR)/Makefile)
+CGIT_DIR     = cgit-$(CGIT_VERSION)
+CGIT_TARBALL = cgit_$(CGIT_VERSION)+git$(GIT_VERSION).orig.tar.gz
+
+get-cgit:
+	rm -rf $(CGIT_DIR)
+	git clone $(CGIT_URL) $(CGIT_DIR)
+	git -C $(CGIT_DIR) checkout v$(CGIT_VERSION)
+	git -C $(CGIT_DIR) submodule update --init
+
+get-orig-source: get-cgit
+	git -C $(CGIT_DIR) archive -o cgit.tar --prefix=$(CGIT_DIR)/ v$(CGIT_VERSION)
+	git -C $(CGIT_DIR)/git archive -o git.tar --prefix=$(CGIT_DIR)/git/ v$(GIT_VERSION)
+	tar --concatenate -f $(CGIT_DIR)/cgit.tar $(CGIT_DIR)/git/git.tar
+	gzip -n -9 $(CGIT_DIR)/cgit.tar
+	mv $(CGIT_DIR)/cgit.tar.gz $(CGIT_TARBALL)
+	rm -rf $(CGIT_DIR)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-cgit/pkg-cgit.git



More information about the Pkg-cgit-commits mailing list