summaryrefslogtreecommitdiff
blob: 7cc9e93461793765e27d355621ed21b840c566ff (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
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit git autotools

EGIT_REPO_URI="git://live.polito.it/var/git/feng.git"
EGIT_BOOTSTRAP="eautoreconf"

DESCRIPTION="Standard rtsp streaming server"
HOMEPAGE="http://live.polito.it/documentation/netembryo"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~x86 ~ppc64"
IUSE=""

RDEPEND="media-video/ffmpeg
		 >=dev-libs/glib-2
		 media-video/netembryo-git
		 dev-libs/bufferpool"
DEPEND="${RDEPEND}"

pkg_setup() {
	enewgroup feng
	enewuser feng -1 -1 /var/feng feng
}

pkg_config() {
	einfo "Installing default avroot to ${ROOT}/var/feng/avroot"
	mkdir -p "${ROOT}"/var/feng/avroot
	cp -R "${ROOT}"/usr/share/doc/${PF}/avroot/* "${ROOT}"/var/feng/avroot
	chown -R feng:0 "${ROOT}"/var/feng/avroot
}

pkg_postinst() {
	if [[ -e "${ROOT}/var/feng/avroot" ]] ; then
		einfo "The default avroot has not been installed into"
		einfo "${ROOT}/var/feng/avroot because the directory already exists"
		einfo "and we do not want to overwrite any files you have put there."
		einfo
		einfo "If you would like to install the latest avroot, please run"
		einfo "emerge --config =${PF}"
	else
		einfo "Installing default avroot to ${ROOT}/var/feng/avroot"
		mkdir -p "${ROOT}"/var/feng/avroot
		cp -R "${ROOT}"/usr/share/doc/${PF}/avroot/* "${ROOT}"/var/feng/avroot
		chown -R feng:0 "${ROOT}"/var/feng/avroot
	fi
}

src_compile() {
	econf --localstatedir=/var || die "econf failed"
	emake || die "emake failed"
}

src_install() {
	make DESTDIR=${D} install || die "make install failed"
	dodoc README
	mv ${D}/var/feng/avroot ${D}/usr/share/doc/${PF}/
	dodoc ChangeLog
	newinitd ${FILESDIR}/feng.rc feng
	newconfd ${FILESDIR}/feng.confd feng
}