summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick McCarty <patrick.mccarty@linux.intel.com>2013-02-08 21:30:18 (GMT)
committerPatrick McCarty <patrick.mccarty@linux.intel.com>2013-02-08 23:31:13 (GMT)
commit6cddf1212275558e9a7c021c91e5b71c1a56d70b (patch)
tree2885b609b5ada28901d877b59b83338092ebcc8e
parent9bb81f8a90ecc8b70c955bff72ec59dd3d9e5ae7 (diff)
downloadlsof-6cddf1212275558e9a7c021c91e5b71c1a56d70b.zip
lsof-6cddf1212275558e9a7c021c91e5b71c1a56d70b.tar.gz
lsof-6cddf1212275558e9a7c021c91e5b71c1a56d70b.tar.bz2
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.
-rwxr-xr-xpackaging/upstream2downstream.sh45
1 files changed, 45 insertions, 0 deletions
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 <usptream-tarball>
+#
+# This code is in the public domain; do with it what you wish.
+#
+# Copyright (C) 2007 Karel Zak <kzak@redhat.com>
+#
+
+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
+