forked from SteveAyre/mysql-cluster
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build_pkg
executable file
·49 lines (39 loc) · 1.18 KB
/
build_pkg
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
#!/bin/sh -e
PACKAGE_VERSION=`dpkg-parsechangelog | grep ^Version: | cut -d\ -f2`
VERSION=`echo $PACKAGE_VERSION | cut -d- -f1`
VERSION_MAJOR=`echo $VERSION | cut -d. -f1-2`
TARBALL=.mysql-cluster-${VERSION}.tar.gz
URL=http://dev.mysql.com/get/Downloads/MySQL-Cluster-${VERSION_MAJOR}/mysql-cluster-gpl-${VERSION}.tar.gz/from/http://www.mirrorservice.org/sites/ftp.mysql.com/
DIR=mysql-cluster-${VERSION}
# Use ccache if available
if [ `which ccache` ]
then
export MYSQL_BUILD_CC="ccache gcc"
export MYSQL_BUILD_CXX="ccache g++"
fi
# Build test options
# nocheck - skip testing (faster build)
# fulltest - very long testsuite
# leave both commented out for the normal test
#export DEB_BUILD_OPTIONS=nocheck
#export DEB_BUILD_OPTIONS=fulltest
# Download original source code
if [ ! -f ${TARBALL} ]
then
wget -O ${TARBALL} ${URL}
fi
# Remove any old copies of packages
rm -rf *.deb *.changes *.log
# Extract archive, add debian files
rm -rf ${DIR}
mkdir ${DIR}
tar -C ${DIR} --strip-components=1 -zxf ${TARBALL}
cp -arv debian ${DIR}
# Compile packages
cd ${DIR}
dpkg-buildpackage -b 2>&1 | tee build.log
cd ..
# Lintian checks
#lintian -c *.deb 2>&1 | tee lintian.log
# Cleanup and done
echo Done