forked from kambria-platform/kbcb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-debian.sh
executable file
·42 lines (35 loc) · 958 Bytes
/
build-debian.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
#!/bin/sh
# Config tp exit shell on error
# set -e
# Get package version
read -p "Input version [kbcb-<version>]:" version
package=kbcb-$version
build_path=./packages/debian
# Create package dir
mkdir -p $build_path
cd $build_path
rm -rf $package
mkdir -p ./$package/$package
# Copy source to new package dir
cd ../..
cp README.md ./debian/README.Debian
cp -r debian include src CMakeLists.txt $build_path/$package/$package
# Build source (For testing purpose)
# When build package (debuild),
# debbuild uses dh_auto_configure which defined in debian/rules
cd $build_path/$package/$package
mkdir ./build
cd ./build
cmake .. -DENV="PRODUCTION" -DSHARED="/usr/share/kbcb/pre-push"
make
# Build package
cd ../..
tar -cvzf $package.tar.gz $package
cd ./$package
dh_make --file ../$package.tar.gz --copyright gpl2 --indep
debuild -us -uc
LightGreen='\033[1;32m'
NoColor='\033[0m'
echo ""
echo "${LightGreen}$package was built completly!${NoColor}"
echo ""