Rename and add orig script
This commit is contained in:
parent
4a8375f388
commit
2844f68466
83
build_orig.sh
Normal file
83
build_orig.sh
Normal 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
|
0
README.source → debian/README.source
vendored
0
README.source → debian/README.source
vendored
0
changelog → debian/changelog
vendored
0
changelog → debian/changelog
vendored
0
compat → debian/compat
vendored
0
compat → debian/compat
vendored
0
control → debian/control
vendored
0
control → debian/control
vendored
0
copyright → debian/copyright
vendored
0
copyright → debian/copyright
vendored
0
dirs → debian/dirs
vendored
0
dirs → debian/dirs
vendored
0
docs → debian/docs
vendored
0
docs → debian/docs
vendored
8
rules → debian/rules
vendored
8
rules → debian/rules
vendored
@ -21,13 +21,13 @@ install: build
|
|||||||
dh_installdirs
|
dh_installdirs
|
||||||
install $(CURDIR)/debian/megacli.wrapper $(CURDIR)/debian/megacli/usr/sbin/megacli
|
install $(CURDIR)/debian/megacli.wrapper $(CURDIR)/debian/megacli/usr/sbin/megacli
|
||||||
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)/amd64/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/libstorelibir-2.so.14.07-0 $(CURDIR)/debian/megacli/usr/lib/megacli/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)/i386/opt/MegaRAID/MegaCli/MegaCli $(CURDIR)/debian/megacli/usr/lib/megacli/megacli.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)/i386/opt/MegaRAID/MegaCli/libstorelibir-2.so.14.07-0 $(CURDIR)/debian/megacli/usr/lib/megacli/libstorelibir-2.so.14.07-0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
binary-indep:
|
binary-indep:
|
0
source/format → debian/source/format
vendored
0
source/format → debian/source/format
vendored
0
user_guide.pdf → debian/user_guide.pdf
vendored
0
user_guide.pdf → debian/user_guide.pdf
vendored
2
files.diz
Normal file
2
files.diz
Normal 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
|
Loading…
Reference in New Issue
Block a user