[opencv] 01/13: Add get-orig-source target
Nobuhiro Iwamatsu
iwamatsu at moszumanska.debian.org
Sat May 13 09:54:24 UTC 2017
This is an automated email from the git hooks/post-receive script.
iwamatsu pushed a commit to branch master
in repository opencv.
commit 270e8b47b60b69d5ee88df26e6d82c04457a077d
Author: Nobuhiro Iwamatsu <iwamatsu at nigauri.org>
Date: Tue May 9 05:27:56 2017 +0900
Add get-orig-source target
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu at nigauri.org>
---
debian/rules | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 68 insertions(+)
diff --git a/debian/rules b/debian/rules
index 99bbec3..7a816c8 100755
--- a/debian/rules
+++ b/debian/rules
@@ -134,3 +134,71 @@ override_dh_gencontrol:
dh_numpy
dh_numpy3
dh_gencontrol
+
+OCV_CONTRIB = opencv_contrib-3.2.0
+PKG = opencv
+UVER = $(shell dpkg-parsechangelog -S Version | sed 's,-.*,,')
+DTYPE = +dfsg
+VER ?= $(subst $(DTYPE),,$(UVER))
+get-orig-source:
+ $(eval GOS_TMP_DIR := $(shell mktemp -d $(PKG)-XXXXXXXXX))
+
+ @echo "# OpenCV Downloading..."
+ uscan --no-conf --verbose --force-download --download-version $(VER) \
+ --destdir $(GOS_TMP_DIR) --no-symlink
+ $(if $(wildcard $(GOS_TMP_DIR)/$(PKG)-$(VER)),$(error $(PKG)-$(VER) exist, aborting..))
+
+ @echo "# Extracting..."
+ cd $(GOS_TMP_DIR) \
+ && mkdir $(PKG)-$(VER)$(DTYPE) \
+ && tar -xf $(PKG)_$(VER).orig.tar.* \
+ --directory $(PKG)-$(VER)$(DTYPE) \
+ --strip-components 1 \
+ || $(RM) -r $(PKG)-$(VER)$(DTYPE)
+
+ @echo "# Cleaning-up..."
+ cd $(GOS_TMP_DIR)/ \
+ && $(RM) -r -v $(PKG)-$(VER)$(DTYPE)/3rdparty \
+ && $(RM) -r -v $(PKG)-$(VER)$(DTYPE)/modules/highgui/src/files_Qt/Milky \
+ && find $(PKG)-$(VER)$(DTYPE)/ -type f -name '[L|l]ena.png' -delete \
+ && find $(PKG)-$(VER)$(DTYPE)/ -type f -name '[L|l]ena.jpg' -delete
+
+ @echo "# Packing..."
+ cd $(GOS_TMP_DIR) \
+ && find -L "$(PKG)-$(VER)$(DTYPE)" -xdev -type f -print \
+ | LC_ALL=C sort \
+ | XZ_OPT="-6v" tar -caf "$(PKG)_$(VER)$(DTYPE).orig.tar.xz" \
+ -T- --owner=root --group=root --mode=a+rX \
+ && $(RM) -r "$(PKG)-$(VER)$(DTYPE)"
+
+ @echo "# OpenCV contrib Downloading..."
+ uscan --no-conf --verbose --force-download \
+ --upstream-version 0 --download-version $(VER) \
+ --download --destdir $(GOS_TMP_DIR) --no-symlink
+ $(if $(wildcard $(GOS_TMP_DIR)/contrib_$(VER)),$(error contrib_$(VER) exist, aborting..))
+
+ @echo "# OpenCV contrib Extracting..."
+ cd $(GOS_TMP_DIR) \
+ && mkdir -p contrib \
+ && tar -xf $(PKG)_$(VER).orig-contrib.tar.* \
+ --directory contrib/ \
+ --strip-components 1 \
+ || $(RM) -r contrib
+
+ @echo "# OpenCV contrib Cleaning-up..."
+ # Remove SIFT/SURF from source tarball by legal concerns
+ cd $(GOS_TMP_DIR)/ \
+ && $(RM) -r -v contrib/modules/xfeatures2d/
+
+ @echo "# OpenCV contrib Packing..."
+ cd $(GOS_TMP_DIR)/ \
+ && find -L contrib -xdev -type f -print \
+ | LC_ALL=C sort \
+ | XZ_OPT="-6v" tar -caf "$(PKG)_$(VER)$(DTYPE).orig-contrib.tar.xz" \
+ -T- --owner=root --group=root --mode=a+rX \
+ && $(RM) -r contrib
+
+ # mv $(GOS_TMP_DIR)/$(PKG)_$(VER)$(DTYPE).orig* $(CURDIR)
+ rm -Rf $(GOS_TMP_DIR)
+ # move files
+ mv "$(PKG)_$(VER)$(DTYPE).*.tar.xz" ../.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/opencv.git
More information about the debian-science-commits
mailing list