summaryrefslogtreecommitdiff
blob: 50d651492d436b7add6531df77882ef034cb5622 (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
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-fs/cvmfs/cvmfs-2.1.10.ebuild,v 1.1 2013/06/17 23:03:46 bicatali Exp $

EAPI=5

inherit cmake-utils

DESCRIPTION="HTTP read-only file system for distributing software"
HOMEPAGE="http://cernvm.cern.ch/portal/filesystem"
SRC_URI="https://ecsft.cern.ch/dist/${PN}/${P}/${P}.tar.gz"

LICENSE="BSD"
SLOT="0"

IUSE="+client debug doc server"

CDEPEND="
	dev-db/sqlite:3
	dev-libs/openssl
	net-dns/c-ares
	net-misc/curl[adns]
	sys-libs/zlib
	client? (
		dev-cpp/sparsehash
		dev-libs/leveldb
		sys-fs/fuse )
	server? ( sys-libs/zlib )"

RDEPEND="${CDEPEND}
	client? ( net-fs/autofs )
	server? ( www-servers/apache[ssl] )"

DEPEND="${CDEPEND}
	virtual/pkgconfig
	doc? ( app-doc/doxygen[dot] )"

PATCHES=(
	"${FILESDIR}"/${P}-no-config.patch
	"${FILESDIR}"/${P}-openrc.patch
)

src_prepare() {
	sed -i -e 's/COPYING//' CMakeLists.txt || die
	cp "${FILESDIR}"/Find*.cmake cmake/Modules/ || die
	rm bootstrap.sh || die
	cmake-utils_src_prepare
}

src_configure() {
	local mycmakeargs=(
		-DCARES_BUILTIN=OFF
		-DSQLITE3_BUILTIN=OFF
		-DLIBCURL_BUILTIN=OFF
		-DZLIB_BUILTIN=OFF
		-DSPARSEHASH_BUILTIN=OFF
		-DLEVELDB_BUILTIN=OFF
		$(cmake-utils_use debug BUILD_SERVER_DEBUG)
		$(cmake-utils_use server BUILD_SERVER)
		$(cmake-utils_use client BUILD_CVMFS)
		$(cmake-utils_use client BUILD_LIBCVMFS)
		$(cmake-utils_use client INSTALL_MOUNT_SCRIPTS)
	)
	cmake-utils_src_configure
}

src_compile() {
	cmake-utils_src_compile
	if use doc; then
		cd doc
		doxygen cvmfs.doxy || die
	fi
}

src_install() {
	cmake-utils_src_install
	use doc && dohtml -r doc/html/*
}

pkg_config() {
	if use client; then
		einfo "Setting up CernVM-FS client"
		cvmfs_config setup
		einfo "Now edit ${EROOT%/}/etc/cvmfs/default.local and run"
		einfo "  ${EROOT%/}/usr/init.d/autofs restart"
	fi
}