Blame SOURCES/upstream2downstream.sh

932381
#!/bin/bash
932381
#
932381
# This script removes non-linux dialects from upstream source package before
932381
# release.  There is a problem with copyrights for some UN*Xes ... also .. this
932381
# script merges all to the one normal tarball and rename all to lsof_X.XX-rh.
932381
#
932381
# Usage:  ./upstream2downstream  <usptream-tarball>
932381
# 
932381
# This code is in the public domain; do with it what you wish.
932381
#
932381
# Copyright (C) 2007 Karel Zak <kzak@redhat.com>
932381
#
932381
932381
UPSTREAM="$1"
932381
NAME=$(basename $UPSTREAM .tar.bz2)
932381
MYPWD=$(pwd)
932381
TMP=$(mktemp -d)
932381
932381
echo
932381
echo -n "Extracting upstream code..."
932381
tar -jxf $UPSTREAM  -C $TMP
932381
cd $TMP/$NAME
932381
tar xf "$NAME"_src.tar
932381
echo " done."
932381
932381
echo -n "Moving files to downstream directory..."
932381
mv "$NAME"_src/ "$NAME"-rh
932381
mv README* 00* "$NAME"-rh
932381
echo " done."
932381
932381
echo -n "Removing non-Linux dialects..."
932381
rm -rf "$NAME"-rh/dialects/{aix,darwin,du,freebsd,hpux,n+obsd,n+os,osr,sun,uw}
932381
echo " done."
932381
932381
echo -n "Creating final downstream tarball..."
932381
tar Jcf $MYPWD/"$NAME"-rh.tar.xz "$NAME"-rh
932381
echo " done."
932381
932381
rm -rf $TMP
932381
cd $MYPWD
932381
932381
echo
932381
echo "Linux-only tarball: $MYPWD/"$NAME"-rh.tar.xz"
932381
echo
932381