]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/platforms/mandrake/bacula.spec.in
This commit was manufactured by cvs2svn to create tag
[bacula/bacula] / bacula / platforms / mandrake / bacula.spec.in
index 9a3626be75372740a3ecbb9fa08c1979d64d2e08..f0fa1a5dfa8b4a77555df21ff292a6c9ea4e7e4a 100644 (file)
@@ -5,7 +5,7 @@
 
 # basic defines for every build
 %define depkgs ../depkgs
-%define depkgs_version 22Jun05
+%define depkgs_version 28Mar06
 %define sqlite_bindir /usr/lib/bacula/sqlite
 %define working_dir /var/bacula
 %define director_daemon_user bacula
@@ -18,7 +18,8 @@
 %define group_file /etc/group
 %define useradd /usr/sbin/useradd
 %define groupadd /usr/sbin/groupadd
-%define _rescuever 1.8.2
+%define usermod /usr/sbin/usermod
+%define _rescuever 1.8.3
 
 # platform defines - set one below or define the build_xxx on the command line
 # RedHat builds
@@ -34,7 +35,7 @@
 %define fc3 0
 %{?build_fc3:%define fc3 1}
 %define fc4 0
-%{?build_fc4:%define fc3 1}
+%{?build_fc4:%define fc4 1}
 # Whitebox Enterprise build
 %define wb3 0
 %{?build_wb3:%define wb3 1}
@@ -46,6 +47,9 @@
 %{?build_rhel4:%define rhel4 1}
 %{?build_rhel4:%define fc3 1}
 # CentOS build
+%define centos3 0
+%{?build_centos3:%define centos3 1}
+%{?build_centos3:%define wb3 1}
 %define centos4 0
 %{?build_centos4:%define centos4 1}
 %{?build_centos4:%define fc3 1}
@@ -59,7 +63,7 @@
 %{?build_mdk:%define mdk 1}
 
 # test for a platform definition
-%if ! %{rh7} && ! %{rh8} && ! %{rh9} && ! %{fc1} && ! %{fc3} && ! %{wb3} && ! %{su9} && ! %{su10} && ! %{mdk}
+%if ! %{rh7} && ! %{rh8} && ! %{rh9} && ! %{fc1} && ! %{fc3} && ! %{fc4} && ! %{wb3} && ! %{su9} && ! %{su10} && ! %{mdk}
 %{error: You must specify a platform. Please examine the spec file.}
 exit 1
 %endif
@@ -102,23 +106,23 @@ exit 1
 %if %{rh7} || %{rh8} || %{rh9} || %{rhel3} || %{rhel4}
 %define _dist %(grep Red /etc/redhat-release)
 %endif
-%if %{fc1}
+%if %{fc1} || %{fc4}
 %define _dist %(grep Fedora /etc/redhat-release)
 %endif
-%if %{centos4}
+%if %{centos4} || %{centos3}
 %define _dist %(grep CentOS /etc/redhat-release)
 %endif
 %if %{fc3} && ! %{rhel4} && ! %{centos4}
 %define _dist %(grep Fedora /etc/redhat-release)
 %endif
-%if %{wb3} && ! %{rhel3}
+%if %{wb3} && ! %{rhel3} && ! %{centos3}
 %define _dist %(grep White /etc/whitebox-release)
 %endif
 %if %{su9} || %{su10}
 %define _dist %(grep -i SuSE /etc/SuSE-release)
 %endif
 %if %{mdk}
-%define _dist %(grep Mandrake /etc/mandrake-release)
+%define _dist %(grep Mand /etc/mandrake-release)
 %endif
 
 # Should we build gconsole, possible only if gnome >= 2.0 available
@@ -127,6 +131,8 @@ exit 1
 %else
 %define gconsole 1
 %endif
+# specifically disallow gconsole if desired
+%{?nobuild_gconsole:%define gconsole 0}
 
 Summary: Bacula - The Network Backup Solution
 Name: bacula
