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

EAPI="4"
RESTRICT="mirror"
WANT_LIBTOOL=none
inherit eutils autotools vcs-snapshot

DESCRIPTION="Keep directories compressed with squashfs. Useful for portage tree, texmf-dist"
HOMEPAGE="http://forums.gentoo.org/viewtopic-t-465367.html"
SRC_URI="http://github.com/vaeth/${PN}/tarball/release-${PV} -> ${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~x86"
IUSE="readonly +title zsh-completion"

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

src_prepare() {
	epatch_user
	eautoreconf
}

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

check_for_obsolete() {
	local a
	a="/etc/mtab.lock"
	if test -p '/etc/mtab' && test -e "${a}"
	then	ewarn
		ewarn "${a} is probably left from a previous install and now obsolete."
		ewarn "You probably want to remove it."
		ewarn
	fi
	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
	:
}