new files for FreeBSD packaging at 1.6.0pre3
[openafs.git] / src / packaging / FreeBSD / Makefile
1 # New ports collection makefile for:    openafs
2 # Date created:                         2010-11-06
3 # Whom:                                 Ben Kaduk <kaduk@mit.edu>
4 # Based on:                             port by Alec Kloss <alec@setfilepointer.com>
5 #
6 # $FreeBSD$
7 #
8
9 PORTNAME=       openafs
10 DISTVERSION=    1.6.0pre3
11 CATEGORIES=     net kld
12 MASTER_SITES=   http://dl.central.org/dl/openafs/candidate/${DISTVERSION}/:openafs \
13                 http://dl.openafs.org/dl/openafs/candidate/${DISTVERSION}/:openafs \
14                 http://dl.central.org/dl/cellservdb/:gco \
15                 http://grand.central.org/dl/cellservdb/:gco
16 DISTFILES=      ${PORTNAME}-${DISTVERSION}-src.tar.bz2:openafs \
17                 ${PORTNAME}-${DISTVERSION}-doc.tar.bz2:openafs \
18                 CellServDB:gco
19 EXTRACT_ONLY=   ${PORTNAME}-${DISTVERSION}-src.tar.bz2 \
20                 ${PORTNAME}-${DISTVERSION}-doc.tar.bz2
21
22 MAINTAINER=     kaduk@mit.edu
23 COMMENT=        AFS implementation from openafs.org
24
25 OPTIONS=        FUSE "Build afsd.fuse (enable fuse support)" off
26
27 USE_LDCONFIG=   yes
28 PATCH_STRIP=    -p1
29
30 USE_BZIP2=      yes
31 HAS_CONFIGURE=  yes
32 USE_RC_SUBR=    afsd afsserver
33
34 ONLY_FOR_ARCHS= i386 amd64
35
36 KERNELDIR=      /usr/obj/usr/src/sys/GENERIC
37 KMODDIR=        /boot/modules
38
39 .include <bsd.port.pre.mk>
40
41 .if ${OSVERSION} < 800000
42 IGNORE= supports FreeBSD 8.0 and later
43 .endif
44
45 .if !exists(${KERNELDIR}/opt_global.h)
46 IGNORE= OpenAFS requires opt_global.h from kernel build tree
47 .endif
48
49 CONFIGURE_ARGS= --prefix=${PREFIX} \
50         --localstatedir=/var \
51         --mandir=${PREFIX}/man \
52         --with-bsd-kernel-build=${KERNELDIR} \
53         --enable-debug \
54         --enable-debug-kernel \
55         --enable-debug-lwp \
56         --includedir=${PREFIX}/include/openafs \
57                         ${CONFIGURE_TARGET}
58 #       --with-krb5 KRB5CFLAGS=-I/usr/include \
59 #       KRB5LIBS='-lkrb5 -lcom_err -lcrypto -lcrypt -lasn1 -lhx509 -lroken' \
60
61 .if !defined(WITH_FUSE)
62 CONFIGURE_ARGS+=        --disable-fuse-client
63 PLIST_SUB+=     FUSE="@comment "
64 .else
65 LIB_DEPENDS+=   fuse.2:${PORTSDIR}/sysutils/fusefs-libs
66 PLIST_SUB+=     FUSE=""
67 .endif
68
69 WRKSRC=         ${WRKDIR}/${PORTNAME}-${DISTVERSION}
70
71 CONFLICTS=      heimdal-[0-9]*
72
73 .include "Makefile.man"
74
75 post-install:
76         @${MKDIR} ${PREFIX}/etc/openafs
77         @${CP} ${DISTDIR}/CellServDB ${PREFIX}/etc/openafs/CellServDB.sample
78         @if [ ! -e ${PREFIX}/etc/openafs/CellServDB ] ; then \
79                 ${CP} -p ${PREFIX}/etc/openafs/CellServDB.sample ${PREFIX}/etc/openafs/CellServDB ; \
80         fi
81         @${ECHO_CMD} openafs.org > ${PREFIX}/etc/openafs/ThisCell.sample
82         @if [ ! -e ${PREFIX}/etc/openafs/ThisCell ] ; then \
83                 ${CP} -p ${PREFIX}/etc/openafs/ThisCell.sample ${PREFIX}/etc/openafs/ThisCell ; \
84         fi
85         @${ECHO_CMD} '/afs:/usr/vice/cache:150000' > ${PREFIX}/etc/openafs/cacheinfo.sample
86         @if [ ! -e ${PREFIX}/etc/openafs/cacheinfo ] ; then \
87                 ${CP} -p ${PREFIX}/etc/openafs/cacheinfo.sample ${PREFIX}/etc/openafs/cacheinfo; \
88         fi
89         ${MV} ${PREFIX}/lib/openafs/libafs.ko ${KMODDIR}/
90         @${RMDIR} ${PREFIX}/lib/openafs
91         kldxref ${KMODDIR}
92
93 pre-deinstall:
94         @if cmp -s ${PREFIX}/etc/openafs/CellServDB ${PREFIX}/etc/openafs/CellServDB.sample; then \
95                 ${RM} ${PREFIX}/etc/openafs/CellServDB; fi
96         @if cmp -s ${PREFIX}/etc/openafs/ThisCell ${PREFIX}/etc/openafs/ThisCell.sample; then \
97                 ${RM} ${PREFIX}/etc/openafs/ThisCell; fi
98         @if cmp -s ${PREFIX}/etc/openafs/cacheinfo ${PREFIX}/etc/openafs/cacheinfo.sample; then \
99                 ${RM} ${PREFIX}/etc/openafs/cacheinfo; fi
100
101 .include <bsd.port.post.mk>