-
Notifications
You must be signed in to change notification settings - Fork 1
/
cowbuild-package-lunarg
executable file
·62 lines (55 loc) · 2.14 KB
/
cowbuild-package-lunarg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
cowbuild_package () {
DIST=$1
VENDOR=$2
LOCAL=$3
OPTS=${4:-""}
git reset --hard
rm -f "../${SOURCE}_${BASE_VERSION}-*"
debian/rules debian/control
dch --vendor=$VENDOR --local=$LOCAL ""
dch --vendor=$VENDOR --distribution=$DIST --release ""
debuild -i -us -uc -sa -S --lintian-opts -X chng
FULL_VERSION=$(dpkg-parsechangelog | sed -n 's/^Version: //p')
DSC_FILE="../${SOURCE}_${FULL_VERSION}.dsc"
if [[ $PKG_ARCH =~ "amd64" ]] || [[ $PKG_ARCH =~ "all" ]] || [[ $PKG_ARCH =~ "any" ]] ; then
echo "#########################################################"
echo "Building amd64 $DIST packages.."
echo "#########################################################"
sudo DIST=$DIST ARCH=amd64 cowbuilder --pkgname-logfile --build $OPTS $DSC_FILE
fi
# if [[ $PKG_ARCH =~ "i386" ]] || [[ $PKG_ARCH =~ "any" ]] ; then
# echo "#########################################################"
# echo "Building i386 $DIST packages.."
# echo "#########################################################"
# # Don't rebuild the source package, only binary.
# sudo DIST=$DIST ARCH=i386 cowbuilder --binary-arch --pkgname-logfile --build $DSC_FILE
# fi
}
usage="$0 [-b <BUILD VERSION>] [-s <LOCAL SUFFIX>]"
BUILD_VERSION="1."
BUILD_SUFFIX="~lunarg"
while getopts ":b:s:" options; do
case $options in
b ) BUILD_VERSION="${OPTARG}.";;
s ) BUILD_SUFFIX="${OPTARG}";;
* ) echo $usage
exit 1;;
esac
done
SOURCE=$(dpkg-parsechangelog | sed -n 's/^Source: //p')
BASE_VERSION=$(dpkg-parsechangelog | sed -n 's/^Version: //p' | sed -n 's/-.*$//p')
PKG_ARCH=$(sed -n 's/^Architecture: //p' debian/control)
# Check all the normal sources for an orig tarball before generating a new one
# (which likely will have a different hash than a pre-existing original)
origtargz -dt
if [ $? -ne 0 ]; then
debian/rules gentarball
fi
source $(dirname $(readlink -f $0))/.common-lunarg.sh
for Distro in "${LunarGDistros[@]}";
do
cowbuild_package ${Distro} ${DistroVendor[${Distro}]} \
"${DistroLocalSuffix[${Distro}]}${BUILD_SUFFIX}${BUILD_VERSION}" \
"${DistroPbuilderOpts[${Distro}]}"
done