-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.sh
executable file
·52 lines (42 loc) · 1.12 KB
/
build.sh
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
#!/bin/sh
TEMP=`getopt -o '' -l release: -- "$@"`
eval set -- "$TEMP"
while true; do
case "$1" in
--release)
RELEASE=$2 ; shift 2 ;;
--) shift; break ;;
*) echo "Internal error!" ; exit 1 ;;
esac
done
if [[ -z $RELEASE ]] ; then
echo "$0 - Build number is not set"
exit 1
fi
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR
VERSION=`python ./setup.py --version`
DISTRO=`rpm --eval %{dist}`
BUILDROOT=`pwd`/build
rm -rf $BUILDROOT
mkdir -p $BUILDROOT/BUILDROOT
mkdir -p $BUILDROOT/BUILD
mkdir -p $BUILDROOT/RPMS
mkdir -p $BUILDROOT/SOURCES
mkdir -p $BUILDROOT/SPECS
mkdir -p $BUILDROOT/SRPMS
fpm --verbose \
-s python \
-t rpm \
--python-bin /usr/bin/python3.6 \
--python-easyinstall /usr/bin/easy_install-3.6 \
--python-package-name-prefix python36 \
-a noarch \
-n python36-scalable-cuckoo-filter \
--iteration $RELEASE$DISTRO \
-d python36-bitarray \
-d python36-mmh3 \
./setup.py
RC=$?; if [[ $RC != 0 ]]; then exit $RC; fi
# get the RPMs
find $BUILDROOT/RPMS -name '*.rpm' -exec cp {} . \;