summaryrefslogtreecommitdiff
blob: f79f29b6f119e13d4f51bc7d5815cc149f32bda6 (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
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-fs/shfs/shfs-0.31.ebuild,v 1.6 2004/06/24 22:44:21 agriffis Exp $

inherit eutils

IUSE="amd doc"

MY_P=${P}-1
S=${WORKDIR}/${MY_P}
DESCRIPTION="Secure Shell File System"
HOMEPAGE="http://shfs.sourceforge.net/"
SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="x86 ppc"
DEPEND="virtual/linux-sources
		net-misc/openssh
		amd? ( net-fs/am-utils )"

src_compile() {
	epatch ${FILESDIR}/shfs-gentoo-${PV}-makefile-root.diff
	use ppc && epatch ${FILESDIR}/shfs-gentoo-${PV}-ppc.diff
	emake || die
}

src_install() {
	# Install kernel module
	cd ${S}/shfs
	mv Makefile Makefile.old
	cat Makefile.old | grep -v depmod > Makefile
	einfo " Installing kernel module..."
	make MODULESDIR=${D}/lib/modules/${KV} install || die

	# Install binaries
	cd ${S}/shfsmount
	dobin shfsmount
	dobin shfsumount

	# Allows users to mount/umount
	einfo " Setting suid bit on /usr/bin executables..."
	fperms 4755 /usr/bin/shfsmount
	fperms 4755 /usr/bin/shfsumount

	# Performs symlink to support use of mount(8)
	dodir /sbin
	einfo " Adding /sbin/mount.shfs symlink..."
	dosym /usr/bin/shfsmount /sbin/mount.shfs

	# Install docs
	doman ${S}/docs/manpages/shfsmount.8 ${S}/docs/manpages/shfsumount.8
	use doc && dohtml -r ${S}/docs/html

	# Install automount support (if desired)
	if use amd ; then
		einfo " Installing am-utils config files..."
		insinto /etc/amd
		doins ${FILESDIR}/amd.conf
		doins ${FILESDIR}/amd.shfs
		exeinto /etc/amd
		doexe ${FILESDIR}/shfs.mount
		dosym /etc/amd/shfs.mount /etc/amd/shfs.unmount
	fi
}

pkg_postinst() {
	echo "running depmod...."
	depmod -aq || die
}