@@ -139,6 +145,8 @@ Source1:http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.t
 Source2: Release_Notes-%{version}-%{release}.tar.gz
 Source3:http://www.prdownloads.sourceforge.net/bacula/%{name}-docs-%{version}.tar.gz
 Source4:http://www.prdownloads.sourceforge.net/bacula/%{name}-rescue-%{_rescuever}.tar.gz
+Patch0: bacula-1.38.6-script.patch
+Patch1: bacula-1.38.6-makefile.patch
 BuildRoot: %{_tmppath}/%{name}-root
 URL: http://www.bacula.org/
 Vendor: The Bacula Team
@@ -149,19 +157,23 @@ Packager: D. Scott Barninger <barninger@fairfieldcomputers.com>
 %define _rescuesrc ../%{name}-rescue-%{_rescuever}
 
 BuildRequires: atk-devel, ncurses-devel, pango-devel, perl
-BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel, pkgconfig
+BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel
 BuildRequires: openssl-devel
+%if %{gconsole}
+BuildRequires: pkgconfig
+%endif
 %if %{rh7}
 BuildRequires: libtermcap-devel
 BuildRequires: glibc-devel >= 2.2
-BuildRequires: ORBit-devel
 %endif
 %if %{su9}
 BuildRequires: termcap
+BuildRequires: glibc-devel >= 2.3
+%endif
+%if %{su9} && %{gconsole}
 BuildRequires: libgnome >= 2.0
 BuildRequires: gtk2-devel >= 2.0
 BuildRequires: libgnomeui-devel >= 2.0
-BuildRequires: glibc-devel >= 2.3
 BuildRequires: ORBit2-devel
 BuildRequires: libart_lgpl-devel >= 2.0
 BuildRequires: libbonobo-devel >= 2.0
@@ -173,10 +185,12 @@ BuildRequires: freetype2-devel
 %endif
 %if %{su10}
 BuildRequires: termcap
+BuildRequires: glibc-devel >= 2.3
+%endif
+%if %{su10} && %{gconsole}
 BuildRequires: libgnome >= 2.12
 BuildRequires: gtk2-devel >= 2.8
 BuildRequires: libgnomeui-devel >= 2.12
-BuildRequires: glibc-devel >= 2.3
 BuildRequires: ORBit2-devel
 BuildRequires: libart_lgpl-devel >= 2.3
 BuildRequires: libbonobo-devel >= 2.10
@@ -191,24 +205,43 @@ BuildRequires: libpng-devel
 %endif
 %if %{mdk}
 BuildRequires: libtermcap-devel
+BuildRequires: libstdc++-static-devel
+BuildRequires: glibc-static-devel
+BuildRequires: glibc-devel >= 2.3
+%endif
+%if %{mdk} && %{gconsole}
 BuildRequires: gtk2-devel >= 2.0
 BuildRequires: libgnomeui2-devel >= 2.0
-BuildRequires: glibc-devel >= 2.3
 BuildRequires: libORBit2-devel
 BuildRequires: libart_lgpl-devel >= 2.0
 BuildRequires: libbonobo2_0-devel
 BuildRequires: libbonoboui2_0-devel
 BuildRequires: libbonobo-activation-devel
 BuildRequires: libGConf2-devel
-BuildRequires: libstdc++-static-devel
-BuildRequires: glibc-static-devel
 BuildRequires: freetype2-devel
 %endif
 %if %{fc3}
 BuildRequires: libtermcap-devel
+BuildRequires: glibc-devel >= 2.3
+%endif
+%if %{fc3} && %{gconsole}
 BuildRequires: gtk2-devel >= 2.4
 BuildRequires: libgnomeui-devel >= 2.8
+BuildRequires: ORBit2-devel
+BuildRequires: libart_lgpl-devel >= 2.3
+BuildRequires: libbonobo-devel >= 2.8
+BuildRequires: libbonoboui-devel >= 2.8
+BuildRequires: bonobo-activation-devel
+BuildRequires: GConf2-devel
+BuildRequires: freetype-devel
+%endif
+%if %{fc4}
+BuildRequires: libtermcap-devel
 BuildRequires: glibc-devel >= 2.3
