]> git.sur5r.net Git - bacula/bacula/blob - bacula/platforms/build_rpm.sh
Tweak Win32 build
[bacula/bacula] / bacula / platforms / build_rpm.sh
1 #!/bin/sh
2
3 # shell script to build bacula rpm release
4 # copy this script into your SPECS directory along with the spec file
5 # 09 Apr 2006 D. Scott Barninger
6
7 # usage: ./build_rpm.sh platform mysql_version
8
9 if [ "$1" = "--help" ]; then
10         echo
11         echo usage: ./build_rpm.sh platform mysql_version
12         echo
13         echo You must specify a platform:
14         echo rh7,rh8,rh9,fc1,fc3,fc4,wb3,rhel3,rhel4,centos3,centos4,su9,su10,mdk
15         echo
16         echo You must specify a MySQL version either 3 or 4.
17         echo
18         echo Example: ./build_rpm.sh fc4 4
19         exit 1
20 fi
21
22 PLATFORM=$1
23 MYSQL=$2
24
25 if [ -z "$PLATFORM" ]; then
26         echo
27         echo usage: ./build_rpm.sh platform mysql_version
28         echo
29         echo You must specify a platform:
30         echo rh7,rh8,rh9,fc1,fc3,fc4,wb3,rhel3,rhel4,centos3,centos4,su9,su10,mdk
31         exit 1
32 fi
33 if [ -z "$MYSQL" ]; then
34         echo
35         echo usage: ./build_rpm.sh platform mysql_version
36         echo
37         echo You must specify a MySQL version either 3 or 4.
38         exit 1
39 fi
40
41 if [ "$MYSQL" = "3" ]; then
42         MYSQL_VER=mysql
43 fi
44 if [ "$MYSQL" = "4" ]; then
45         MYSQL_VER=mysql4
46 fi
47
48 echo Building MySQL packages for "$PLATFORM"...
49 sleep 5
50 rpmbuild -ba --define "build_${PLATFORM} 1" \
51         --define "build_${MYSQL_VER} 1" \
52         bacula.spec
53
54 echo Building PostgreSQL packages for "$PLATFORM"...
55 sleep 5
56 rpmbuild -bb --define "build_${PLATFORM} 1" \
57         --define "build_postgresql 1" \
58         bacula.spec
59
60 echo Building SQLite packages for "$PLATFORM"...
61 sleep 5
62 rpmbuild -bb --define "build_${PLATFORM} 1" \
63         --define "build_sqlite 1" \
64         bacula.spec