diff --git a/build_orig.sh b/build_orig.sh new file mode 100644 index 0000000..32def3e --- /dev/null +++ b/build_orig.sh @@ -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 diff --git a/README.source b/debian/README.source similarity index 100% rename from README.source rename to debian/README.source diff --git a/changelog b/debian/changelog similarity index 69% rename from changelog rename to debian/changelog index cc5bc1a..84c1f58 100644 --- a/changelog +++ b/debian/changelog @@ -1,10 +1,10 @@ -megacli (8.07.14-1) unstable; urgency=medium +storcli (8.07.14-1) unstable; urgency=medium * New upstream release. -- Adam Cécile (Le_Vert) 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). * 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) 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). - * 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). - * Include megacli user guide PDF (Closes: #178). + * Include storcli user guide PDF (Closes: #178). -- Adam Cécile (Le_Vert) 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. -- Adam Cécile (Le_Vert) 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. -- Adam Cécile (Le_Vert) 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. - * Rename both source and binary packages from megaclisas to megacli. + * Rename both source and binary packages from storclisas to storcli. * Support IA-64 package. -- Adam Cécile (Le_Vert) 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. * Add upstream changelog. @@ -51,7 +51,7 @@ megaclisas (2.00.11-1) unstable; urgency=low -- Adam Cécile (Le_Vert) 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. diff --git a/compat b/debian/compat similarity index 100% rename from compat rename to debian/compat diff --git a/control b/debian/control similarity index 100% rename from control rename to debian/control diff --git a/copyright b/debian/copyright similarity index 100% rename from copyright rename to debian/copyright diff --git a/dirs b/debian/dirs similarity index 100% rename from dirs rename to debian/dirs diff --git a/docs b/debian/docs similarity index 100% rename from docs rename to debian/docs diff --git a/rules b/debian/rules similarity index 53% rename from rules rename to debian/rules index ff6596c..890aeb4 100755 --- a/rules +++ b/debian/rules @@ -19,22 +19,22 @@ install: build dh_testroot dh_clean -k 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) - 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)/opt/storRAID/storCli/storCli64 $(CURDIR)/debian/storcli/usr/lib/storcli/storcli.real + install $(CURDIR)/opt/storRAID/storCli/libstorelibir-2.so.14.07-0 $(CURDIR)/debian/storcli/usr/lib/storcli/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)/opt/storRAID/storCli/storCli $(CURDIR)/debian/storcli/usr/lib/storcli/storcli.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)/opt/storRAID/storCli/libstorelibir-2.so.14.07-0 $(CURDIR)/debian/storcli/usr/lib/storcli/libstorelibir-2.so.14.07-0 endif binary-indep: binary-arch: build install dh_testdir dh_testroot - dh_installchangelogs 8.07.14_MegaCLI.txt + dh_installchangelogs 8.07.14_storCLI.txt dh_installdocs dh_compress dh_fixperms diff --git a/source/format b/debian/source/format similarity index 100% rename from source/format rename to debian/source/format diff --git a/debian/storcli.wrapper b/debian/storcli.wrapper new file mode 100644 index 0000000..8fd2716 --- /dev/null +++ b/debian/storcli.wrapper @@ -0,0 +1,3 @@ +#!/bin/sh + +LD_LIBRARY_PATH="/usr/lib/storcli:$LD_LIBRARY_PATH" /usr/lib/storcli/storcli.real "$@" diff --git a/user_guide.pdf b/debian/user_guide.pdf similarity index 100% rename from user_guide.pdf rename to debian/user_guide.pdf diff --git a/files.diz b/files.diz new file mode 100644 index 0000000..b80b9db --- /dev/null +++ b/files.diz @@ -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 diff --git a/megacli.wrapper b/megacli.wrapper deleted file mode 100644 index 1bd90f3..0000000 --- a/megacli.wrapper +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -LD_LIBRARY_PATH="/usr/lib/megacli:$LD_LIBRARY_PATH" /usr/lib/megacli/megacli.real "$@"