Rename and add orig script

This commit is contained in:
Mario Fetka 2016-05-26 17:51:14 +02:00
parent 4a8375f388
commit 2844f68466
13 changed files with 89 additions and 4 deletions

83
build_orig.sh Normal file
View File

@ -0,0 +1,83 @@
#!/bin/bash
# the directory of the script
DIR=`cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd`
echo "Working directory $DIR"
# the temp directory used, within $DIR
WORK_DIR=`mktemp -d -p "$DIR"`
echo "Creating temp working directory $WORK_DIR"
# deletes the temp directory
function cleanup {
rm -rf "$WORK_DIR"
echo "Deleted temp working directory $WORK_DIR"
}
# register the cleanup function to be called on the EXIT signal
trap cleanup EXIT
# Download Files specified in files.diz
while IFS=! read type app version outputfile url md5
do
echo "Downloading $app Version: $version"
#use -O for output file. define $outputfile yourself
wget --no-check-certificate --tries=1 -O $DIR/../$outputfile --timeout=5 "$url"
# use $(..) instead of backticks.
calculated_md5=$(md5sum "$DIR/../$outputfile" | cut -f 1 -d " ")
# compare md5
case "$calculated_md5" in
"$md5" )
echo "$DIR/../$outputfile md5 ok"
;;
*)
echo "$DIR/../$outputfile md5 NOT ok"
exit 1
;;
esac
done < "$DIR/files.diz"
# Extract to specified dir and set some variables
while IFS=! read type app version outputfile url md5
do
mkdir -p $WORK_DIR/${type}
pushd $WORK_DIR/${type}
unzip $DIR/../$outputfile
popd
mkdir -p $WORK_DIR/${app}-${version}/${type}
dos2unix $WORK_DIR/${type}/*.txt
mv $WORK_DIR/${type}/*.txt $WORK_DIR/${app}-${version}
pushd $WORK_DIR/${app}-${version}/${type}
rpm2cpio $WORK_DIR/${type}/Linux/*.rpm | cpio -idmv
case "${type}" in
"amd64" )
rm -f opt/MegaRAID/MegaCli/MegaCli
;;
"i386" )
rm -f opt/MegaRAID/MegaCli/MegaCli64
rm -f opt/MegaRAID/MegaCli/libstorelibir-2.so*
;;
*)
echo "Wrong arch"
exit 1
;;
esac
echo "${app}_${version}.orig.tar.gz" > $WORK_DIR/filename.txt
echo "${app}-${version}" > $WORK_DIR/dirname.txt
echo "${version}" > $WORK_DIR/version.txt
popd
done < "$DIR/files.diz"
FILENAME=`cat $WORK_DIR/filename.txt`
DIRNAME=`cat $WORK_DIR/dirname.txt`
echo "Creating $DIR/../$FILENAME "
pushd $WORK_DIR
tar -czf $DIR/../$FILENAME $DIRNAME
popd
VER=`cat $WORK_DIR/version.txt`
echo "Importing $DIR/../$FILENAME as $VER into git"
cleanup
gbp import-orig --pristine-tar -u $VER $DIR/../$FILENAME
exit 0

View File

View File

View File

View File

View File

View File

View File

@ -21,13 +21,13 @@ install: build
dh_installdirs
install $(CURDIR)/debian/megacli.wrapper $(CURDIR)/debian/megacli/usr/sbin/megacli
ifeq ($(DEB_BUILD_ARCH),amd64)
install $(CURDIR)/opt/MegaRAID/MegaCli/MegaCli64 $(CURDIR)/debian/megacli/usr/lib/megacli/megacli.real
install $(CURDIR)/opt/MegaRAID/MegaCli/libstorelibir-2.so.14.07-0 $(CURDIR)/debian/megacli/usr/lib/megacli/libstorelibir-2.so.14.07-0
install $(CURDIR)/amd64/opt/MegaRAID/MegaCli/MegaCli64 $(CURDIR)/debian/megacli/usr/lib/megacli/megacli.real
install $(CURDIR)/amd64/opt/MegaRAID/MegaCli/libstorelibir-2.so.14.07-0 $(CURDIR)/debian/megacli/usr/lib/megacli/libstorelibir-2.so.14.07-0
endif
ifeq ($(DEB_BUILD_ARCH),i386)
install $(CURDIR)/opt/MegaRAID/MegaCli/MegaCli $(CURDIR)/debian/megacli/usr/lib/megacli/megacli.real
install $(CURDIR)/i386/opt/MegaRAID/MegaCli/MegaCli $(CURDIR)/debian/megacli/usr/lib/megacli/megacli.real
# Seem to be x64 only
#install $(CURDIR)/opt/MegaRAID/MegaCli/libstorelibir-2.so.14.07-0 $(CURDIR)/debian/megacli/usr/lib/megacli/libstorelibir-2.so.14.07-0
#install $(CURDIR)/i386/opt/MegaRAID/MegaCli/libstorelibir-2.so.14.07-0 $(CURDIR)/debian/megacli/usr/lib/megacli/libstorelibir-2.so.14.07-0
endif
binary-indep:

2
files.diz Normal file
View File

@ -0,0 +1,2 @@
amd64!megacli!8.7.14.1!8-07-14_MegaCLI.zip!http://docs.avagotech.com/docs-and-downloads/raid-controllers/raid-controllers-common-files/8-07-14_MegaCLI.zip!bf53eeb0e8ccc09c34f52d7035940c62
i386!megacli!8.7.14.1!8-07-14_MegaCLI.zip!http://docs.avagotech.com/docs-and-downloads/raid-controllers/raid-controllers-common-files/8-07-14_MegaCLI.zip!bf53eeb0e8ccc09c34f52d7035940c62