[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

extract waf binary (fix for #645191)



Hi,

Can I fix this bug with an attached patch?
This patch doesn't contain repacked sources' changes. get-orig-source will create it.
waf-unpack will be able to extract waf without following upstream changes.

Regards,
-- 
Koichi Akabe
  vbkaisetsu at {gmail.com, debian.or.jp}
diff -urN midori-0.4.3/debian/changelog midori-0.4.3+dfsg/debian/changelog
--- midori-0.4.3/debian/changelog	2011-12-19 08:26:47.000000000 +0900
+++ midori-0.4.3+dfsg/debian/changelog	2012-09-14 11:07:46.033372721 +0900
@@ -1,3 +1,13 @@
+midori (0.4.3+dfsg-1) unstable; urgency=low
+
+  * Repack to extract waf script (Closes: 645191)
+  * debian/waf-unpack
+    - add to describe how to extract waf script
+  * debian/rules
+    - add get-orig-source target
+
+ -- Koichi Akabe <vbkaisetsu@gmail.com>  Fri, 14 Sep 2012 11:07:38 +0900
+
 midori (0.4.3-1) unstable; urgency=low
 
   * New upstream release.
diff -urN midori-0.4.3/debian/rules midori-0.4.3+dfsg/debian/rules
--- midori-0.4.3/debian/rules	2011-12-18 22:47:40.000000000 +0900
+++ midori-0.4.3+dfsg/debian/rules	2012-09-14 11:05:49.069376851 +0900
@@ -23,7 +23,22 @@
 %:
 	dh $@
 
-WAF=./waf
+upstream_version ?= $(shell dpkg-parsechangelog | sed -rne 's/^Version: ([0-9.]+)(\+dfsg)?.*$$/\1/p')
+dfsg_version = $(upstream_version)+dfsg
+upstream_pkg = "midori"
+pkg = $(shell dpkg-parsechangelog | sed -ne 's/^Source: //p')
+
+get-orig-source:
+	uscan --rename --download-current-version --destdir=.
+	tar -xjf $(pkg)_$(upstream_version).orig.tar.bz2
+	rm -f $(pkg)_$(upstream_version).orig.tar.bz2
+	mv $(upstream_pkg)-$(upstream_version) $(pkg)_$(dfsg_version).orig
+	$(CURDIR)/debian/waf-unpack $(pkg)_$(dfsg_version).orig
+	rm $(pkg)_$(dfsg_version).orig/waf
+	tar -cjf $(CURDIR)/../$(pkg)_$(dfsg_version).orig.tar.bz2 $(pkg)_$(dfsg_version).orig
+	rm -r $(pkg)_$(dfsg_version).orig
+
+WAF=WAFDIR=waf-modules ./waf-unpacked
 
 debian/presubj: debian/presubj.in
 	@echo "presubj parameters:"
@@ -42,6 +57,8 @@
 	rm -rf _build_
 	rm -rf .waf*
 	rm -rf .lock-wscript
+	rm -rf `find waf-modules -name "*.pyc"`
+
 
 override_dh_auto_configure:
 	$(WAF) --nocache configure --debug-level=none --prefix /usr
diff -urN midori-0.4.3/debian/waf-unpack midori-0.4.3+dfsg/debian/waf-unpack
--- midori-0.4.3/debian/waf-unpack	1970-01-01 09:00:00.000000000 +0900
+++ midori-0.4.3+dfsg/debian/waf-unpack	2012-09-14 11:06:01.885376401 +0900
@@ -0,0 +1,41 @@
+#!/usr/bin/env python
+
+from os import path, rename, remove, chmod
+import sys
+import shutil
+
+basedir = path.join(path.dirname(path.abspath(__file__)), "..")
+targetdir = sys.argv[1]
+
+skip = False
+
+waf = open(path.join(targetdir, "waf"), "r")
+unp = open(path.join(basedir, "debian/wafunp.py"), "w")
+
+shutil.copyfile(path.join(basedir, "debian/waf-unpack"),
+                path.join(basedir, "debian/waf-unpack.bup"))
+thisfile = open(path.join(basedir, "debian/waf-unpack"), "a")
+for l in waf:
+	if l == "#==>\n":
+		skip = True
+		thisfile.write(l)
+	elif l == "#<==\n":
+		skip = False
+		thisfile.write(l)
+	elif not skip:
+		unp.write(l)
+	else:
+		thisfile.write(l)
+
+waf.close()
+unp.close()
+thisfile.close()
+
+import wafunp
+rename(path.join(basedir, "debian/.%s-%s-%s" % (wafunp.WAF, wafunp.VERSION, wafunp.REVISION)), path.join(targetdir, "waf-modules"))
+rename(path.join(basedir, "debian/waf-unpack.bup"), path.join(basedir, "debian/waf-unpack"))
+chmod(path.join(basedir, "debian/waf-unpack"), 0744)
+remove(path.join(targetdir, "waf-modules/t.bz2"))
+remove(path.join(basedir, "debian/wafunp.pyc"))
+rename(path.join(basedir, "debian/wafunp.py"), path.join(targetdir, "waf-unpacked"))
+chmod(path.join(targetdir, "waf-unpacked"), 0744)
diff -urN midori-0.4.3/debian/watch midori-0.4.3+dfsg/debian/watch
--- midori-0.4.3/debian/watch	2011-12-18 22:47:40.000000000 +0900
+++ midori-0.4.3+dfsg/debian/watch	2012-09-13 23:25:18.000000000 +0900
@@ -1,2 +1,3 @@
 version=3
+opts=dversionmangle=s/\+dfsg// \
 http://archive.xfce.org/src/apps/midori/([\d\.]+)/midori-([\d.]+).tar.bz2

Attachment: pgpTkjBvbTysi.pgp
Description: PGP signature


Reply to: