Clean code
[irreco.git] / script / irtrans-deb-creator.sh
blob14fb132982a11809d48070f64869bdc9e99cb34e
1 #!/bin/bash
3 # Go to folder where this file lies.
4 cd `dirname "$0"`
6 main()
8 case "$1" in
9 --deb|-deb|deb|.deb|debaa|debbaa|debioi)
10 make_deb;;
12 info_print;
13 exit 1;;
14 esac
17 info_print()
19 echo ""
20 echo " Usage: irtrans-deb-creator COMMAND"
21 echo ""
22 echo " Commands:"
23 echo " --deb | -deb | deb"
24 echo " This creates irtrans .deb into ../debs/"
25 echo " Packaging requires that you have installet Irreco dev"
26 echo " package into Scratchbox."
27 echo ""
30 make_deb()
33 # Check we are in scratchbox
34 if [[ "$_SBOX_DIR" == "" ||
35 "$_SBOX_RESTART_FILE" == "" ||
36 "$_SBOX_SHELL_PID" == "" ||
37 "$_SBOX_USER_GROUPNAME" == "" ]]; then
38 echo "Error: Need scratchbox."
39 exit 1
42 # Unpack irtrans lib and make libIRTrans.so
43 cd ../irtrans/trunk
45 echo ""
46 echo "Untar and make libirtrans"
47 echo ""
49 ./untar-irtrans.sh
51 make clean
53 make irtrans_noccf
55 # Go to irtrans backend directory, clean stuff and build package
56 cd ../../backend/irtrans/trunk/
57 ./autoclean.sh
58 dpkg-buildpackage -rfakeroot -i
60 # Ditch .deb to correct directory
61 mkdir -v ../../../debs/
62 #mv -fv ../irreco-backend-irtrans* ../../../debs/
63 #mv -fv ../irtrans*.changes ../../../debs/
65 # Do cleaning
66 #cd ../../../script/
67 #./irtrans.sh clean
71 main "$@"