Package: dpatch
Version: 2.0.31
Severity: wishlist
Tags: patch

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi dpatch maintainers,

 Now dh in debhelper7 supports quilt but not dpatch.
 So I made a patch to add dpatch support for dh7 (stolen from quilt :)
 Please consider to apply it.

 Thanks.

- -- 
Regards,

 Hideki Yamane

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkuaRDQACgkQIu0hy8THJkuiJwCgrfVdcgDQbZwW/rMxg3PGVMPQ
fEMAoJ9maJdtkLaoWpe7qyy69gBhPF1m
=aPKA
-----END PGP SIGNATURE-----
diff -Nru dpatch-2.0.31/debhelper/dh_dpatch_patch dpatch-2.0.31.1/debhelper/dh_dpatch_patch
--- dpatch-2.0.31/debhelper/dh_dpatch_patch	1970-01-01 09:00:00.000000000 +0900
+++ dpatch-2.0.31.1/debhelper/dh_dpatch_patch	2010-03-12 15:03:54.000000000 +0900
@@ -0,0 +1,58 @@
+#!/usr/bin/perl -w
+
+=head1 NAME
+
+dh_dpatch_patch - apply patches listed in debian/patches/00list
+
+=cut
+
+use strict;
+use Debian::Debhelper::Dh_Lib;
+
+=head1 SYNOPSIS
+
+B<dh_dpatch_patch> [S<I<debhelper options>>]
+
+=head1 DESCRIPTION
+
+dh_dpatch_patch simply calls B<dpatch apply-all> .
+All patches listed in B<debian/patches/00list> are then applied in the
+current directory. The command does not fail if the patches have
+already been applied.
+
+=head1 EXAMPLES
+
+dh_dpatch_patch is usually called indirectly in a rules file via the
+dh command.
+
+	%:
+		dh --with dpatch $@
+
+It can also be direcly called at the start of the build (or configure)
+rule.
+
+	build:
+		dh_dpatch_patch
+		./configure
+		$(MAKE)
+
+=cut
+
+init();
+
+#$ENV{"QUILT_PATCHES"} = $ENV{"QUILT_PATCH_DIR"} ?
+#                        $ENV{"QUILT_PATCH_DIR"} : "debian/patches";
+complex_doit('dpatch apply-all || test $? = 2');
+
+=head1 SEE ALSO
+
+L<debhelper(7)>, L<dh(1)>.
+
+This program is meant to be used together with debhelper.
+
+=head1 AUTHOR
+
+Hideki Yamane <henr...@debian.or.jp>, stolen from dh_dpatch_quilt written by Raphael Hertzog <hert...@debian.org>
+
+=cut
+
diff -Nru dpatch-2.0.31/debhelper/dh_dpatch_unpatch dpatch-2.0.31.1/debhelper/dh_dpatch_unpatch
--- dpatch-2.0.31/debhelper/dh_dpatch_unpatch	1970-01-01 09:00:00.000000000 +0900
+++ dpatch-2.0.31.1/debhelper/dh_dpatch_unpatch	2010-03-12 15:03:54.000000000 +0900
@@ -0,0 +1,57 @@
+#!/usr/bin/perl -w
+
+=head1 NAME
+
+dh_dpatch_unpatch - unapply patches listed in debian/patched
+
+=cut
+
+use strict;
+use Debian::Debhelper::Dh_Lib;
+
+=head1 SYNOPSIS
+
+B<dh_dpatch_unpatch> [S<I<debhelper options>>]
+
+=head1 DESCRIPTION
+
+dh_dpatch_unpatch simply calls B<dpatch deapply-all>.
+All patches listed in B<debian/patched> are then unapplied in the
+current directory. The command does not fail if the patches have
+already been unapplied.
+
+=head1 EXAMPLES
+
+dh_dpatch_unpatch is usually called indirectly in a rules file via the
+dh command.
+
+	%:
+		dh --with dpatch $@
+
+It can also be direcly called in the clean rule.
+
+	clean:
+		dh_testdir
+		dh_testroot
+		[ ! -f Makefile ] || $(MAKE) clean
+		dh_dpatch_unpatch
+		dh_clean
+
+=cut
+
+init();
+
+complex_doit('dpatch deapply-all || test $? = 2');
+
+=head1 SEE ALSO
+
+L<debhelper(7)>, L<dh(1)>.
+
+This program is meant to be used together with debhelper.
+
+=head1 AUTHOR
+
+Hideki Yamane <henr...@debian.or.jp>, stolen from dh_quilt_unpatch written by Raphael Hertzog <hert...@debian.org>
+
+=cut
+
diff -Nru dpatch-2.0.31/debhelper/dpatch.pm dpatch-2.0.31.1/debhelper/dpatch.pm
--- dpatch-2.0.31/debhelper/dpatch.pm	1970-01-01 09:00:00.000000000 +0900
+++ dpatch-2.0.31.1/debhelper/dpatch.pm	2010-03-12 15:03:54.000000000 +0900
@@ -0,0 +1,20 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+use Debian::Debhelper::Dh_Lib;
+#!/usr/bin/perl
+use warnings;
+use strict;
+use Debian::Debhelper::Dh_Lib;
+
+insert_before("dh_auto_configure", "dh_dpatch_patch");
+insert_before("dh_clean", "dh_dpatch_unpatch");
+
+
+# Eval to avoid problem with debhelper < 7.3.12
+eval {
+    add_command("dh_dpatch_patch", "patch");
+};
+
+1;
+
diff -Nru dpatch-2.0.31/debian/changelog dpatch-2.0.31.1/debian/changelog
--- dpatch-2.0.31/debian/changelog	2009-03-21 23:29:38.000000000 +0900
+++ dpatch-2.0.31.1/debian/changelog	2010-03-12 15:16:24.000000000 +0900
@@ -1,3 +1,10 @@
+dpatch (2.0.31.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * add debhelper7 support
+
+ -- Hideki Yamane (Debian-JP) <henr...@debian.or.jp>  Fri, 12 Mar 2010 15:16:01 +0900
+
 dpatch (2.0.31) unstable; urgency=low
 
   * fix: /usr/share/dpatch/dpatch-edit-patch.functions: line 140: shifti:
diff -Nru dpatch-2.0.31/debian/control dpatch-2.0.31.1/debian/control
--- dpatch-2.0.31/debian/control	2009-03-21 23:26:23.000000000 +0900
+++ dpatch-2.0.31.1/debian/control	2010-03-12 15:01:13.000000000 +0900
@@ -3,6 +3,7 @@
 Priority: optional
 Maintainer: Dpatch Maintainers <dpatch-maintain...@lists.alioth.debian.org>
 Uploaders: Junichi Uekawa <dan...@debian.org>, Marc Haber <mh+debian-packa...@zugschlus.de>
+Build-Depends-Indep: perl
 Standards-Version: 3.8.0
 Vcs-Git: git://git.debian.org/git/dpatch/dpatch.git
 Vcs-Browser: http://git.debian.org/?p=dpatch/dpatch.git
diff -Nru dpatch-2.0.31/debian/rules dpatch-2.0.31.1/debian/rules
--- dpatch-2.0.31/debian/rules	2008-08-05 12:57:53.000000000 +0900
+++ dpatch-2.0.31.1/debian/rules	2010-03-12 15:20:35.000000000 +0900
@@ -12,6 +12,9 @@
 build:
 	test -e debian/control
 	${MAKE}
+# add addon for debhelper7
+	pod2man -c Debhelper debhelper/dh_dpatch_patch debian/dh_dpatch_patch.1
+	pod2man -c Debhelper debhelper/dh_dpatch_unpatch debian/dh_dpatch_unpatch.1
 
 testroot:
 	test -e debian/control && test xroot = x`whoami`
@@ -19,6 +22,7 @@
 clean: testroot
 	${MAKE} clean
 	rm -rf debian/files* ${DPATCH}
+	rm -f debian/dh_dpatch_patch.1 debian/dh_dpatch_unpatch.1
 
 # General compresser rule
 ${DOCDIR}/%.gz: %
@@ -29,7 +33,8 @@
 	install -d ${DPATCH}/usr/bin \
 		   ${DPATCH}/DEBIAN \
 		   ${EXDIR} ${MAN1DIR} ${MAN7DIR} \
-		   ${DPATCH}/etc/bash_completion.d
+		   ${DPATCH}/etc/bash_completion.d \
+		   ${DPATCH}/usr/share/perl5/Debian/Debhelper/Sequence
 
 # Install everything, save DEBIAN/ and stuff from debian/
 install: build installdirs \
@@ -38,6 +43,11 @@
 	${MAKE} install DESTDIR=${DPATCH}
 # history
 	cp -r history ${DOCDIR}/
+# install dh7 addons
+	install -m0644 debhelper/dpatch.pm ${DPATCH}/usr/share/perl5/Debian/Debhelper/Sequence/
+	install -m0644 debian/dh_dpatch_patch.1 ${MAN1DIR}
+	install -m0644 debian/dh_dpatch_unpatch.1 ${MAN1DIR}
+	install -m0755 debhelper/dh_dpatch_* ${DPATCH}/usr/bin/
 # Compress stuff
 	find ${MAN1DIR} -type f -not -name '*.gz' | xargs gzip -9f
 	find ${MAN7DIR} -type f -not -name '*.gz' | xargs gzip -9f

Reply via email to