From ced70c27c61130464b395a2e526a7cc1e2f9ad9a Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sun, 26 Jul 2009 17:05:18 +0000 Subject: [PATCH] Tweak RedHat spec files git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@9102 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/autoconf/configure.in | 48 +--- bacula/configure | 39 +-- bacula/platforms/redhat/bacula.spec.in | 316 +++++++++++++++++++------ bacula/platforms/redhat/bsys.spec.in | 186 ++++++++++++++- bacula/technotes | 2 + 5 files changed, 443 insertions(+), 148 deletions(-) diff --git a/bacula/autoconf/configure.in b/bacula/autoconf/configure.in index 67519956f4..8da31fa007 100644 --- a/bacula/autoconf/configure.in +++ b/bacula/autoconf/configure.in @@ -2556,10 +2556,17 @@ PFILES="platforms/Makefile" PSCMD="ps -e" WIN32= MACOSX= + hostname=`uname -n | cut -d '.' -f 1` if test x${hostname} = x ; then hostname="localhost" fi +dnl Make sure hostname is resolved +ping -c 1 $hostname 2>/dev/null 1>/dev/null +if test ! $? = 0; then + hostname="localhost" +fi + case "$DISTNAME" in aix) DISTVER=`uname -r` @@ -2611,11 +2618,6 @@ darwin) platforms/darwin/Makefile" ;; debian) - dnl Make sure hostname is resolved - ping -c 1 $hostname 2>&1 1>/dev/null - if test ! $? = 0; then - hostname="localhost" - fi if `test -f /etc/apt/sources.list && grep -q ubuntu /etc/apt/sources.list`; then DISTNAME="ubuntu" fi @@ -2649,11 +2651,6 @@ debian) fi ;; freebsd) - dnl Make sure hostname is resolved - ping -c 1 $hostname 2>&1 1>/dev/null - if test ! $? = 0; then - hostname="localhost" - fi DISTVER=`uname -a |awk '{print $3}'` VER=`echo $DISTVER | cut -c 1` if test x$VER = x4 ; then @@ -2713,11 +2710,6 @@ openbsd) platforms/openbsd/bacula-dir" ;; redhat) - dnl Make sure hostname is resolved - ping -c 1 $hostname 2>&1 1>/dev/null - if test ! $? = 0; then - hostname="localhost" - fi if test -f /etc/whitebox-release ; then f=/etc/whitebox-release else @@ -2739,14 +2731,10 @@ redhat) platforms/redhat/bacula-sd \ platforms/redhat/bacula-dir \ platforms/redhat/bacula.spec \ + platforms/redhat/bsys.spec \ " ;; mandrake) - dnl Make sure hostname is resolved - ping -c 1 $hostname 2>&1 1>/dev/null - if test ! $? = 0; then - hostname="localhost" - fi DISTVER=`cat /etc/mandrake-release | grep release |\ cut -f 5 -d ' '` TAPEDRIVE="/dev/nst0" @@ -2760,11 +2748,6 @@ mandrake) " ;; gentoo) - dnl Make sure hostname is resolved - ping -c 1 $hostname 2>&1 1>/dev/null - if test ! $? = 0; then - hostname="localhost" - fi DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release` TAPEDRIVE="/dev/nst0" PSCMD="ps -e -o pid,command" @@ -2776,11 +2759,6 @@ gentoo) platforms/gentoo/bacula-dir" ;; slackware) - dnl Make sure hostname is resolved - ping -c 1 $hostname 2>&1 1>/dev/null - if test ! $? = 0; then - hostname="localhost" - fi DISTVER=`cat /etc/slackware-version` TAPEDRIVE="/dev/nst0" PSCMD="ps -e -o pid,command" @@ -2806,11 +2784,6 @@ solaris) LIBS="$LIBS -lresolv" ;; suse) - dnl Make sure hostname is resolved - ping -c 1 $hostname 2>&1 1>/dev/null - if test ! $? = 0; then - hostname="localhost" - fi DISTVER=`cat /etc/SuSE-release |grep VERSION|\ cut -f 3 -d ' '` TAPEDRIVE="/dev/nst0" @@ -2824,11 +2797,6 @@ suse) platforms/suse/bacula.spec" ;; suse5) - dnl Make sure hostname is resolved - ping -c 1 $hostname 2>&1 1>/dev/null - if test ! $? = 0; then - hostname="localhost" - fi DISTNAME=suse DISTVER=5.x TAPEDRIVE="/dev/nst0" diff --git a/bacula/configure b/bacula/configure index a165700550..973cf82b93 100755 --- a/bacula/configure +++ b/bacula/configure @@ -42564,10 +42564,16 @@ PFILES="platforms/Makefile" PSCMD="ps -e" WIN32= MACOSX= + hostname=`uname -n | cut -d '.' -f 1` if test x${hostname} = x ; then hostname="localhost" fi +ping -c 1 $hostname 2>/dev/null 1>/dev/null +if test ! $? = 0; then + hostname="localhost" +fi + case "$DISTNAME" in aix) DISTVER=`uname -r` @@ -42619,10 +42625,6 @@ darwin) platforms/darwin/Makefile" ;; debian) - ping -c 1 $hostname 2>&1 1>/dev/null - if test ! $? = 0; then - hostname="localhost" - fi if `test -f /etc/apt/sources.list && grep -q ubuntu /etc/apt/sources.list`; then DISTNAME="ubuntu" fi @@ -42656,10 +42658,6 @@ debian) fi ;; freebsd) - ping -c 1 $hostname 2>&1 1>/dev/null - if test ! $? = 0; then - hostname="localhost" - fi DISTVER=`uname -a |awk '{print $3}'` VER=`echo $DISTVER | cut -c 1` if test x$VER = x4 ; then @@ -42722,10 +42720,6 @@ openbsd) platforms/openbsd/bacula-dir" ;; redhat) - ping -c 1 $hostname 2>&1 1>/dev/null - if test ! $? = 0; then - hostname="localhost" - fi if test -f /etc/whitebox-release ; then f=/etc/whitebox-release else @@ -42747,13 +42741,10 @@ redhat) platforms/redhat/bacula-sd \ platforms/redhat/bacula-dir \ platforms/redhat/bacula.spec \ + platforms/redhat/bsys.spec \ " ;; mandrake) - ping -c 1 $hostname 2>&1 1>/dev/null - if test ! $? = 0; then - hostname="localhost" - fi DISTVER=`cat /etc/mandrake-release | grep release |\ cut -f 5 -d ' '` TAPEDRIVE="/dev/nst0" @@ -42767,10 +42758,6 @@ mandrake) " ;; gentoo) - ping -c 1 $hostname 2>&1 1>/dev/null - if test ! $? = 0; then - hostname="localhost" - fi DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release` TAPEDRIVE="/dev/nst0" PSCMD="ps -e -o pid,command" @@ -42782,10 +42769,6 @@ gentoo) platforms/gentoo/bacula-dir" ;; slackware) - ping -c 1 $hostname 2>&1 1>/dev/null - if test ! $? = 0; then - hostname="localhost" - fi DISTVER=`cat /etc/slackware-version` TAPEDRIVE="/dev/nst0" PSCMD="ps -e -o pid,command" @@ -42814,10 +42797,6 @@ _ACEOF LIBS="$LIBS -lresolv" ;; suse) - ping -c 1 $hostname 2>&1 1>/dev/null - if test ! $? = 0; then - hostname="localhost" - fi DISTVER=`cat /etc/SuSE-release |grep VERSION|\ cut -f 3 -d ' '` TAPEDRIVE="/dev/nst0" @@ -42831,10 +42810,6 @@ suse) platforms/suse/bacula.spec" ;; suse5) - ping -c 1 $hostname 2>&1 1>/dev/null - if test ! $? = 0; then - hostname="localhost" - fi DISTNAME=suse DISTVER=5.x TAPEDRIVE="/dev/nst0" diff --git a/bacula/platforms/redhat/bacula.spec.in b/bacula/platforms/redhat/bacula.spec.in index 69b81f13f9..07303e90a9 100644 --- a/bacula/platforms/redhat/bacula.spec.in +++ b/bacula/platforms/redhat/bacula.spec.in @@ -1,8 +1,169 @@ # Bacula RPM spec file -# Copyright (C) 2000-2008 Kern Sibbald +# +# Copyright (C) 2000-2009 Free Software Foundation Europe e.V. # Platform Build Configuration + +BuildRequires: libacl-devel + +# probems with mandriva build: + +# nothing provides libbonobo2_0-devel, nothing provides libbonoboui2_0-devel + +# set Macros by opensuse_bs, see http://en.opensuse.org/Build_Service/cross_distribution_package_how_to +#openSUSE 11.1 %if 0%{?suse_version} == 1110 +#openSUSE 11.0 %if 0%{?suse_version} == 1100 +#openSUSE 10.3 %if 0%{?suse_version} == 1030 +#openSUSE 10.2 %if 0%{?suse_version} == 1020 +#SUSE Linux 10.1 %if 0%{?suse_version} == 1010 +#SUSE Linux 10.0 %if 0%{?suse_version} == 1000 +#SUSE Linux 9.3 %if 0%{?suse_version} == 930 +#SLES 9 %if 0%{?sles_version} == 9 also set: %if 0%{?suse_version} == 910 +#SLE 10 %if 0%{?sles_version} == 10 also set: %if 0%{?suse_version} == 1010 +#SLE 11 %if 0%{?sles_version} == 11 also set: %if 0%{?suse_version} == 1110 +#CentOS 5 %if 0%{?centos_version} == 501 +#RHEL 4 %if 0%{?rhel_version} == 406 +#RHEL 5 %if 0%{?rhel_version} == 501 +#Fedora 6 with Extras %if 0%{?fedora_version} == 6 +#Fedora 7 with Extras %if 0%{?fedora_version} == 7 +#Fedora 8 with Extras %if 0%{?fedora_version} == 8 +#Fedora 9 with Extras %if 0%{?fedora_version} == 9 +#Fedora 10 with Extras %if 0%{?fedora_version} == 10 +#Mandriva 2006 %if 0%{?mandriva_version} == 2006 +#Mandriva 2007 %if 0%{?mandriva_version} == 2007 +#Mandriva 2008 %if 0%{?mandriva_version} == 2008 + + +%if 0%{?opensuse_bs} +# am I running in opensuse build service? +# TODO: seems to make problems + +# choose database backend here +# postgres, mysql, sqlite +%define build_postgresql 1 + +# Build Service: Determine Distribution + +%ifarch x86_64 + %define build_x86_64 1 +%endif + + +%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version} +BuildRequires: GConf2-devel +BuildRequires: freetype-devel +BuildRequires: libtermcap-devel +BuildRequires: shadow-utils +%endif + + + + +%if 0%{?mandriva_version} == 2007 +%define build_mdv 1 +%define _dist "Mandriva 2007" +# %define gconsole 0 +%endif + +%if 0%{?fedora_version} == 8 +%define build_fc8 1 +%define _dist "Fedora Core 8" +BuildRequires: redhat-release +%endif + +%if 0%{?fedora_version} == 9 +%define build_fc9 1 +%define _dist "Fedora Core 9" +BuildRequires: redhat-release +%endif + + +%if 0%{?fedora_version} == 10 +%define build_fc9 1 +%define _dist "Fedora Core 10" +BuildRequires: PolicyKit-gnome +BuildRequires: fedora-release +%endif + +%if 0%{?fedora_version} == 11 +%define build_fc9 1 +%define _dist "Fedora Core 11" +BuildRequires: PolicyKit-gnome +BuildRequires: fedora-release +%endif + + + + +%if 0%{?rhel_version} == 501 +%define build_rhel5 1 +%define _dist "Red Hat Enterprise Linux Server release 5" +BuildRequires: redhat-release +%endif + +%if 0%{?rhel_version} == 406 +%define build_rhel4 1 +%define _dist "Red Hat Enterprise Linux Server release 4" +BuildRequires: redhat-release +%endif + + +%if 0%{?centos_version} == 501 +%define build_centos5 1 +%define _dist "CentOS 5" +BuildRequires: redhat-release +%endif + + +%if 0%{?suse_version} == 1020 +%define build_su102 1 +%define _dist "OpenSUSE 10.2" +BuildRequires: suse-release +%endif + + +%if 0%{?suse_version} == 1030 +%define build_su103 1 +%define _dist "OpenSUSE 10.3" +BuildRequires: suse-release +%endif + +%if 0%{?suse_version} == 1100 +%define build_su110 1 +%define _dist "SUSE 11" +BuildRequires: suse-release +%endif + + +%if 0%{?suse_version} == 1110 +%define build_su111 1 +%define _dist "SUSE 11" +%endif + + +%if 0%{?sles_version} == 9 +%define build_su9 1 +%define _dist "SLES 9" +%endif + + +%if 0%{?sles_version} == 10 +%define build_su10 1 +%define _dist "SLE 10" +%endif + + +%if 0%{?sles_version} == 11 +%define build_su111 1 +%define _dist "SLES 11" +%endif + + + +%endif +# opensuse-bs? + # basic defines for every build %define _version @VERSION@ %define _release 1 @@ -255,6 +416,23 @@ exit 1 %if %{mdk} %define _dist %(grep Mand /etc/mandrake-release) %endif + +# opensuse build service start +%if 0%{?sles_version} == 9 +%define _dist "SLES 9" +%endif + +%if 0%{?sles_version} == 10 +%define _dist "SLE 10" +%endif + + +%if 0%{?sles_version} == 11 +%define _dist "SLE 11" +%endif + +# opensuse build service end + %{?DISTNAME:%define _dist %{DISTNAME}} Distribution: %{_dist} @@ -318,12 +496,9 @@ Distribution: %{_dist} %define wxconsole 0 %endif -%{expand: %%define gccver %(rpm -q --queryformat %%{version} gcc)} -%{expand: %%define gccrel %(rpm -q --queryformat %%{release} gcc)} - BuildRequires: gcc, gcc-c++, make, autoconf BuildRequires: ncurses-devel, perl -BuildRequires: libstdc++-devel = %{gccver}-%{gccrel}, zlib-devel +BuildRequires: libstdc++-devel, zlib-devel BuildRequires: openssl-devel %if ! %{rh7} BuildRequires: libxml2-devel @@ -1516,15 +1691,15 @@ export QTLIB=/usr/lib64/qt4/ %configure \ --prefix=%{_prefix} \ --sbindir=%{_sbindir} \ - --sysconfdir=%{sysconf_dir} \ - --with-scriptdir=%{script_dir} \ - --with-working-dir=%{working_dir} \ - --with-pid-dir=%{pid_dir} \ + --sysconfdir=%{sysconf_dir} \ + --with-scriptdir=%{script_dir} \ + --with-working-dir=%{working_dir} \ + --with-pid-dir=%{pid_dir} \ --enable-smartalloc \ --enable-client-only \ - %if %{mdk} - --disable-nls \ - %endif + %if %{mdk} + --disable-nls \ + %endif --enable-static-fd make @@ -1533,10 +1708,10 @@ make %configure \ --prefix=%{_prefix} \ --sbindir=%{_sbindir} \ - --sysconfdir=%{sysconf_dir} \ - --with-scriptdir=%{script_dir} \ - --with-working-dir=%{working_dir} \ - --with-pid-dir=%{pid_dir} \ + --sysconfdir=%{sysconf_dir} \ + --with-scriptdir=%{script_dir} \ + --with-working-dir=%{working_dir} \ + --with-pid-dir=%{pid_dir} \ --enable-smartalloc \ %if %{gconsole} --enable-gnome \ @@ -1554,23 +1729,23 @@ make --with-postgresql \ %endif %if %{wxconsole} - --enable-bwx-console \ + --enable-bwx-console \ %endif %if %{bat} - --enable-bat \ - --with-qwt=${cwd}/%{depkgs}/qwt \ + --enable-bat \ + --with-qwt=${cwd}/%{depkgs}/qwt \ %endif %if %{python} - --with-python \ + --with-python \ %endif %if %{client_only} - --enable-client-only \ + --enable-client-only \ %endif %if %{rh7} || %{rh8} || %{rh9} || %{fc1} || %{fc3} || %{wb3} - --disable-batch-insert \ + --disable-batch-insert \ %endif - --mandir=%{_mandir} \ - --with-plugindir=%{script_dir} \ + --mandir=%{_mandir} \ + --with-plugindir=%{script_dir} \ --with-subsys-dir=%{_subsysdir} \ --with-dir-user=%{director_daemon_user} \ --with-dir-group=%{daemon_group} \ @@ -1627,10 +1802,10 @@ cd %{depkgs} make \ prefix=$RPM_BUILD_ROOT%{_prefix} \ sbindir=$RPM_BUILD_ROOT%{_sbindir} \ - sysconfdir=$RPM_BUILD_ROOT%{sysconf_dir} \ - scriptdir=$RPM_BUILD_ROOT%{script_dir} \ + sysconfdir=$RPM_BUILD_ROOT%{sysconf_dir} \ + scriptdir=$RPM_BUILD_ROOT%{script_dir} \ working_dir=$RPM_BUILD_ROOT%{working_dir} \ - piddir=$RPM_BUILD_ROOT%{pid_dir} \ + piddir=$RPM_BUILD_ROOT%{pid_dir} \ mandir=$RPM_BUILD_ROOT%{_mandir} \ mtx-install cd ${cwd} @@ -2017,6 +2192,7 @@ rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt %{_mandir}/man8/dbcheck.8.%{manpage_ext} %{_mandir}/man1/bsmtp.1.%{manpage_ext} %{_libdir}/libbac* + %endif %if ! %{client_only} && %{rescue} @@ -2050,24 +2226,24 @@ DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1` # are we upgrading from sqlite to sqlite3? if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite ];then echo "This version of bacula-sqlite involves an upgrade to sqlite3." - echo "Your catalog database file is not compatible with sqlite3, thus" - echo "you will need to dump the data, delete the old file, and re-run" - echo "this rpm upgrade." - echo "" - echo "Backing up your current database..." + echo "Your catalog database file is not compatible with sqlite3, thus" + echo "you will need to dump the data, delete the old file, and re-run" + echo "this rpm upgrade." + echo "" + echo "Backing up your current database..." echo ".dump" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db > %{working_dir}/bacula_backup.sql - mv %{working_dir}/bacula.db %{working_dir}/bacula.db.old - echo "Your catalog data has been saved in %{working_dir}/bacula_backup.sql and your" - echo "catalog file has been renamed %{working_dir}/bacula.db.old." - echo "" - echo "Please re-run this rpm package upgrade." - echo "After the upgrade is complete, restore your catalog" - echo "with the following commands:" - echo "%{script_dir}/drop_sqlite3_tables" - echo "cd %{working_dir}" - echo "%{sqlite_bindir}/sqlite3 $* bacula.db < bacula_backup.sql" - echo "chown bacula.bacula bacula.db" - exit 1 + mv %{working_dir}/bacula.db %{working_dir}/bacula.db.old + echo "Your catalog data has been saved in %{working_dir}/bacula_backup.sql and your" + echo "catalog file has been renamed %{working_dir}/bacula.db.old." + echo "" + echo "Please re-run this rpm package upgrade." + echo "After the upgrade is complete, restore your catalog" + echo "with the following commands:" + echo "%{script_dir}/drop_sqlite3_tables" + echo "cd %{working_dir}" + echo "%{sqlite_bindir}/sqlite3 $* bacula.db < bacula_backup.sql" + echo "chown bacula.bacula bacula.db" + exit 1 fi # test for bacula database older than version 10 and sqlite3 if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite3 ];then @@ -2084,7 +2260,7 @@ if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "10" ]; then echo "This bacula upgrade will update a bacula database from version 10 to 11." echo "You appear to be running database version $DB_VER. You must first update" echo "your database to version 10 and then install this upgrade. The alternative" - echo "is to use %{script_dir}/drop_%{db_backend}_tables to delete all your your current" + echo "is to use %{script_dir}/drop_%{db_backend}_tables to delete all your your current" echo "catalog information, then do the upgrade. Information on updating a" echo "database older than version 10 can be found in the release notes." exit 1 @@ -2098,7 +2274,7 @@ fi %if ! %{client_only} # check for and copy %{sysconf_dir}/console.conf to bconsole.conf if [ -s %{sysconf_dir}/console.conf ];then - cp -p %{sysconf_dir}/console.conf %{sysconf_dir}/bconsole.conf + cp -p %{sysconf_dir}/console.conf %{sysconf_dir}/bconsole.conf fi # create the daemon users and groups @@ -2180,11 +2356,11 @@ DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1` if [ -z "$DB_VER" ]; then echo "Hmm, doesn't look like you have an existing database." echo "Granting privileges for MySQL user bacula..." - %{script_dir}/grant_mysql_privileges + %{script_dir}/grant_mysql_privileges echo "Creating MySQL bacula database..." - %{script_dir}/create_mysql_database + %{script_dir}/create_mysql_database echo "Creating bacula tables..." - %{script_dir}/make_mysql_tables + %{script_dir}/make_mysql_tables # check to see if we need to upgrade a 2.x database elif [ "$DB_VER" -lt "11" ]; then @@ -2192,7 +2368,7 @@ elif [ "$DB_VER" -lt "11" ]; then echo "Backing up your current database..." mysqldump -f --opt bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2 echo "Upgrading bacula database ..." - %{script_dir}/update_mysql_tables + %{script_dir}/update_mysql_tables echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2" fi @@ -2208,17 +2384,17 @@ if [ -s %{working_dir}/bacula.db ]; then echo "Backing up your current database..." echo ".dump" | %{sqlite_bindir}/sqlite3 %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2 echo "Upgrading bacula database ..." - %{script_dir}/update_sqlite3_tables + %{script_dir}/update_sqlite3_tables echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2" fi else # create the database and tables echo "Hmm, doesn't look like you have an existing database." echo "Creating SQLite database..." - %{script_dir}/create_sqlite3_database - chown %{director_daemon_user}.%{daemon_group} %{working_dir}/bacula.db + %{script_dir}/create_sqlite3_database + chown %{director_daemon_user}.%{daemon_group} %{working_dir}/bacula.db echo "Creating the SQLite tables..." - %{script_dir}/make_sqlite3_tables + %{script_dir}/make_sqlite3_tables fi %endif @@ -2231,11 +2407,11 @@ DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head if [ -z "$DB_VER" ]; then echo "Hmm, doesn't look like you have an existing database." echo "Creating PostgreSQL bacula database..." - %{script_dir}/create_postgresql_database + %{script_dir}/create_postgresql_database echo "Creating bacula tables..." - %{script_dir}/make_postgresql_tables + %{script_dir}/make_postgresql_tables echo "Granting privileges for PostgreSQL user bacula..." - %{script_dir}/grant_postgresql_privileges + %{script_dir}/grant_postgresql_privileges # check to see if we need to upgrade a 2.x database elif [ "$DB_VER" -lt "11" ]; then @@ -2243,7 +2419,7 @@ elif [ "$DB_VER" -lt "11" ]; then echo "Backing up your current database..." pg_dump bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2 echo "Upgrading bacula database ..." - %{script_dir}/update_postgresql_tables + %{script_dir}/update_postgresql_tables echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2" fi @@ -2252,7 +2428,7 @@ fi %if ! %{client_only} # generate passwords if needed if [ -d %{sysconf_dir} ]; then - cd %{sysconf_dir} + cd %{sysconf_dir} for file in *.conf; do for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX; do need_password=`grep $string $file 2>/dev/null` @@ -2264,9 +2440,10 @@ if [ -d %{sysconf_dir} ]; then done done fi -/sbin/ldconfig %endif +/sbin/ldconfig + %if %{mysql} %preun mysql %endif @@ -2280,25 +2457,22 @@ fi %if ! %{client_only} # delete our links if [ $1 = 0 ]; then -/sbin/chkconfig --del bacula-dir -/sbin/chkconfig --del bacula-fd -/sbin/chkconfig --del bacula-sd + /sbin/chkconfig --del bacula-dir + /sbin/chkconfig --del bacula-fd + /sbin/chkconfig --del bacula-sd fi %endif %if %{mysql} %postun mysql -/sbin/ldconfig %endif %if %{sqlite} -%postun sqlite -/sbin/ldconfig %endif %if %{postgresql} %postun postgresql -/sbin/ldconfig %endif +/sbin/ldconfig %if ! %{client_only} && %{mtx} %files mtx @@ -2390,7 +2564,7 @@ fi # generate passwords if needed if [ -d %{sysconf_dir} ]; then - cd %{sysconf_dir} + cd %{sysconf_dir} for file in *.conf; do for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX; do need_password=`grep $string $file 2>/dev/null` @@ -2472,7 +2646,7 @@ fi %post gconsole # generate passwords if needed if [ -d %{sysconf_dir} ]; then - cd %{sysconf_dir} + cd %{sysconf_dir} for file in *.conf; do for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX; do need_password=`grep $string $file 2>/dev/null` @@ -2517,7 +2691,7 @@ fi %post wxconsole # generate passwords if needed if [ -d %{sysconf_dir} ]; then - cd %{sysconf_dir} + cd %{sysconf_dir} for file in *.conf; do for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX; do need_password=`grep $string $file 2>/dev/null` @@ -2562,7 +2736,7 @@ fi %post bat # generate passwords if needed if [ -d %{sysconf_dir} ]; then - cd %{sysconf_dir} + cd %{sysconf_dir} for file in *.conf; do for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX; do need_password=`grep $string $file 2>/dev/null` diff --git a/bacula/platforms/redhat/bsys.spec.in b/bacula/platforms/redhat/bsys.spec.in index e0525d4dba..3681888acb 100644 --- a/bacula/platforms/redhat/bsys.spec.in +++ b/bacula/platforms/redhat/bsys.spec.in @@ -1,8 +1,169 @@ # Bacula RPM spec file +# # Copyright (C) 2000-2009 Free Software Foundation Europe e.V. # Platform Build Configuration + +BuildRequires: libacl-devel + +# probems with mandriva build: + +# nothing provides libbonobo2_0-devel, nothing provides libbonoboui2_0-devel + +# set Macros by opensuse_bs, see http://en.opensuse.org/Build_Service/cross_distribution_package_how_to +#openSUSE 11.1 %if 0%{?suse_version} == 1110 +#openSUSE 11.0 %if 0%{?suse_version} == 1100 +#openSUSE 10.3 %if 0%{?suse_version} == 1030 +#openSUSE 10.2 %if 0%{?suse_version} == 1020 +#SUSE Linux 10.1 %if 0%{?suse_version} == 1010 +#SUSE Linux 10.0 %if 0%{?suse_version} == 1000 +#SUSE Linux 9.3 %if 0%{?suse_version} == 930 +#SLES 9 %if 0%{?sles_version} == 9 also set: %if 0%{?suse_version} == 910 +#SLE 10 %if 0%{?sles_version} == 10 also set: %if 0%{?suse_version} == 1010 +#SLE 11 %if 0%{?sles_version} == 11 also set: %if 0%{?suse_version} == 1110 +#CentOS 5 %if 0%{?centos_version} == 501 +#RHEL 4 %if 0%{?rhel_version} == 406 +#RHEL 5 %if 0%{?rhel_version} == 501 +#Fedora 6 with Extras %if 0%{?fedora_version} == 6 +#Fedora 7 with Extras %if 0%{?fedora_version} == 7 +#Fedora 8 with Extras %if 0%{?fedora_version} == 8 +#Fedora 9 with Extras %if 0%{?fedora_version} == 9 +#Fedora 10 with Extras %if 0%{?fedora_version} == 10 +#Mandriva 2006 %if 0%{?mandriva_version} == 2006 +#Mandriva 2007 %if 0%{?mandriva_version} == 2007 +#Mandriva 2008 %if 0%{?mandriva_version} == 2008 + + +%if 0%{?opensuse_bs} +# am I running in opensuse build service? +# TODO: seems to make problems + +# choose database backend here +# postgres, mysql, sqlite +%define build_postgresql 1 + +# Build Service: Determine Distribution + +%ifarch x86_64 + %define build_x86_64 1 +%endif + + +%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version} +BuildRequires: GConf2-devel +BuildRequires: freetype-devel +BuildRequires: libtermcap-devel +BuildRequires: shadow-utils +%endif + + + + +%if 0%{?mandriva_version} == 2007 +%define build_mdv 1 +%define _dist "Mandriva 2007" +# %define gconsole 0 +%endif + +%if 0%{?fedora_version} == 8 +%define build_fc8 1 +%define _dist "Fedora Core 8" +BuildRequires: redhat-release +%endif + +%if 0%{?fedora_version} == 9 +%define build_fc9 1 +%define _dist "Fedora Core 9" +BuildRequires: redhat-release +%endif + + +%if 0%{?fedora_version} == 10 +%define build_fc9 1 +%define _dist "Fedora Core 10" +BuildRequires: PolicyKit-gnome +BuildRequires: fedora-release +%endif + +%if 0%{?fedora_version} == 11 +%define build_fc9 1 +%define _dist "Fedora Core 11" +BuildRequires: PolicyKit-gnome +BuildRequires: fedora-release +%endif + + + + +%if 0%{?rhel_version} == 501 +%define build_rhel5 1 +%define _dist "Red Hat Enterprise Linux Server release 5" +BuildRequires: redhat-release +%endif + +%if 0%{?rhel_version} == 406 +%define build_rhel4 1 +%define _dist "Red Hat Enterprise Linux Server release 4" +BuildRequires: redhat-release +%endif + + +%if 0%{?centos_version} == 501 +%define build_centos5 1 +%define _dist "CentOS 5" +BuildRequires: redhat-release +%endif + + +%if 0%{?suse_version} == 1020 +%define build_su102 1 +%define _dist "OpenSUSE 10.2" +BuildRequires: suse-release +%endif + + +%if 0%{?suse_version} == 1030 +%define build_su103 1 +%define _dist "OpenSUSE 10.3" +BuildRequires: suse-release +%endif + +%if 0%{?suse_version} == 1100 +%define build_su110 1 +%define _dist "SUSE 11" +BuildRequires: suse-release +%endif + + +%if 0%{?suse_version} == 1110 +%define build_su111 1 +%define _dist "SUSE 11" +%endif + + +%if 0%{?sles_version} == 9 +%define build_su9 1 +%define _dist "SLES 9" +%endif + + +%if 0%{?sles_version} == 10 +%define build_su10 1 +%define _dist "SLE 10" +%endif + + +%if 0%{?sles_version} == 11 +%define build_su111 1 +%define _dist "SLES 11" +%endif + + + +%endif +# opensuse-bs? + # basic defines for every build %define _version @VERSION@ %define _release 1 @@ -240,6 +401,24 @@ exit 1 %if %{mdk} %define _dist %(grep Mand /etc/mandrake-release) %endif + +# opensuse build service start +%if 0%{?sles_version} == 9 +%define _dist "SLES 9" +%endif + +%if 0%{?sles_version} == 10 +%define _dist "SLE 10" +%endif + + +%if 0%{?sles_version} == 11 +%define _dist "SLE 11" +%endif + +# opensuse build service end + +%{?DISTNAME:%define _dist %{DISTNAME}} Distribution: %{_dist} # Should we build gconsole, possible only if gtk= >= 2.4 available. @@ -302,14 +481,11 @@ Distribution: %{_dist} %define wxconsole 0 %endif -%{expand: %%define gccver %(rpm -q --queryformat %%{version} gcc)} -%{expand: %%define gccrel %(rpm -q --queryformat %%{release} gcc)} - -#BuildRequires: libattr-devel for 3.0 +BuildRequires: libattr-devel BuildRequires: libacl-devel BuildRequires: gcc, gcc-c++, make, autoconf BuildRequires: ncurses-devel, perl -BuildRequires: libstdc++-devel = %{gccver}-%{gccrel}, libxml2-devel, zlib-devel +BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel BuildRequires: openssl-devel %if %{python} BuildRequires: python, python-devel diff --git a/bacula/technotes b/bacula/technotes index d627070125..b3ba6750da 100644 --- a/bacula/technotes +++ b/bacula/technotes @@ -2,6 +2,8 @@ General: +26Jul09 +kes Tweak RedHat spec files 24Jul09 kes Add format to a fprintf kes Attempt to fix SQLite seg fault problem -- 2.39.5