[perl-DBI/f21] Repackage source tarball to remove non-free DBI/FAQ.pm
Jitka Plesnikova
jplesnik at fedoraproject.org
Mon Mar 9 13:57:12 UTC 2015
commit 0047a33f4e9d4ea7b05e564acaa1d04be512e74d
Author: Jitka Plesnikova <jplesnik at redhat.com>
Date: Mon Mar 9 14:57:01 2015 +0100
Repackage source tarball to remove non-free DBI/FAQ.pm
.gitignore | 1 +
perl-DBI.spec | 14 ++++++++++++--
sources | 2 +-
strip_FAQ.sh | 41 +++++++++++++++++++++++++++++++++++++++++
4 files changed, 55 insertions(+), 3 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 8f8db17..e44abc2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,3 +14,4 @@ DBI-1.613.tar.gz
/DBI-1.628.tar.gz
/DBI-1.630.tar.gz
/DBI-1.631.tar.gz
+/DBI-1.631_repackaged.tar.gz
diff --git a/perl-DBI.spec b/perl-DBI.spec
index 59bcffb..fa5a779 100644
--- a/perl-DBI.spec
+++ b/perl-DBI.spec
@@ -10,12 +10,19 @@
Name: perl-DBI
Version: 1.631
-Release: 5%{?dist}
+Release: 6%{?dist}
Summary: A database access API for perl
Group: Development/Libraries
License: GPL+ or Artistic
URL: http://dbi.perl.org/
-Source0: http://www.cpan.org/authors/id/T/TI/TIMB/DBI-%{version}.tar.gz
+# The source tarball must be repackaged to remove the DBI/FAQ.pm, since the
+# license is not a FSF free license.
+# When upgrading, download the new source tarball, and run
+# "./strip-FAQ.sh <version>" to produce the "-repackaged" tarball.
+# Source0: http://www.cpan.org/authors/id/T/TI/TIMB/DBI-%{version}.tar.gz
+Source0: DBI-%{version}_repackaged.tar.gz
+Source1: strip_FAQ.sh
+
# Add a security warning about use of RPC::PlClient, bug #1030578, CPAN RT#90475
Patch0: DBI-1.630-Security-notice-for-Proxy.patch
BuildRequires: perl
@@ -159,6 +166,9 @@ make test
%endif
%changelog
+* Mon Mar 09 2015 Jitka Plesnikova <jplesnik at redhat.com> - 1.631-6
+- Repackage source tarball to remove non-free DBI/FAQ.pm (bug #1199532)
+
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.631-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
diff --git a/sources b/sources
index ebfbc07..13e9d63 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-444d3c305e86597e11092b517794a840 DBI-1.631.tar.gz
+45c453f9e4d233f1e16f7c9e46f6787f DBI-1.631_repackaged.tar.gz
diff --git a/strip_FAQ.sh b/strip_FAQ.sh
new file mode 100755
index 0000000..8d8f138
--- /dev/null
+++ b/strip_FAQ.sh
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+version=$1
+[ -z "$version" ] && { echo "Usage: $0 <version>"; exit 1; }
+
+# files to be removed without the main DBI-<version>/ prefix
+declare -a REMOVE
+REMOVE[${#REMOVE[*]}]="lib/DBI/FAQ.pm"
+
+orig="DBI-${version}"
+orig_tgz="${orig}.tar.gz"
+repackaged="${orig}_repackaged"
+repackaged_tgz="${repackaged}.tar.gz"
+
+# pre checks
+[ ! -f "${orig_tgz}" ] && { echo "ERROR: ${orig_tgz} does not exist"; exit 1; }
+[ -f "${repackaged_tgz}" ] && { echo "ERROR: ${repackaged_tgz} already exist"; exit 1; }
+
+# repackage
+tdir=`mktemp -d tmpXXXXXX`
+pushd "${tdir}"
+
+tar -xpzf ../${orig_tgz}
+for file in "${REMOVE[@]}"; do
+ rm -rf "${orig}/${file}"
+done
+tar -cpzf ../"${repackaged_tgz}" "${orig}"
+
+popd
+rm -rf "${tdir}"
+
+# post checks
+RET=0
+for file in "${REMOVE[@]}"; do
+ found=$(tar -ztvf "${repackaged_tgz}" | grep "${file}")
+ [ -n "$found" ] && { echo "ERROR: file ${file} is still in the repackaged archive."; RET=1; }
+done
+
+[ $RET == 0 ] && echo "Sucessfully repackaged ${orig}: ${repackaged_tgz}"
+
+exit $RET
More information about the scm-commits
mailing list