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 # set to 1 to build wxconsole package else set 0
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 the full path to your rpm BUILD directory
45 RPMBUILD=/usr/src/packages/BUILD
47 # enter your arch string here (i386, i586, i686)
50 ############################################################################################
52 SRPM=bacula-$VERSION-$RELEASE.src.rpm
54 echo Building MySQL packages for "$PLATFORM"...
56 if [ "$WXCONSOLE" = "1" ]; then
57 rpmbuild --rebuild --define "build_${PLATFORM} 1" \
58 --define "build_mysql${MYSQL} 1" \
59 --define "contrib_packager ${PACKAGER}" \
60 --define "build_wxconsole 1" \
63 rpmbuild --rebuild --define "build_${PLATFORM} 1" \
64 --define "build_mysql${MYSQL} 1" \
65 --define "contrib_packager ${PACKAGER}" ${SRPM}
69 echo Building PostgreSQL packages for "$PLATFORM"...
71 rpmbuild --rebuild --define "build_${PLATFORM} 1" \
72 --define "build_postgresql 1" \
73 --define "contrib_packager ${PACKAGER}" \
74 --define "nobuild_gconsole 1" ${SRPM}
77 echo Building SQLite packages for "$PLATFORM"...
79 rpmbuild --rebuild --define "build_${PLATFORM} 1" \
80 --define "build_sqlite 1" \
81 --define "contrib_packager ${PACKAGER}" \
82 --define "nobuild_gconsole 1" ${SRPM}
85 # delete the updatedb package and any debuginfo packages built
86 rm -f ${RPMDIR}/bacula*debug*
87 rm -f ${RPMDIR}/bacula-updatedb*
89 # copy files to cwd and rename files to final upload names
91 mv -f ${RPMDIR}/bacula-mysql-${VERSION}-${RELEASE}.${ARCH}.rpm \
92 ./bacula-mysql-${VERSION}-${RELEASE}.${PLATFORM}.${ARCH}.rpm
94 mv -f ${RPMDIR}/bacula-postgresql-${VERSION}-${RELEASE}.${ARCH}.rpm \
95 ./bacula-postgresql-${VERSION}-${RELEASE}.${PLATFORM}.${ARCH}.rpm
97 mv -f ${RPMDIR}/bacula-sqlite-${VERSION}-${RELEASE}.${ARCH}.rpm \
98 ./bacula-sqlite-${VERSION}-${RELEASE}.${PLATFORM}.${ARCH}.rpm
100 mv -f ${RPMDIR}/bacula-mtx-${VERSION}-${RELEASE}.${ARCH}.rpm \
101 ./bacula-mtx-${VERSION}-${RELEASE}.${PLATFORM}.${ARCH}.rpm
103 mv -f ${RPMDIR}/bacula-client-${VERSION}-${RELEASE}.${ARCH}.rpm \
104 ./bacula-client-${VERSION}-${RELEASE}.${PLATFORM}.${ARCH}.rpm
106 mv -f ${RPMDIR}/bacula-gconsole-${VERSION}-${RELEASE}.${ARCH}.rpm \
107 ./bacula-gconsole-${VERSION}-${RELEASE}.${PLATFORM}.${ARCH}.rpm
109 mv -f ${RPMDIR}/bacula-wxconsole-${VERSION}-${RELEASE}.${ARCH}.rpm \
110 ./bacula-wxconsole-${VERSION}-${RELEASE}.${PLATFORM}.${ARCH}.rpm
112 # now sign the packages
113 echo Ready to sign packages...
115 rpm --addsign ./*.rpm
123 # 16 Jul 2006 initial release