dev-ruby/metaclass-0.0.4-r0: add alpha keyword
[gentoo.git] / app-backup / burp / burp-1.4.40-r1.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6
7 inherit autotools eutils user
8
9 DESCRIPTION="Network backup and restore client and server for Unix and Windows"
10 HOMEPAGE="http://burp.grke.org/"
11 SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2
12         http://burp.grke.org/downloads/${P}/${P}.tar.bz2"
13
14 LICENSE="AGPL-3"
15 SLOT="0"
16 KEYWORDS="~amd64"
17 IUSE="acl afs ipv6 libressl nls tcpd xattr"
18
19 DEPEND="
20         !libressl? ( dev-libs/openssl:0= )
21         libressl? ( dev-libs/libressl:0= )
22         dev-libs/uthash
23         sys-libs/libcap
24         <net-libs/librsync-2.0
25         sys-libs/ncurses:0=
26         sys-libs/zlib
27         acl? ( sys-apps/acl )
28         afs? ( net-fs/openafs )
29         nls? ( sys-devel/gettext )
30         tcpd? ( sys-apps/tcp-wrappers )
31         xattr? ( sys-apps/attr )
32         "
33 RDEPEND="${DEPEND}
34         virtual/logger
35         "
36
37 DOCS=( CONTRIBUTORS DONATIONS UPGRADING )
38 PATCHES=(
39         "${FILESDIR}/${PV}-non-zero-or-build-failure.patch"
40         "${FILESDIR}/${PV}-bedup-conf-path.patch"
41         "${FILESDIR}/${PV}-tinfo.patch"
42         )
43
44 pkg_setup() {
45         enewgroup "${PN}"
46         enewuser "${PN}" -1 "" "" "${PN}"
47 }
48
49 src_prepare() {
50         epatch "${PATCHES[@]}"
51         eautoreconf
52 }
53
54 src_configure() {
55         local myeconfargs=(
56                 --sbindir=/usr/sbin
57                 --sysconfdir=/etc/burp
58                 --enable-largefile
59                 $(use_enable acl)
60                 $(use_enable afs)
61                 $(use_enable ipv6)
62                 $(use_enable nls)
63                 $(use_enable xattr)
64                 $(use_with tcpd tcp-wrappers)
65         )
66         econf "${myeconfargs[@]}"
67 }
68
69 src_install() {
70         default
71
72         fowners root:burp /etc/burp /var/spool/burp
73         fperms 0775 /etc/burp /var/spool/burp
74         fowners root:burp /etc/burp/clientconfdir
75         fperms 0750 /etc/burp/clientconfdir
76         fowners root:burp /etc/burp/burp-server.conf
77         fperms 0640 /etc/burp/burp-server.conf
78
79         newinitd "${FILESDIR}"/${PN}.initd ${PN}
80         dodoc docs/*
81
82         sed -e 's|^# user=graham|user = burp|' \
83                 -e 's|^# group=nogroup|group = burp|' \
84                 -e 's|^pidfile = .*|lockfile = /run/lock/burp/server.lock|' \
85                 -i "${D}"/etc/burp/burp-server.conf || die
86 }
87
88 pkg_postinst() {
89         if [[ ! -e /etc/burp/CA/index.txt ]]; then
90                 elog "At first run burp server will generate DH parameters and SSL"
91                 elog "certificates.  You should adjust configuration before."
92                 elog "Server configuration is located at"
93                 elog ""
94                 elog "  /etc/burp/burp-server.conf"
95                 elog ""
96         fi
97 }