+%endif
+%if %{fc4} && %{gconsole}
+BuildRequires: gtk2-devel >= 2.6
+BuildRequires: libgnomeui-devel >= 2.10
 BuildRequires: ORBit2-devel
 BuildRequires: libart_lgpl-devel >= 2.3
 BuildRequires: libbonobo-devel >= 2.8
@@ -217,11 +250,13 @@ BuildRequires: bonobo-activation-devel
 BuildRequires: GConf2-devel
 BuildRequires: freetype-devel
 %endif
-%if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3}
+%if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4}
 BuildRequires: libtermcap-devel
+BuildRequires: glibc-devel >= 2.3
+%endif
+%if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} && %{gconsole}
 BuildRequires: gtk2-devel >= 2.0
 BuildRequires: libgnomeui-devel >= 2.0
-BuildRequires: glibc-devel >= 2.3
 BuildRequires: ORBit2-devel
 BuildRequires: libart_lgpl-devel >= 2.0
 BuildRequires: libbonobo-devel >= 2.0
@@ -485,7 +520,19 @@ Requires: bonobo-activation
 Requires: GConf2
 Requires: freetype
 %endif
-%if %{gconsole} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3}
+%if %{gconsole} && %{fc4}  
+Requires: gtk2 >= 2.6
+Requires: libgnomeui >= 2.10
+Requires: glibc >= 2.3
+Requires: ORBit2
+Requires: libart_lgpl >= 2.3
+Requires: libbonobo >= 2.8
+Requires: libbonoboui >= 2.8
+Requires: bonobo-activation
+Requires: GConf2
+Requires: freetype
+%endif
+%if %{gconsole} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4}
 Requires: gtk2 >= 2.0
 Requires: libgnomeui >= 2.0
 Requires: glibc >= 2.3
@@ -532,6 +579,9 @@ server packages.
 %setup -T -D -b 3
 %setup -T -D -b 4
 
+%patch0
+%patch1 -p1
+
 %build
 
 %if %{su9} || %{su10}
@@ -585,6 +635,9 @@ export LDFLAGS=-L/usr/lib64/mysql
         --with-scriptdir=/etc/bacula \
         --enable-smartalloc \
         --enable-client-only \
+        %if %{mdk}
+        --disable-nls \
+        %endif
         --enable-static-fd
 
 make
@@ -684,6 +737,11 @@ rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
 %endif
 
+# fixme - make installs gconsole script for build without gconsole
+%if ! %{gconsole}
+rm -f $RPM_BUILD_ROOT/etc/bacula/gconsole
+%endif
+
 rm -f $RPM_BUILD_ROOT/usr/sbin/static-bacula-fd
 
 # install the init scripts
@@ -717,7 +775,7 @@ cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/b
 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
 %endif
-%if %{rh8} || %{rh9} || %{wb3} || %{fc1} || %{fc3} || %{mdk}
+%if %{rh8} || %{rh9} || %{wb3} || %{fc1} || %{fc3} || %{fc4} || %{mdk}
 %define iftrick 1
 %else
 %define iftrick 0
@@ -832,6 +890,10 @@ chmod 644 $RPM_BUILD_ROOT/etc/bacula/tray-monitor.conf
 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.dbx
 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.gdb
 %attr(-, root, %{daemon_group}) /etc/bacula/rescue
+%attr(-, root, %{daemon_group}) /etc/bacula/disk-changer
+%attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-dir
+%attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-fd
+%attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-sd
 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir
 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd
 %attr(-, root, %{storage_daemon_group}) /etc/bacula/dvd-handler
@@ -903,7 +965,8 @@ if [ -s /etc/bacula/console.conf ];then
         cp -p /etc/bacula/console.conf /etc/bacula/bconsole.conf
 fi
 
-# create the daemon user and group
+# create the daemon users and groups
+# first create the groups if they don't exist
 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
 if [ -z "$HAVE_BACULA" ]; then
         %{groupadd} -r %{daemon_group} > /dev/null 2>&1
@@ -916,24 +979,41 @@ if [ -z "$HAVE_BACULA" ]; then
         echo "The group %{storage_daemon_group} has been added to %{group_file}."
         echo "See the manual chapter \"Running Bacula\" for details."
 fi
