summaryrefslogtreecommitdiff
path: root/packaging/pristine-tar.spec
blob: f3e83d93172c19c7b2e6e6ae59e44d4aff02a797 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
Name:       pristine-tar
Summary:    Regenerate pristine tarballs
Version:    1.28
Release:    0
Group:      Development/Tools/Building
License:    GPLv2
URL:        http://kitenet.net/~joey/code/pristine-tar/
Source0:    %{name}_%{version}.tar.gz
# Patches auto-generated by git-buildpackage:
Patch0:     0001-Fix-libbz2.so-version-numbers.patch
Patch1:     0002-openSUSE-HACK-add-upstream-bzip2-v1.0.6-sources.patch
Patch2:     0003-openSUSE-HACK-modify-Makefile-in-upstream-bzip2.patch
Patch3:     0004-openSUSE-HACK-enable-special-upstream-bzip2.patch
Patch4:     0005-pristine-gz-obey-the-XDELTA_PROGRAM-build-parameter.patch
Patch5:     0006-Add-.gbp.conf.patch
Patch6:     0007-implement-tar-format-guessing.patch
Patch7:     0008-Use-posix-tar-format-by-default.patch
Patch8:     0009-Mangle-PAX-headers-when-using-posix-tar-format.patch
Patch9:     0010-Remove-all-timestamps-from-extended-PAX-headers.patch
Requires:   gzip
Requires:   bzip2
%if 0%{?suse_version} >= 1210
Recommends: pbzip2
%else
Requires:   pbzip2
%endif
Requires:   git
%if 0%{?suse_version}
Requires:   perl-base
%else
Requires:   perl
%endif
%if 0%{?fedora}
Requires:   xdelta1
%else
Requires:   xdelta < 3
%endif
BuildRequires:  pkgconfig(zlib)
BuildRequires:  perl(ExtUtils::MakeMaker)
%if 0%{?suse_version}
BuildRequires:  fdupes
%endif

# Need to define these manually because otherwise rpmbuild makes the package
# provide libbz2.so which breaks building of other tools
AutoProv:   no
Provides: perl(Pristine::Tar)
Provides: perl(Pristine::Tar::Delta)
Provides: perl(Pristine::Tar::Delta::Tarball)
Provides: perl(Pristine::Tar::Formats)


%description
pristine-tar can regenerate a pristine upstream tarball using only a small
binary delta file and a copy of the source which can be a revision control
checkout.

The package also includes a pristine-gz command, which can regenerate a
pristine .gz file, and a pristine-bz2 for .bz2 files.

The delta file is designed to be checked into revision control along-side the
source code, thus allowing the original tarball to be extracted from revision
control.



%prep
%setup -q -n %{name}
# 0001-Fix-libbz2.so-version-numbers.patch
%patch0 -p1
# 0002-openSUSE-HACK-add-upstream-bzip2-v1.0.6-sources.patch
%if 0%{?suse_version}
%patch1 -p1
%endif
# 0003-openSUSE-HACK-modify-Makefile-in-upstream-bzip2.patch
%if 0%{?suse_version}
%patch2 -p1
%endif
# 0004-openSUSE-HACK-enable-special-upstream-bzip2.patch
%if 0%{?suse_version}
%patch3 -p1
%endif
# 0005-pristine-gz-obey-the-XDELTA_PROGRAM-build-parameter.patch
%patch4 -p1
# 0006-Add-.gbp.conf.patch
%patch5 -p1
# 0007-implement-tar-format-guessing.patch
%patch6 -p1
# 0008-Use-posix-tar-format-by-default.patch
%patch7 -p1
# 0009-Mangle-PAX-headers-when-using-posix-tar-format.patch
%patch8 -p1
# 0010-Remove-all-timestamps-from-extended-PAX-headers.patch
%patch9 -p1

%build
%if 0%{?fedora}
%define makemaker_extraopts XDELTA_PROGRAM=xdelta1
%endif
perl Makefile.PL INSTALLDIRS=vendor PREFIX=%{_prefix} %{?makemaker_extraopts}

make %{?jobs:-j%jobs}



%install
rm -rf %{buildroot}
%make_install

find %{buildroot}/usr/lib/pristine-tar/ -name '*.a' | xargs rm

# Run fdupes if building in openSUSE
%if 0%{?suse_version}
%fdupes -s %{buildroot}/usr/lib/pristine-tar/
%endif



%files
%defattr(-,root,root,-)
%{_bindir}/*
/usr/lib/pristine-tar
%{perl_vendorlib}/*
%{perl_archlib}/*
%{_mandir}/man1/*.gz
%doc debian/changelog debian/copyright delta-format.txt TODO GPL
%exclude %{perl_vendorarch}