]> git.sur5r.net Git - bacula/bacula/blob - bacula/platforms/contrib-rpm/build_rpm.sh
Add contrib-rpm
[bacula/bacula] / bacula / platforms / contrib-rpm / build_rpm.sh
1 #!/bin/bash
2
3 # shell script to build bacula rpm release
4 # copy this script into a working directory with the src rpm to build and execute
5 # 16 Jul 2006 D. Scott Barninger
6
7 # Copyright (C) 2006 Kern Sibbald
8 # licensed under GPL-v2
9
10 # signing rpms
11 # Make sure you have a .rpmmacros file in your home directory containing the following:
12 #
13 # %_signature gpg
14 # %_gpg_name Your Name <your-email@site.org>
15 #
16 # the %_gpg_name information must match your key
17
18
19 # usage: ./build_rpm.sh
20
21 ###########################################################################################
22 # script configuration section
23
24 VERSION=1.38.11
25 RELEASE=3
26
27 # set to one of rh7,rh8,rh9,fc1,fc3,fc4,fc5,wb3,rhel3,rhel4,centos3,centos4,su9,su10,mdk,mdv
28 PLATFORM=su10
29
30 # MySQL version
31 # set to empty (for MySQL 3), 4 or 5
32 MYSQL=4
33
34 # building wxconsole
35 # if your platform does not support building wxconsole (wxWidgets >= 2.6)
36 # delete the line [--define "build_wxconsole 1" \] below:
37
38 # enter your name and email address here
39 PACKAGER="Your Name <your-email@site.org>"
40
41 # enter the full path to your RPMS output directory
42 RPMDIR=/usr/src/packages/RPMS/i586
43
44 # enter your arch string here (i386, i586, i686)
45 ARCH=i586
46
47 ############################################################################################
48
49 SRPM=bacula-$VERSION-$RELEASE.src.rpm
50
51 # if your platform does not support wxconsole delete the line below
52 # defining build_wxconsole
53 echo Building MySQL packages for "$PLATFORM"...
54 sleep 2
55 rpmbuild --rebuild --define "build_${PLATFORM} 1" \
56 --define "build_mysql${MYSQL} 1" \
57 --define "contrib_packager ${PACKAGER}" \
58 --define "build_wxconsole 1" \
59 ${SRPM}
60
61 echo Building PostgreSQL packages for "$PLATFORM"...
62 sleep 2
63 rpmbuild --rebuild --define "build_${PLATFORM} 1" \
64 --define "build_postgresql 1" \
65 --define "contrib_packager ${PACKAGER}" \
66 --define "nobuild_gconsole 1" ${SRPM}
67
68 echo Building SQLite packages for "$PLATFORM"...
69 sleep 2
70 rpmbuild --rebuild --define "build_${PLATFORM} 1" \
71 --define "build_sqlite 1" \
72 --define "contrib_packager ${PACKAGER}" \
73 --define "nobuild_gconsole 1" ${SRPM}
74
75 # delete the updatedb package and any nodebug packages built
76 rm -f ${RPMDIR}/bacula*debug*
77 rm -f ${RPMDIR}/bacula-updatedb*
78
79 # copy files to cwd and rename files to final upload names
80
81 mv -f ${RPMDIR}/bacula-mysql-${VERSION}-${RELEASE}.${ARCH}.rpm \
82 ./bacula-mysql-${VERSION}-${RELEASE}.${PLATFORM}.${ARCH}.rpm
83
84 mv -f ${RPMDIR}/bacula-postgresql-${VERSION}-${RELEASE}.${ARCH}.rpm \
85 ./bacula-postgresql-${VERSION}-${RELEASE}.${PLATFORM}.${ARCH}.rpm
86
87 mv -f ${RPMDIR}/bacula-sqlite-${VERSION}-${RELEASE}.${ARCH}.rpm \
88 ./bacula-sqlite-${VERSION}-${RELEASE}.${PLATFORM}.${ARCH}.rpm
89
90 mv -f ${RPMDIR}/bacula-mtx-${VERSION}-${RELEASE}.${ARCH}.rpm \
91 ./bacula-mtx-${VERSION}-${RELEASE}.${PLATFORM}.${ARCH}.rpm
92
93 mv -f ${RPMDIR}/bacula-client-${VERSION}-${RELEASE}.${ARCH}.rpm \
94 ./bacula-client-${VERSION}-${RELEASE}.${PLATFORM}.${ARCH}.rpm
95
96 mv -f ${RPMDIR}/bacula-gconsole-${VERSION}-${RELEASE}.${ARCH}.rpm \
97 ./bacula-gconsole-${VERSION}-${RELEASE}.${PLATFORM}.${ARCH}.rpm
98
99 # now sign the packages
100 echo Ready to sign packages...
101 sleep 2
102 rpm --addsign ./*.rpm
103
104 echo
105 echo Finished.
106 echo
107 ls
108
109 # changelog
110 # 16 Jul 2006 initial release
111
112
113