+# now create the users if they do not exist
+# we do not use the -g option allowing the primary group to be set to system default
+# this will be a unique group on redhat type systems or the group users on some systems
 HAVE_BACULA=`grep %{storage_daemon_user} %{user_file} 2>/dev/null`
 if [ -z "$HAVE_BACULA" ]; then
-        %{useradd} -r -c "Bacula" -d %{working_dir} -g %{storage_daemon_group} -M -n -s /sbin/nologin %{storage_daemon_user} > /dev/null 2>&1
+        %{useradd} -r -c "Bacula" -d %{working_dir} -M -n -s /sbin/nologin %{storage_daemon_user} > /dev/null 2>&1
         echo "The user %{storage_daemon_user} has been added to %{user_file}."
         echo "See the manual chapter \"Running Bacula\" for details."
 fi
 HAVE_BACULA=`grep %{director_daemon_user} %{user_file} 2>/dev/null`
 if [ -z "$HAVE_BACULA" ]; then
-        %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -n -s /sbin/nologin %{director_daemon_user} > /dev/null 2>&1
+        %{useradd} -r -c "Bacula" -d %{working_dir} -M -n -s /sbin/nologin %{director_daemon_user} > /dev/null 2>&1
         echo "The user %{director_daemon_user} has been added to %{user_file}."
         echo "See the manual chapter \"Running Bacula\" for details."
 fi
 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
 if [ -z "$HAVE_BACULA" ]; then
-        %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -n -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
+        %{useradd} -r -c "Bacula" -d %{working_dir} -M -n -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
         echo "The user %{file_daemon_user} has been added to %{user_file}."
         echo "See the manual chapter \"Running Bacula\" for details."
 fi
+# now we add the supplementary groups, this is ok to call even if the users already exist
+# we only do this if the user is NOT root
+IS_ROOT=%{director_daemon_user}
+if [ "$IS_ROOT" != "root" ]; then
+%{usermod} %{director_daemon_user} -G %{daemon_group}
+fi
+IS_ROOT=%{storage_daemon_user}
+if [ "$IS_ROOT" != "root" ]; then
+%{usermod} %{storage_daemon_user} -G %{daemon_group},%{storage_daemon_group}
+fi
+IS_ROOT=%{file_daemon_user}
+if [ "$IS_ROOT" != "root" ]; then
+%{usermod} %{file_daemon_user} -G %{daemon_group}
+fi
 
 %if %{mysql}
 %post mysql
@@ -1102,12 +1182,20 @@ if [ -z "$HAVE_BACULA" ]; then
         echo "The group %{daemon_group} has been added to %{group_file}."
         echo "See the manual chapter \"Running Bacula\" for details."
 fi
+# we do not use the -g option allowing the primary group to be set to system default
+# this will be a unique group on redhat type systems or the group users on some systems
 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
 if [ -z "$HAVE_BACULA" ]; then
-        %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -n -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
+        %{useradd} -r -c "Bacula" -d %{working_dir} -M -n -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
         echo "The user %{file_daemon_user} has been added to %{user_file}."
         echo "See the manual chapter \"Running Bacula\" for details."
 fi
+# now we add the supplementary group, this is ok to call even if the user already exists
+# we only do this if the user is NOT root
+IS_ROOT=%{file_daemon_user}
+if [ "$IS_ROOT" != "root" ]; then
+%{usermod} %{file_daemon_user} -G %{daemon_group}
+fi
 
 %post client
 # add our link
@@ -1208,6 +1296,15 @@ fi
 %endif
 
 %changelog
+* Sun Apr 02 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- 1.38.6 release
+- fix problem specifying more than one primary group for user bacula
+- add build switch to not build gconsole regardless of platform
+* Sun Jan 29 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add centos3 build tag
+- fix link error of static-fd on Mandrake with --disable-nls
+* Fri Jan 27 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add fc4 dependencies
 * Mon Jan 23 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
 - add SuSE 10.0 build
 - remove specific permission in attrib macros