]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/platforms/rpms/redhat/bacula.spec.in
Tweak bacula.spec.in
[bacula/bacula] / bacula / platforms / rpms / redhat / bacula.spec.in
index 0375caf17c4308081c3cc46cb9880f83e39f642b..a158d43a99f360ef5d92b022864dd927bc3f03f1 100644 (file)
@@ -1,3 +1,4 @@
+#
 # Bacula RPM spec file
 #
 
@@ -33,7 +34,6 @@
 %{?single_dir_install:%define single_dir 1}
 
 # Installation Directory locations
-%if %{single_dir}
 %define _prefix        /opt/bacula
 %define _sbindir       /opt/bacula/bin
 %define _bindir        /opt/bacula/bin
 %define plugin_dir     /opt/bacula/plugins
 %define lib_dir        /opt/bacula/lib
 %define log_dir        /opt/bacula/log
-%else
-%define _prefix        /usr
-%define _sbindir       %_prefix/sbin
-%define _bindir        %_prefix/bin
-%define _subsysdir     /var/lock/subsys
-%define sqlite_bindir %_libdir/bacula/sqlite
-%define _mandir        %_prefix/share/man
-%define sysconf_dir    /etc/bacula
-%define script_dir     %_libdir/bacula
-%define working_dir    /var/lib/bacula
-%define pid_dir        /var/run
-%define plugin_dir     %_libdir/bacula/plugins
-%define lib_dir        %_libdir/bacula/lib
-%define log_dir        %_libdir/bacula/log
-%endif
-
 %define systemd_dir    /lib/systemd/system
 
 # Daemon user:group Don't change them unless you know what you are doing
@@ -105,11 +89,7 @@ Prefix: %{_prefix}
 # what happens if the release is not 1? DSB
 Source0: http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.tar.gz
 Source1: http://www.prdownloads.sourceforge.net/bacula/%{product}-%{version}.tar.gz
-%if 0%{?opensuse_bs}
-Source2: Release_Notes-%{version}-1.tar.gz
-%else
 Source2: Release_Notes-%{version}-%{release}.tar.gz
-%endif
 
 # define the basic package description
 %define blurb Bacula - The Leading Open Source Backup Solution.
@@ -228,7 +208,7 @@ Source2: Release_Notes-%{version}-%{release}.tar.gz
 # if the platform is using systemd
 %define usesystemd 0
 
-%if %{rhel7} || %{fc22}
+%if %{rhel7} || %{fc22} || %{centos7}
 %define usesystemd 1
 %endif
 
@@ -313,7 +293,10 @@ exit 1
 %if %{fc16} || %{fc17} || %{fc18} || %{fc22}
 %define _dist %(grep Fedora /etc/redhat-release)
 %endif
-%if %{centos7} || %{centos6} || %{centos5} || %{centos4} || %{centos3}
+%if %{centos7} || %{centos6}
+%define _dist %(grep CentOS /etc/redhat-release)
+%endif
+%if %{centos5} || %{centos4} || %{centos3}
 %define _dist %(grep CentOS /etc/redhat-release)
 %endif
 %if %{sl5} ||%{sl4} || %{sl3}
@@ -328,32 +311,8 @@ exit 1
 %if %{mdk}
 %define _dist %(grep Mand /etc/mandrake-release)
 %endif
-%if %{rhat} || %{rhel}
-%define _dist %(grep Red /etc/redhat-release)
-%endif
-%{?DISTNAME:%define _dist %{DISTNAME}}
-
-# only set Disribution if not in opensuse build service, as it sets it itself
-%if ! 0%{?opensuse_bs}
-Distribution: %{_dist}
-%endif
 
