diff options
author | Conrad Kostecki <conikost@gentoo.org> | 2021-04-11 20:29:03 +0200 |
---|---|---|
committer | Conrad Kostecki <conikost@gentoo.org> | 2021-04-11 21:23:46 +0200 |
commit | 3a38c0451e9f781371191490e80f76d4100a62e3 (patch) | |
tree | 6cbd24d8aa5ab2417d1bfb7607352ef0deca0621 /app-backup/backuppc | |
parent | app-admin/tenshi: migrate to GLEP 81 (diff) | |
download | gentoo-3a38c0451e9f781371191490e80f76d4100a62e3.tar.gz gentoo-3a38c0451e9f781371191490e80f76d4100a62e3.tar.bz2 gentoo-3a38c0451e9f781371191490e80f76d4100a62e3.zip |
app-backup/backuppc: migrate to GLEP 81
Also updated to EAPI=7.
Closes: https://bugs.gentoo.org/781209
Package-Manager: Portage-3.0.18, Repoman-3.0.3
Signed-off-by: Conrad Kostecki <conikost@gentoo.org>
Diffstat (limited to 'app-backup/backuppc')
8 files changed, 212 insertions, 16 deletions
diff --git a/app-backup/backuppc/backuppc-3.3.1-r6.ebuild b/app-backup/backuppc/backuppc-3.3.1-r6.ebuild new file mode 100644 index 000000000000..a2b9c23aa1c1 --- /dev/null +++ b/app-backup/backuppc/backuppc-3.3.1-r6.ebuild @@ -0,0 +1,196 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +MY_P="BackupPC-${PV}" + +inherit depend.apache systemd + +DESCRIPTION="High-performance backups to a server's disk" +HOMEPAGE="http://backuppc.sourceforge.net/" +SRC_URI="https://github.com/${PN}/${PN}/releases/download/${PV}/${MY_P}.tar.gz" +S="${WORKDIR}/${MY_P}" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="rss samba" + +DEPEND=" + acct-group/backuppc + acct-user/backuppc + app-admin/apache-tools + app-admin/makepasswd + dev-lang/perl +" + +# The CGI modules are handled in $RDEPEND. +APACHE_MODULES="apache2_modules_alias," # RedirectMatch +APACHE_MODULES+="apache2_modules_authn_core," # AuthType +APACHE_MODULES+="apache2_modules_authz_core," # Require +APACHE_MODULES+="apache2_modules_authz_host," # Require host +APACHE_MODULES+="apache2_modules_authz_user" # Require valid-user + +# Older versions of mod_perl think they're compatibile with apache-2.4, +# so we require the new one explicitly. +RDEPEND=" + ${DEPEND} + app-arch/par2cmdline + dev-perl/Archive-Zip + dev-perl/CGI + dev-perl/File-RsyncP + dev-perl/libwww-perl + virtual/mta + virtual/perl-IO-Compress + www-apache/mod_perl + www-apache/mpm_itk + || ( + >=www-servers/apache-2.4[${APACHE_MODULES},apache2_modules_cgi] + >=www-servers/apache-2.4[${APACHE_MODULES},apache2_modules_cgid] + >=www-servers/apache-2.4[${APACHE_MODULES},apache2_modules_fcgid] + ) + rss? ( dev-perl/XML-RSS ) + samba? ( net-fs/samba )" + +PATCHES=( + "${FILESDIR}/3.3.0/01-fix-configure.pl.patch" + "${FILESDIR}/3.3.0/02-fix-config.pl-formatting.patch" + "${FILESDIR}/3.3.0/03-reasonable-config.pl-defaults.patch" + "${FILESDIR}/3.2.0/04-add-docdir-marker.patch" + "${FILESDIR}/3.2.0/05-nicelevel.patch" + "${FILESDIR}"/${P}-perl522.patch #580254 + "${FILESDIR}"/${P}-perl526.patch #594128 +) + +CGIDIR="/usr/lib/backuppc/htdocs" +CONFDIR="/etc/BackupPC" +DATADIR="/var/lib/backuppc" +DOCDIR="/usr/share/doc/${PF}" +LOGDIR="/var/log/BackupPC" +need_apache2_4 + +src_prepare() { + default + + # Fix initscript + sed -e 's/runscript/openrc-run/g' -i init.d/src/gentoo-backuppc || die + + # Fix docs location using the marker that we've patched in. + sed "s+__DOCDIR__+${DOCDIR}+" -i "lib/BackupPC/CGI/View.pm" || die +} + +src_install() { + local myconf + myconf="" + if use samba ; then + myconf="--bin-path smbclient=$(type -p smbclient)" + myconf="${myconf} --bin-path nmblookup=$(type -p nmblookup)" + fi + + /usr/bin/env perl ./configure.pl \ + --batch \ + --bin-path perl=$(type -p perl) \ + --bin-path tar=$(type -p tar) \ + --bin-path rsync=$(type -p rsync) \ + --bin-path ping=$(type -p ping) \ + --bin-path df=$(type -p df) \ + --bin-path ssh=$(type -p ssh) \ + --bin-path sendmail=$(type -p sendmail) \ + --bin-path hostname=$(type -p hostname) \ + --bin-path gzip=$(type -p gzip) \ + --bin-path bzip2=$(type -p bzip2) \ + --config-dir "${CONFDIR}" \ + --install-dir /usr \ + --data-dir "${DATADIR}" \ + --hostname 127.0.0.1 \ + --uid-ignore \ + --dest-dir "${D}" \ + --html-dir "${CGIDIR}"/image \ + --html-dir-url /image \ + --cgi-dir "${CGIDIR}" \ + --fhs \ + ${myconf} || die "failed the configure.pl script" + + ebegin "Installing documentation" + + pod2man \ + -errors=none \ + --section=8 \ + --center="BackupPC manual" \ + "${S}"/doc/BackupPC.pod backuppc.8 \ + || die "failed to generate man page" + + doman backuppc.8 + + # Place the documentation in the correct location + dodoc "${D}/usr/doc/BackupPC.html" + dodoc "${D}/usr/doc/BackupPC.pod" + rm -rf "${D}/usr/doc" || die + + eend 0 + + # Setup directories + dodir "${CONFDIR}/pc" + + keepdir "${CONFDIR}" + keepdir "${CONFDIR}/pc" + keepdir "${DATADIR}"/{trash,pool,pc,cpool} + keepdir "${LOGDIR}" + + ebegin "Setting up init.d/conf.d/systemd scripts" + newinitd "${S}"/init.d/gentoo-backuppc backuppc + newconfd "${S}"/init.d/gentoo-backuppc.conf backuppc + systemd_dounit "${FILESDIR}/${PN}.service" + + insinto "${APACHE_MODULES_CONFDIR}" + doins "${FILESDIR}"/99_backuppc.conf + + # Make sure that the ownership is correct + chown -R backuppc:backuppc "${D}${CONFDIR}" || die + chown -R backuppc:backuppc "${D}${DATADIR}" || die + chown -R backuppc:backuppc "${D}${LOGDIR}" || die +} + +pkg_postinst() { + elog "Installation finished, you may now start using BackupPC." + elog + elog "- Read the documentation in /usr/share/doc/${PF}/BackupPC.html" + elog " Please pay special attention to the security section." + elog + elog "- You can launch backuppc by running:" + elog + elog " # /etc/init.d/backuppc start" + elog + elog "- To enable the GUI, first edit ${ROOT}/etc/conf.d/apache2 and add," + elog + elog " \"-D BACKUPPC -D PERL -D MPM_ITK\"" + elog + elog " to the APACHE2_OPTS line." + elog + elog " Then you must edit ${ROOT}/etc/apache2/modules.d/00_mpm_itk.conf" + elog " and adjust the values of LimitUIDRange/LimitGIDRange to include" + elog " the UID and GID of the backuppc user." + elog + elog " Finally, start apache:" + elog + elog " # /etc/init.d/apache2 start" + elog + elog " The web interface should now be running on," + elog + elog " http://127.0.0.1:8080/" + elog + + # Generate a new password if there's no auth file + if [[ ! -f "${CONFDIR}/users.htpasswd" ]]; then + adminuser="backuppc" + adminpass=$( makepasswd --chars=12 ) + htpasswd -bc "${CONFDIR}/users.htpasswd" $adminuser $adminpass + + elog "" + elog "- Created admin user $adminuser with password $adminpass" + elog " To add new users, run: " + elog "" + elog " # htpasswd ${CONFDIR}/users.htpasswd newUser" + fi +} diff --git a/app-backup/backuppc/files/3.2.0/04-add-docdir-marker.patch b/app-backup/backuppc/files/3.2.0/04-add-docdir-marker.patch index 0355aedf04b7..d6a5a1c42991 100644 --- a/app-backup/backuppc/files/3.2.0/04-add-docdir-marker.patch +++ b/app-backup/backuppc/files/3.2.0/04-add-docdir-marker.patch @@ -1,5 +1,5 @@ ---- lib/BackupPC/CGI/View.pm.orig 2009-09-30 19:08:34.353577546 +0300 -+++ lib/BackupPC/CGI/View.pm 2009-09-30 19:16:01.982412712 +0300 +--- a/lib/BackupPC/CGI/View.pm.orig 2009-09-30 19:08:34.353577546 +0300 ++++ b/lib/BackupPC/CGI/View.pm 2009-09-30 19:16:01.982412712 +0300 @@ -86,7 +86,7 @@ $file = $bpc->ConfDir() . "/hosts"; $linkHosts = 1; diff --git a/app-backup/backuppc/files/3.2.0/05-nicelevel.patch b/app-backup/backuppc/files/3.2.0/05-nicelevel.patch index 50938f60bcdc..f6ecce98a7a8 100644 --- a/app-backup/backuppc/files/3.2.0/05-nicelevel.patch +++ b/app-backup/backuppc/files/3.2.0/05-nicelevel.patch @@ -1,5 +1,5 @@ ---- init.d/src/gentoo-backuppc.orig 2009-10-18 00:14:44.125346723 +0300 -+++ init.d/src/gentoo-backuppc 2009-10-18 00:15:37.101346981 +0300 +--- a/init.d/src/gentoo-backuppc.orig 2009-10-18 00:14:44.125346723 +0300 ++++ b/init.d/src/gentoo-backuppc 2009-10-18 00:15:37.101346981 +0300 @@ -21,7 +21,7 @@ start() { checkconfig || return 1 @@ -9,8 +9,8 @@ eend $? } ---- init.d/src/gentoo-backuppc.conf.orig 2009-10-18 00:14:52.513347638 +0300 -+++ init.d/src/gentoo-backuppc.conf 2009-10-18 00:16:03.457346630 +0300 +--- a/init.d/src/gentoo-backuppc.conf.orig 2009-10-18 00:14:52.513347638 +0300 ++++ b/init.d/src/gentoo-backuppc.conf 2009-10-18 00:16:03.457346630 +0300 @@ -3,3 +3,4 @@ PID_FILE=__LOGDIR__/BackupPC.pid EXEC=__INSTALLDIR__/bin/BackupPC diff --git a/app-backup/backuppc/files/3.3.0/01-fix-configure.pl.patch b/app-backup/backuppc/files/3.3.0/01-fix-configure.pl.patch index c943fdce68b1..f27fccc154fe 100644 --- a/app-backup/backuppc/files/3.3.0/01-fix-configure.pl.patch +++ b/app-backup/backuppc/files/3.3.0/01-fix-configure.pl.patch @@ -1,5 +1,5 @@ ---- configure.pl.dist 2013-09-23 23:01:19.524743747 +0300 -+++ configure.pl 2013-09-23 23:01:37.344567459 +0300 +--- a/configure.pl.dist 2013-09-23 23:01:19.524743747 +0300 ++++ b/configure.pl 2013-09-23 23:01:37.344567459 +0300 @@ -158,7 +158,7 @@ # config file to get all the defaults. # diff --git a/app-backup/backuppc/files/3.3.0/02-fix-config.pl-formatting.patch b/app-backup/backuppc/files/3.3.0/02-fix-config.pl-formatting.patch index 79ad6547fa6f..14a9600536d7 100644 --- a/app-backup/backuppc/files/3.3.0/02-fix-config.pl-formatting.patch +++ b/app-backup/backuppc/files/3.3.0/02-fix-config.pl-formatting.patch @@ -1,5 +1,5 @@ ---- conf/config.pl.dist 2013-09-23 23:05:50.332064754 +0300 -+++ conf/config.pl 2013-09-23 23:07:44.110943607 +0300 +--- a/conf/config.pl.dist 2013-09-23 23:05:50.332064754 +0300 ++++ b/conf/config.pl 2013-09-23 23:07:44.110943607 +0300 @@ -355,7 +355,7 @@ # needs to be a full path and you can't include shell syntax like # redirection and pipes; put that in a script if you need it. diff --git a/app-backup/backuppc/files/3.3.0/03-reasonable-config.pl-defaults.patch b/app-backup/backuppc/files/3.3.0/03-reasonable-config.pl-defaults.patch index 8b54fc87b050..0dd85d3acad1 100644 --- a/app-backup/backuppc/files/3.3.0/03-reasonable-config.pl-defaults.patch +++ b/app-backup/backuppc/files/3.3.0/03-reasonable-config.pl-defaults.patch @@ -1,5 +1,5 @@ ---- conf/config.pl.formatted 2013-09-23 23:12:30.708129365 +0300 -+++ conf/config.pl 2013-09-23 23:12:39.448043656 +0300 +--- a/conf/config.pl.formatted 2013-09-23 23:12:30.708129365 +0300 ++++ b/conf/config.pl 2013-09-23 23:12:39.448043656 +0300 @@ -1305,7 +1305,7 @@ '--times', '--block-size=2048', diff --git a/app-backup/backuppc/files/backuppc-3.3.1-perl522.patch b/app-backup/backuppc/files/backuppc-3.3.1-perl522.patch index fb7eeeef1e02..cb29e890d347 100644 --- a/app-backup/backuppc/files/backuppc-3.3.1-perl522.patch +++ b/app-backup/backuppc/files/backuppc-3.3.1-perl522.patch @@ -1,5 +1,5 @@ ---- lib/BackupPC/CGI/Browse.pm 2016-11-22 20:52:03.622509160 +0100 -+++ lib/BackupPC/CGI/Browse.pm 2016-11-22 20:50:35.871018400 +0100 +--- a/lib/BackupPC/CGI/Browse.pm 2016-11-22 20:52:03.622509160 +0100 ++++ b/lib/BackupPC/CGI/Browse.pm 2016-11-22 20:50:35.871018400 +0100 @@ -62,13 +62,13 @@ fix bug https://bugzilla.redhat.com/attachment.cgi?id=1104083 # my @Backups = $bpc->BackupInfoRead($host); diff --git a/app-backup/backuppc/files/backuppc-3.3.1-perl526.patch b/app-backup/backuppc/files/backuppc-3.3.1-perl526.patch index 3a04f94835c3..ec7b9a63d06f 100644 --- a/app-backup/backuppc/files/backuppc-3.3.1-perl526.patch +++ b/app-backup/backuppc/files/backuppc-3.3.1-perl526.patch @@ -1,6 +1,6 @@ diff -ruN BackupPC-3.3.1.orig/lib/BackupPC/Lib.pm BackupPC-3.3.1/lib/BackupPC/Lib.pm ---- BackupPC-3.3.1.orig/lib/BackupPC/Lib.pm 2015-01-12 01:19:53.000000000 +0100 -+++ BackupPC-3.3.1/lib/BackupPC/Lib.pm 2017-07-08 00:31:52.100003197 +0200 +--- a/BackupPC-3.3.1.orig/lib/BackupPC/Lib.pm 2015-01-12 01:19:53.000000000 +0100 ++++ b/BackupPC-3.3.1/lib/BackupPC/Lib.pm 2017-07-08 00:31:52.100003197 +0200 @@ -1261,7 +1261,7 @@ # # Replace scalar variables first |