Fix build on Fedora < 30

This commit is contained in:
Simone Caronni 2019-01-12 15:14:20 +01:00
parent 3e17df1c34
commit 3065577c28

View File

@ -3,7 +3,7 @@
Name: bacula Name: bacula
Version: 9.2.1 Version: 9.2.1
Release: 1%{?dist} Release: 2%{?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
@ -61,13 +61,12 @@ BuildRequires: libcap-devel
BuildRequires: lzo-devel BuildRequires: lzo-devel
BuildRequires: ncurses-devel BuildRequires: ncurses-devel
BuildRequires: openssl-devel BuildRequires: openssl-devel
BuildRequires: libpq-devel
BuildRequires: readline-devel BuildRequires: readline-devel
BuildRequires: sqlite-devel BuildRequires: sqlite-devel
BuildRequires: zlib-devel BuildRequires: zlib-devel
# https://fedoraproject.org/wiki/Changes/perl_Package_to_Install_Core_Modules # https://fedoraproject.org/wiki/Changes/perl_Package_to_Install_Core_Modules
%if 0%{?fedora} >= 27 || 0%{?rhel} > 7 %if 0%{?fedora} || 0%{?rhel} > 7
BuildRequires: perl-interpreter BuildRequires: perl-interpreter
%else %else
BuildRequires: perl BuildRequires: perl
@ -77,7 +76,7 @@ BuildRequires: perl
BuildRequires: systemd BuildRequires: systemd
%endif %endif
%if 0%{?fedora} >= 28 || 0%{?rhel} > 7 %if 0%{?fedora} || 0%{?rhel} > 7
BuildRequires: mariadb-connector-c-devel BuildRequires: mariadb-connector-c-devel
BuildRequires: qt5-devel BuildRequires: qt5-devel
%else %else
@ -86,6 +85,12 @@ BuildRequires: tcp_wrappers-devel
BuildRequires: qt4-devel >= 4.6.2 BuildRequires: qt4-devel >= 4.6.2
%endif %endif
%if 0%{?fedora} >= 30
BuildRequires: libpq-devel
%else
BuildRequires: postgresql-devel
%endif
%description %description
Bacula is a set of programs that allow you to manage the backup, recovery, and Bacula is a set of programs that allow you to manage the backup, recovery, and
verification of computer data across a network of different computers. It is verification of computer data across a network of different computers. It is
@ -322,7 +327,7 @@ find updatedb -type f | xargs chmod -x
%build %build
export CFLAGS="$RPM_OPT_FLAGS -I%{_includedir}/ncurses" export CFLAGS="$RPM_OPT_FLAGS -I%{_includedir}/ncurses"
export CPPFLAGS="$RPM_OPT_FLAGS -I%{_includedir}/ncurses" export CPPFLAGS="$RPM_OPT_FLAGS -I%{_includedir}/ncurses"
%if 0%{?fedora} > 27 || 0%{?rhel} > 7 %if 0%{?fedora} || 0%{?rhel} > 7
export PATH="$PATH:%{_qt5_bindir}" export PATH="$PATH:%{_qt5_bindir}"
%else %else
export PATH="$PATH:%{_qt4_bindir}" export PATH="$PATH:%{_qt4_bindir}"
@ -359,7 +364,7 @@ export PATH="$PATH:%{_qt4_bindir}"
--with-smtp-host=localhost \ --with-smtp-host=localhost \
--with-sqlite3 \ --with-sqlite3 \
--with-subsys-dir=%{_localstatedir}/lock/subsys \ --with-subsys-dir=%{_localstatedir}/lock/subsys \
%if 0%{!?fedora} >= 28 || 0%{!?rhel} > 7 %if 0%{!?fedora} || 0%{!?rhel} > 7
--with-tcp-wrappers \ --with-tcp-wrappers \
%endif %endif
--with-working-dir=%{_localstatedir}/spool/bacula \ --with-working-dir=%{_localstatedir}/spool/bacula \
@ -373,7 +378,7 @@ make %{?_smp_mflags}
make -C examples/nagios/check_bacula make -C examples/nagios/check_bacula
pushd src/qt-console/tray-monitor pushd src/qt-console/tray-monitor
%if 0%{?fedora} >= 28 || 0%{?rhel} > 7 %if 0%{?fedora} || 0%{?rhel} > 7
%{?qmake_qt5}%{!?qmake_qt5:qmake-qt5} tray-monitor.pro %{?qmake_qt5}%{!?qmake_qt5:qmake-qt5} tray-monitor.pro
%else %else
%{?qmake_qt4}%{!?qmake_qt4:qmake-qt4} tray-monitor.pro %{?qmake_qt4}%{!?qmake_qt4:qmake-qt4} tray-monitor.pro
@ -398,7 +403,7 @@ rm -f %{buildroot}%{_libdir}/libbaccats.so
# Bat # Bat
install -p -m 644 -D src/qt-console/images/bat_icon.png %{buildroot}%{_datadir}/pixmaps/bat_icon.png install -p -m 644 -D src/qt-console/images/bat_icon.png %{buildroot}%{_datadir}/pixmaps/bat_icon.png
install -p -m 644 -D scripts/bat.desktop %{buildroot}%{_datadir}/applications/bat.desktop install -p -m 644 -D scripts/bat.desktop %{buildroot}%{_datadir}/applications/bat.desktop
%if 0%{?fedora} >= 28 || 0%{?rhel} > 7 %if 0%{?fedora} || 0%{?rhel} > 7
# ? # ?
install -p -m 755 -D src/qt-console/.libs/bat %{buildroot}%{_sbindir}/bat install -p -m 755 -D src/qt-console/.libs/bat %{buildroot}%{_sbindir}/bat
%endif %endif
@ -732,6 +737,10 @@ fi
%{_libdir}/nagios/plugins/check_bacula %{_libdir}/nagios/plugins/check_bacula
%changelog %changelog
* Sat Jan 12 2019 Simone Caronni <negativo17@gmail.com> - 9.2.1-2
- Make the build succeed also on supported RHEL and Fedora releases.
- Remove Fedora 27 references.
* Mon Aug 20 2018 Simone Caronni <negativo17@gmail.com> - 9.2.1-1 * Mon Aug 20 2018 Simone Caronni <negativo17@gmail.com> - 9.2.1-1
- Update to 9.2.1. - Update to 9.2.1.