summaryrefslogtreecommitdiff
path: root/app-backup/backuppc
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /app-backup/backuppc
reinit the tree, so we can have metadata
Diffstat (limited to 'app-backup/backuppc')
-rw-r--r--app-backup/backuppc/Manifest15
-rw-r--r--app-backup/backuppc/backuppc-3.3.1-r4.ebuild196
-rw-r--r--app-backup/backuppc/backuppc-3.3.1-r5.ebuild197
-rw-r--r--app-backup/backuppc/files/3.2.0/04-add-docdir-marker.patch11
-rw-r--r--app-backup/backuppc/files/3.2.0/05-nicelevel.patch18
-rw-r--r--app-backup/backuppc/files/3.3.0/01-fix-configure.pl.patch30
-rw-r--r--app-backup/backuppc/files/3.3.0/02-fix-config.pl-formatting.patch137
-rw-r--r--app-backup/backuppc/files/3.3.0/03-reasonable-config.pl-defaults.patch64
-rw-r--r--app-backup/backuppc/files/99_backuppc.conf32
-rw-r--r--app-backup/backuppc/files/backuppc-3.3.1-perl522.patch17
-rw-r--r--app-backup/backuppc/files/backuppc-3.3.1-perl526.patch21
-rw-r--r--app-backup/backuppc/files/backuppc.service13
-rw-r--r--app-backup/backuppc/metadata.xml8
13 files changed, 759 insertions, 0 deletions
diff --git a/app-backup/backuppc/Manifest b/app-backup/backuppc/Manifest
new file mode 100644
index 000000000000..143c55d7f687
--- /dev/null
+++ b/app-backup/backuppc/Manifest
@@ -0,0 +1,15 @@
+AUX 3.2.0/04-add-docdir-marker.patch 470 SHA256 9236caf66f1d5cd607ced53173cd127d49bfacb08212e93e0beff37ad80cc4bb SHA512 82b3fbb9c86405f2d8ab12f0a8de21d4b793ec012bfb1cd0fb3a51b769c3d29cfda1adf1b701826fd3e36e0a8aaf10b84b75643620b6512bd2351bbe768fc636 WHIRLPOOL 3526872a7f3ee121791624f4ba8c19a9cbbf899813ec832e2bcb6da77b9e936c845f893e9665d038d918802cc99fee92712737df12d734a411c118a97376d2ed
+AUX 3.2.0/05-nicelevel.patch 756 SHA256 a707a592754fadc92a769a488518b355468afa8d57a280e29adff4e8c4384566 SHA512 b33fe04ba54c8d28c51a3c2d85b13e204db9a7f4f193d25888c168234f6fbe6f02a49403b7097f056d7ab8495cddaf457f1776d64bcc84188d2d67e8ea77c1f6 WHIRLPOOL bf6150e8e4c149762c0b53ac79d591215f2594eaeabb1408c6bc432653a5b713bf5894e94d4480eb765be10a3b7a9294f87994e022529e750e19ebe68f4ce746
+AUX 3.3.0/01-fix-configure.pl.patch 1098 SHA256 54b7371fd3f68a9d3dde5f06b93992aa3c5a17f0d759c7b674fa7a640b461d43 SHA512 532b88689e50c0a399b42a3264975e1fc71a97b9edfd60faf5e94d0bfad972717c380b8925ca4d7df1e402b13f7104082a57bbecd3fbf74113c6f0e4d0990584 WHIRLPOOL 1eb3dcc5bae154a02132a55c80142196dd98f932678df73cdb88b2fafaa3cc88d9583cee21046794f7e6eeb24573d4d6258fd6bcf84ac0a2da45ae4c613d639f
+AUX 3.3.0/02-fix-config.pl-formatting.patch 3900 SHA256 e75fcd312bb0a7c6dc86f9d3c66686789ecaffe7ecb3ce24c413f4accbcf46ed SHA512 e61e0bd445c57e1726411a5dec3a21f0d0f6ab6d394cc1882f0de467f9515d6299f3bf4955fbfaafd049097f0814665114e8453d750db19a063202af1378f394 WHIRLPOOL 498d719c853888af6abd6a9185be39c38fcd163bf57119657a611387deeed723ce2dea76f820aa73e57fa7385c8cab3d27d550805834d691ed9ffec3d2f5cc83
+AUX 3.3.0/03-reasonable-config.pl-defaults.patch 1904 SHA256 343245b84f80dd556cef02fda338729204442be8eb0f6c01b69634edee59b31f SHA512 19033dfefa135cba82d7fef50e619916af710d40c46c214e508cd83cf9cbcf032b8fa54e960e5c685e428b3646777b1040c6d067e0d642d8ba9623ade0fb6d11 WHIRLPOOL d30398f169dca1324784de4e7046cfcb7a71b9022f0cb67cc114e2f7b4e8695702ddde8bacee6c04645958c446f2cfa5d218fd70b992b356f2ab199da15b96c1
+AUX 99_backuppc.conf 718 SHA256 13b0e98b8a306de5b32330b53840a1a1e07c48f62aa6544fea5167fae3fed04f SHA512 cb68dfbb635564740428850ea3f026ebc0b8e22b2bca52640b2f367e5487fa205b00ec82e4e192b311e2886686b81f9ea52de54886994c6cce1cd154937fa0ee WHIRLPOOL 2d9abe48f24ffeabedaafb37e0219b4b6e1e044b195ae32c8afedabaf57188db5709dff5c992f3102bdb1e3724f25c496e08975d861a3beb378df0cb0c4d005c
+AUX backuppc-3.3.1-perl522.patch 607 SHA256 39e5b941705920f2a8f2ec73523d920861af0278021072e3d18a8826a5d1908a SHA512 4d33fff4df53ee885676d58f78984616bb413fcbfd16fdacff0656d70a7c70c012c25f2fd685b360d878ebd407e76fab23103617f2bde0007ad9fc6bf34128c0 WHIRLPOOL 1ad5f7b15ff99130bddac84fec205a0d2fbf25f68dfecb25375599d5dc8272552e1e6aa46006852f631d472a3ab76ec82efb23cda0841633a9c4d308b24a9e74
+AUX backuppc-3.3.1-perl526.patch 969 SHA256 c3a9ecbd526268b4610025455467ff594f8a9bc3bc94ea602616253760b1d485 SHA512 da626131a3253bbc6fe46a06f74462a2d356a71ae369e8de88acca2d85376be0d6ad16c8c566f7c80b93e794808f8b1c09a75707d5031dc64b93ab0f698faced WHIRLPOOL bbf89cf615cb0e2db781589e41e27256d0cc4827028fca45423fbc61c625f23f8117011b9928f6f324efcf2a40bd8b48c08d08e1453de3824f9763bcbbd36124
+AUX backuppc.service 231 SHA256 64114b3ba85c4f6fe313734523c5c2f53f269bf69aea71b85d8f2a8fad7f80f8 SHA512 9a7cb7ac7da2851cfaf90fafe082800fbac34a5a40a9f6aed1ea817b6f9aeb5be60cb3cfb35c263997c2ac1d22f3384752a23f44158572a9efc8f2c48e99c969 WHIRLPOOL 73d966f11ee9070c73016a77373bc80cf90b746fe67f53a178f439767c72b6d2efcfc16b66d4771e11a5862006e26bcff433da1dc4668635ea3e8f1254b28ef9
+DIST BackupPC-3.3.1.tar.gz 556461 SHA256 c9cc4aec28a7474a68d40f4bc460ff15140e05c96900c7f98ff3ef06c4f6ae4c SHA512 b6bb9de3103c5062098d80755055b7461ae9133a4a46a66b3d0af89d081086571694db1898e7d85880defa15b030bad522812116ae5361c0fbde90b877d139c6 WHIRLPOOL 1d895f530932fc1287cde9db584befc6ca0850b5841cc4e60927442d0db662ec092bda4efa4953650d3bfa13deb6e9fafa25c10f82e19b39c67969bb4e143bac
+EBUILD backuppc-3.3.1-r4.ebuild 5477 SHA256 6a38cb3548b056d35fa06112f1b4a90144db7276dfb48145f3d71f9cc0656396 SHA512 baaa06ec3fad3743f213def8dada6ada60973068f9629d9508e561570567189736190aa7be557c6b3a917f238b331ce4ea79c1160e9e916e6c233ffe455f8e82 WHIRLPOOL 38361bed12d687eb8f7595afd3d33ff5d425146add36998d30c47f825a4076a23b70348b4ade37120b01bce396cacaf5bb7e9c4f47751926c1653529cb221e8a
+EBUILD backuppc-3.3.1-r5.ebuild 5527 SHA256 c11b158eeaf4533f47501332979c77c6deea69f94ba900467970cffe36f9035c SHA512 62674f0cbf192ccabcdf07c638949e97138229d63bf20fd785513a19f2612b3d2fc78a92010125bb509c23ca1f7aee4d68ff776af0c985732bf2db2d8ed34998 WHIRLPOOL 925f19a4572a28fe3f01a0b3ed9259cf79e6f172d06c06021627bd3044dd5eb908bb2860f7a2b4a535d80a3595cc777d348b5c35ac6189424ec550c9f5646746
+MISC ChangeLog 5475 SHA256 3314e604fac7c9aa6f2aaeac3455267155348c8098410ab78036de0c9e1c9481 SHA512 9489dd75dd8d3a4293dfacca4e87cf8950caeb12bc1ffab6799e760595d11baededaa1ee539c5162284a1aeee727fefafb69761a3f6cc23073d877434cf6d0a7 WHIRLPOOL 38b1bd5d921381f44c3c5e5d32dccc4821075b963673efed1953210b0d59b5e72fe476d5a27601777bfe8b76b3569e9f0907ff4e38e6884f34401f08e8694eef
+MISC ChangeLog-2015 4969 SHA256 ff971ce4f576305d8716057a045d3e03ce91c11b911d53b654e818afeda89b28 SHA512 94f00aa13f98e63dc1ab372fd44430afd868d9e5c3353782ece3aa6d88d20677afa560d4cf9d0b741342f97d24253185913107b30773cba1a21e0bf36f24140e WHIRLPOOL 556015ae5a37c510febd7926ec277a1839bf6162e70ce246c1f966b79f82d67d6d797bcea4540650a2b80a19350bafa3aab3f37a36b14edd96ddc00820dbc700
+MISC metadata.xml 245 SHA256 2ed31d145dc2ab60b1831fb2907b6345be8646b5200997e2d2f8e2b3ef8cf6dc SHA512 4129c00f4fd37b4c2e051df35c98105ee97b74bc2a8af78e97f2cbc4c97d14740456fc01ed2ab5c6df3bab10a17ce1728de9e4b83cfee393a8841e8933232877 WHIRLPOOL 757f6848afff294f8f748273dc054a16758d724a506b103b87a5bdf0f0a2a4200637b456eb3d94b3b42e2439633c15387b2035a32d7fe4cef1f2b23cd17d2c87
diff --git a/app-backup/backuppc/backuppc-3.3.1-r4.ebuild b/app-backup/backuppc/backuppc-3.3.1-r4.ebuild
new file mode 100644
index 000000000000..62d816fa2e8a
--- /dev/null
+++ b/app-backup/backuppc/backuppc-3.3.1-r4.ebuild
@@ -0,0 +1,196 @@
+# 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
+
+ # 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/backuppc-3.3.1-r5.ebuild b/app-backup/backuppc/backuppc-3.3.1-r5.ebuild
new file mode 100644
index 000000000000..879139e9d5e9
--- /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/3.2.0/04-add-docdir-marker.patch b/app-backup/backuppc/files/3.2.0/04-add-docdir-marker.patch
new file mode 100644
index 000000000000..0355aedf04b7
--- /dev/null
+++ b/app-backup/backuppc/files/3.2.0/04-add-docdir-marker.patch
@@ -0,0 +1,11 @@
+--- 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
+@@ -86,7 +86,7 @@
+ $file = $bpc->ConfDir() . "/hosts";
+ $linkHosts = 1;
+ } elsif ( $type eq "docs" ) {
+- $file = $bpc->InstallDir() . "/doc/BackupPC.html";
++ $file = "__DOCDIR__/BackupPC.html";
+ } elsif ( $host ne "" ) {
+ if ( !defined($In{num}) ) {
+ # get the latest LOG file
diff --git a/app-backup/backuppc/files/3.2.0/05-nicelevel.patch b/app-backup/backuppc/files/3.2.0/05-nicelevel.patch
new file mode 100644
index 000000000000..50938f60bcdc
--- /dev/null
+++ b/app-backup/backuppc/files/3.2.0/05-nicelevel.patch
@@ -0,0 +1,18 @@
+--- 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
+@@ -21,7 +21,7 @@
+ start() {
+ checkconfig || return 1
+ ebegin "Starting BackupPC"
+- start-stop-daemon --start --chuid ${USER} --user ${USER} --pidfile ${PID_FILE} --exec ${EXEC} -- ${EXEC_OPTIONS}
++ start-stop-daemon --start --chuid ${USER} --user ${USER} --nicelevel ${NICELEVEL} --pidfile ${PID_FILE} --exec ${EXEC} -- ${EXEC_OPTIONS}
+ 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
+@@ -3,3 +3,4 @@
+ PID_FILE=__LOGDIR__/BackupPC.pid
+ EXEC=__INSTALLDIR__/bin/BackupPC
+ EXEC_OPTIONS=-d
++NICELEVEL=0
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
new file mode 100644
index 000000000000..c943fdce68b1
--- /dev/null
+++ b/app-backup/backuppc/files/3.3.0/01-fix-configure.pl.patch
@@ -0,0 +1,30 @@
+--- configure.pl.dist 2013-09-23 23:01:19.524743747 +0300
++++ configure.pl 2013-09-23 23:01:37.344567459 +0300
+@@ -158,7 +158,7 @@
+ # config file to get all the defaults.
+ #
+ my $ConfigPath = "";
+-my $ConfigFileOK = 1;
++my $ConfigFileOK = 0;
+ while ( 1 ) {
+ if ( $ConfigFileOK && -f "/etc/BackupPC/config.pl" ) {
+ $ConfigPath = "/etc/BackupPC/config.pl";
+@@ -213,7 +213,8 @@
+ $bpc->{LogDir} = $Conf{LogDir} = "$Conf{TopDir}/log"
+ if ( $Conf{LogDir} eq '' );
+ }
+- $bpc->{ConfDir} = $Conf{ConfDir} = $confDir;
++ # Disable this as it's not really neccessary for this ebuild
++ # $bpc->{ConfDir} = $Conf{ConfDir} = $confDir;
+ my $err = $bpc->ServerConnect($Conf{ServerHost}, $Conf{ServerPort}, 1);
+ if ( $err eq "" ) {
+ print <<EOF;
+@@ -729,7 +730,7 @@
+ if ( $Conf{CgiDir} =~ m{cgi-bin(/.*)} ) {
+ $Conf{CgiURL} = "'http://$Conf{ServerHost}/cgi-bin$1/BackupPC_Admin'";
+ } else {
+- $Conf{CgiURL} = "'http://$Conf{ServerHost}/cgi-bin/BackupPC_Admin'";
++ $Conf{CgiURL} = "'http://$Conf{ServerHost}/BackupPC_Admin'";
+ }
+ }
+
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
new file mode 100644
index 000000000000..79ad6547fa6f
--- /dev/null
+++ b/app-backup/backuppc/files/3.3.0/02-fix-config.pl-formatting.patch
@@ -0,0 +1,137 @@
+--- conf/config.pl.dist 2013-09-23 23:05:50.332064754 +0300
++++ 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.
+ #
+-$Conf{ServerInitdPath} = '';
++$Conf{ServerInitdPath} = undef;
+ $Conf{ServerInitdStartCmd} = '';
+
+
+@@ -373,7 +373,7 @@
+ # time taken for the backup, plus the granularity of $Conf{WakeupSchedule}
+ # will make the actual backup interval a bit longer.
+ #
+-$Conf{FullPeriod} = 6.97;
++$Conf{FullPeriod} = '6.97';
+
+ #
+ # Minimum period in days between incremental backups (a user requested
+@@ -383,7 +383,7 @@
+ # time taken for the backup, plus the granularity of $Conf{WakeupSchedule}
+ # will make the actual backup interval a bit longer.
+ #
+-$Conf{IncrPeriod} = 0.97;
++$Conf{IncrPeriod} = '0.97';
+
+ #
+ # Number of full backups to keep. Must be >= 1.
+@@ -458,7 +458,7 @@
+ # $Conf{FullKeepCnt} = 4;
+ # $Conf{FullKeepCnt} = [4];
+ #
+-$Conf{FullKeepCnt} = 1;
++$Conf{FullKeepCnt} = [1];
+
+ #
+ # Very old full backups are removed after $Conf{FullAgeMax} days. However,
+@@ -688,7 +688,7 @@
+ # '*' => ['/myFiles', '/important'], # these are other shares
+ # };
+ #
+-$Conf{BackupFilesOnly} = undef;
++$Conf{BackupFilesOnly} = {};
+
+ #
+ # List of directories or files to exclude from the backup. For Smb,
+@@ -749,7 +749,7 @@
+ # '*' => ['/junk', '/dont_back_this_up'], # these are for other shares
+ # };
+ #
+-$Conf{BackupFilesExclude} = undef;
++$Conf{BackupFilesExclude} = {};
+
+ #
+ # PCs that are always or often on the network can be backed up after
+@@ -932,7 +932,7 @@
+ #
+ # This setting only matters if $Conf{XferMethod} = 'smb'.
+ #
+-$Conf{SmbShareName} = 'C$';
++$Conf{SmbShareName} = ['C$'];
+
+ #
+ # Smbclient share user name. This is passed to smbclient's -U argument.
+@@ -1054,7 +1054,7 @@
+ #
+ # This setting only matters if $Conf{XferMethod} = 'tar'.
+ #
+-$Conf{TarShareName} = '/';
++$Conf{TarShareName} = ['/'];
+
+ #
+ # Command to run tar on the client. GNU tar is required. You will
+@@ -1233,7 +1233,7 @@
+ #
+ # $Conf{RsyncShareName} = ['/', '/var', '/data', '/boot'];
+ #
+-$Conf{RsyncShareName} = '/';
++$Conf{RsyncShareName} = ['/'];
+
+ #
+ # Rsync daemon port on the client, for $Conf{XferMethod} = "rsyncd".
+@@ -1285,7 +1285,7 @@
+ #
+ # This setting has no effect unless checksum caching is turned on.
+ #
+-$Conf{RsyncCsumCacheVerifyProb} = 0.01;
++$Conf{RsyncCsumCacheVerifyProb} = '0.01';
+
+ #
+ # Arguments to rsync for backup. Do not edit the first set unless you
+@@ -1883,7 +1883,7 @@
+ # rounded up (ie: 2.5 means a user will never receive email more
+ # than once every 3 days).
+ #
+-$Conf{EMailNotifyMinDays} = 2.5;
++$Conf{EMailNotifyMinDays} = '2.5';
+
+ #
+ # Name to use as the "from" name for email. Depending upon your mail
+@@ -1938,7 +1938,7 @@
+ # When there have been no backups in this number of days the user
+ # is sent an email.
+ #
+-$Conf{EMailNotifyOldBackupDays} = 7.0;
++$Conf{EMailNotifyOldBackupDays} = 7;
+
+ #
+ # This subject and message is sent to a user if their PC has not recently
+@@ -1965,7 +1965,7 @@
+ # How old the most recent backup of Outlook files has to be before
+ # notifying user.
+ #
+-$Conf{EMailNotifyOldOutlookDays} = 5.0;
++$Conf{EMailNotifyOldOutlookDays} = 5;
+
+ #
+ # This subject and message is sent to a user if their Outlook files have
+@@ -2102,14 +2102,17 @@
+ {
+ link => "?action=view&type=docs",
+ lname => "Documentation", # actually displays $Lang->{Documentation}
++ name => undef,
+ },
+ {
+ link => "http://backuppc.wiki.sourceforge.net",
+ name => "Wiki", # displays literal "Wiki"
++ lname => undef,
+ },
+ {
+ link => "http://backuppc.sourceforge.net",
+ name => "SourceForge", # displays literal "SourceForge"
++ lname => undef,
+ },
+ ];
+
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
new file mode 100644
index 000000000000..8b54fc87b050
--- /dev/null
+++ b/app-backup/backuppc/files/3.3.0/03-reasonable-config.pl-defaults.patch
@@ -0,0 +1,64 @@
+--- conf/config.pl.formatted 2013-09-23 23:12:30.708129365 +0300
++++ conf/config.pl 2013-09-23 23:12:39.448043656 +0300
+@@ -1305,7 +1305,7 @@
+ '--times',
+ '--block-size=2048',
+ '--recursive',
+-
++ '--specials',
+ #
+ # Rsync >= 2.6.3 supports the --checksum-seed option
+ # which allows rsync checksum caching on the server.
+@@ -1313,7 +1313,7 @@
+ # you have a recent client rsync version and you want
+ # to enable checksum caching.
+ #
+- #'--checksum-seed=32761',
++ '--checksum-seed=32761',
+ ];
+
+ #
+@@ -1383,6 +1383,7 @@
+ '--relative',
+ '--ignore-times',
+ '--recursive',
++ '--specials',
+
+ #
+ # Rsync >= 2.6.3 supports the --checksum-seed option
+@@ -1391,7 +1392,7 @@
+ # you have a recent client rsync version and you want
+ # to enable checksum caching.
+ #
+- #'--checksum-seed=32761',
++ '--checksum-seed=32761',
+
+ #
+ # Add additional arguments here
+@@ -2029,7 +2030,7 @@
+ # --> administrative users are only craig and celia'.
+ #
+ $Conf{CgiAdminUserGroup} = '';
+-$Conf{CgiAdminUsers} = '';
++$Conf{CgiAdminUsers} = 'backuppc';
+
+ #
+ # URL of the BackupPC_Admin CGI script. Used for email messages.
+@@ -2076,7 +2077,7 @@
+ # dates (MM/DD), a value of 2 uses full YYYY-MM-DD format, and zero
+ # for international dates (DD/MM).
+ #
+-$Conf{CgiDateFormatMMDD} = 1;
++$Conf{CgiDateFormatMMDD} = 2;
+
+ #
+ # If set, the complete list of hosts appears in the left navigation
+@@ -2262,7 +2263,7 @@
+ ClientTimeout => 1,
+ MaxOldPerPCLogFiles => 1,
+ CompressLevel => 1,
+- ClientNameAlias => 1,
++ ClientNameAlias => 0,
+ DumpPreUserCmd => 0,
+ DumpPostUserCmd => 0,
+ RestorePreUserCmd => 0,
diff --git a/app-backup/backuppc/files/99_backuppc.conf b/app-backup/backuppc/files/99_backuppc.conf
new file mode 100644
index 000000000000..eae766e4fa75
--- /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>
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 000000000000..fb7eeeef1e02
--- /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 );
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 000000000000..3a04f94835c3
--- /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;
diff --git a/app-backup/backuppc/files/backuppc.service b/app-backup/backuppc/files/backuppc.service
new file mode 100644
index 000000000000..7c4877a4ee24
--- /dev/null
+++ b/app-backup/backuppc/files/backuppc.service
@@ -0,0 +1,13 @@
+[Unit]
+Description= BackupPC server
+After=syslog.target local-fs.target remote-fs.target
+
+[Service]
+Type=oneshot
+User=backuppc
+Group=backuppc
+ExecStart=/usr/bin/BackupPC -d
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
diff --git a/app-backup/backuppc/metadata.xml b/app-backup/backuppc/metadata.xml
new file mode 100644
index 000000000000..13724624fa85
--- /dev/null
+++ b/app-backup/backuppc/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <!-- maintainer-needed -->
+ <upstream>
+ <remote-id type="sourceforge">backuppc</remote-id>
+ </upstream>
+</pkgmetadata>