]> git.sur5r.net Git - bacula/bacula/blob - bacula/platforms/contrib-rpm/build_rpm.sh
3.0.0 release updates.
[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 # 19 Aug 2006 D. Scott Barninger
6
7 # Copyright (C) 2006 Free Software Foundation Europe e.V.
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=3.0.0
25 RELEASE=1
26
27 # build platform for spec
28 # set to one of rh7,rh8,rh9,fc1,fc3,fc4,fc5,fc6,fc7,fc8,fc9,wb3,rhel3,rhel4,rhel5,centos3,centos4,centos5,sl3, sl4,sl5,su9,su10,su102,su103,su110,su111,mdk,mdv
29 PLATFORM=su111
30
31 # platform designator for file names
32 # for RedHat/Fedora set to one of rh7,rh8,rh9,fc1,fc3,fc4,fc5,fc6,fc7,fc8,fc9 OR
33 # for RHEL3/clones wb3, rhel3, sl3 & centos3 set to el3 OR
34 # for RHEL4/clones rhel4, sl4 & centos4 set to el4 OR
35 # for RHEL5/clones rhel5, sl5 & centos5 set to el5 OR
36 # for SuSE set to su90, su91, su92, su100 or su101 or su102 or su103 or su110 or su111 OR
37 # for Mandrake set to 101mdk or 20060mdk
38 FILENAME=su111
39
40 # MySQL version
41 # set to empty (for MySQL 3), 4 or 5
42 MYSQL=5
43
44 # enter your name and email address here
45 PACKAGER="Your Name <your-email@site.org>"
46
47 # enter the full path to your RPMS output directory
48 RPMDIR=/usr/src/packages/RPMS/i586
49
50 # enter the full path to your rpm BUILD directory
51 RPMBUILD=/usr/src/packages/BUILD
52
53 # enter your arch string here (i386, i586, i686, x86_64)
54 ARCH=i586
55
56 # if the src rpm is not in the current working directory enter the directory location
57 # with trailing slash where it is found.
58 SRPMDIR=
59
60 # set to 1 to sign packages, 0 not to sign if you want to sign on another machine.
61 SIGN=1
62
63 # to save the bacula-updatedb package set to 1, else 0
64 # only one updatedb package is required per release so normally this should be 0
65 # for all contrib packagers
66 SAVEUPDATEDB=0
67
68 # to override your language shell variable uncomment and edit this
69 # export LANG=en_US.UTF-8
70
71 # this is now in the spec file but when building bat on older versions uncomment
72 #export QTDIR=$(pkg-config --variable=prefix QtCore)
73 #export QTINC=$(pkg-config --variable=includedir QtCore)
74 #export QTLIB=$(pkg-config --variable=libdir QtCore)
75 #export PATH=${QTDIR}/bin/:${PATH}
76
77 # Make no changes below this point without consensus
78
79 ############################################################################################
80
81 SRPM=${SRPMDIR}bacula-$VERSION-$RELEASE.src.rpm
82
83 echo Building MySQL packages for "$PLATFORM"...
84 sleep 2
85 rpmbuild --rebuild --define "build_${PLATFORM} 1" \
86 --define "build_mysql${MYSQL} 1" \
87 --define "build_python 1" \
88 --define "nobuild_gconsole 1" \
89 --define "contrib_packager ${PACKAGER}" ${SRPM}
90 rm -rf ${RPMBUILD}/*
91
92 echo Building PostgreSQL packages for "$PLATFORM"...
93 sleep 2
94 rpmbuild --rebuild --define "build_${PLATFORM} 1" \
95 --define "build_postgresql 1" \
96 --define "contrib_packager ${PACKAGER}" \
97 --define "build_python 1" \
98 --define "build_bat 1" \
99 --define "nobuild_gconsole 1" ${SRPM}
100 rm -rf ${RPMBUILD}/*
101
102 echo Building SQLite packages for "$PLATFORM"...
103 sleep 2
104 rpmbuild --rebuild --define "build_${PLATFORM} 1" \
105 --define "build_sqlite 1" \
106 --define "contrib_packager ${PACKAGER}" \
107 --define "build_python 1" \
108 --define "nobuild_gconsole 1" ${SRPM}
109 rm -rf ${RPMBUILD}/*
110
111 # delete the updatedb package and any debuginfo packages built
112 rm -f ${RPMDIR}/bacula*debug*
113 if [ "$SAVEUPDATEDB" = "1" ]; then
114         mv -f ${RPMDIR}/bacula-updatedb* ./;
115 else
116         rm -f ${RPMDIR}/bacula-updatedb*;
117 fi
118
119 # copy files to cwd and rename files to final upload names
120
121 mv -f ${RPMDIR}/bacula-mysql-${VERSION}-${RELEASE}.${ARCH}.rpm \
122 ./bacula-mysql-${VERSION}-${RELEASE}.${FILENAME}.${ARCH}.rpm
123
124 mv -f ${RPMDIR}/bacula-postgresql-${VERSION}-${RELEASE}.${ARCH}.rpm \
125 ./bacula-postgresql-${VERSION}-${RELEASE}.${FILENAME}.${ARCH}.rpm
126
127 mv -f ${RPMDIR}/bacula-sqlite-${VERSION}-${RELEASE}.${ARCH}.rpm \
128 ./bacula-sqlite-${VERSION}-${RELEASE}.${FILENAME}.${ARCH}.rpm
129
130 mv -f ${RPMDIR}/bacula-mtx-${VERSION}-${RELEASE}.${ARCH}.rpm \
131 ./bacula-mtx-${VERSION}-${RELEASE}.${FILENAME}.${ARCH}.rpm
132
133 mv -f ${RPMDIR}/bacula-client-${VERSION}-${RELEASE}.${ARCH}.rpm \
134 ./bacula-client-${VERSION}-${RELEASE}.${FILENAME}.${ARCH}.rpm
135
136 mv -f ${RPMDIR}/bacula-bat-${VERSION}-${RELEASE}.${ARCH}.rpm \
137 ./bacula-bat-${VERSION}-${RELEASE}.${FILENAME}.${ARCH}.rpm
138
139 # now sign the packages
140 if [ "$SIGN" = "1" ]; then
141         echo Ready to sign packages...;
142         sleep 2;
143         rpm --addsign ./*.rpm;
144 fi
145
146 echo
147 echo Finished.
148 echo
149 ls
150
151 # changelog
152 # 16 Jul 2006 initial release
153 # 05 Aug 2006 add python support
154 # 06 Aug 2006 add remote source directory, add switch for signing, refine file names
155 # 19 Aug 2006 add $LANG override to config section per request Felix Schwartz
156 # 27 Jan 2007 add fc6 target
157 # 29 Apr 2007 add sl3 & sl4 target and bat package
158 # 06 May 2007 add fc7 target
159 # 15 Sep 2007 add rhel5 and clones
160 # 10 Nov 2007 add su103
161 # 12 Jan 2008 add fc8
162 # 23 May 2008 add fc9
163 # 28 Jun 2008 add su110
164 # 08 Nov 2008 add use of pkgconfig to obtain QT4 paths
165 # 31 Dec 2008 add su111
166 # 05 Apr 2009 deprecate gconsole and wxconsole, bat built by default