public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: app-backup/backuppc/, app-backup/backuppc/files/
@ 2016-01-19  0:05 Michael Orlitzky
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Orlitzky @ 2016-01-19  0:05 UTC (permalink / raw
  To: gentoo-commits

commit:     b3ff61af65df489d597ae5e3d9d765500e5e5eaf
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 18 23:58:30 2016 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Tue Jan 19 00:02:16 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b3ff61af

app-backup/backuppc: add version 3.3.1 (masked) with apache-2.4 support.

This new version adds apache-2.4 support to backuppc, but at the cost
of requiring www-apache/mpm_itk and a new mod_perl supporting
apache-2.4. The former is available and less onerous than the current
requirement of a separate web server. However, the only mod_perl
supporting apache-2.4 at the moment is masked, so the new version of
backuppc is masked as well.

The configuration for the new version should be more familiar to
users: it is enabled by passing -D BACKUPPC to apache2.

Gentoo-Bug: 532718
Gentoo-Bug: 541312

Package-Manager: portage-2.2.26

 app-backup/backuppc/Manifest               |   1 +
 app-backup/backuppc/backuppc-3.3.1.ebuild  | 194 +++++++++++++++++++++++++++++
 app-backup/backuppc/files/99_backuppc.conf |  32 +++++
 3 files changed, 227 insertions(+)

diff --git a/app-backup/backuppc/Manifest b/app-backup/backuppc/Manifest
index cee7799..07d6999 100644
--- a/app-backup/backuppc/Manifest
+++ b/app-backup/backuppc/Manifest
@@ -1 +1,2 @@
 DIST BackupPC-3.3.0.tar.gz 554155 SHA256 8a9c1b6faa4502b4c40617be97e806813815d9e22544854d99983c3da7c1f69b SHA512 67ec1ca4d22ab1e81f9c0f409c758347a6c772e3d1aa39c93207f9d328176ac7b4e679d0b03972fc5870c37dde0480d28c61ae19975d54e144235ea0e84e9901 WHIRLPOOL 23a9ce5dd600843cea72354e1afe595e3779f883839f8d3feca7f1355ed20048026090097ddfbcf394632672b42bef4884bc6661203542d6fe2c6bc2e8ad7b96
+DIST BackupPC-3.3.1.tar.gz 556461 SHA256 c9cc4aec28a7474a68d40f4bc460ff15140e05c96900c7f98ff3ef06c4f6ae4c SHA512 b6bb9de3103c5062098d80755055b7461ae9133a4a46a66b3d0af89d081086571694db1898e7d85880defa15b030bad522812116ae5361c0fbde90b877d139c6 WHIRLPOOL 1d895f530932fc1287cde9db584befc6ca0850b5841cc4e60927442d0db662ec092bda4efa4953650d3bfa13deb6e9fafa25c10f82e19b39c67969bb4e143bac

diff --git a/app-backup/backuppc/backuppc-3.3.1.ebuild b/app-backup/backuppc/backuppc-3.3.1.ebuild
new file mode 100644
index 0000000..f7c0711
--- /dev/null
+++ b/app-backup/backuppc/backuppc-3.3.1.ebuild
@@ -0,0 +1,194 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit depend.apache eutils user
+
+MY_P="BackupPC-${PV}"
+
+DESCRIPTION="High-performance backups to a server's disk"
+HOMEPAGE="http://backuppc.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+
+IUSE="rss samba"
+
+# 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
+
+DEPEND="dev-lang/perl
+	app-admin/apache-tools
+	app-admin/makepasswd"
+
+# Older versions of mod_perl think they're compatibile with apache-2.4,
+# so we require the new one explicitly.
+RDEPEND="${DEPEND}
+	virtual/perl-IO-Compress
+	dev-perl/Archive-Zip
+	dev-perl/libwww-perl
+	app-arch/tar
+	app-arch/par2cmdline
+	app-arch/gzip
+	app-arch/bzip2
+	virtual/mta
+	>=www-apache/mod_perl-2.0.9
+	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] )
+	net-misc/rsync
+	dev-perl/File-RsyncP
+	rss? ( dev-perl/XML-RSS )
+	samba? ( net-fs/samba )"
+
+need_apache2_4
+
+SLOT="0"
+
+S="${WORKDIR}/${MY_P}"
+
+CGIDIR="/usr/lib/backuppc/htdocs"
+CONFDIR="/etc/BackupPC"
+DATADIR="/var/lib/backuppc"
+DOCDIR="/usr/share/doc/${PF}"
+LOGDIR="/var/log/BackupPC"
+
+pkg_setup() {
+	enewgroup backuppc
+	enewuser backuppc -1 /bin/bash /var/lib/backuppc backuppc
+}
+
+src_prepare() {
+	epatch "${FILESDIR}/3.3.0/01-fix-configure.pl.patch"
+	epatch "${FILESDIR}/3.3.0/02-fix-config.pl-formatting.patch"
+	epatch "${FILESDIR}/3.3.0/03-reasonable-config.pl-defaults.patch"
+
+	epatch "${FILESDIR}/3.2.0/04-add-docdir-marker.patch"
+	epatch "${FILESDIR}/3.2.0/05-nicelevel.patch"
+
+	# Fix docs location using the marker that we've patched in.
+	sed -i "s+__DOCDIR__+${DOCDIR}+" "lib/BackupPC/CGI/View.pm" \
+		|| die "failed to sed the documentation location"
+}
+
+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 scripts"
+	newinitd "${S}"/init.d/gentoo-backuppc backuppc
+	newconfd "${S}"/init.d/gentoo-backuppc.conf backuppc
+
+	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/99_backuppc.conf b/app-backup/backuppc/files/99_backuppc.conf
new file mode 100644
index 0000000..eae766e
--- /dev/null
+++ b/app-backup/backuppc/files/99_backuppc.conf
@@ -0,0 +1,32 @@
+<IfDefine BACKUPPC>
+
+
+Listen 8080
+<VirtualHost 127.0.0.1:8080>
+  AssignUserId backuppc backuppc
+  DocumentRoot "/usr/lib/backuppc/htdocs/"
+  RedirectMatch ^/$ /BackupPC_Admin
+
+  <Directory "/usr/lib/backuppc/htdocs">
+    AuthType Basic
+    AuthName "BackupPC Community Edition Administrative Interface"
+    AuthUserFile "/etc/BackupPC/users.htpasswd"
+    Options ExecCGI
+    Require valid-user
+    Require host 127.0.0.1
+  </Directory>
+
+  <Location "/BackupPC_Admin">
+    SetHandler perl-script
+    PerlResponseHandler ModPerl::Registry
+    PerlOptions +ParseHeaders
+  </Location>
+
+  <Directory "/usr/lib/backuppc/htdocs/image">
+    Require all granted
+    Options -ExecCGI
+  </Directory>
+</VirtualHost>
+
+
+</IfDefine>


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-backup/backuppc/, app-backup/backuppc/files/
@ 2016-11-26 12:55 Pacho Ramos
  0 siblings, 0 replies; 3+ messages in thread