-%if 0%{?opensuse_bs} &&  %{mysql} && %{suse}
-# needed in opensuse_bs, as rpm is installed during build process
-BuildRequires: libmysqlclient-devel
-BuildRequires: mysql-client
-BuildRequires: mysql
-%endif
-%if 0%{?opensuse_bs} &&  %{suse} && %{postgresql}
-BuildRequires: %{postgres_package}
-BuildRequires: %{postgres_server_package}
-%endif
-BuildRequires: openssl
-
-%if 0%{?opensuse_bs} && %{suse}
-BuildRequires: pwdutils
-BuildRequires: sysconfig
-%endif
+Distribution: %_dist
 
 # should we turn on python support
 %define python 0
@@ -428,8 +387,15 @@ BuildRequires: %{postgres_devel_package} >= %{postgres_version}
 %{blurb7}
 %{blurb8}
 
+#
+# ===========================================================
+# Generate mysql, sqlite, or postgresql rpm
+# ===========================================================
+#
 %if %{mysql}
 %package mysql
+Provides: Perl
+Provides: libbaccats.so
 %endif
 %if %{sqlite}
 %package sqlite
@@ -501,6 +467,13 @@ This build includes python scripting support.
 This build includes tcp-wrappers support.
 %endif
 
+
+
+#
+# ===========================================================
+# Client -- bacula-fd rpm
+# ===========================================================
+#
 %package client
 Summary: Bacula - The Network Backup Solution
 Group: System Environment/Daemons
@@ -541,6 +514,11 @@ This build includes python scripting support.
 This build includes tcp-wrappers support.
 %endif
 
+#
+# ===========================================================
+# Generate updatedb rpm
+# ===========================================================
+#
 %if ! %{client_only}
 %package updatedb
 
@@ -562,6 +540,11 @@ This package installs scripts for updating older versions of the bacula
 database.
 %endif
 
+#
+# ===========================================================
+# Generate libs rpm
+# ===========================================================
+#
 %package libs
 
 Summary: Bacula - The Network Backup Solution
@@ -668,9 +651,6 @@ export BACULA="Bacula"
 %if %{mysql}
         --with-mysql \
 %endif
-%if %{sqlite}
-        --with-sqlite3=${cwd}/%{depkgs}/sqlite3 \
-%endif
 %if %{postgresql}
         --with-postgresql \
 %endif
@@ -740,7 +720,7 @@ rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-bwxconsole.1.%{manpage_ext}
 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-tray-monitor.1.%{manpage_ext}
 rm -f $RPM_BUILD_ROOT%{script_dir}/gconsole
 
-# Remove docs for programs only included in bee
+# Remove docs for programs we do not distribute
 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bpluginfo.8.%{manpage_ext}
 
 # Storage-ctl packaged in shstore rpm
