aboutsummaryrefslogtreecommitdiffstats
path: root/chinese/gbfs/Makefile
blob: d3d43cc6783c436a19a3b795d93d26a56327df6c (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
# New ports collection makefile for:    zh-gbfs
# Date created:         Oct 13, 2000
# Whom:                 statue@freebsd.sinica.edu.tw
#
# $FreeBSD$
#

PORTNAME=   gbfs
PORTVERSION=    1.0
CATEGORIES= chinese
MASTER_SITES=   ftp://freebsd.sinica.edu.tw/pub/statue/gbfs/ \
        ftp://ftp.gnuchina.org/incoming/zhBSD/

MAINTAINER= statue@freebsd.sinica.edu.tw

NO_PACKAGE= "Different versions definitely cause crash"

SYSDIR=     /usr/src/sys
KMODDIR=    ${PREFIX}/modules
PLIST_SUB=  MSDOSFSKO=${MSDOSFSKO}

.include <bsd.port.pre.mk>

.if ${OSVERSION} > 500027
MSDOSFSDIR= ${SYSDIR}/fs/msdosfs
MSDOSFSKO=  msdosfs.ko
MSDOSFSKODIR=   ${SYSDIR}/modules/msdosfs
.elif ${OSVERSION} > 500018 && ${OSVERSION} < 500027
MSDOSFSDIR= ${SYSDIR}/fs/msdosfs
MSDOSFSKO=  msdosfs.ko
MSDOSFSKODIR=   ${SYSDIR}/modules/msdosfs
.elif ${OSVERSION} <= 500018 && ${OSVERSION} < 440001
MSDOSFSDIR= ${SYSDIR}/msdosfs
MSDOSFSKO=  msdos.ko
MSDOSFSKODIR=   ${SYSDIR}/modules/msdos
.else
MSDOSFSDIR= ${SYSDIR}/msdosfs
MSDOSFSKO=  msdos.ko
MSDOSFSKODIR=   ${SYSDIR}/modules/msdos
.endif

pre-extract:
    @if [ ! -d /sys -o ! -d /usr/src/sys ]; then \
        ${ECHO_CMD} "****************************************" ; \
        ${ECHO_CMD} " You need to extract kernel source tree" ; \
        ${ECHO_CMD} " before you build this package..." ; \
        ${ECHO_CMD} "****************************************" ; \
        ${FALSE} ; \
    fi

do-extract:
    @${MKDIR} ${WRKDIR}/msdos ${WRKDIR}/cd9660
    @${CP} -R ${MSDOSFSDIR}/*.[ch] ${WRKDIR}/msdos
    @${CP} ${MSDOSFSKODIR}/Makefile ${WRKDIR}/msdos/Makefile.ori
    @${CP} -R ${SYSDIR}/isofs/cd9660/*.[ch] ${WRKDIR}/cd9660
    @${CP} ${SYSDIR}/modules/cd9660/Makefile ${WRKDIR}/cd9660/Makefile.ori
    @(cd ${WRKDIR}; ${TAR} xzf ${DISTDIR}/${DISTFILES} )
    @${SED} -e 's,@@PREFIX@@,${PREFIX},' ${FILESDIR}/gbfs.sh > ${WRKDIR}/gbfs.sh

do-patch:
    (cd ${WRKDIR}/msdos; ${PATCH} --quiet < ${WRKDIR}/msdosfs.diff )
    @${SED} -e "/^\.PATH/d" ${WRKDIR}/msdos/Makefile.ori > ${WRKDIR}/msdos/Makefile
    (cd ${WRKDIR}/cd9660; ${PATCH} --quiet < ${WRKDIR}/cd9660.diff )
    @${SED} -e "/^\.PATH/d" ${WRKDIR}/cd9660/Makefile.ori > ${WRKDIR}/cd9660/Makefile

do-build:
    @(cd ${WRKDIR}/msdos; make all)
    @(cd ${WRKDIR}/cd9660; make all)

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

do-install:
    @${INSTALL_SCRIPT} ${WRKDIR}/gbfs.sh ${PREFIX}/etc/rc.d
    @${INSTALL_SCRIPT} ${WRKDIR}/msdos/${MSDOSFSKO} ${KMODDIR}/${MSDOSFSKO}
    @${INSTALL_SCRIPT} ${WRKDIR}/cd9660/cd9660.ko ${KMODDIR}/cd9660.ko

.include <bsd.port.post.mk>