Code

debian/rules: Added get-orig-source target.
authorSebastian Harl <sh@tokkee.org>
Thu, 9 Oct 2008 21:51:26 +0000 (23:51 +0200)
committerSebastian Harl <sh@tokkee.org>
Thu, 9 Oct 2008 22:13:05 +0000 (00:13 +0200)
This target uses uscan to download and repack the upstream tarball using
debian/bin/uscan_repack.sh. This script removes src/win32helpers, *.sln and
*.vcproj from the upstream sources. It then applies all patches in
debian/patches-repack/ and rebuilds the autotools build system.

debian/patches-repack/00-win32helpers.patch has been added to remove
src/win32helpers/, *.sln and *.vcproj from the build scripts.

debian/bin/uscan_repack.sh [new file with mode: 0755]
debian/changelog
debian/patches-repack/00-win32helpers.patch [new file with mode: 0644]
debian/rules
debian/watch

diff --git a/debian/bin/uscan_repack.sh b/debian/bin/uscan_repack.sh
new file mode 100755 (executable)
index 0000000..ca1d079
--- /dev/null
@@ -0,0 +1,40 @@
+#! /bin/sh
+#
+# This script is called as:
+# $0 --upstream-version <version> <filename>
+
+echo
+set -ex
+
+test $# -eq 3 || exit 255
+
+version="$2"
+filename="$3"
+
+toplevel_sourcedir=`tar ztf ${filename} | head -n 1 | sed -e 's,/.*,,g'`
+
+tar zxf ${filename}
+rm -f ${filename}
+
+mv $toplevel_sourcedir enblend-$version+dfsg
+
+rm -rf enblend-$version+dfsg/src/win32helpers
+find enblend-$version+dfsg -name '*.vcproj' -o -name '*.sln' | xargs rm -f
+
+for patch in debian/patches-repack/*.patch; do
+       ( cd enblend-$version+dfsg; patch -p1 ) < $patch
+done
+
+(
+       cd enblend-$version+dfsg
+       aclocal -I m4
+       autoheader -f
+       automake -acf
+       autoconf
+       rm -rf autom4te.cache/ config.h.in~
+)
+
+tar cf - enblend-$version+dfsg | gzip -9 \
+       > ../enblend_$version+dfsg.orig.tar.gz
+rm -rf enblend-$version+dfsg
+
index c53f9fc0fbc286714d82ba7e192c12df787142f1..425de216c2ea8060cccd05f171ca71fa5b558edb 100644 (file)
@@ -20,13 +20,28 @@ enblend (3.2+dfsg-1) unstable; urgency=low
   * Thanks a lot to Andreas for his help!
   * debian/rules:
     - Include AUTHORS file in the package as well.
+    - Added get-orig-source target which uses uscan to download and repack the
+      upstream tarball using debian/bin/uscan_repack.sh - thanks to Bernd
+      Zeimetz for the idea!
   * debian/patches:
     - Removed gcc4.3-includes.dpatch - included upstream.
     - Removed type_mismatch.dpatch - included upstream.
+  * debian/patches-repack:
+    - Added patches to be applied when repacking the tarball.
+    - Added 00-win32helpers.patch to remove src/win32helpers/, *.sln and
+      *.vcproj from the build scripts.
   * debian/control:
     - Updated standards-version to 3.8.0 - no changes.
-
- -- Sebastian Harl <sh@tokkee.org>  Tue, 07 Oct 2008 18:32:37 +0200
+  * debian/bin/uscan_repack.sh:
+    - Added script to take care of the repacking.
+    - Remove src/win32helpers/.
+    - Remove *.sln and *.vcproj.
+    - Apply patches in debian/patches-repack/.
+    - Regenerate autotools build system.
+  * debian/watch:
+    - Call debian/bin/uscan_repack.sh.
+
+ -- Sebastian Harl <sh@tokkee.org>  Thu, 09 Oct 2008 23:39:43 +0200
 
 enblend (3.0+dfsg-2) unstable; urgency=low
 
diff --git a/debian/patches-repack/00-win32helpers.patch b/debian/patches-repack/00-win32helpers.patch
new file mode 100644 (file)
index 0000000..2466925
--- /dev/null
@@ -0,0 +1,98 @@
+diff a/Makefile.am b/Makefile.am
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1,2 +1,2 @@
+-EXTRA_DIST = VIGRA_LICENSE README_WINDOWS.txt enblend.sln enblend_msvc2003.sln enblend_msvc2008.sln
++EXTRA_DIST = VIGRA_LICENSE README_WINDOWS.txt
+ SUBDIRS = include doc src
+diff a/configure.in b/configure.in
+--- a/configure.in
++++ b/configure.in
+@@ -140,8 +140,7 @@
+                  include/vigra/Makefile
+                  include/vigra_ext/Makefile
+                  src/Makefile
+-                 src/vigra_impex/Makefile
+-                 src/win32helpers/Makefile])
++                 src/vigra_impex/Makefile])
+ AC_OUTPUT
+ AC_MSG_RESULT([
+diff a/src/Makefile.am b/src/Makefile.am
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -1,5 +1,4 @@
+-EXTRA_DIST = enblend.vcproj enblend_msvc2003.vcproj enblend_msvc2008.vcproj enfuse.vcproj enfuse_msvc2003.vcproj enfuse_msvc2008.vcproj
+-SUBDIRS = vigra_impex win32helpers
++SUBDIRS = vigra_impex
+ bin_PROGRAMS = enblend enfuse
+ enblend_SOURCES = anneal.h assemble.h blend.h bounds.h common.h enblend.h enblend.cc fixmath.h float_cast.h gpu.cc gpu.h mask.h nearest.h numerictraits.h path.h pyramid.h
+ enblend_LDFLAGS = -ffast-math
+diff a/src/enblend.cc b/src/enblend.cc
+--- a/src/enblend.cc
++++ b/src/enblend.cc
+@@ -21,11 +21,6 @@
+ #include <config.h>
+ #endif
+-#ifdef _MSC_VER
+-#include <win32helpers\win32config.h>
+-#define isnan _isnan
+-#endif // _MSC_VER
+-
+ // Defines lrint for fast fromRealPromotes
+ #include "float_cast.h"
+@@ -49,14 +44,7 @@
+ #include <list>
+ #include <vector>
+-#ifndef _WIN32
+ #include <getopt.h>
+-#else
+-//extern "C" int getopt(int nargc, char** nargv, char* ostr);
+-extern "C" {
+-#include <win32helpers/getopt_long.h>
+-}
+-#endif
+ extern "C" char *optarg;
+ extern "C" int optind;
+diff a/src/enfuse.cc b/src/enfuse.cc
+--- a/src/enfuse.cc
++++ b/src/enfuse.cc
+@@ -21,11 +21,6 @@
+ #include <config.h>
+ #endif
+-#ifdef _MSC_VER
+-#include <win32helpers\win32config.h>
+-#define isnan _isnan
+-#endif // _MSC_VER
+-
+ // Defines lrint for fast fromRealPromotes
+ #include "float_cast.h"
+@@ -49,14 +44,7 @@
+ #include <list>
+ #include <vector>
+-#ifndef _WIN32
+ #include <getopt.h>
+-#else
+-//extern "C" int getopt(int nargc, char** nargv, char* ostr);
+-extern "C" {
+-#include <win32helpers/getopt_long.h>
+-}
+-#endif
+ extern "C" char *optarg;
+ extern "C" int optind;
+diff a/src/vigra_impex/Makefile.am b/src/vigra_impex/Makefile.am
+--- a/src/vigra_impex/Makefile.am
++++ b/src/vigra_impex/Makefile.am
+@@ -1,4 +1,3 @@
+-EXTRA_DIST = vigra_impex.vcproj vigra_impex_msvc2003.vcproj vigra_impex_msvc2008.vcproj
+ noinst_LIBRARIES = libvigra_impex.a
+ libvigra_impex_a_SOURCES = auto_file.hxx bmp.cxx bmp.hxx byteorder.cxx byteorder.hxx codecmanager.cxx codecmanager.hxx error.hxx gif.cxx gif.hxx hdr.cxx hdr.hxx iccjpeg.c iccjpeg.h imageinfo.cxx jpeg.cxx jpeg.hxx png.cxx png.hxx pnm.cxx pnm.hxx rgbe.c rgbe.h sun.cxx sun.hxx tiff.cxx tiff.hxx viff.cxx viff.hxx void_vector.cxx void_vector.hxx exr.cxx exr.hxx
+ #libvigra_impex_a_CXXFLAGS = -I${top_srcdir}/include -O3 -Wall -DHasPNG -DHasJPEG -DHasTIFF
index 84f46a17e83ae4e20ba335422e1841fdedda16f1..7ac48f74586f4067d6898f9502d31db8ca51db62 100755 (executable)
@@ -21,6 +21,12 @@ endif
 
 include /usr/share/dpatch/dpatch.make
 
+get-orig-source:
+       dh_testdir
+       dh_testroot
+       chmod 755 debian/bin/uscan_repack.sh
+       uscan --verbose --force-download --rename
+
 config.status: configure $(DPATCH_STAMPFN)
        dh_testdir
        CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) \
@@ -75,5 +81,5 @@ binary-arch: build install
        dh_builddeb
 
 binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install 
+.PHONY: get-orig-source build clean binary-indep binary-arch binary install
 
index 45d554363a647eba6eb2691f5d567455c39a9a61..1a4ebf2d5e17723d9aa74faf3827c130640d404f 100644 (file)
@@ -1,4 +1,6 @@
 version=3
 
 opts=dversionmangle=s/\+dfsg$// \
-http://sf.net/enblend/enblend(?:-enfuse)?-([0-9.]+)\.tar\.gz
+http://sf.net/enblend/enblend(?:-enfuse)?-([0-9.]+)\.tar\.gz \
+       debian debian/bin/uscan_repack.sh
+