@@ -805,10 +785,6 @@ cp -p updatedb/* $RPM_BUILD_ROOT%{script_dir}/updatedb/
 
 # install specific scripts
 
-# install special upgrade script, except for sqlite3
-%if ! %{sqlite}
-%endif
-
 %if ! %{client_only}
 # install the sample-query.sql file
 cp -p examples/sample-query.sql $RPM_BUILD_ROOT%{script_dir}/sample-query.sql
@@ -859,11 +835,7 @@ rm -f $RPM_BUILD_ROOT%{_sbindir}/bacula
 
 %clean
 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
-%if 0%{?opensuse_bs}
-rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-1.txt
-%else
 rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt
-%endif
 
 
 %if %{mysql}
@@ -880,23 +852,6 @@ rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt
 %{_libdir}/libbacsql*
 %endif
 
-%if %{sqlite}
-%files sqlite
-%defattr(-,root,root)
-%attr(-, root, %{daemon_group}) %{script_dir}/create_sqlite3_database
-%attr(-, root, %{daemon_group}) %{script_dir}/drop_sqlite3_database
-%attr(-, root, %{daemon_group}) %{script_dir}/grant_sqlite3_privileges
-%attr(-, root, %{daemon_group}) %{script_dir}/make_sqlite3_tables
-%attr(-, root, %{daemon_group}) %{script_dir}/drop_sqlite3_tables
-%attr(-, root, %{daemon_group}) %{script_dir}/update_sqlite3_tables
-%{sqlite_bindir}/libsqlite3.a
-%{sqlite_bindir}/sqlite3.h
-%{sqlite_bindir}/sqlite3
-%{_libdir}/libbaccats*
-%{_libdir}/libbacsql*
-%endif
-
-
 
 %if %{postgresql}
 %files postgresql
@@ -916,7 +871,6 @@ rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt
 %if ! %{client_only}
 %attr(-, root, %{daemon_group}) %dir %{script_dir}
 %attr(-, root, %{daemon_group}) %dir %{sysconf_dir}
-#%attr(-, %{director_daemon_user}, %{daemon_group}) %dir %{log_dir}
 %attr(-, root, %{daemon_group}) %{script_dir}/bacula
 %attr(-, root, %{daemon_group}) %{script_dir}/bacula_config
 %attr(-, root, %{daemon_group}) %{script_dir}/bconsole
@@ -937,11 +891,8 @@ rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt
 %attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-fd
 %attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-sd
 %attr(-, root, %{daemon_group}) %{plugin_dir}/bpipe-fd.so
-#%attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir
-#%attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd
 %attr(-, root, %{daemon_group}) %{_sbindir}/dbcheck
 %attr(-, root, %{storage_daemon_group}) %{script_dir}/dvd-handler
-#%attr(-, root, %{storage_daemon_group}) /etc/init.d/bacula-sd
 %attr(-, root, %{storage_daemon_group}) %{script_dir}/mtx-changer
 %attr(-, root, %{storage_daemon_group}) %config(noreplace) %{script_dir}/mtx-changer.conf
 
@@ -965,6 +916,7 @@ rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt
 %attr(-, root, %{daemon_group}) %config(noreplace) %{logwatch_dir}/conf/logfiles/bacula.conf
 %attr(-, root, %{daemon_group}) %config(noreplace) %{logwatch_dir}/conf/services/bacula.conf
 %attr(-, root, %{daemon_group}) %{script_dir}/sample-query.sql
+%attr(-, root, %{daemon_group}) %{script_dir}/query.sql
 
 %attr(-, %{storage_daemon_user}, %{daemon_group}) %dir %{working_dir}
 
@@ -1001,15 +953,10 @@ rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt
 %{_mandir}/man8/bwild.8.%{manpage_ext}
 %{_mandir}/man1/bsmtp.1.%{manpage_ext}
 %{_mandir}/man1/bat.1.%{manpage_ext}
-
 %_prefix/share/doc/*
 
-# opensuse build service changes the release itself
-%if 0%{?opensuse_bs}
-%doc ../Release_Notes-%{version}-1.txt
-%else
 %doc ../Release_Notes-%{version}-%{release}.txt
-%endif
+
 %endif
 
 %if %{mysql}
@@ -1310,12 +1257,10 @@ fi
 %defattr(-,root,root)
 %attr(-, root, %{daemon_group}) %dir %{script_dir}
 %attr(-, root, %{daemon_group}) %dir %{plugin_dir}
-#%attr(-, root, %{daemon_group}) %dir %{log_dir}
 %attr(-, root, %{daemon_group}) %dir %{sysconf_dir}
 
 # SD/DIR might write here
 %attr(-, %{storage_daemon_user}, %{daemon_group}) %dir %{log_dir}
-#%attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-fd
 
 %if %{usesystemd}
 %attr(-, root, %{daemon_group})  %{systemd_dir}/bacula-fd.service
@@ -1421,8 +1366,6 @@ exit 0
 %files updatedb
 %defattr(-,root,%{daemon_group})
 %{script_dir}/updatedb/*
-#oensuse_bs: directories not owned by any package
-#%{script_dir}/updatedb
 
 %pre updatedb
 # create the daemon group