Add F18 systemd macros and refresh distro checks
This commit is contained in:
parent
0462b22387
commit
2529f6ce9d
90
bacula.spec
90
bacula.spec
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
Name: bacula
|
Name: bacula
|
||||||
Version: 5.2.10
|
Version: 5.2.10
|
||||||
Release: 6%{?dist}
|
Release: 7%{?dist}
|
||||||
Summary: Cross platform network backup for Linux, Unix, Mac and Windows
|
Summary: Cross platform network backup for Linux, Unix, Mac and Windows
|
||||||
# See LICENSE for details
|
# See LICENSE for details
|
||||||
License: AGPLv3 with exceptions
|
License: AGPLv3 with exceptions
|
||||||
@ -54,17 +54,17 @@ BuildRequires: readline-devel
|
|||||||
BuildRequires: sqlite-devel
|
BuildRequires: sqlite-devel
|
||||||
BuildRequires: zlib-devel
|
BuildRequires: zlib-devel
|
||||||
|
|
||||||
%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6
|
%if 0%{?fedora} || 0%{?rhel} >= 6
|
||||||
BuildRequires: qt4-devel >= 4.6.2
|
BuildRequires: qt4-devel >= 4.6.2
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if 0%{?fedora} >= 7 || 0%{?rhel} >= 6
|
%if 0%{?fedora} || 0%{?rhel} >= 6
|
||||||
BuildRequires: tcp_wrappers-devel
|
BuildRequires: tcp_wrappers-devel
|
||||||
%else
|
%else
|
||||||
BuildRequires: tcp_wrappers
|
BuildRequires: tcp_wrappers
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if 0%{?fedora} >= 15 || 0%{?rhel} > 6
|
%if 0%{?fedora} || 0%{?rhel} > 6
|
||||||
BuildRequires: systemd-units
|
BuildRequires: systemd-units
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ Provides: bacula-director-sqlite = %{version}-%{release}
|
|||||||
Obsoletes: bacula-director-sqlite < 5.2.3-5
|
Obsoletes: bacula-director-sqlite < 5.2.3-5
|
||||||
Provides: bacula-director-postgresql = %{version}-%{release}
|
Provides: bacula-director-postgresql = %{version}-%{release}
|
||||||
Obsoletes: bacula-director-postgresql < 5.2.3-5
|
Obsoletes: bacula-director-postgresql < 5.2.3-5
|
||||||
%if 0%{?fedora} >= 15 || 0%{?rhel} > 6
|
%if 0%{?fedora} || 0%{?rhel} > 6
|
||||||
Requires(post): systemd-sysv
|
Requires(post): systemd-sysv
|
||||||
Requires(post): systemd-units
|
Requires(post): systemd-units
|
||||||
Requires(preun): systemd-units
|
Requires(preun): systemd-units
|
||||||
@ -174,7 +174,7 @@ Provides: bacula-storage-sqlite = %{version}-%{release}
|
|||||||
Obsoletes: bacula-storage-sqlite < 5.2.0
|
Obsoletes: bacula-storage-sqlite < 5.2.0
|
||||||
Provides: bacula-storage-postgresql = %{version}-%{release}
|
Provides: bacula-storage-postgresql = %{version}-%{release}
|
||||||
Obsoletes: bacula-storage-postgresql < 5.2.0
|
Obsoletes: bacula-storage-postgresql < 5.2.0
|
||||||
%if 0%{?fedora} >= 15 || 0%{?rhel} > 6
|
%if 0%{?fedora} || 0%{?rhel} > 6
|
||||||
Requires(post): systemd-sysv
|
Requires(post): systemd-sysv
|
||||||
Requires(post): systemd-units
|
Requires(post): systemd-units
|
||||||
Requires(preun): systemd-units
|
Requires(preun): systemd-units
|
||||||
@ -200,7 +200,7 @@ devices.
|
|||||||
Summary: Bacula backup client
|
Summary: Bacula backup client
|
||||||
Group: System Environment/Daemons
|
Group: System Environment/Daemons
|
||||||
Requires: bacula-common%{?_isa} = %{version}-%{release}
|
Requires: bacula-common%{?_isa} = %{version}-%{release}
|
||||||
%if 0%{?fedora} >= 15 || 0%{?rhel} > 6
|
%if 0%{?fedora} || 0%{?rhel} > 6
|
||||||
Requires(post): systemd-sysv
|
Requires(post): systemd-sysv
|
||||||
Requires(post): systemd-units
|
Requires(post): systemd-units
|
||||||
Requires(preun): systemd-units
|
Requires(preun): systemd-units
|
||||||
@ -237,7 +237,7 @@ This package contains the command-line management console for the bacula backup
|
|||||||
system.
|
system.
|
||||||
|
|
||||||
|
|
||||||
%if 0%{?fedora} >= 11 || 0%{?rhel} >= 6
|
%if 0%{?fedora} || 0%{?rhel} >= 6
|
||||||
%package console-bat
|
%package console-bat
|
||||||
Summary: Bacula bat console
|
Summary: Bacula bat console
|
||||||
Group: System Environment/Daemons
|
Group: System Environment/Daemons
|
||||||
@ -337,7 +337,7 @@ export CPPFLAGS="$RPM_OPT_FLAGS -I%{_includedir}/ncurses"
|
|||||||
$*
|
$*
|
||||||
}
|
}
|
||||||
|
|
||||||
%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6
|
%if 0%{?fedora} || 0%{?rhel} >= 6
|
||||||
export QMAKE=/usr/bin/qmake-qt4
|
export QMAKE=/usr/bin/qmake-qt4
|
||||||
build --enable-bat --htmldir=%{_datadir}/doc/bacula-console-bat-%{version}
|
build --enable-bat --htmldir=%{_datadir}/doc/bacula-console-bat-%{version}
|
||||||
%else
|
%else
|
||||||
@ -354,7 +354,7 @@ pushd examples/nagios/check_bacula
|
|||||||
CFLAGS="%{optflags}" make LIBS="-lpthread -ldl -lssl -lcrypto -lz"
|
CFLAGS="%{optflags}" make LIBS="-lpthread -ldl -lssl -lcrypto -lz"
|
||||||
popd
|
popd
|
||||||
|
|
||||||
%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6
|
%if 0%{?fedora} || 0%{?rhel} >= 6
|
||||||
pushd src/qt-console/tray-monitor
|
pushd src/qt-console/tray-monitor
|
||||||
/usr/bin/qmake-qt4
|
/usr/bin/qmake-qt4
|
||||||
make %{?_smp_mflags}
|
make %{?_smp_mflags}
|
||||||
@ -377,7 +377,7 @@ rm -f %{buildroot}%{_libdir}/libbaccats-%{version}.so
|
|||||||
# Sample query file
|
# Sample query file
|
||||||
mv %{buildroot}%{_libexecdir}/bacula/query.sql %{buildroot}%{_sysconfdir}/bacula/query.sql
|
mv %{buildroot}%{_libexecdir}/bacula/query.sql %{buildroot}%{_sysconfdir}/bacula/query.sql
|
||||||
|
|
||||||
%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6
|
%if 0%{?fedora} || 0%{?rhel} >= 6
|
||||||
# Bat
|
# Bat
|
||||||
install -p -m 644 -D src/qt-console/images/bat_icon.png %{buildroot}%{_datadir}/pixmaps/bat.png
|
install -p -m 644 -D src/qt-console/images/bat_icon.png %{buildroot}%{_datadir}/pixmaps/bat.png
|
||||||
desktop-file-install --vendor="fedora" --dir=%{buildroot}%{_datadir}/applications %{SOURCE13}
|
desktop-file-install --vendor="fedora" --dir=%{buildroot}%{_datadir}/applications %{SOURCE13}
|
||||||
@ -403,7 +403,7 @@ install -p -m 644 -D scripts/logwatch/logfile.bacula.conf %{buildroot}%{_sysconf
|
|||||||
install -p -m 644 -D scripts/logwatch/services.bacula.conf %{buildroot}%{_sysconfdir}/logwatch/conf/services/bacula.conf
|
install -p -m 644 -D scripts/logwatch/services.bacula.conf %{buildroot}%{_sysconfdir}/logwatch/conf/services/bacula.conf
|
||||||
|
|
||||||
install -p -m 755 -D %{SOURCE19} %{buildroot}%{_sbindir}/bacula-checkconf
|
install -p -m 755 -D %{SOURCE19} %{buildroot}%{_sbindir}/bacula-checkconf
|
||||||
%if 0%{?fedora} >= 15 || 0%{?rhel} > 6
|
%if 0%{?fedora} || 0%{?rhel} > 6
|
||||||
# Systemd unit files
|
# Systemd unit files
|
||||||
mkdir -p %{buildroot}%{_unitdir}
|
mkdir -p %{buildroot}%{_unitdir}
|
||||||
install -p -m 755 -D %{SOURCE10} %{buildroot}%{_unitdir}/bacula-fd.service
|
install -p -m 755 -D %{SOURCE10} %{buildroot}%{_unitdir}/bacula-fd.service
|
||||||
@ -507,7 +507,9 @@ test "$1" != 0 || userdel %username &>/dev/null || :
|
|||||||
test "$1" != 0 || groupdel %username &>/dev/null || :
|
test "$1" != 0 || groupdel %username &>/dev/null || :
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
%if 0%{?fedora} >= 15 || 0%{?rhel} > 6
|
# Until this is fixed upstream in fedpkg, leave it like this
|
||||||
|
# http://permalink.gmane.org/gmane.linux.redhat.fedora.devel/168291
|
||||||
|
%if (0%{?fedora} == 16 || 0%{?fedora} == 17) && !0%{?rhel}
|
||||||
|
|
||||||
%post client
|
%post client
|
||||||
if [ $1 -eq 1 ] ; then
|
if [ $1 -eq 1 ] ; then
|
||||||
@ -610,7 +612,55 @@ fi
|
|||||||
/sbin/chkconfig --del bacula-sd >/dev/null 2>&1 || :
|
/sbin/chkconfig --del bacula-sd >/dev/null 2>&1 || :
|
||||||
/bin/systemctl try-restart bacula-sd.service >/dev/null 2>&1 || :
|
/bin/systemctl try-restart bacula-sd.service >/dev/null 2>&1 || :
|
||||||
|
|
||||||
%else
|
%endif
|
||||||
|
|
||||||
|
%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7
|
||||||
|
|
||||||
|
%post client
|
||||||
|
%systemd_post %{name}-fd.service
|
||||||
|
|
||||||
|
%preun client
|
||||||
|
%systemd_preun %{name}-fd.service
|
||||||
|
|
||||||
|
%postun client
|
||||||
|
%systemd_postun_with_restart %{name}-fd.service
|
||||||
|
|
||||||
|
%triggerun client -- bacula-client < 5.0.3-10
|
||||||
|
/usr/bin/systemd-sysv-convert --save bacula-fd >/dev/null 2>&1 ||:
|
||||||
|
/sbin/chkconfig --del bacula-fd >/dev/null 2>&1 || :
|
||||||
|
/bin/systemctl try-restart bacula-fd.service >/dev/null 2>&1 || :
|
||||||
|
|
||||||
|
%post director
|
||||||
|
%systemd_post %{name}-dir.service
|
||||||
|
|
||||||
|
%preun director
|
||||||
|
%systemd_preun %{name}-dir.service
|
||||||
|
|
||||||
|
%postun director
|
||||||
|
%systemd_postun_with_restart %{name}-dir.service
|
||||||
|
|
||||||
|
%triggerun director -- bacula-director-common < 5.0.3-10
|
||||||
|
/usr/bin/systemd-sysv-convert --save bacula-dir >/dev/null 2>&1 ||:
|
||||||
|
/sbin/chkconfig --del bacula-dir >/dev/null 2>&1 || :
|
||||||
|
/bin/systemctl try-restart bacula-dir.service >/dev/null 2>&1 || :
|
||||||
|
|
||||||
|
%post storage
|
||||||
|
%systemd_post %{name}-sd.service
|
||||||
|
|
||||||
|
%preun storage
|
||||||
|
%systemd_preun %{name}-sd.service
|
||||||
|
|
||||||
|
%postun storage
|
||||||
|
%systemd_postun_with_restart %{name}-sd.service
|
||||||
|
|
||||||
|
%triggerun storage -- bacula-storage-common < 5.0.3-10
|
||||||
|
/usr/bin/systemd-sysv-convert --save bacula-sd >/dev/null 2>&1 ||:
|
||||||
|
/sbin/chkconfig --del bacula-sd >/dev/null 2>&1 || :
|
||||||
|
/bin/systemctl try-restart bacula-sd.service >/dev/null 2>&1 || :
|
||||||
|
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%if 0%{?rhel} == 6
|
||||||
|
|
||||||
%post client
|
%post client
|
||||||
/sbin/chkconfig --add bacula-fd
|
/sbin/chkconfig --add bacula-fd
|
||||||
@ -713,7 +763,7 @@ fi
|
|||||||
%config(noreplace) %{_sysconfdir}/sysconfig/bacula-dir
|
%config(noreplace) %{_sysconfdir}/sysconfig/bacula-dir
|
||||||
%{_sysconfdir}/logwatch/scripts/services/bacula
|
%{_sysconfdir}/logwatch/scripts/services/bacula
|
||||||
%{_sysconfdir}/logwatch/scripts/shared/applybaculadate
|
%{_sysconfdir}/logwatch/scripts/shared/applybaculadate
|
||||||
%if 0%{?fedora} >= 15 || 0%{?rhel} > 6
|
%if 0%{?fedora} || 0%{?rhel} > 6
|
||||||
%{_unitdir}/bacula-dir.service
|
%{_unitdir}/bacula-dir.service
|
||||||
%else
|
%else
|
||||||
%{_initrddir}/bacula-dir
|
%{_initrddir}/bacula-dir
|
||||||
@ -765,7 +815,7 @@ fi
|
|||||||
%{_sbindir}/btape
|
%{_sbindir}/btape
|
||||||
%attr(640,root,root) %config(noreplace) %{_sysconfdir}/bacula/bacula-sd.conf
|
%attr(640,root,root) %config(noreplace) %{_sysconfdir}/bacula/bacula-sd.conf
|
||||||
%config(noreplace) %{_sysconfdir}/sysconfig/bacula-sd
|
%config(noreplace) %{_sysconfdir}/sysconfig/bacula-sd
|
||||||
%if 0%{?fedora} >= 15 || 0%{?rhel} > 6
|
%if 0%{?fedora} || 0%{?rhel} > 6
|
||||||
%{_unitdir}/bacula-sd.service
|
%{_unitdir}/bacula-sd.service
|
||||||
%else
|
%else
|
||||||
%{_initrddir}/bacula-sd
|
%{_initrddir}/bacula-sd
|
||||||
@ -784,7 +834,7 @@ fi
|
|||||||
%files client
|
%files client
|
||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
%{_sbindir}/bacula-fd
|
%{_sbindir}/bacula-fd
|
||||||
%if 0%{?fedora} >= 15 || 0%{?rhel} > 6
|
%if 0%{?fedora} || 0%{?rhel} > 6
|
||||||
%{_unitdir}/bacula-fd.service
|
%{_unitdir}/bacula-fd.service
|
||||||
%else
|
%else
|
||||||
%{_initrddir}/bacula-fd
|
%{_initrddir}/bacula-fd
|
||||||
@ -800,7 +850,7 @@ fi
|
|||||||
%attr(644,root,root) %config(noreplace) %{_sysconfdir}/bacula/bconsole.conf
|
%attr(644,root,root) %config(noreplace) %{_sysconfdir}/bacula/bconsole.conf
|
||||||
%{_mandir}/man8/bconsole.8.*
|
%{_mandir}/man8/bconsole.8.*
|
||||||
|
|
||||||
%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6
|
%if 0%{?fedora} || 0%{?rhel} >= 6
|
||||||
%files console-bat
|
%files console-bat
|
||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
%doc %{_datadir}/doc/bacula-console-bat-%{version}/*
|
%doc %{_datadir}/doc/bacula-console-bat-%{version}/*
|
||||||
@ -837,6 +887,10 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Sep 11 2012 Simone Caronni <negativo17@gmail.com> - 5.2.10-7
|
||||||
|
- Add Fedora 18 systemd macros.
|
||||||
|
- Remove old distribution checks.
|
||||||
|
|
||||||
* Wed Aug 29 2012 Simone Caronni <negativo17@gmail.com> - 5.2.10-6
|
* Wed Aug 29 2012 Simone Caronni <negativo17@gmail.com> - 5.2.10-6
|
||||||
- Remove user definition during prep so they are not used during the install
|
- Remove user definition during prep so they are not used during the install
|
||||||
phase (rhbz#852732).
|
phase (rhbz#852732).
|
||||||
|
Loading…
Reference in New Issue
Block a user