Move and add Orig Build Script

This commit is contained in:
Mario Fetka 2016-05-26 18:47:32 +02:00
parent 4a8375f388
commit f8173a77b5
14 changed files with 104 additions and 20 deletions

82
build_orig.sh Normal file
View File

@ -0,0 +1,82 @@
#!/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}/storcli_all_os/Linux/*.rpm | cpio -idmv
case "${type}" in
"amd64" )
rm -f opt/MegaRAID/storcli/storcli
;;
"i386" )
rm -f opt/MegaRAID/storcli/storcli64
;;
*)
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

@ -1,10 +1,10 @@
megacli (8.07.14-1) unstable; urgency=medium storcli (8.07.14-1) unstable; urgency=medium
* New upstream release. * New upstream release.
-- Adam Cécile (Le_Vert) <gandalf@le-vert.net> Sun, 26 Jan 2014 00:40:52 +0100 -- Adam Cécile (Le_Vert) <gandalf@le-vert.net> Sun, 26 Jan 2014 00:40:52 +0100
megacli (8.04.07-1) unstable; urgency=low storcli (8.04.07-1) unstable; urgency=low
* New upstream release (Closes: #221). * New upstream release (Closes: #221).
* Rewrite debian/copyright to use the machine readable format. * Rewrite debian/copyright to use the machine readable format.
@ -13,36 +13,36 @@ megacli (8.04.07-1) unstable; urgency=low
-- Adam Cécile (Le_Vert) <gandalf@le-vert.net> Mon, 20 Aug 2012 22:23:22 +0200 -- Adam Cécile (Le_Vert) <gandalf@le-vert.net> Mon, 20 Aug 2012 22:23:22 +0200
megacli (8.02.16-1) unstable; urgency=low storcli (8.02.16-1) unstable; urgency=low
* New upstream release (Closes: #60). * New upstream release (Closes: #60).
* Rewrite most of the packaging because megacli now needs a specific * Rewrite most of the packaging because storcli now needs a specific
library (loaded using a shell wrapper). library (loaded using a shell wrapper).
* Include megacli user guide PDF (Closes: #178). * Include storcli user guide PDF (Closes: #178).
-- Adam Cécile (Le_Vert) <gandalf@le-vert.net> Mon, 30 Jan 2012 17:26:35 +0100 -- Adam Cécile (Le_Vert) <gandalf@le-vert.net> Mon, 30 Jan 2012 17:26:35 +0100
megacli (5.00.12-1) unstable; urgency=low storcli (5.00.12-1) unstable; urgency=low
* New upstream release. * New upstream release.
-- Adam Cécile (Le_Vert) <gandalf@le-vert.net> Sun, 16 Aug 2009 01:58:43 +0200 -- Adam Cécile (Le_Vert) <gandalf@le-vert.net> Sun, 16 Aug 2009 01:58:43 +0200
megacli (4.00.11-1) unstable; urgency=low storcli (4.00.11-1) unstable; urgency=low
* New upstream release. * New upstream release.
-- Adam Cécile (Le_Vert) <gandalf@le-vert.net> Mon, 27 Apr 2009 19:21:30 +0200 -- Adam Cécile (Le_Vert) <gandalf@le-vert.net> Mon, 27 Apr 2009 19:21:30 +0200
megacli (4.00.08-1) unstable; urgency=low storcli (4.00.08-1) unstable; urgency=low
* New upstream release. * New upstream release.
* Rename both source and binary packages from megaclisas to megacli. * Rename both source and binary packages from storclisas to storcli.
* Support IA-64 package. * Support IA-64 package.
-- Adam Cécile (Le_Vert) <gandalf@le-vert.net> Thu, 11 Dec 2008 17:33:57 +0100 -- Adam Cécile (Le_Vert) <gandalf@le-vert.net> Thu, 11 Dec 2008 17:33:57 +0100
megaclisas (2.00.11-1) unstable; urgency=low storclisas (2.00.11-1) unstable; urgency=low
* New upstream release. * New upstream release.
* Add upstream changelog. * Add upstream changelog.
@ -51,7 +51,7 @@ megaclisas (2.00.11-1) unstable; urgency=low
-- Adam Cécile (Le_Vert) <gandalf@le-vert.net> Thu, 21 Aug 2008 15:42:02 +0200 -- Adam Cécile (Le_Vert) <gandalf@le-vert.net> Thu, 21 Aug 2008 15:42:02 +0200
megaclisas (1.01.40-1) unstable; urgency=low storclisas (1.01.40-1) unstable; urgency=low
* Initial release. * Initial release.

View File

View File

View File

View File

View File

View File

@ -19,22 +19,22 @@ install: build
dh_testroot dh_testroot
dh_clean -k dh_clean -k
dh_installdirs dh_installdirs
install $(CURDIR)/debian/megacli.wrapper $(CURDIR)/debian/megacli/usr/sbin/megacli install $(CURDIR)/debian/storcli.wrapper $(CURDIR)/debian/storcli/usr/sbin/storcli
ifeq ($(DEB_BUILD_ARCH),amd64) ifeq ($(DEB_BUILD_ARCH),amd64)
install $(CURDIR)/opt/MegaRAID/MegaCli/MegaCli64 $(CURDIR)/debian/megacli/usr/lib/megacli/megacli.real install $(CURDIR)/opt/storRAID/storCli/storCli64 $(CURDIR)/debian/storcli/usr/lib/storcli/storcli.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)/opt/storRAID/storCli/libstorelibir-2.so.14.07-0 $(CURDIR)/debian/storcli/usr/lib/storcli/libstorelibir-2.so.14.07-0
endif endif
ifeq ($(DEB_BUILD_ARCH),i386) ifeq ($(DEB_BUILD_ARCH),i386)
install $(CURDIR)/opt/MegaRAID/MegaCli/MegaCli $(CURDIR)/debian/megacli/usr/lib/megacli/megacli.real install $(CURDIR)/opt/storRAID/storCli/storCli $(CURDIR)/debian/storcli/usr/lib/storcli/storcli.real
# Seem to be x64 only # 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)/opt/storRAID/storCli/libstorelibir-2.so.14.07-0 $(CURDIR)/debian/storcli/usr/lib/storcli/libstorelibir-2.so.14.07-0
endif endif
binary-indep: binary-indep:
binary-arch: build install binary-arch: build install
dh_testdir dh_testdir
dh_testroot dh_testroot
dh_installchangelogs 8.07.14_MegaCLI.txt dh_installchangelogs 8.07.14_storCLI.txt
dh_installdocs dh_installdocs
dh_compress dh_compress
dh_fixperms dh_fixperms

3
debian/storcli.wrapper vendored Normal file
View File

@ -0,0 +1,3 @@
#!/bin/sh
LD_LIBRARY_PATH="/usr/lib/storcli:$LD_LIBRARY_PATH" /usr/lib/storcli/storcli.real "$@"

2
files.diz Normal file
View File

@ -0,0 +1,2 @@
amd64!storcli!1.19.4.1!1.19.04_StorCLI.zip!http://docs.avagotech.com/docs-and-downloads/docs-and-downloads/raid-controllers/raid-controllers-common-files/1.19.04_StorCLI.zip!b2d227422d63e7954332aa81f5a5e1a2
i386!storcli!1.19.4.1!1.19.04_StorCLI.zip!http://docs.avagotech.com/docs-and-downloads/docs-and-downloads/raid-controllers/raid-controllers-common-files/1.19.04_StorCLI.zip!b2d227422d63e7954332aa81f5a5e1a2

View File

@ -1,3 +0,0 @@
#!/bin/sh
LD_LIBRARY_PATH="/usr/lib/megacli:$LD_LIBRARY_PATH" /usr/lib/megacli/megacli.real "$@"