summaryrefslogtreecommitdiff
path: root/sysutils/fusefs-kmod/Makefile
blob: b20bcfdde24fe2d31ea2d0fbca071534c17ef796 (plain) (blame)
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# Created by: Anish Mistry <amistry@am-productions.biz>
# $FreeBSD$

PORTNAME=	fusefs
DISTVERSION=	0.3.9-pre1.20080208
PORTREVISION=	11
CATEGORIES=	sysutils kld
MASTER_SITES=	http://mercurial.creo.hu/repos/fuse4bsd-hg/index.cgi/archive/ \
    		http://mirrors.rit.edu/zi/fuse4bsd/ \
  		LOCAL/bdrewery/${PORTNAME}/
PKGNAMESUFFIX=	-kmod
DISTNAME=	${HG_SHORTREV}
DIST_SUBDIR=	fuse4bsd

MAINTAINER=	mirror176@cox.net
COMMENT=	Kernel module for fuse

BUILD_DEPENDS=	fusefs-libs>2.4.1:${PORTSDIR}/sysutils/fusefs-libs

SSP_UNSAFE=	kernel module does not support ssp

USE_RC_SUBR=	fusefs
KMODDIR?=	${PREFIX}/modules
PLIST_SUB=	KMODDIR=${KMODDIR}
MAKE_ENV=	BINDIR="${PREFIX}/sbin" MANDIR="${MANPREFIX}/man/man" \
		KMODDIR="${KMODDIR}" SYSDIR="${SRC_BASE}/sys" \
		MOUNT="${SRC_BASE}/sbin/mount"
WRKSRC=		${WRKDIR}/fuse4bsd-${HG_SHORTREV}
DISABLE_SIZE=	yes

OPTIONS_DEFINE=	AUTOSETUP DOCS
AUTOSETUP_DESC=	Automatic global config file setup

.include <bsd.port.pre.mk>

.if ${PORT_OPTIONS:MDOCS}
BUILD_DEPENDS+=	deplate:${PORTSDIR}/textproc/ruby-deplate
.endif

SRC_BASE?=	/usr/src
SETUP=		setup.sh
HG_SHORTREV=	498acaef33b0

MAN8=		mount_fusefs.8
TXT_DOCS=	doc.text
HTML_DOCS=	Faq.html \
		Implementation.html \
		Quickstart.html \
		article.css \
		deplate-mini.png \
		deplate.css \
		doc.html \
		heading-navbar.css \
		home-grey.png \
		mailto.png \
		next-grey.png \
		prev-grey.png \
		remote.png \
		serif.css \
		tabbar-right.css

.if ${OSVERSION} >= 900040
EXTRA_PATCHES+=	${FILESDIR}/extra-patch-fuse_module__fuse_vnops.c
.endif

.if ${OSVERSION} >= 1000011
EXTRA_PATCHES+=	${FILESDIR}/extrapatch-fuse_module__fuse_vnops.c
.endif

.if exists(${SRC_BASE}/sys/fs/fuse)
IGNORE=		Integrated into base
.endif
.if !exists(${SRC_BASE}/sys/Makefile)
IGNORE=		requires the Kernel source to be installed. Set SRC_BASE if it is not in /usr/src
.endif
.if !exists(${SRC_BASE}/sbin/mount)
IGNORE=		requires the userland sources to be installed. Set SRC_BASE if it is not in /usr/src
.endif

.if ${ARCH} != "i386" && ${ARCH} != "amd64"
BROKEN=		Does not compile on other than i386/amd64
.endif

.if ${PORT_OPTIONS:MAUTOSETUP}
SUB_FILES+=	${SETUP}
.else
SUB_FILES+=	pkg-message
.endif

post-patch:
	@${REINPLACE_CMD} -e 's/deplate.rb/deplate/g' \
		${WRKSRC}/doc/Makefile
	@${REINPLACE_CMD} -e 's|-I../inc|-I${SRC_BASE}/sys -I../inc|g' \
		${WRKSRC}/mount_fusefs/Makefile

post-configure:
	@${CP} ${LOCALBASE}/include/fuse/fuse_kernel.h ${WRKSRC}/fuse_module

post-build:
.if ${PORT_OPTIONS:MDOCS}
	@cd ${WRKSRC}/doc && make plaintext html_chunked
.endif

pre-su-install:
	@${MKDIR} ${KMODDIR}

post-install:
	@${LN} -fs ${PREFIX}/sbin/mount_fusefs /usr/sbin
.if ${PORT_OPTIONS:MAUTOSETUP} && !defined(PACKAGE_BUILDING)
	@${ECHO} "Modifying global startup config files and loading module..."
	@${SH} ${WRKDIR}/${SETUP}
.else
	@${ECHO_CMD}; ${CAT} ${PKGMESSAGE}; ${ECHO_CMD}
.endif

.if ${PORT_OPTIONS:MDOCS}
	@${MKDIR} ${DOCSDIR}/kmod/html
.for i in ${TXT_DOCS}
	@${INSTALL_DATA} ${WRKSRC}/doc/plaintext_out/$i ${DOCSDIR}/kmod
.endfor
.for i in ${HTML_DOCS}
	@${INSTALL_DATA} ${WRKSRC}/doc/html_chunked_out/$i ${DOCSDIR}/kmod/html
.endfor
.endif

.include <bsd.port.post.mk>