summaryrefslogtreecommitdiff
blob: e70b6f91e3c90e76677f449457137bad0581638c (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
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-util/cvsup/cvsup-16.1h.ebuild,v 1.14 2004/07/14 23:10:33 agriffis Exp $

inherit eutils

MY_P="${P/-/-snap-}"
DESCRIPTION="a faster alternative to cvs"
HOMEPAGE="http://www.cvsup.org/"
SRC_URI="ftp://ftp3.freebsd.org/pub/FreeBSD/development/CVSup/sources/${MY_P}.tar.gz"

LICENSE="BSD"
SLOT="0"
KEYWORDS="-* x86 ppc"
IUSE="X doc static"

DEPEND="virtual/libc
	dev-util/yacc
	>=sys-apps/sed-4
	virtual/m3"
RDEPEND="virtual/libc"

S=${WORKDIR}/${MY_P}

src_unpack() {
	unpack ${A}
	[ ${ARCH} == "ppc" ] && epatch ${FILESDIR}/${PV}-ppc.patch
}

src_compile() {
	local mym3flags=""
	use static && mym3flags="${mym3flags} -DSTATIC"
	use X || mym3flags="${mym3flags} -DNOGUI"
	[ "${mym3flags:0:1}" == " " ] && mym3flags="${mym3flags:1}"
	sed -i \
		-e "s:/usr/local:${D}/usr:" \
	 	-e "s:^M3FLAGS=:M3FLAGS=${mym3flags}:" \
		Makefile || die "sed Makefile failed"

	# then we fix the /usr/local/etc/cvsup paths in all the files
	sed -i \
		-e "s:/usr/local/etc:/etc:" \
		`grep /usr/local/etc * -Rl` \
		|| die "sed ${f} failed"

	# then we compile cvsup
	make || die "cvsup compile failed"

	# now we do up the html pages ...
	if use doc ; then
		cd ${S}/doc
		make || die "html pages failed to compile !?"
		sed -i -e "s:images/::" *.html || die "sed ${f} failed"
		mv ${S}/doc/images/* ${S}/doc/
	fi
}

src_install() {
	dodir /var/cvsup

	for f in `find . -perm +1 -type f | grep -v doc` ; do
		dobin ${f} || die "dobin failed (${f})"
	done

	doman */src/*.[1-9] || die "doman failed"
	use doc && dohtml doc/*.{html,gif}
	dodoc Acknowledgments Announce Blurb ChangeLog Install

	insinto /etc/cvsup
	doins ${FILESDIR}/gentoo.sup ${FILESDIR}/gentoo_mirror.sup
	exeinto /etc/init.d
	newexe ${FILESDIR}/cvsupd.rc cvsupd || die "newexe failed"
	insinto /etc/conf.d
	newins ${FILESDIR}/cvsupd.confd cvsupd || die "newins failed"
}