Packaging updated with latest GBP
[tools/pristine-tar.git] / packaging / 0004-openSUSE-HACK-enable-special-upstream-bzip2.patch
1 From: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2 Date: Thu, 16 Aug 2012 14:28:28 +0300
3 Subject: openSUSE HACK: enable special upstream bzip2
4
5 This is a hack for openSUSE that makes pristine-bz2 use a special
6 (pristine-tar-specific) bzip2. Otherwise it uses the system bzip2 which
7 is unable to re-create/gendelta bz2 archives created by other
8 distributions.
9
10 Gbp-Rpm-If: 0%{?suse_version}
11
12 Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
13 ---
14  Makefile.PL  |    5 +++++
15  pristine-bz2 |    4 +++-
16  2 files changed, 8 insertions(+), 1 deletion(-)
17
18 diff --git a/Makefile.PL b/Makefile.PL
19 index d11e396..4d40774 100755
20 --- a/Makefile.PL
21 +++ b/Makefile.PL
22 @@ -20,6 +20,8 @@ extra_build: zgz/zgz pristine-tar.spec
23         pod2man -c pristine-xz pristine-xz > pristine-xz.1
24         pod2man -c zgz zgz/zgz.pod > zgz.1
25         make -C pit/suse-bzip2
26 +       make -C pit/upstream-bzip2
27 +       sed -i s'|^my $$__upstream_bzip2_prefix.*|my $$__upstream_bzip2_prefix = "$(ZGZ_LIB)/upstream-bzip2/";|' pristine-bz2
28  
29  ZGZ_SOURCES = zgz/zgz.c zgz/gzip/*.c zgz/old-bzip2/*.c
30  zgz/zgz: $(ZGZ_SOURCES)
31 @@ -37,6 +39,9 @@ extra_install:
32         install -d $(DESTDIR)$(ZGZ_LIB)/suse-bzip2
33         install pit/suse-bzip2/bzip2 $(DESTDIR)$(ZGZ_LIB)/suse-bzip2
34         install pit/suse-bzip2/libbz2* $(DESTDIR)$(ZGZ_LIB)/suse-bzip2
35 +       install -d $(DESTDIR)$(ZGZ_LIB)/upstream-bzip2
36 +       install pit/upstream-bzip2/bzip2 $(DESTDIR)$(ZGZ_LIB)/upstream-bzip2
37 +       install pit/upstream-bzip2/libbz2* $(DESTDIR)$(ZGZ_LIB)/upstream-bzip2
38  
39  extra_clean: pristine-tar.spec
40         rm -f *.1 zgz/zgz
41 diff --git a/pristine-bz2 b/pristine-bz2
42 index 147ad86..dd9690c 100755
43 --- a/pristine-bz2
44 +++ b/pristine-bz2
45 @@ -91,7 +91,9 @@ use IO::Handle;
46  delete $ENV{BZIP};
47  delete $ENV{BZIP2};
48  
49 -my @supported_bzip2_programs = qw(bzip2 pbzip2 zgz);
50 +my $__upstream_bzip2_prefix = "";
51 +
52 +my @supported_bzip2_programs = ("${__upstream_bzip2_prefix}bzip2",  "pbzip2", "zgz");
53  
54  my $try=0;
55