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
7 # Copyright (C) 2006 Kern Sibbald
8 # licensed under GPL-v2
11 # Make sure you have a .rpmmacros file in your home directory containing the following:
14 # %_gpg_name Your Name <your-email@site.org>
16 # the %_gpg_name information must match your key
19 # usage: ./build_rpm.sh
21 ###########################################################################################
22 # script configuration section
27 # set to one of rh7,rh8,rh9,fc1,fc3,fc4,fc5,wb3,rhel3,rhel4,centos3,centos4,su9,su10,mdk,mdv
31 # set to empty (for MySQL 3), 4 or 5
35 # if your platform does not support building wxconsole (wxWidgets >= 2.6)
36 # delete the line [--define "build_wxconsole 1" \] below:
38 # enter your name and email address here
39 PACKAGER="Your Name <your-email@site.org>"
41 # enter the full path to your RPMS output directory
42 RPMDIR=/usr/src/packages/RPMS/i586
44 # enter your arch string here (i386, i586, i686)
47 ############################################################################################
49 SRPM=bacula-$VERSION-$RELEASE.src.rpm
51 # if your platform does not support wxconsole delete the line below
52 # defining build_wxconsole
53 echo Building MySQL packages for "$PLATFORM"...
55 rpmbuild --rebuild --define "build_${PLATFORM} 1" \
56 --define "build_mysql${MYSQL} 1" \
57 --define "contrib_packager ${PACKAGER}" \
58 --define "build_wxconsole 1" \
61 echo Building PostgreSQL packages for "$PLATFORM"...
63 rpmbuild --rebuild --define "build_${PLATFORM} 1" \
64 --define "build_postgresql 1" \
65 --define "contrib_packager ${PACKAGER}" \
66 --define "nobuild_gconsole 1" ${SRPM}
68 echo Building SQLite packages for "$PLATFORM"...
70 rpmbuild --rebuild --define "build_${PLATFORM} 1" \
71 --define "build_sqlite 1" \
72 --define "contrib_packager ${PACKAGER}" \
73 --define "nobuild_gconsole 1" ${SRPM}
75 # delete the updatedb package and any nodebug packages built
76 rm -f ${RPMDIR}/bacula*debug*
77 rm -f ${RPMDIR}/bacula-updatedb*
79 # copy files to cwd and rename files to final upload names
81 mv -f ${RPMDIR}/bacula-mysql-${VERSION}-${RELEASE}.${ARCH}.rpm \
82 ./bacula-mysql-${VERSION}-${RELEASE}.${PLATFORM}.${ARCH}.rpm
84 mv -f ${RPMDIR}/bacula-postgresql-${VERSION}-${RELEASE}.${ARCH}.rpm \
85 ./bacula-postgresql-${VERSION}-${RELEASE}.${PLATFORM}.${ARCH}.rpm
87 mv -f ${RPMDIR}/bacula-sqlite-${VERSION}-${RELEASE}.${ARCH}.rpm \
88 ./bacula-sqlite-${VERSION}-${RELEASE}.${PLATFORM}.${ARCH}.rpm
90 mv -f ${RPMDIR}/bacula-mtx-${VERSION}-${RELEASE}.${ARCH}.rpm \
91 ./bacula-mtx-${VERSION}-${RELEASE}.${PLATFORM}.${ARCH}.rpm
93 mv -f ${RPMDIR}/bacula-client-${VERSION}-${RELEASE}.${ARCH}.rpm \
94 ./bacula-client-${VERSION}-${RELEASE}.${PLATFORM}.${ARCH}.rpm
96 mv -f ${RPMDIR}/bacula-gconsole-${VERSION}-${RELEASE}.${ARCH}.rpm \
97 ./bacula-gconsole-${VERSION}-${RELEASE}.${PLATFORM}.${ARCH}.rpm
99 # now sign the packages
100 echo Ready to sign packages...
102 rpm --addsign ./*.rpm
110 # 16 Jul 2006 initial release