From 9d07b6a807965e41c6559339bc35ac4456220ca0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppi...@redhat.com>
Date: Fri, 16 Sep 2016 14:58:21 +0200
Subject: Net::libnetFAQ document replaced with a hyper link because of the
 Artistic license

---
 .gitignore       |  2 ++
 perl-libnet.spec | 21 ++++++++++++++++++--
 repackage.sh     | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 sources          |  3 ++-
 4 files changed, 82 insertions(+), 3 deletions(-)
 create mode 100755 repackage.sh

diff --git a/.gitignore b/.gitignore
index d4b4b2b..91eb64e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,5 @@
 /libnet-3.08.tar.gz
 /libnet-3.09.tar.gz
 /libnet-3.10.tar.gz
+/libnet-3.10_repackaged.tar.gz
+/libnetFAQ.pod
diff --git a/perl-libnet.spec b/perl-libnet.spec
index d31dd31..8e5ec86 100644
--- a/perl-libnet.spec
+++ b/perl-libnet.spec
@@ -1,16 +1,27 @@
 Name:           perl-libnet
 Version:        3.10
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Perl clients for various network protocols
+# other files:  GPL+ or Artistic
+## Not in binary packages
+# repackage.sh: GPLv2+
+## Removed from upstream sources:
+# lib/Net/libnetFAQ.pod:    Artistic    (CPAN RT#117888)
 License:        GPL+ or Artistic
 Group:          Development/Libraries
 URL:            http://search.cpan.org/dist/libnet/
-Source0:        
http://www.cpan.org/authors/id/S/SH/SHAY/libnet-%{version}.tar.gz
+# Origin source archive contains Artistic only files, CPAN RT#117888.
+# Local archive produced by "./repackage.sh %%{version}" command.
+# http://www.cpan.org/authors/id/S/SH/SHAY/libnet-%%{version}.tar.gz
+Source0:        libnet-%{version}_repackaged.tar.gz
+# Replacement for the Artistic only file, CPAN RT#117888.
+Source1:        libnetFAQ.pod
 # Convert Changes to UTF-8
 Patch0:         libnet-3.09-Normalize-Changes-encoding.patch
 # Do not create Net/libnet.cfg, bug #1238689
 Patch1:         libnet-3.08-Do-not-create-Net-libnet.cfg.patch
 BuildArch:      noarch
+BuildRequires:  coreutils
 BuildRequires:  findutils
 BuildRequires:  make
 BuildRequires:  perl
@@ -91,6 +102,8 @@ protocols used in the internet community.
 
 %prep
 %setup -q -n libnet-%{version}
+# Provide dummy Net::libnetFAQ document, CPAN RT#117888
+install -m 0644 %{SOURCE1} lib/Net
 %patch0 -p1
 %patch1 -p1
 
@@ -113,6 +126,10 @@ make test
 %{_mandir}/man3/*
 
 %changelog
+* Fri Sep 16 2016 Petr Pisar <ppi...@redhat.com> - 3.10-2
+- Net::libnetFAQ document replaced with a hyper link because of the Artistic
+  license (CPAN RT#117888)
+
 * Mon Aug 01 2016 Jitka Plesnikova <jples...@redhat.com> - 3.10-1
 - 3.10 bump
 
diff --git a/repackage.sh b/repackage.sh
new file mode 100755
index 0000000..b9b8a9a
--- /dev/null
+++ b/repackage.sh
@@ -0,0 +1,59 @@
+#!/bin/bash
+#
+# Copyright (C) 2010 Red Hat, Inc.
+# Authors:
+# Thomas Woerner <twoer...@redhat.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+
+version=$1
+[ -z "$version" ] && { echo "Usage: $0 <version>"; exit 1; }
+
+# files to be removed without the main libnet-<version>/ prefix
+declare -a REMOVE
+REMOVE[${#REMOVE[*]}]="lib/Net/libnetFAQ.pod"
+
+# no changes below this line should be needed
+
+orig="libnet-${version}"
+orig_tgz="${orig}.tar.gz"
+repackaged="${orig}_repackaged"
+repackaged_tar="${repackaged}.tar"
+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
+failure=0
+gzip -dc "${orig_tgz}" > "${repackaged_tar}"
+for file in "${REMOVE[@]}"; do
+    tar -f "${repackaged_tar}" --delete "${orig}/${file}" >> repackage.log
+    [ $? != 0 ] && { echo "ERROR: Could not remove file ${orig}/${file} from 
archive."; failure=1; } || echo "Removed ${orig}/${file} from archive."
+done
+[ $failure != 0 ] && { echo "See repackage.log for details."; exit 1; }
+gzip -9 -n "${repackaged_tar}"
+
+# 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
diff --git a/sources b/sources
index 14962d9..55bf31f 100644
--- a/sources
+++ b/sources
@@ -1 +1,2 @@
-9c298eb72753cd58cee6ed777484e44a  libnet-3.10.tar.gz
+7a9dada2b4dc886c0932ad4f3d6534ab  libnetFAQ.pod
+631c42b40d36bcc689b2d8093ba09545  libnet-3.10_repackaged.tar.gz
-- 
cgit v0.12


        
http://pkgs.fedoraproject.org/cgit/perl-libnet.git/commit/?h=master&id=9d07b6a807965e41c6559339bc35ac4456220ca0
_______________________________________________
perl-devel mailing list -- perl-devel@lists.fedoraproject.org
To unsubscribe send an email to perl-devel-le...@lists.fedoraproject.org

Reply via email to