summaryrefslogtreecommitdiff
blob: 0773811d7052008cc1c0f81e019ecbdd1dccc7c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=5

PYTHON_COMPAT=( python2_7 )

inherit eutils multilib systemd user python-r1

DESCRIPTION="NTLM proxy Authentication against MS proxy/web server"
HOMEPAGE="http://ntlmaps.sourceforge.net/"
SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~x86"

DEPEND="${PYTHON_DEPS}"
RDEPEND="${DEPEND}"

pkg_setup() {
	enewgroup ntlmaps
	enewuser ntlmaps -1 -1 -1 ntlmaps
}

src_prepare() {
	epatch "${FILESDIR}/${P}-gentoo.patch"

	sed \
		-e 's/\r//' \
		-i lib/*.py server.cfg doc/*.{txt,htm} || die 'Failed to convert line endings.'
}

src_install() {
	# Bug #351305, prevent file collision.
	rm "${S}"/lib/utils.py || die

	python_foreach_impl python_domodule lib/*.py

	python_foreach_impl python_newscript main.py ntlmaps

	python_foreach_impl python_optimize

	dodoc doc/*.txt
	dohtml doc/*.{gif,htm}

	insopts -m0640 -g ntlmaps
	insinto /etc/ntlmaps
	doins server.cfg
	newinitd "${FILESDIR}/ntlmaps.init" ntlmaps
	systemd_dounit "${FILESDIR}"/${PN}.service

	diropts -m 0770 -g ntlmaps
	keepdir /var/log/ntlmaps
}