[opencv] 03/09: Add get-orig-source target to debian/rules
Nobuhiro Iwamatsu
iwamatsu at moszumanska.debian.org
Tue Oct 25 21:12:59 UTC 2016
This is an automated email from the git hooks/post-receive script.
iwamatsu pushed a commit to branch with-contrib
in repository opencv.
commit 13b6ff2381949d664e6ae49b0836ea189462618b
Author: Nobuhiro Iwamatsu <iwamatsu at debian.org>
Date: Sat Oct 22 04:07:50 2016 +0900
Add get-orig-source target to debian/rules
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu at debian.org>
---
debian/rules | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 66 insertions(+)
diff --git a/debian/rules b/debian/rules
index de95ba7..9c2525e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -137,3 +137,69 @@ override_dh_fixperms-indep:
dh_fixperms
#chmod 644 $(CURDIR)/debian/opencv-doc/usr/share/doc/opencv-doc/examples/python/*.py
#chmod 644 $(CURDIR)/debian/opencv-doc/usr/share/doc/opencv-doc/examples/python2/*.py
+
+OCV_CONTRIB = opencv_contrib-3.1.0
+PKG = opencv
+UVER = $(shell dpkg-parsechangelog -S Version | sed 's,-.*,,')
+DTYPE = +dfsg1
+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 --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).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 \
+ --watchfile debian/`echo $(OCV_CONTRIB) | cut -d- -f1`.watch \
+ --upstream-version 0 --download-version `echo $(OCV_CONTRIB) | cut -d- -f2,3` \
+ --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 contrib_$(VER).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)
--
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