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

EAPI="3"
inherit autotools
RESTRICT="mirror"

DESCRIPTION="Keep directories compressed with squashfs. Useful for portage tree, texmf-dist"
HOMEPAGE="http://www.mathematik.uni-wuerzburg.de/~vaeth/gentoo/index.html"
SRC_URI="http://www.mathematik.uni-wuerzburg.de/~vaeth/gentoo/${P}.tar.bz2"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="readonly"

RDEPEND="sys-fs/squashfs-tools
	!readonly? ( || (
		sys-fs/aufs2
		sys-fs/unionfs-fuse
		sys-fs/funionfs
		sys-fs/unionfs
		sys-fs/aufs
	) )"
DEPEND=">=sys-devel/autoconf-2.65"

src_prepare () {
	eautoreconf
}

src_configure () {
	econf --docdir="${EPREFIX}/usr/share/doc/${PF}"
}

src_install() {
	emake install DESTDIR="${D}" || die "emake install failed"
	prepalldocs
}

check_for_obsolete () {
	local a
	a="${EPREFIX}/etc/portage/env/sys-fs/squashfs-tools"
	test -e "${a}" && grep -q "squash_dir's hack" "${a}" || return 0
	ewarn "You probably had installed ${PN} with USE=hack-squash-utils"
	ewarn "${a} is left from this."
	ewarn "This file is now obsolete."
	ewarn "It is recommended to remove it and to install instead"
	ewarn "sys-fs/squashfs-tools from the mv overlay with USE=progress-redirect"
	return 1
}

pkg_postinst () {
	if check_for_obsolete && \
		! has_version sys-fs/squashfs-tools[progress-redirect]
	then	ewarn "For better output of ${PN}, it is recommended to install"
		ewarn "sys-fs/squashfs-tools from the mv overlay with USE=progress-redirect"
	fi
	if has_version "<sys-fs/unionfs-fuse-0.25_alpha"
	then	ewarn "It is recommended to use >=unionfs-fuse-0.25_alpha"
		ewarn "Otherwise, if you use squash_dir with unionfs-fuse for the portage tree, put"
		ewarn "PORTAGE_RSYNC_EXTRA_OPTS=\"\${PORTAGE_RSYNC_EXTRA_OPTS} --exclude=/.unionfs\""
		ewarn "into your /etc/make.conf"
	fi
	:
}

pkg_postrm () {
	check_for_obsolete
	:
}