Sat, 24 Mar 2012 21:40:49 +0100
Introduce many changes to the buildconf and source code including:
(01) clean up, update, and partially update default config files,
(02) seems that Melware is unable to perform release engineering so
update chan_capi to new daily snapshot to solve echo problems,
(03) correct Asterisk inadequate hard coded gmime version check,
(04) force postgresql pthreads linkage to solve build problem,
(05) remove buggy hard coded LibXML configure definitions,
(06) remove local architecture specification to allow GCC
internal logic to determine proper CPU type instead,
(07) remove vendor sound install target causing uncontrolled
downloads and non RPM managed file installation,
(08) solve long outstanding bug in tcptls causing Asterisk
to ignore any intermediate CA certificate signatures,
(09) back out Digium engineering team's bright idea of replacing the
very portable and pervasive POSIX rand(1) with ast_random(), and
then not even implementing it causing all references to fail in
platforms not providing the very new POSIX.1-2008 mkdtemp(3)
function only distributed by BSD and some Linux,
(10) withdraw advanced linker symbol manipulations from SVR5 builds
until either Binutils supports hybrid versioned and anonymous
linker scripts or GCC stops hard coding versioned linker scripts,
(11) correct missing library linkage, some tailored to a specific OS,
(12) remove outdated logic for the no longer distributed gmime-config(1),
(13) remove local gmime buildconf hacks now that Asterisk has corrected
their own build configuration to almost portably support gmime,
(14) solve build problems relating to undetected LibXML paths,
(15) correct erroneous out of tree include definitions,
(16) improve some variable and comment naming,
(17) simplify sound language path hierarchy creation,
and correct australian english installation logic.
michael@20 | 1 | ## |
michael@20 | 2 | ## bacula.spec -- OpenPKG RPM Package Specification |
michael@20 | 3 | ## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/> |
michael@20 | 4 | ## |
michael@20 | 5 | ## Permission to use, copy, modify, and distribute this software for |
michael@20 | 6 | ## any purpose with or without fee is hereby granted, provided that |
michael@20 | 7 | ## the above copyright notice and this permission notice appear in all |
michael@20 | 8 | ## copies. |
michael@20 | 9 | ## |
michael@20 | 10 | ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
michael@20 | 11 | ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
michael@20 | 12 | ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
michael@20 | 13 | ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR |
michael@20 | 14 | ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
michael@20 | 15 | ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
michael@20 | 16 | ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
michael@20 | 17 | ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
michael@20 | 18 | ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
michael@20 | 19 | ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
michael@20 | 20 | ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
michael@20 | 21 | ## SUCH DAMAGE. |
michael@20 | 22 | ## |
michael@20 | 23 | |
michael@220 | 24 | # MSvB: |
michael@220 | 25 | # MSvB: Note, see http://www.bacula.org/en/?page=news |
michael@220 | 26 | # MSvB: for information on new configuration options. |
michael@223 | 27 | # MSvB: Warning! -L /pfx/lib is placed before locally |
michael@223 | 28 | # MSvB: built libraries (bacula-<ver>/src/cats...) |
michael@223 | 29 | # MSvB: which causes the old version of bacula to |
michael@223 | 30 | # MSvB: supply logic to the new version build! |
michael@220 | 31 | # MSvB: |
michael@220 | 32 | |
michael@20 | 33 | # package information |
michael@20 | 34 | Name: bacula |
michael@20 | 35 | Summary: Network Backup Tool |
michael@20 | 36 | URL: http://www.bacula.org/ |
michael@20 | 37 | Vendor: Kern Sibbald |
michael@20 | 38 | Packager: OpenPKG Foundation e.V. |
michael@20 | 39 | Distribution: OpenPKG Community |
michael@20 | 40 | Class: PLUS |
michael@20 | 41 | Group: System |
michael@20 | 42 | License: GPL |
michael@223 | 43 | Version: 3.0.3 |
michael@223 | 44 | Release: 20091028 |
michael@20 | 45 | |
michael@20 | 46 | # package options |
michael@20 | 47 | %option with_server yes |
michael@20 | 48 | %option with_ssl yes |
michael@20 | 49 | %option with_wrap no |
michael@20 | 50 | %option with_dvd no |
michael@20 | 51 | %option with_mtx no |
michael@20 | 52 | %option with_python no |
michael@220 | 53 | %option with_dbback sqlite |
michael@20 | 54 | |
michael@20 | 55 | # list of sources |
michael@20 | 56 | Source0: http://switch.dl.sourceforge.net/bacula/bacula-%{version}.tar.gz |
michael@20 | 57 | Source1: rc.bacula |
michael@20 | 58 | Source2: bexec.sh |
michael@20 | 59 | Patch0: bacula.patch |
michael@20 | 60 | |
michael@20 | 61 | # build information |
michael@20 | 62 | Prefix: %{l_prefix} |
michael@20 | 63 | BuildRoot: %{l_buildroot} |
michael@20 | 64 | BuildPreReq: OpenPKG, openpkg >= 20060823, make, gcc, gcc::with_cxx = yes |
michael@20 | 65 | PreReq: OpenPKG, openpkg >= 20060823 |
michael@220 | 66 | BuildPreReq: ncurses, readline, zlib, gawk |
michael@220 | 67 | PreReq: ncurses, readline, zlib, gawk |
michael@20 | 68 | %if "%{with_ssl}" == "yes" |
michael@220 | 69 | BuildPreReq: openssl >= 0.9.8, openssl::with_threads = yes |
michael@220 | 70 | PreReq: openssl >= 0.9.8, openssl::with_threads = yes |
michael@20 | 71 | %endif |
michael@20 | 72 | %if "%{with_wrap}" == "yes" |
michael@20 | 73 | BuildPreReq: tcpwrappers |
michael@20 | 74 | PreReq: tcpwrappers |
michael@20 | 75 | %endif |
michael@220 | 76 | %if "%{with_dbback}" == "sqlite" |
michael@20 | 77 | BuildPreReq: sqlite |
michael@20 | 78 | PreReq: sqlite |
michael@20 | 79 | %endif |
michael@220 | 80 | %if "%{with_dbback}" == "mysql" |
michael@20 | 81 | BuildPreReq: mysql |
michael@20 | 82 | PreReq: mysql |
michael@20 | 83 | %endif |
michael@220 | 84 | %if "%{with_dbback}" == "postgresql" |
michael@20 | 85 | BuildPreReq: postgresql |
michael@20 | 86 | PreReq: postgresql |
michael@20 | 87 | %endif |
michael@20 | 88 | %if "%{with_dvd}" == "yes" |
michael@20 | 89 | BuildPreReq: dvdrw-tools |
michael@20 | 90 | PreReq: dvdrw-tools |
michael@20 | 91 | %endif |
michael@20 | 92 | %if "%{with_mtx}" == "yes" |
michael@20 | 93 | BuildPreReq: mtx |
michael@20 | 94 | PreReq: mtx |
michael@20 | 95 | %endif |
michael@20 | 96 | %if "%{with_python}" == "yes" || "%{with_dvd}" == "yes" |
michael@20 | 97 | BuildPreReq: python |
michael@20 | 98 | PreReq: python |
michael@20 | 99 | %endif |
michael@20 | 100 | AutoReq: no |
michael@20 | 101 | AutoReqProv: no |
michael@20 | 102 | |
michael@20 | 103 | %description |
michael@20 | 104 | Bacula is a set of computer programs that permit you (or the system |
michael@20 | 105 | administrator) to manage backup, recovery, and verification of |
michael@20 | 106 | computer data across a network of computers of different kinds. In |
michael@20 | 107 | technical terms, it is a network client/server based backup program. |
michael@20 | 108 | Bacula is relatively easy to use and efficient, while offering many |
michael@20 | 109 | advanced storage management features that make it easy to find and |
michael@20 | 110 | recover lost or damaged files. |
michael@20 | 111 | |
michael@20 | 112 | %track |
michael@20 | 113 | prog bacula = { |
michael@20 | 114 | version = %{version} |
michael@20 | 115 | url = http://prdownloads.sourceforge.net/bacula/ |
michael@20 | 116 | regex = bacula-(\d+\.\d*[02468]\.\d+)\.tar\.gz |
michael@20 | 117 | } |
michael@20 | 118 | |
michael@20 | 119 | %prep |
michael@20 | 120 | %setup -q |
michael@20 | 121 | %patch -p0 |
michael@20 | 122 | rm -f src/lib/tcpd.h |
michael@20 | 123 | |
michael@20 | 124 | %build |
michael@20 | 125 | # generate a random director password |
michael@20 | 126 | password="`openssl rand -base64 33`" |
michael@20 | 127 | |
michael@20 | 128 | # for the same reason remove version informations from config files |
michael@20 | 129 | %{l_shtool} subst \ |
michael@20 | 130 | -e "s;For Bacula release @VERSION@ .*;;" \ |
michael@20 | 131 | `find . -name "*.conf.in"` |
michael@20 | 132 | |
michael@21 | 133 | # help specific platforms find fdatasync(3) |
michael@21 | 134 | libs="" |
michael@21 | 135 | case "%{l_platform -t}" in |
michael@21 | 136 | *-sunos* ) libs="-lrt" ;; |
michael@21 | 137 | esac |
michael@21 | 138 | |
michael@20 | 139 | # use localhost as default host |
michael@20 | 140 | %{l_shtool} subst \ |
michael@20 | 141 | -e 's;hostname=.*;hostname=localhost;g' \ |
michael@21 | 142 | -e 's;\(CONS_LIBS="-lreadline.*\)-ltermcap;\1-lncurses;g' \ |
michael@20 | 143 | configure |
michael@20 | 144 | |
michael@20 | 145 | # configure |
michael@20 | 146 | LIBS= |
michael@20 | 147 | case "%{l_platform -t}" in |
michael@20 | 148 | *-linux*) LIBS="-L/usr/lib/termcap";; |
michael@20 | 149 | esac |
michael@20 | 150 | CC="%{l_cc}" \ |
michael@20 | 151 | CFLAGS="%{l_cflags -O}" \ |
michael@21 | 152 | CPPFLAGS="%{l_cppflags ncurses}" \ |
michael@20 | 153 | LDFLAGS="%{l_ldflags} $LIBS" \ |
michael@21 | 154 | LIBS="$libs" \ |
michael@143 | 155 | GREP="grep" \ |
michael@20 | 156 | ./configure \ |
michael@20 | 157 | --prefix=%{l_prefix} \ |
michael@20 | 158 | --with-dir-user=%{l_rusr} \ |
michael@20 | 159 | --with-dir-group=%{l_rgrp} \ |
michael@20 | 160 | --with-sd-user=%{l_rusr} \ |
michael@20 | 161 | --with-sd-group=%{l_rgrp} \ |
michael@20 | 162 | --with-fd-user=%{l_susr} \ |
michael@20 | 163 | --with-fd-group=%{l_sgrp} \ |
michael@20 | 164 | --with-dir-password="$password" \ |
michael@20 | 165 | --with-fd-password="$password" \ |
michael@20 | 166 | --with-sd-password="$password" \ |
michael@20 | 167 | --with-mon-dir-password="$password" \ |
michael@20 | 168 | --with-mon-fd-password="$password" \ |
michael@20 | 169 | --with-mon-sd-password="$password" \ |
michael@20 | 170 | --disable-conio \ |
michael@20 | 171 | --enable-readline \ |
michael@20 | 172 | --with-readline=%{l_prefix} \ |
michael@20 | 173 | %if "%{with_server}" != "yes" |
michael@20 | 174 | --enable-client-only \ |
michael@20 | 175 | %endif |
michael@20 | 176 | %if "%{with_ssl}" == "yes" |
michael@20 | 177 | --with-openssl=%{l_prefix} \ |
michael@20 | 178 | %endif |
michael@20 | 179 | %if "%{with_wrap}" == "yes" |
michael@20 | 180 | --with-tcp-wrappers=yes \ |
michael@20 | 181 | %endif |
michael@220 | 182 | %if "%{with_dbback}" == "sqlite" |
michael@20 | 183 | --with-sqlite3=%{l_prefix} \ |
michael@20 | 184 | %endif |
michael@220 | 185 | %if "%{with_dbback}" == "mysql" |
michael@20 | 186 | --with-mysql=%{l_prefix} \ |
michael@20 | 187 | %endif |
michael@220 | 188 | %if "%{with_dbback}" == "postgresql" |
michael@20 | 189 | --with-postgresql=%{l_prefix} \ |
michael@20 | 190 | %endif |
michael@20 | 191 | %if "%{with_python}" == "yes" || "%{with_dvd}" == "yes" |
michael@20 | 192 | --with-python=%{l_prefix} \ |
michael@20 | 193 | %endif |
michael@20 | 194 | --enable-wx-console=no \ |
michael@20 | 195 | --sysconfdir=%{l_prefix}/etc/bacula \ |
michael@21 | 196 | --libexecdir=%{l_prefix}/libexec/bacula \ |
michael@20 | 197 | --mandir=%{l_prefix}/man \ |
michael@20 | 198 | --with-scriptdir=%{l_prefix}/libexec/bacula \ |
michael@20 | 199 | --with-working-dir=%{l_prefix}/var/bacula \ |
michael@20 | 200 | --with-pid-dir=%{l_prefix}/var/bacula/run \ |
michael@20 | 201 | --with-subsys-dir=%{l_prefix}/var/bacula/run/subsys \ |
michael@21 | 202 | --with-archivedir=/tmp \ |
michael@21 | 203 | --with-sbin-perm=0755 \ |
michael@223 | 204 | --disable-shared \ |
michael@220 | 205 | --disable-libtool \ |
michael@20 | 206 | --disable-nls |
michael@20 | 207 | |
michael@20 | 208 | # build |
michael@20 | 209 | %{l_make} %{l_mflags -O} |
michael@20 | 210 | |
michael@20 | 211 | %install |
michael@20 | 212 | rm -rf $RPM_BUILD_ROOT |
michael@20 | 213 | |
michael@20 | 214 | # create installation hierarchy |
michael@20 | 215 | %{l_shtool} mkdir -f -p -m 755 \ |
michael@20 | 216 | $RPM_BUILD_ROOT%{l_prefix}/bin \ |
michael@20 | 217 | $RPM_BUILD_ROOT%{l_prefix}/sbin \ |
michael@20 | 218 | $RPM_BUILD_ROOT%{l_prefix}/libexec/bacula \ |
michael@20 | 219 | $RPM_BUILD_ROOT%{l_prefix}/etc/bacula \ |
michael@20 | 220 | $RPM_BUILD_ROOT%{l_prefix}/etc/bacula/clients \ |
michael@20 | 221 | $RPM_BUILD_ROOT%{l_prefix}/etc/bacula/scripts \ |
michael@20 | 222 | $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \ |
michael@20 | 223 | $RPM_BUILD_ROOT%{l_prefix}/var/bacula \ |
michael@20 | 224 | $RPM_BUILD_ROOT%{l_prefix}/var/bacula/run \ |
michael@20 | 225 | $RPM_BUILD_ROOT%{l_prefix}/var/bacula/run/subsys \ |
michael@20 | 226 | $RPM_BUILD_ROOT%{l_prefix}/man/man1 \ |
michael@220 | 227 | $RPM_BUILD_ROOT%{l_prefix}/man/man8 |
michael@20 | 228 | |
michael@20 | 229 | # install |
michael@20 | 230 | %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT |
michael@20 | 231 | |
michael@20 | 232 | # strip down installation |
michael@21 | 233 | strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* 2>/dev/null || true |
michael@20 | 234 | ( cd $RPM_BUILD_ROOT%{l_prefix}/libexec/bacula && |
michael@21 | 235 | for unwanted in startmysql stopmysql; do |
michael@20 | 236 | rm -f $unwanted |
michael@20 | 237 | done |
michael@20 | 238 | ) || exit $? |
michael@20 | 239 | |
michael@20 | 240 | # install additional files |
michael@20 | 241 | %{l_shtool} install -c -m 754 %{l_value -s -a} \ |
michael@20 | 242 | %{SOURCE bexec.sh} $RPM_BUILD_ROOT%{l_prefix}/libexec/bacula/bexec |
michael@21 | 243 | %{l_shtool} install -c -m 640 \ |
michael@21 | 244 | src/console/bconsole.conf $RPM_BUILD_ROOT%{l_prefix}/etc/bacula/ |
michael@20 | 245 | |
michael@21 | 246 | ## wrap binaries to avoid to specify "-c" for each run |
michael@21 | 247 | #( cd $RPM_BUILD_ROOT%{l_prefix}/sbin |
michael@21 | 248 | # for bin in bacula-dir bacula-fd bacula-sd \ |
michael@21 | 249 | # bconsole bcopy bextract bls bscan dbcheck \ |
michael@21 | 250 | # tray-monitor wx-console; do |
michael@21 | 251 | # if [ -x $bin ]; then |
michael@21 | 252 | # mv $bin $RPM_BUILD_ROOT%{l_prefix}/libexec/bacula |
michael@21 | 253 | # ln $RPM_BUILD_ROOT%{l_prefix}/libexec/bacula/bexec ./$bin |
michael@21 | 254 | # fi |
michael@21 | 255 | # done |
michael@21 | 256 | #) || exit $? |
michael@20 | 257 | |
michael@142 | 258 | # install runcommand script |
michael@20 | 259 | %{l_shtool} install -c -m 755 %{l_value -s -a} \ |
michael@20 | 260 | -e 's,@with_server@,%{with_server},g' \ |
michael@20 | 261 | %{SOURCE rc.bacula} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ |
michael@20 | 262 | |
michael@20 | 263 | # determine installation files |
michael@20 | 264 | %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
michael@20 | 265 | %{l_files_std} \ |
michael@142 | 266 | '%config(noreplace) %{l_prefix}/etc/bacula/*.conf' \ |
michael@142 | 267 | %if "%{with_server}" == "yes" |
michael@142 | 268 | '%attr(-,%{l_musr},%{l_rgrp}) %config(noreplace) %{l_prefix}/etc/bacula/bacula-dir.conf' \ |
michael@142 | 269 | '%attr(-,%{l_musr},%{l_rgrp}) %config(noreplace) %{l_prefix}/etc/bacula/bacula-sd.conf' \ |
michael@142 | 270 | '%attr(-,%{l_musr},%{l_rgrp}) %{l_prefix}/libexec/bacula/delete_catalog_backup' \ |
michael@142 | 271 | '%attr(-,%{l_musr},%{l_rgrp}) %{l_prefix}/libexec/bacula/make_catalog_backup' \ |
michael@142 | 272 | %endif |
michael@20 | 273 | '%attr(-,%{l_musr},%{l_rgrp}) %{l_prefix}/libexec/bacula/dvd-handler' \ |
michael@20 | 274 | '%attr(-,%{l_musr},%{l_rgrp}) %{l_prefix}/libexec/bacula/mtx-changer' \ |
michael@142 | 275 | '%attr(700,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/bacula/run/subsys' \ |
michael@142 | 276 | '%attr(700,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/bacula/run' \ |
michael@142 | 277 | '%attr(700,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/bacula' |
michael@20 | 278 | |
michael@20 | 279 | %files -f files |
michael@20 | 280 | |
michael@20 | 281 | %clean |
michael@20 | 282 | rm -rf $RPM_BUILD_ROOT |
michael@20 | 283 | |
michael@20 | 284 | %post |
michael@20 | 285 | # create initial database |
michael@20 | 286 | if [ ! -f $RPM_INSTALL_PREFIX/var/bacula/bacula.db ]; then |
michael@20 | 287 | $RPM_INSTALL_PREFIX/libexec/bacula/make_bacula_tables |
michael@20 | 288 | chmod 600 $RPM_INSTALL_PREFIX/var/bacula/bacula.db |
michael@20 | 289 | chown %{l_rusr}:%{l_rgrp} $RPM_INSTALL_PREFIX/var/bacula/bacula.db |
michael@20 | 290 | fi |
michael@20 | 291 | |
michael@20 | 292 | # after upgrade, restart service |
michael@20 | 293 | [ $1 -eq 2 ] || exit 0 |
michael@20 | 294 | eval `%{l_rc} bacula status 2>/dev/null` |
michael@20 | 295 | [ ".$bacula_active" = .yes ] && %{l_rc} bacula restart |
michael@20 | 296 | exit 0 |
michael@20 | 297 | |
michael@20 | 298 | %preun |
michael@20 | 299 | # before erase, stop service and remove working files |
michael@20 | 300 | [ $1 -eq 0 ] || exit 0 |
michael@20 | 301 | %{l_rc} bacula stop 2>/dev/null |
michael@20 | 302 | rm -rf $RPM_INSTALL_PREFIX/var/bacula/* |
michael@20 | 303 | exit 0 |
michael@20 | 304 |