From e7251f84bc17d585e260091b9efe2dade073982c Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Thu, 12 Jan 2012 15:29:03 +0200 Subject: Introduce rpm helpers Implements a new gbp.rpm module that contains functionality for e.g. parsing and editing spec files, reading src.rpm files rpm-specific packaging policy etc. Signed-off-by: Markus Lehtonen Signed-off-by: Ed Bartosh Signed-off-by: Zhang Qiang Signed-off-by: Huang Hao --- tests/data/rpm/rpmbuild/SOURCES/bar.tar.gz | Bin 0 -> 177 bytes tests/data/rpm/rpmbuild/SOURCES/foo.txt | 3 + .../data/rpm/rpmbuild/SOURCES/gbp-test-1.0.tar.bz2 | Bin 0 -> 383 bytes .../rpm/rpmbuild/SOURCES/gbp-test-native-1.0.zip | Bin 0 -> 656 bytes .../data/rpm/rpmbuild/SOURCES/gbp-test2-3.0.tar.gz | Bin 0 -> 328 bytes tests/data/rpm/rpmbuild/SOURCES/my.patch | 9 +++ tests/data/rpm/rpmbuild/SOURCES/my2.patch | 7 ++ tests/data/rpm/rpmbuild/SOURCES/my3.patch | 7 ++ tests/data/rpm/rpmbuild/SPECS/gbp-test-native.spec | 34 ++++++++++ .../data/rpm/rpmbuild/SPECS/gbp-test-native2.spec | 35 ++++++++++ tests/data/rpm/rpmbuild/SPECS/gbp-test.spec | 42 ++++++++++++ tests/data/rpm/rpmbuild/SPECS/gbp-test2.spec | 60 +++++++++++++++++ tests/data/rpm/specs/gbp-test-native.spec | 1 + tests/data/rpm/specs/gbp-test-native2.spec | 1 + tests/data/rpm/specs/gbp-test-quirks.spec | 30 +++++++++ tests/data/rpm/specs/gbp-test-reference.spec | 43 ++++++++++++ tests/data/rpm/specs/gbp-test-reference2.spec | 47 +++++++++++++ tests/data/rpm/specs/gbp-test-tags.spec | 74 +++++++++++++++++++++ .../data/rpm/specs/gbp-test-updates-reference.spec | 44 ++++++++++++ tests/data/rpm/specs/gbp-test-updates.spec | 49 ++++++++++++++ tests/data/rpm/specs/gbp-test.spec | 1 + tests/data/rpm/specs/gbp-test2-reference.spec | 61 +++++++++++++++++ tests/data/rpm/specs/gbp-test2-reference2.spec | 68 +++++++++++++++++++ tests/data/rpm/specs/gbp-test2.spec | 1 + 24 files changed, 617 insertions(+) create mode 100644 tests/data/rpm/rpmbuild/SOURCES/bar.tar.gz create mode 100644 tests/data/rpm/rpmbuild/SOURCES/foo.txt create mode 100644 tests/data/rpm/rpmbuild/SOURCES/gbp-test-1.0.tar.bz2 create mode 100644 tests/data/rpm/rpmbuild/SOURCES/gbp-test-native-1.0.zip create mode 100644 tests/data/rpm/rpmbuild/SOURCES/gbp-test2-3.0.tar.gz create mode 100644 tests/data/rpm/rpmbuild/SOURCES/my.patch create mode 100644 tests/data/rpm/rpmbuild/SOURCES/my2.patch create mode 100644 tests/data/rpm/rpmbuild/SOURCES/my3.patch create mode 100644 tests/data/rpm/rpmbuild/SPECS/gbp-test-native.spec create mode 100644 tests/data/rpm/rpmbuild/SPECS/gbp-test-native2.spec create mode 100644 tests/data/rpm/rpmbuild/SPECS/gbp-test.spec create mode 100644 tests/data/rpm/rpmbuild/SPECS/gbp-test2.spec create mode 120000 tests/data/rpm/specs/gbp-test-native.spec create mode 120000 tests/data/rpm/specs/gbp-test-native2.spec create mode 100644 tests/data/rpm/specs/gbp-test-quirks.spec create mode 100644 tests/data/rpm/specs/gbp-test-reference.spec create mode 100644 tests/data/rpm/specs/gbp-test-reference2.spec create mode 100644 tests/data/rpm/specs/gbp-test-tags.spec create mode 100644 tests/data/rpm/specs/gbp-test-updates-reference.spec create mode 100644 tests/data/rpm/specs/gbp-test-updates.spec create mode 120000 tests/data/rpm/specs/gbp-test.spec create mode 100644 tests/data/rpm/specs/gbp-test2-reference.spec create mode 100644 tests/data/rpm/specs/gbp-test2-reference2.spec create mode 120000 tests/data/rpm/specs/gbp-test2.spec (limited to 'tests/data') diff --git a/tests/data/rpm/rpmbuild/SOURCES/bar.tar.gz b/tests/data/rpm/rpmbuild/SOURCES/bar.tar.gz new file mode 100644 index 0000000..f5dae80 Binary files /dev/null and b/tests/data/rpm/rpmbuild/SOURCES/bar.tar.gz differ diff --git a/tests/data/rpm/rpmbuild/SOURCES/foo.txt b/tests/data/rpm/rpmbuild/SOURCES/foo.txt new file mode 100644 index 0000000..25ed442 --- /dev/null +++ b/tests/data/rpm/rpmbuild/SOURCES/foo.txt @@ -0,0 +1,3 @@ +FOO: + +file for testing rpm support of git-buildpackage. diff --git a/tests/data/rpm/rpmbuild/SOURCES/gbp-test-1.0.tar.bz2 b/tests/data/rpm/rpmbuild/SOURCES/gbp-test-1.0.tar.bz2 new file mode 100644 index 0000000..7d0759f Binary files /dev/null and b/tests/data/rpm/rpmbuild/SOURCES/gbp-test-1.0.tar.bz2 differ diff --git a/tests/data/rpm/rpmbuild/SOURCES/gbp-test-native-1.0.zip b/tests/data/rpm/rpmbuild/SOURCES/gbp-test-native-1.0.zip new file mode 100644 index 0000000..22a273d Binary files /dev/null and b/tests/data/rpm/rpmbuild/SOURCES/gbp-test-native-1.0.zip differ diff --git a/tests/data/rpm/rpmbuild/SOURCES/gbp-test2-3.0.tar.gz b/tests/data/rpm/rpmbuild/SOURCES/gbp-test2-3.0.tar.gz new file mode 100644 index 0000000..7b3eaf3 Binary files /dev/null and b/tests/data/rpm/rpmbuild/SOURCES/gbp-test2-3.0.tar.gz differ diff --git a/tests/data/rpm/rpmbuild/SOURCES/my.patch b/tests/data/rpm/rpmbuild/SOURCES/my.patch new file mode 100644 index 0000000..50870df --- /dev/null +++ b/tests/data/rpm/rpmbuild/SOURCES/my.patch @@ -0,0 +1,9 @@ +diff --git a/dummy.sh b/dummy.sh +index 8c33db6..6f04268 100755 +--- dummy.sh ++++ dummy.sh +@@ -1,3 +1,3 @@ + #!/bin/sh + +-echo "Hello world" ++echo "Hello GBP" diff --git a/tests/data/rpm/rpmbuild/SOURCES/my2.patch b/tests/data/rpm/rpmbuild/SOURCES/my2.patch new file mode 100644 index 0000000..ad5ca2d --- /dev/null +++ b/tests/data/rpm/rpmbuild/SOURCES/my2.patch @@ -0,0 +1,7 @@ +diff --git a/mydir/myfile.txt b/mydir/myfile.txt +new file mode 100644 +index 0000000..2cdad29 +--- /dev/null ++++ b/mydir/myfile.txt +@@ -0,0 +1 @@ ++Dummy diff --git a/tests/data/rpm/rpmbuild/SOURCES/my3.patch b/tests/data/rpm/rpmbuild/SOURCES/my3.patch new file mode 100644 index 0000000..9fee859 --- /dev/null +++ b/tests/data/rpm/rpmbuild/SOURCES/my3.patch @@ -0,0 +1,7 @@ +diff --git a/README b/README +index a1311cb..a59f1b9 100644 +--- a/README ++++ b/README +@@ -1 +1 @@ +-Just for testing git-buildpackage. ++Just for testing GBP. diff --git a/tests/data/rpm/rpmbuild/SPECS/gbp-test-native.spec b/tests/data/rpm/rpmbuild/SPECS/gbp-test-native.spec new file mode 100644 index 0000000..38b07e4 --- /dev/null +++ b/tests/data/rpm/rpmbuild/SPECS/gbp-test-native.spec @@ -0,0 +1,34 @@ +Name: gbp-test-native +Summary: Test package for git-buildpackage +Version: 1.0 +Release: 1 +Group: Development/Libraries +License: GPLv2 +Source1: %{name}-%{version}.zip +BuildRequires: unzip + +%description +Package for testing the RPM functionality of git-buildpackage. +Mimics a "native" package + + +%prep +unzip %{SOURCE1} +%setup -T -D + + +%build +make + + +%install +rm -rf %{buildroot} +mkdir -p %{buildroot}/%{_datadir}/%{name} +cp -R * %{buildroot}/%{_datadir}/%{name} + + + +%files +%defattr(-,root,root,-) +%dir %{_datadir}/%{name} +%{_datadir}/%{name} diff --git a/tests/data/rpm/rpmbuild/SPECS/gbp-test-native2.spec b/tests/data/rpm/rpmbuild/SPECS/gbp-test-native2.spec new file mode 100644 index 0000000..34fd33d --- /dev/null +++ b/tests/data/rpm/rpmbuild/SPECS/gbp-test-native2.spec @@ -0,0 +1,35 @@ +Name: gbp-test-native2 +Summary: Test package for git-buildpackage +Version: 2.0 +Release: 0 +Group: Development/Libraries +License: GPLv2 +Source: foo.txt +BuildRequires: unzip + +%description +Package for testing the RPM functionality of git-buildpackage. +Mimics a "native" package that doesn't have any source tarball. + + +%prep +# Just create build dir +%setup -T -c +cp %{SOURCE0} . + + +%build +# Nothing to do + + +%install +rm -rf %{buildroot} +mkdir -p %{buildroot}/%{_datadir}/%{name} +cp -R * %{buildroot}/%{_datadir}/%{name} + + + +%files +%defattr(-,root,root,-) +%dir %{_datadir}/%{name} +%{_datadir}/%{name} diff --git a/tests/data/rpm/rpmbuild/SPECS/gbp-test.spec b/tests/data/rpm/rpmbuild/SPECS/gbp-test.spec new file mode 100644 index 0000000..c46a734 --- /dev/null +++ b/tests/data/rpm/rpmbuild/SPECS/gbp-test.spec @@ -0,0 +1,42 @@ +Name: gbp-test +Summary: Test package for git-buildpackage +Version: 1.0 +Release: 1 +Group: Development/Libraries +License: GPLv2 +Source: %{name}-%{version}.tar.bz2 +Source1: foo.txt +Source20: bar.tar.gz +# Gbp-Ignore-Patches: 0 +Patch0: my.patch +Patch10: my2.patch +Patch20: my3.patch + + +%description +Package for testing the RPM functionality of git-buildpackage. + + +%prep +%setup -n %{name} -a 20 + +%patch0 +%patch10 -p1 + + +%build +make + + +%install +rm -rf %{buildroot} +mkdir -p %{buildroot}/%{_datadir}/%{name} +cp -R * %{buildroot}/%{_datadir}/%{name} +install %{SOURCE0} %{buildroot}/%{_datadir}/%{name} + + + +%files +%defattr(-,root,root,-) +%dir %{_datadir}/%{name} +%{_datadir}/%{name} diff --git a/tests/data/rpm/rpmbuild/SPECS/gbp-test2.spec b/tests/data/rpm/rpmbuild/SPECS/gbp-test2.spec new file mode 100644 index 0000000..8a92725 --- /dev/null +++ b/tests/data/rpm/rpmbuild/SPECS/gbp-test2.spec @@ -0,0 +1,60 @@ +Name: gbp-test2 +Summary: Test package 2 for git-buildpackage +Epoch: 2 +Version: 3.0 +Release: 0 +Group: Development/Libraries +License: GPLv2 +Source10: ftp://ftp.host.com/%{name}-%{version}.tar.gz +Source: foo.txt +Source20: bar.tar.gz +# Gbp-Ignore-Patches: -1 +Patch: my.patch +Patch10: my2.patch +Patch20: my3.patch +Packager: Markus Lehtonen +VCS: myoldvcstag + +%description +Package for testing the RPM functionality of git-buildpackage. + +%package empty +Summary: Empty subpackage + +%description empty +Empty subpackage for the %{name} test package. + + +%prep +%setup -T -n %{name}-%{version} -c -a 10 + +%patch +%patch -P 10 -p1 + +echo "Do things" + +# Gbp-Patch-Macros + +%build +make + + +%install +rm -rf %{buildroot} +mkdir -p %{buildroot}/%{_datadir}/%{name} +cp -R * %{buildroot}/%{_datadir}/%{name} +install %{SOURCE0} %{buildroot}/%{_datadir}/%{name} + + +%changelog +* Tue Feb 04 2014 Name 1 +- My change + + +%files +%defattr(-,root,root,-) +%dir %{_datadir}/%{name} +%{_datadir}/%{name} + +%files empty +%defattr(-,root,root,-) diff --git a/tests/data/rpm/specs/gbp-test-native.spec b/tests/data/rpm/specs/gbp-test-native.spec new file mode 120000 index 0000000..60de36f --- /dev/null +++ b/tests/data/rpm/specs/gbp-test-native.spec @@ -0,0 +1 @@ +../rpmbuild/SPECS/gbp-test-native.spec \ No newline at end of file diff --git a/tests/data/rpm/specs/gbp-test-native2.spec b/tests/data/rpm/specs/gbp-test-native2.spec new file mode 120000 index 0000000..ad13ad6 --- /dev/null +++ b/tests/data/rpm/specs/gbp-test-native2.spec @@ -0,0 +1 @@ +../rpmbuild/SPECS/gbp-test-native2.spec \ No newline at end of file diff --git a/tests/data/rpm/specs/gbp-test-quirks.spec b/tests/data/rpm/specs/gbp-test-quirks.spec new file mode 100644 index 0000000..bb56b00 --- /dev/null +++ b/tests/data/rpm/specs/gbp-test-quirks.spec @@ -0,0 +1,30 @@ +# +# Spec for testing some quirks of spec parsing +# + +Name: pkg_name +Summary: Spec for testing some quirks of spec parsing +Version: 0.1 +Release: 1.2 +License: GPLv2 +Source1: foobar.tar.gz +# Gbp-Ignore-Patches: 2 4 888 +Patch1: 01.patch +Patch2: 02.patch +Patch3: 03.patch +Patch4: 04.patch +Patch5: 05.patch + +%description +Spec for testing some quirks of spec parsing. No intended for building an RPM. + +%prep +# We don't have Source0 so rpmbuild would fail, but gbp shouldn't crash +%setup -q + +# Patches are applied out-of-order wrt. numbering +%patch5 +%patch2 +%patch1 +# Patch 999 does not exist, rpmbuild would fail but GBP should not +%patch999 diff --git a/tests/data/rpm/specs/gbp-test-reference.spec b/tests/data/rpm/specs/gbp-test-reference.spec new file mode 100644 index 0000000..050d139 --- /dev/null +++ b/tests/data/rpm/specs/gbp-test-reference.spec @@ -0,0 +1,43 @@ +Name: gbp-test +Summary: Test package for git-buildpackage +Version: 1.0 +Release: 1 +Group: Development/Libraries +License: GPLv2 +Source: %{name}-%{version}.tar.bz2 +Source1: foo.txt +Source20: bar.tar.gz +# Gbp-Ignore-Patches: 0 +Patch0: my.patch +# Patches auto-generated by git-buildpackage: +Patch1: new.patch + + +%description +Package for testing the RPM functionality of git-buildpackage. + + +%prep +%setup -n %{name} -a 20 + +%patch0 +# new.patch +%patch1 -p1 + + +%build +make + + +%install +rm -rf %{buildroot} +mkdir -p %{buildroot}/%{_datadir}/%{name} +cp -R * %{buildroot}/%{_datadir}/%{name} +install %{SOURCE0} %{buildroot}/%{_datadir}/%{name} + + + +%files +%defattr(-,root,root,-) +%dir %{_datadir}/%{name} +%{_datadir}/%{name} diff --git a/tests/data/rpm/specs/gbp-test-reference2.spec b/tests/data/rpm/specs/gbp-test-reference2.spec new file mode 100644 index 0000000..0fbe026 --- /dev/null +++ b/tests/data/rpm/specs/gbp-test-reference2.spec @@ -0,0 +1,47 @@ +Name: gbp-test +VCS: myvcstag +Summary: Test package for git-buildpackage +Version: 1.0 +Release: 1 +Group: Development/Libraries +License: GPLv2 +Source: %{name}-%{version}.tar.bz2 +Source1: foo.txt +Source20: bar.tar.gz +# Gbp-Ignore-Patches: 0 +Patch0: my.patch +# Patches auto-generated by git-buildpackage: +Patch1: new.patch + + +%description +Package for testing the RPM functionality of git-buildpackage. + + +%prep +%setup -n %{name} -a 20 + +%patch0 +# new.patch +%patch1 -p1 + + +%build +make + + +%install +rm -rf %{buildroot} +mkdir -p %{buildroot}/%{_datadir}/%{name} +cp -R * %{buildroot}/%{_datadir}/%{name} +install %{SOURCE0} %{buildroot}/%{_datadir}/%{name} + + + +%files +%defattr(-,root,root,-) +%dir %{_datadir}/%{name} +%{_datadir}/%{name} +%changelog +* Wed Feb 05 2014 Name 1 +- New entry diff --git a/tests/data/rpm/specs/gbp-test-tags.spec b/tests/data/rpm/specs/gbp-test-tags.spec new file mode 100644 index 0000000..ee4c2b9 --- /dev/null +++ b/tests/data/rpm/specs/gbp-test-tags.spec @@ -0,0 +1,74 @@ +# +# Spec file for testing all RPM tags (that we know of +# + +%define suse_release %(test -e /etc/SuSE-release && head -n1 /etc/SuSE-release | cut -d ' ' -f2 | cut --output-delimiter=0 -d. -f1,2 || echo 0) +%if "%{suse_release}" >= "1201" +%define test_weak_dep_tags 1 +%endif + +%define test_arch_os_tags %(test -n "$GBP_SKIP_ARCH_OS_TAGS" && echo 0 || echo 1) + +%define source_fn_base source +%define patch_fn_base patch + +# Gbp-Undefined-Tag: foobar + +# Test that we accept different cases +NAME: my_name +version: 0 +ReLeasE: 0 + +# Rest of the tags +Epoch: 0 +Summary: my_summary +License: my_license +Distribution: my_distribution +Vendor: my_vendor +Group: my_group +Packager: my_packager +Url: my_url +Vcs: my_vcs +Source: my_source +Patch: my_%patch_fn_base +Patch0: my_%{patch_fn_base}0 +Nosource: 0 +Nopatch: 0 +#Icon: my_icon +BuildRoot: my_buildroot +Provides: my_provides +Requires: my_requires +Conflicts: my_conflicts +Obsoletes: my_obsoletes +BuildConflicts: my_buildconflicts +BuildRequires: my_buildrequires +AutoReqProv: No +AutoReq: No +AutoProv: No +DistTag: my_disttag +BugUrl: my_bugurl +Collections: my_collections + +%if 0%{?test_weak_dep_tags} +Recommends: my_recommends +Suggests: my_suggests +Supplements: my_supplements +Enhances: my_enhances +BuildRecommends:my_buildrecommends +BuildSuggests: my_buildsuggests +BuildSupplements:my_buildsupplements +BuildEnhances: my_buildenhances +%endif + +# These should be filtered out by GBP +%if "%{test_arch_os_tags}" != "0" +BuildArch: my_buildarch +ExcludeArch: my_excludearch +ExclusiveArch: my_exclusivearch +ExcludeOs: my_excludeos +ExclusiveOs: my_exclusiveos +%endif + +%description +Package for testing GBP. + diff --git a/tests/data/rpm/specs/gbp-test-updates-reference.spec b/tests/data/rpm/specs/gbp-test-updates-reference.spec new file mode 100644 index 0000000..ff56f58 --- /dev/null +++ b/tests/data/rpm/specs/gbp-test-updates-reference.spec @@ -0,0 +1,44 @@ +# +# Spec file for testing deleting/adding/updating tags and macros +# + +# Gbp-Undefined-Tag: foobar + +# Test that we accept different cases +Name: my_name +Version: 0 +Release: 1 +Summary: my_summary +License: new license +Distribution: my_distribution +Group: my_group +Packager: my_packager +Url: my_url +Vcs: my_vcs +Nosource: 0 +Nopatch: 0 +BuildRoot: my_buildroot +Provides: my_provides +Requires: my_requires +Conflicts: my_conflicts +Obsoletes: my_obsoletes +BuildConflicts: my_buildconflicts +BuildRequires: my_buildrequires +AutoReqProv: No +AutoReq: No +AutoProv: No +DistTag: my_disttag +BugUrl: my_bugurl +Collections: my_collections + +%description +Package for testing GBP. + +%prep +%setup -n my_prefix + +%patch0 my new args + +%build + +%install diff --git a/tests/data/rpm/specs/gbp-test-updates.spec b/tests/data/rpm/specs/gbp-test-updates.spec new file mode 100644 index 0000000..dc8ffbf --- /dev/null +++ b/tests/data/rpm/specs/gbp-test-updates.spec @@ -0,0 +1,49 @@ +# +# Spec file for testing deleting/adding/updating tags and macros +# + +# Gbp-Undefined-Tag: foobar + +# Test that we accept different cases +Name: my_name +Version: 0 +Release: 1 +Summary: my_summary +License: my_license +Distribution: my_distribution +Vendor: my_vendor +Group: my_group +Packager: my_packager +Url: my_url +Vcs: my_vcs +Source: my_source +Patch: my_%patch_fn_base +Patch0: my_%{patch_fn_base}0 +Nosource: 0 +Nopatch: 0 +BuildRoot: my_buildroot +Provides: my_provides +Requires: my_requires +Conflicts: my_conflicts +Obsoletes: my_obsoletes +BuildConflicts: my_buildconflicts +BuildRequires: my_buildrequires +AutoReqProv: No +AutoReq: No +AutoProv: No +DistTag: my_disttag +BugUrl: my_bugurl +Collections: my_collections + +%description +Package for testing GBP. + +%prep +%setup -n my_prefix + +%patch -b my_patch +%patch -P0 -b my_patch0 + +%build + +%install diff --git a/tests/data/rpm/specs/gbp-test.spec b/tests/data/rpm/specs/gbp-test.spec new file mode 120000 index 0000000..30ae284 --- /dev/null +++ b/tests/data/rpm/specs/gbp-test.spec @@ -0,0 +1 @@ +../rpmbuild/SPECS/gbp-test.spec \ No newline at end of file diff --git a/tests/data/rpm/specs/gbp-test2-reference.spec b/tests/data/rpm/specs/gbp-test2-reference.spec new file mode 100644 index 0000000..1882131 --- /dev/null +++ b/tests/data/rpm/specs/gbp-test2-reference.spec @@ -0,0 +1,61 @@ +Name: gbp-test2 +Summary: Test package 2 for git-buildpackage +Epoch: 2 +Version: 3.0 +Release: 0 +Group: Development/Libraries +License: GPLv2 +Source10: ftp://ftp.host.com/%{name}-%{version}.tar.gz +Source: foo.txt +Source20: bar.tar.gz +# Gbp-Ignore-Patches: -1 +Patch: my.patch +# Patches auto-generated by git-buildpackage: +Patch0: new.patch +Packager: Markus Lehtonen + +%description +Package for testing the RPM functionality of git-buildpackage. + +%package empty +Summary: Empty subpackage + +%description empty +Empty subpackage for the %{name} test package. + + +%prep +%setup -T -n %{name}-%{version} -c -a 10 + +%patch + +echo "Do things" + +# Gbp-Patch-Macros +# new.patch +%if 1 +%patch0 -p1 +%endif + +%build +make + + +%install +rm -rf %{buildroot} +mkdir -p %{buildroot}/%{_datadir}/%{name} +cp -R * %{buildroot}/%{_datadir}/%{name} +install %{SOURCE0} %{buildroot}/%{_datadir}/%{name} + + +%changelog +* Wed Feb 05 2014 Name 2 +- New entry + +%files +%defattr(-,root,root,-) +%dir %{_datadir}/%{name} +%{_datadir}/%{name} + +%files empty +%defattr(-,root,root,-) diff --git a/tests/data/rpm/specs/gbp-test2-reference2.spec b/tests/data/rpm/specs/gbp-test2-reference2.spec new file mode 100644 index 0000000..d41f450 --- /dev/null +++ b/tests/data/rpm/specs/gbp-test2-reference2.spec @@ -0,0 +1,68 @@ +Name: gbp-test2 +Summary: Test package 2 for git-buildpackage +Epoch: 2 +Version: 3.0 +Release: 0 +Group: Development/Libraries +License: GPLv2 +Source10: ftp://ftp.host.com/%{name}-%{version}.tar.gz +Source: foo.txt +Source20: bar.tar.gz +# Gbp-Ignore-Patches: -1 +Patch: my.patch +# Patches auto-generated by git-buildpackage: +Patch0: 1.patch +Patch1: 2.patch +Packager: Markus Lehtonen +VCS: myvcstag + +%description +Package for testing the RPM functionality of git-buildpackage. + +%package empty +Summary: Empty subpackage + +%description empty +Empty subpackage for the %{name} test package. + + +%prep +%setup -T -n %{name}-%{version} -c -a 10 + +%patch + +echo "Do things" + +# Gbp-Patch-Macros +# 1.patch +%if true +%patch0 -p1 +%endif +# 2.patch +%ifarch %ix86 +%patch1 -p1 +%endif + +%build +make + + +%install +rm -rf %{buildroot} +mkdir -p %{buildroot}/%{_datadir}/%{name} +cp -R * %{buildroot}/%{_datadir}/%{name} +install %{SOURCE0} %{buildroot}/%{_datadir}/%{name} + + +%changelog +* Tue Feb 04 2014 Name 1 +- My change + + +%files +%defattr(-,root,root,-) +%dir %{_datadir}/%{name} +%{_datadir}/%{name} + +%files empty +%defattr(-,root,root,-) diff --git a/tests/data/rpm/specs/gbp-test2.spec b/tests/data/rpm/specs/gbp-test2.spec new file mode 120000 index 0000000..af4080c --- /dev/null +++ b/tests/data/rpm/specs/gbp-test2.spec @@ -0,0 +1 @@ +../rpmbuild/SPECS/gbp-test2.spec \ No newline at end of file -- cgit v1.2.3