path: root/packaging/
diff options
authorPatrick McCarty <>2013-02-08 13:30:18 -0800
committerPatrick McCarty <>2013-02-08 15:31:13 -0800
commit6cddf1212275558e9a7c021c91e5b71c1a56d70b (patch)
tree2885b609b5ada28901d877b59b83338092ebcc8e /packaging/
parent9bb81f8a90ecc8b70c955bff72ec59dd3d9e5ae7 (diff)
Import the 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.
Diffstat (limited to 'packaging/')
1 files changed, 45 insertions, 0 deletions
diff --git a/packaging/ b/packaging/
new file mode 100755
index 0000000..ddaf9bf
--- /dev/null
+++ b/packaging/
@@ -0,0 +1,45 @@
+# 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 <usptream-tarball>
+# This code is in the public domain; do with it what you wish.
+# Copyright (C) 2007 Karel Zak <>
+NAME=$(basename $UPSTREAM .tar.bz2)
+TMP=$(mktemp -d)
+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 "Linux-only tarball: $MYPWD/"$NAME"-linux-only.tar.xz"