app-backup/bacula: amd64 stable wrt bug #705862
[gentoo.git] / app-backup / flexbackup / flexbackup-1.2.1-r13.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit versionator
7
8 DESCRIPTION="Flexible backup script using perl"
9 HOMEPAGE="http://flexbackup.sourceforge.net/"
10 SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
11
12 LICENSE="GPL-2"
13 SLOT="0"
14 KEYWORDS="amd64 hppa ppc x86"
15 IUSE=""
16
17 RDEPEND="app-arch/mt-st"
18 DEPEND="${RDEPEND}"
19
20 DOCS="CHANGES CREDITS README TODO"
21 HTML_DOCS="faq.html"
22
23 src_prepare() {
24         # Patch from upstream adds optional lzma compression mode.
25         eapply -p0 "${FILESDIR}"/${P}-lzma.patch
26
27         # Fix bug #116510: cannot back up remote machines after patch CAN-2005-2965
28         eapply "${FILESDIR}"/${P}-secure-tempfile.patch
29
30         # Fix bug #96334: incorrectly determines bash 3.x to be bash 1.x
31         eapply -p0 "${FILESDIR}"/${P}-bash.patch
32
33         # Fix bug #171205: specifies wrong command line option for mbuffer / other small enhancements
34         eapply "${FILESDIR}"/${P}-mbuffer-switch.patch
35
36         # Fix bug #173672: remote host buffer test is broken
37         eapply "${FILESDIR}"/${P}-remote-bufftest.patch
38
39         # Fix bug #178126: subtle subtree pruning issue / other small issues
40         eapply "${FILESDIR}"/${P}-prune.patch
41
42         # Fix bug #184560: fails to back up targets with spaces in their names in some modes
43         eapply -p0 "${FILESDIR}"/${P}-spaces-in-filenames.patch
44
45         # Fix bug #190357: fails on very large files with afio back end
46         eapply -p0 "${FILESDIR}"/${P}-afio-large-files.patch
47
48         # Fix bug #235416: prevent normal status message during conf file read from going to stderr
49         eapply -p0 "${FILESDIR}"/${P}-quieten.patch
50
51         # Fix bug #331673: perl 5.12 deprecation warnings.
52         eapply -p0 "${FILESDIR}"/${P}-perl-5.12-deprecation-warning.patch
53
54         # Fix bug #495232: perl 5.16 deprecation warnings.
55         eapply -p0 "${FILESDIR}"/${P}-perl-5.16-deprecation-warning.patch
56
57         # Fix bug #601368: app-backup/flexbackup breaks with >=app-arch/tar-1.29 when making tar-based backups
58         eapply "${FILESDIR}"/${P}-tar-1.29.patch
59
60         eapply_user
61
62         sed -i \
63                 -e '/^\$type = /s:afio:tar:' \
64                 -e "/^\$buffer = /s:'buffer':'false':" \
65                 flexbackup.conf \
66                 || die "Failed to set modified configuration defaults."
67
68         MY_PV=$(replace_all_version_separators '_')
69         sed -i \
70                 -e "/^[[:blank:]]*my \$ver = /s:${MY_PV}:&-${PR}:" \
71                 flexbackup \
72                 || die "Failed to apply ebuild revision to internal version string."
73 }
74
75 src_install() {
76         dodir /etc /usr/bin /usr/share/man/man{1,5}
77         emake install \
78                 PREFIX="${D}"/usr \
79                 CONFFILE="${D}"/etc/flexbackup.conf
80
81         einstalldocs
82 }
83
84 pkg_postinst() {
85         elog "Please edit your /etc/flexbackup.conf file to suit your"
86         elog "needs.  If you are using devfs, the tape device should"
87         elog "be set to /dev/tapes/tape0/mtn.  If you need to use any"
88         elog "archiver other than tar, please emerge it separately."
89 }