summaryrefslogtreecommitdiff
blob: 4e8608ee5592b9f055457104ff9e8eeddfdbb93f (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-nds/gosa-core/gosa-core-2.6.12.ebuild,v 1.1 2011/03/01 06:47:43 dev-zero Exp $

EAPI=4

inherit eutils

DESCRIPTION="LDAP administration frontend for user administration."
HOMEPAGE="https://oss.gonicus.de/labs/gosa/wiki/WikiStart."
SRC_URI="ftp://oss.gonicus.de/pub/gosa/${P}.tar.bz2
	http://oss.gonicus.de/pub/gosa/${P}.tar.bz2
	ftp://oss.gonicus.de/pub/gosa/archive/${P}.tar.bz2
	http://oss.gonicus.de/pub/gosa/archive/${P}.tar.bz2	"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64"
IUSE="mail samba"

DEPEND="dev-lang/php[iconv,imap,ldap,mysql,session,zip]
	sys-devel/gettext"
RDEPEND="${DEPEND}
	virtual/httpd-php
	dev-perl/Crypt-SmbHash
	media-gfx/imagemagick"
PDEPEND="mail? ( ~net-nds/gosa-plugin-mail-${PV} )
	samba? ( ~net-nds/gosa-plugin-samba-${PV} )"

src_prepare() {
	epatch \
		"${S}/redhat/02_fix_class_mapping.patch" \
		"${S}/redhat/03_fix_locale_location.patch" \
		"${S}/redhat/04_fix_online_help_location.patch"
	sed -i \
		-e 's|../contrib|/usr/share/gosa/template|' \
		include/functions.inc || die "sed failed"
}

src_install() {
	insinto /usr/share/gosa
	doins -r doc html ihtml include locale plugins setup

	insinto /usr/share/gosa/template
	doins contrib/gosa.conf

	dosbin \
		update-gosa \
		bin/gosa-encrypt-passwords

	dobin \
		update-locale \
		update-online-help \
		update-pdf-help \
		dh-make-gosa \
		contrib/gosa

	insinto /etc/gosa
	doins \
		contrib/shells \
		contrib/encodings \
		contrib/desktoprc
	touch "${D}/etc/gosa/gosa.secrets"

	doicon debian/*.xpm
	domenu debian/gosa-desktop.desktop

	doman *.1 contrib/*.1 contrib/*.5

	dodoc contrib/openldap/slapd.conf
	insinto /etc/openldap/schema/gosa
	doins contrib/openldap/*.schema

	insinto /etc/apache2/vhosts.d
	doins "${FILESDIR}/gosa.include"

	dodoc AUTHORS Changelog FAQ README README.safemode

	keepdir /etc/gosa
	keepdir /var/spool/gosa
	keepdir /var/cache/gosa
}

pkg_prerm() {
	ebegin "Flushing the class and locale cache"
	rm -r "${EROOT}"var/cache/gosa/*
	eend $?
	ebegin "Clearing the spool directory"
	rm -r "${EROOT}"var/spool/gosa/*
	eend $?
}

pkg_postinst() {
	ebegin "Generating class cache and locales"
	"${EROOT}"usr/sbin/update-gosa
	eend $?

	elog "Please make sure that the web server you are going to use has"
	elog "read-write access to ${EROOT}var/spool/gosa"

	elog "For Apache there is the gosa.include file in ${EROOT}etc/apache/vhosts.d."
	elog "You can either use it as a template for your configuration or directly"
	elog "include it in your apache configuration."

	elog "GOsa requires some objectclasses and attributes to be present in the"
	elog "directory. A sample configuration for slapd.conf can be found here:"
	elog "    ${EROOR}usr/share/doc/${PF}/slapd.conf[.gz]"
}