From 6cddf1212275558e9a7c021c91e5b71c1a56d70b Mon Sep 17 00:00:00 2001 From: Patrick McCarty Date: Fri, 8 Feb 2013 13:30:18 -0800 Subject: Import the upstream2downstream.sh script This script was taken from the Fedora packaging tree, modified to change the suffix of the tarball (rh -> linux-only) to reflect how the tarball was modified. --- packaging/upstream2downstream.sh | 45 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 packaging/upstream2downstream.sh diff --git a/packaging/upstream2downstream.sh b/packaging/upstream2downstream.sh new file mode 100755 index 0000000..ddaf9bf --- /dev/null +++ b/packaging/upstream2downstream.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# +# This script removes non-linux dialects from upstream source package before +# release. There is a problem with copyrights for some UN*Xes ... also .. this +# script merges all to the one normal tarball and rename all to lsof_X.XX-linux-only. +# +# Usage: ./upstream2downstream +# +# This code is in the public domain; do with it what you wish. +# +# Copyright (C) 2007 Karel Zak +# + +UPSTREAM="$1" +NAME=$(basename $UPSTREAM .tar.bz2) +MYPWD=$(pwd) +TMP=$(mktemp -d) + +echo +echo -n "Extracting upstream code..." +tar -jxf $UPSTREAM -C $TMP +cd $TMP/$NAME +tar xf "$NAME"_src.tar +echo " done." + +echo -n "Moving files to downstream directory..." +mv "$NAME"_src/ "$NAME"-linux-only +mv README* 00* "$NAME"-linux-only +echo " done." + +echo -n "Removing non-Linux dialects..." +rm -rf "$NAME"-linux-only/dialects/{aix,darwin,du,freebsd,hpux,n+obsd,n+os,osr,sun,uw} +echo " done." + +echo -n "Creating final downstream tarball..." +tar Jcf $MYPWD/"$NAME"-linux-only.tar.xz "$NAME"-linux-only +echo " done." + +rm -rf $TMP +cd $MYPWD + +echo +echo "Linux-only tarball: $MYPWD/"$NAME"-linux-only.tar.xz" +echo + -- cgit v1.2.3