--- bacula-9.0.6.ebuild.orig 2017-12-17 12:09:23.000000000 -0500 +++ bacula-9.0.6.ebuild.orig 2018-02-07 13:20:30.388989646 -0500 @@ -1,11 +1,11 @@ # Copyright 1999-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -EAPI="5" +EAPI="6" -inherit eutils multilib qt4-r2 systemd user libtool +inherit qmake-utils desktop systemd user libtool MY_PV=${PV/_beta/-b} MY_P=${PN}-${MY_PV} DESCRIPTION="Featureful client/server network backup suite" @@ -13,11 +13,11 @@ SRC_URI="mirror://sourceforge/bacula/${MY_P}.tar.gz" LICENSE="AGPL-3" SLOT="0" KEYWORDS="~amd64 ~ppc ~sparc ~x86" -IUSE="acl bacula-clientonly bacula-nodir bacula-nosd examples ipv6 libressl logwatch mysql postgres qt4 readline +sqlite ssl static tcpd vim-syntax X" +IUSE="acl bacula-clientonly bacula-nodir bacula-nosd examples ipv6 libressl logwatch mysql postgres qt4 qt5 readline +sqlite ssl static tcpd vim-syntax X" DEPEND=" dev-libs/gmp:0 !bacula-clientonly? ( postgres? ( dev-db/postgresql:=[threads] ) @@ -27,10 +27,14 @@ ) qt4? ( dev-qt/qtsvg:4 x11-libs/qwt:5 ) + qt5? ( + dev-qt/qtsvg:5 + x11-libs/qwt:6 + ) logwatch? ( sys-apps/logwatch ) tcpd? ( >=sys-apps/tcp-wrappers-7.6 ) readline? ( sys-libs/readline:0 ) static? ( acl? ( virtual/acl[static-libs] ) @@ -85,10 +89,16 @@ ewarn ewarn "Building statically linked 'bat' is not supported. Ignorig 'qt4' useflag." ewarn fi + if use bacula-clientonly && use static && use qt5; then + ewarn + ewarn "Building statically linked 'bat' is not supported. Ignorig 'qt5' useflag." + ewarn + fi + if ! use bacula-clientonly; then if [ -z "$(egetent passwd bacula 2>/dev/null)" ]; then enewuser bacula -1 -1 /var/lib/bacula bacula,disk,tape,cdrom,cdrw einfo einfo "The user 'bacula' has been created. Please see the bacula manual" @@ -116,35 +126,39 @@ # bug 466690 Use CXXFLAGS instead of CFLAGS sed -i -e 's/@CFLAGS@/@CXXFLAGS@/' autoconf/Make.common.in || die # drop automatic install of unneeded documentation (for bug 356499) - epatch "${FILESDIR}"/7.2.0/${PN}-7.2.0-doc.patch + eapply -p0 "${FILESDIR}"/7.2.0/${PN}-7.2.0-doc.patch # bug #310087 - epatch "${FILESDIR}"/5.2.3/${PN}-5.2.3-as-needed.patch + eapply "${FILESDIR}"/5.2.3/${PN}-5.2.3-as-needed.patch # bug #311161 - epatch "${FILESDIR}"/9.0.2/${PN}-9.0.2-lib-search-path.patch + eapply -p0 "${FILESDIR}"/9.0.2/${PN}-9.0.2-lib-search-path.patch # bat needs to respect LDFLAGS - epatch "${FILESDIR}"/5.2.3/${PN}-5.2.3-ldflags.patch + eapply -p0 "${FILESDIR}"/5.2.3/${PN}-5.2.3-ldflags.patch # bug #328701 - epatch "${FILESDIR}"/5.2.3/${PN}-5.2.3-openssl-1.patch + eapply -p0 "${FILESDIR}"/5.2.3/${PN}-5.2.3-openssl-1.patch - epatch "${FILESDIR}"/9.0.2/${PN}-9.0.2-fix-static.patch + eapply -p0 "${FILESDIR}"/9.0.2/${PN}-9.0.2-fix-static.patch # fix soname in libbaccat.so bug #602952 - epatch "${FILESDIR}/bacula-fix-sonames.patch" - + eapply -p0 "${FILESDIR}/bacula-fix-sonames.patch" + # do not strip binaries sed -i -e "s/strip /# strip /" src/filed/Makefile.in || die sed -i -e "s/strip /# strip /" src/console/Makefile.in || die # fix file not found error during make depend - epatch "${FILESDIR}"/7.0.2/${PN}-7.0.2-depend.patch + eapply -p0 "${FILESDIR}"/7.0.2/${PN}-7.0.2-depend.patch + + # fix missing QtGlobal include in src/qt-console/pages.h + eapply -p0 "${FILESDIR}"/9.0.6/${PN}-9.0.6-fix-pages-h-qt-includes.patch + eapply_user # Fix systemd unit files: # bug 497748 sed -i -e '/Requires/d' platforms/systemd/*.service.in || die sed -i -e '/StandardOutput/d' platforms/systemd/*.service.in || die @@ -187,12 +201,17 @@ fi fi # do not build bat if 'static' clientonly if ! use bacula-clientonly || ! use static; then - myconf="${myconf} \ - $(use_enable qt4 bat)" + if use qt4; then + myconf="${myconf} \ + $(use_enable qt4 bat)" + elif use qt5; then + myconf="${myconf} \ + $(use_enable qt5 bat)" + fi fi myconf="${myconf} \ $(use_with X x) \ $(use_enable !readline conio) \ @@ -211,26 +230,31 @@ --sysconfdir=/etc/bacula \ --with-subsys-dir=/var/lock/subsys \ --with-working-dir=/var/lib/bacula \ --with-logdir=/var/lib/bacula \ --with-scriptdir=/usr/libexec/bacula \ - --with-systemd=$(systemd_get_unitdir) \ + --with-systemd=$(systemd_get_systemunitdir) \ --with-dir-user=bacula \ --with-dir-group=bacula \ --with-sd-user=root \ --with-sd-group=bacula \ --with-fd-user=root \ --with-fd-group=bacula \ --enable-smartalloc \ --disable-afs \ --host=${CHOST} \ ${myconf} + # correct configuration for QT based bat if use qt4 ; then pushd src/qt-console eqmake4 popd + elif use qt5 ; then + pushd src/qt-console + eqmake5 + popd fi } src_compile() { # Make build log verbose (bug #447806) @@ -241,11 +265,11 @@ emake DESTDIR="${D}" install doicon scripts/bacula.png # install bat icon and desktop file when enabled # (for some reason ./configure doesn't pick this up) - if use qt4 && ! use static ; then + if (use qt4 || use qt5) && ! use static ; then doicon src/qt-console/images/bat_icon.png domenu scripts/bat.desktop fi # remove some scripts we don't need at all @@ -286,11 +310,11 @@ emake DESTDIR="${D}" install popd >&/dev/null || die fi fi - if ! use qt4; then + if ! use qt4 && ! use qt5; then rm -vf "${D}"/usr/share/man/man1/bat.1* fi rm -vf "${D}"/usr/share/man/man1/bacula-tray-monitor.1* if use bacula-clientonly || use bacula-nodir; then rm -vf "${D}"/usr/share/man/man8/bacula-dir.8* @@ -411,8 +435,8 @@ einfo "Best use it only for a client-only installation. See Bug #445540." einfo fi einfo "Please note that 'bconsole' will always be installed. To compile 'bat'" - einfo "you have to enable 'USE=qt4'." + einfo "you have to enable 'USE=qt4' or 'USE=qt5'." einfo }