]> git.sur5r.net Git - bacula/bacula/blob - bacula/platforms/contrib-rpm/build_rpm.sh
minor typo fixed.
[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 # set to 1 to build wxconsole package else set 0
36 WXCONSOLE=0
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 the full path to your rpm BUILD directory
45 RPMBUILD=/usr/src/packages/BUILD
46
47 # enter your arch string here (i386, i586, i686)
48 ARCH=i586
49
50 ############################################################################################
51
52 SRPM=bacula-$VERSION-$RELEASE.src.rpm
53
54 echo Building MySQL packages for "$PLATFORM"...
55 sleep 2
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" \
61 ${SRPM}
62 else
63 rpmbuild --rebuild --define "build_${PLATFORM} 1" \
64 --define "build_mysql${MYSQL} 1" \
65 --define "contrib_packager ${PACKAGER}" ${SRPM}
66 fi
67 rm -rf ${RPMBUILD}/*
68
69 echo Building PostgreSQL packages for "$PLATFORM"...
70 sleep 2
71 rpmbuild --rebuild --define "build_${PLATFORM} 1" \
72 --define "build_postgresql 1" \
73 --define "contrib_packager ${PACKAGER}" \
74 --define "nobuild_gconsole 1" ${SRPM}
75 rm -rf ${RPMBUILD}/*
76
77 echo Building SQLite packages for "$PLATFORM"...
78 sleep 2
79 rpmbuild --rebuild --define "build_${PLATFORM} 1" \
80 --define "build_sqlite 1" \
81 --define "contrib_packager ${PACKAGER}" \
82 --define "nobuild_gconsole 1" ${SRPM}
83 rm -rf ${RPMBUILD}/*
84
85 # delete the updatedb package and any debuginfo packages built
86 rm -f ${RPMDIR}/bacula*debug*
87 rm -f ${RPMDIR}/bacula-updatedb*
88
89 # copy files to cwd and rename files to final upload names
90
91 mv -f ${RPMDIR}/bacula-mysql-${VERSION}-${RELEASE}.${ARCH}.rpm \
92 ./bacula-mysql-${VERSION}-${RELEASE}.${PLATFORM}.${ARCH}.rpm
93
94 mv -f ${RPMDIR}/bacula-postgresql-${VERSION}-${RELEASE}.${ARCH}.rpm \
95 ./bacula-postgresql-${VERSION}-${RELEASE}.${PLATFORM}.${ARCH}.rpm
96
97 mv -f ${RPMDIR}/bacula-sqlite-${VERSION}-${RELEASE}.${ARCH}.rpm \
98 ./bacula-sqlite-${VERSION}-${RELEASE}.${PLATFORM}.${ARCH}.rpm
99
100 mv -f ${RPMDIR}/bacula-mtx-${VERSION}-${RELEASE}.${ARCH}.rpm \
101 ./bacula-mtx-${VERSION}-${RELEASE}.${PLATFORM}.${ARCH}.rpm
102
103 mv -f ${RPMDIR}/bacula-client-${VERSION}-${RELEASE}.${ARCH}.rpm \
104 ./bacula-client-${VERSION}-${RELEASE}.${PLATFORM}.${ARCH}.rpm
105
106 mv -f ${RPMDIR}/bacula-gconsole-${VERSION}-${RELEASE}.${ARCH}.rpm \
107 ./bacula-gconsole-${VERSION}-${RELEASE}.${PLATFORM}.${ARCH}.rpm
108
109 mv -f ${RPMDIR}/bacula-wxconsole-${VERSION}-${RELEASE}.${ARCH}.rpm \
110 ./bacula-wxconsole-${VERSION}-${RELEASE}.${PLATFORM}.${ARCH}.rpm
111
112 # now sign the packages
113 echo Ready to sign packages...
114 sleep 2
115 rpm --addsign ./*.rpm
116
117 echo
118 echo Finished.
119 echo
120 ls
121
122 # changelog
123 # 16 Jul 2006 initial release
124
125
126