+#
# Bacula RPM spec file
#
%{?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
# 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.
%{?build_centos5:%define fc6 1}
%define centos6 0
%{?build_centos6:%define centos6 1}
+%define centos7 0
+%{?build_centos7:%define centos7 1}
# SL build
%define sl3 0
%{?build_sl3:%define sl3 1}
%define suse 1
%endif
%define rhel 0
-%if %{rhel3} || %{rhel4} || %{rhel5} || %{rhel6} || %{rhel7} || %{centos3} || %{centos4} || %{centos5} || %{centos6}
+%if %{rhel3} || %{rhel4} || %{rhel5} || %{rhel6} || %{rhel7} || %{centos3} || %{centos4} || %{centos5} || %{centos6} || %{centos7}
%define rhel 1
%endif
%define scil 0
%if %{fc16} || %{fc17} || %{fc18} || %{fc22}
%define _dist %(grep Fedora /etc/redhat-release)
%endif
+%if %{centos7} || %{centos6}
+%define _dist %(grep CentOS /etc/redhat-release)
+%endif
%if %{centos5} || %{centos4} || %{centos3}
%define _dist %(grep CentOS /etc/redhat-release)
%endif
%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
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
cp -p platforms/suse/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
cp -p platforms/suse/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
cp -p platforms/suse/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
-%endif # suse
+%endif # suse
%if %{mdk}
cp -p platforms/mandrake/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
cp -p platforms/mandrake/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
cp -p platforms/mandrake/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
-%endif # mdk
+%endif # mdk
%if ! %{suse} && ! %{mdk}
cp -p platforms/redhat/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
cp -p platforms/redhat/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
cp -p platforms/redhat/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
-%endif # !suse && !mdk
+%endif # !suse && !mdk
chmod 0754 $RPM_BUILD_ROOT/etc/init.d/*
-%endif # ! usesystemd
+%endif # ! usesystemd
%if %{client_only}
rm -f $RPM_BUILD_ROOT/etc/init.d/bacula-dir
%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}
%_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}
%pre mysql