From: Pacho Ramos @ 2016-11-26 12:55 UTC (permalink / raw
  To: gentoo-commits

commit:     7f57742cb7cc422bfff1f62fb62a639bbab7de79
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 26 12:53:42 2016 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Sat Nov 26 12:55:46 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7f57742c

app-backup/backuppc: Fix perl-5.22 compat (#580254 by Till Korten)

Package-Manager: portage-2.3.2

 app-backup/backuppc/backuppc-3.3.1-r3.ebuild       | 196 +++++++++++++++++++++
 .../backuppc/files/backuppc-3.3.1-perl522.patch    |  17 ++
 2 files changed, 213 insertions(+)

diff --git a/app-backup/backuppc/backuppc-3.3.1-r3.ebuild b/app-backup/backuppc/backuppc-3.3.1-r3.ebuild
new file mode 100644
index 00000000..8d292d6
--- /dev/null
+++ b/app-backup/backuppc/backuppc-3.3.1-r3.ebuild
@@ -0,0 +1,196 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit depend.apache eutils user systemd
+
+MY_P="BackupPC-${PV}"
+
+DESCRIPTION="High-performance backups to a server's disk"
+HOMEPAGE="http://backuppc.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+
+IUSE="rss samba"
+
+# 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
+
+DEPEND="dev-lang/perl
+	app-admin/apache-tools
+	app-admin/makepasswd"
+
+# Older versions of mod_perl think they're compatibile with apache-2.4,
+# so we require the new one explicitly.
+RDEPEND="${DEPEND}
+	virtual/perl-IO-Compress
+	dev-perl/Archive-Zip
+	dev-perl/libwww-perl
+	app-arch/tar
+	app-arch/par2cmdline
+	app-arch/gzip
+	app-arch/bzip2
+	virtual/mta
+	>=www-apache/mod_perl-2.0.9
+	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] )
+	net-misc/rsync
+	dev-perl/File-RsyncP
+	rss? ( dev-perl/XML-RSS )
+	samba? ( net-fs/samba )"
+
+need_apache2_4
+
+SLOT="0"
+
+S="${WORKDIR}/${MY_P}"
+
+CGIDIR="/usr/lib/backuppc/htdocs"
+CONFDIR="/etc/BackupPC"
+DATADIR="/var/lib/backuppc"
+DOCDIR="/usr/share/doc/${PF}"
+LOGDIR="/var/log/BackupPC"
+
+pkg_setup() {
+	enewgroup backuppc
+	enewuser backuppc -1 /bin/bash /var/lib/backuppc backuppc
+}
+
+src_prepare() {
+	epatch "${FILESDIR}/3.3.0/01-fix-configure.pl.patch"
+	epatch "${FILESDIR}/3.3.0/02-fix-config.pl-formatting.patch"
+	epatch "${FILESDIR}/3.3.0/03-reasonable-config.pl-defaults.patch"
+
+	epatch "${FILESDIR}/3.2.0/04-add-docdir-marker.patch"
+	epatch "${FILESDIR}/3.2.0/05-nicelevel.patch"
+
+	epatch "${FILESDIR}"/${P}-perl522.patch #580254
+
+	# Fix docs location using the marker that we've patched in.
+	sed -i "s+__DOCDIR__+${DOCDIR}+" "lib/BackupPC/CGI/View.pm" \
+		|| die "failed to sed the documentation location"
+}
+
+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/backuppc-3.3.1-perl522.patch b/app-backup/backuppc/files/backuppc-3.3.1-perl522.patch
new file mode 100644
index 00000000..fb7eeee
--- /dev/null
+++ b/app-backup/backuppc/files/backuppc-3.3.1-perl522.patch
@@ -0,0 +1,17 @@
+--- 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
+@@ -62,13 +62,13 @@ fix bug https://bugzilla.redhat.com/attachment.cgi?id=1104083
+     #
+     my @Backups = $bpc->BackupInfoRead($host);
+ 
+     #
+     # default to the newest backup
+     #
+-    if ( !defined($In{num}) && defined(@Backups) && @Backups > 0 ) {
++    if ( !defined($In{num}) && @Backups > 0 ) {
+         $i = @Backups - 1;
+         $num = $Backups[$i]{num};
+     }
+ 
+     for ( $i = 0 ; $i < @Backups ; $i++ ) {
+         last if ( $Backups[$i]{num} == $num );


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-backup/backuppc/, app-backup/backuppc/files/
@ 2017-07-07 22:35 Andreas Hüttel
  0 siblings, 0 replies; 3+ messages in thread
From: Andreas Hüttel @ 2017-07-07 22:35 UTC (permalink / raw
  To: gentoo-commits

commit:     ecb172112c03bebc7862a6d04967f25a4d27b847
Author:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Fri Jul  7 22:35:23 2017 +0000
Commit:     Andreas Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Fri Jul  7 22:35:23 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ecb17211

app-backup/backuppc: Add revision bump with Perl 5.26 compatibility patch, bug 594128

Package-Manager: Portage-2.3.6, Repoman-2.3.2

 app-backup/backuppc/backuppc-3.3.1-r5.ebuild       | 197 +++++++++++++++++++++
 .../backuppc/files/backuppc-3.3.1-perl526.patch    |  21 +++
 2 files changed, 218 insertions(+)

diff --git a/app-backup/backuppc/backuppc-3.3.1-r5.ebuild b/app-backup/backuppc/backuppc-3.3.1-r5.ebuild
new file mode 100644
index 00000000000..a506f581e20
--- /dev/null
+++ b/app-backup/backuppc/backuppc-3.3.1-r5.ebuild
@@ -0,0 +1,197 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit depend.apache eutils user systemd
+
+MY_P="BackupPC-${PV}"
+
+DESCRIPTION="High-performance backups to a server's disk"
+HOMEPAGE="http://backuppc.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+
+IUSE="rss samba"
+
+# 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
+
+DEPEND="dev-lang/perl
+	app-admin/apache-tools
+	app-admin/makepasswd"
+
+# Older versions of mod_perl think they're compatibile with apache-2.4,
+# so we require the new one explicitly.
+RDEPEND="${DEPEND}
+	virtual/perl-IO-Compress
+	dev-perl/Archive-Zip
+	dev-perl/CGI
+	dev-perl/libwww-perl
+	app-arch/tar
+	app-arch/par2cmdline
+	app-arch/gzip
+	app-arch/bzip2
+	virtual/mta
+	>=www-apache/mod_perl-2.0.9
+	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] )
+	net-misc/rsync
+	dev-perl/File-RsyncP
+	rss? ( dev-perl/XML-RSS )
+	samba? ( net-fs/samba )"
+
+need_apache2_4
+
+SLOT="0"
+
+S="${WORKDIR}/${MY_P}"
+
+CGIDIR="/usr/lib/backuppc/htdocs"
+CONFDIR="/etc/BackupPC"
+DATADIR="/var/lib/backuppc"
+DOCDIR="/usr/share/doc/${PF}"
+LOGDIR="/var/log/BackupPC"
+
+pkg_setup() {
+	enewgroup backuppc
+	enewuser backuppc -1 /bin/bash /var/lib/backuppc backuppc
+}
+
+src_prepare() {
+	epatch "${FILESDIR}/3.3.0/01-fix-configure.pl.patch"
+	epatch "${FILESDIR}/3.3.0/02-fix-config.pl-formatting.patch"
+	epatch "${FILESDIR}/3.3.0/03-reasonable-config.pl-defaults.patch"
+
+	epatch "${FILESDIR}/3.2.0/04-add-docdir-marker.patch"
+	epatch "${FILESDIR}/3.2.0/05-nicelevel.patch"
+
+	epatch "${FILESDIR}"/${P}-perl522.patch #580254
+	epatch "${FILESDIR}"/${P}-perl526.patch #594128
+
+	# Fix docs location using the marker that we've patched in.
+	sed -i "s+__DOCDIR__+${DOCDIR}+" "lib/BackupPC/CGI/View.pm" \
+		|| die "failed to sed the documentation location"
+}
+
+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/backuppc-3.3.1-perl526.patch b/app-backup/backuppc/files/backuppc-3.3.1-perl526.patch
new file mode 100644
index 00000000000..3a04f94835c
--- /dev/null
+++ b/app-backup/backuppc/files/backuppc-3.3.1-perl526.patch
@@ -0,0 +1,21 @@
+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
+@@ -1261,7 +1261,7 @@
+         #
+         # Replace scalar variables first
+         #
+-        $arg =~ s[\${(\w+)}(\+?)]{
++        $arg =~ s[\$\{(\w+)}(\+?)]{
+             exists($vars->{$1}) && ref($vars->{$1}) ne "ARRAY"
+                 ? ($2 eq "+" ? $bpc->shellEscape($vars->{$1}) : $vars->{$1})
+                 : "\${$1}$2"
+@@ -1270,7 +1270,7 @@
+         # Now replicate any array arguments; this just works for just one
+         # array var in each argument.
+         #
+-        if ( $arg =~ m[(.*)\${(\w+)}(\+?)(.*)] && ref($vars->{$2}) eq "ARRAY" ) {
++        if ( $arg =~ m[(.*)\$\{(\w+)}(\+?)(.*)] && ref($vars->{$2}) eq "ARRAY" ) {
+             my $pre  = $1;
+             my $var  = $2;
+             my $esc  = $3;


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-07-07 22:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-26 12:55 [gentoo-commits] repo/gentoo:master commit in: app-backup/backuppc/, app-backup/backuppc/files/ Pacho Ramos
  -- strict thread matches above, loose matches on Subject: below --
2017-07-07 22:35 Andreas Hüttel
2016-01-19  0:05 Michael Orlitzky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox