aboutsummaryrefslogtreecommitdiffstats
path: root/comms/hso-kmod/Makefile
blob: 0c9b1acd43c4b9a875fc6d05581e6591efd3d8db (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
# New ports collection makefile for:    hso-kmod
# Date created:             12 May 2008
# Whom:                 Ganael Laplanche <ganael.laplanche@martymac.org>
#
# $FreeBSD$
#

PORTNAME=   hso
PORTVERSION=    20081023
PORTREVISION=   3
CATEGORIES= comms kld
MASTER_SITES=   http://www.shapeshifter.se/pub/hso/
PKGNAMESUFFIX=  -kmod
DISTFILES=  ${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX}

MAINTAINER= martymac@FreeBSD.org
COMMENT=    Driver for Option HSDPA modem

LICENSE=    BSD

CONFLICTS=  uhso-kmod-[0-9]*

NO_PACKAGE= should be recompiled for a particular FreeBSD kernel

OPTIONS_DEFINE= HSOCTL DEVD DEBUG
OPTIONS_DEFAULT=    HSOCTL DEVD

HSOCTL_DESC=    Build hsoctl tool

SUB_FILES=  pkg-message
KMODDIR?=   /boot/modules
PLIST_SUB+= KMODDIR=${KMODDIR}
MAKE_ENV+=  KMODDIR=${KMODDIR}

MAN4=   hso.4

.include <bsd.port.pre.mk>

.if ${OSVERSION} > 800063
BROKEN= does not build with USB2, please try comms/uhso-kmod instead
.endif

.if ${PORT_OPTIONS:MHSOCTL}
HSOCTL_VERSION= 20081023
DISTFILES+= hsoctl-${HSOCTL_VERSION}${EXTRACT_SUFX}
WRKSRC_HSOCTL=  ${WRKDIR}/hsoctl-${HSOCTL_VERSION}
PLIST_SUB+= PL_HSOCTL=""
MAN1=   hsoctl.1
.else
PLIST_SUB+= PL_HSOCTL="@comment "
.endif
.if ${PORT_OPTIONS:MDEVD}
PLIST_SUB+= PL_DEVD=""
.else
PLIST_SUB+= PL_DEVD="@comment "
.endif
.if empty(PORT_OPTIONS:MDEBUG)
EXTRA_PATCHES+= ${PATCHDIR}/HSO-NODEBUG-patch-Makefile
.endif

.if !exists(${SRC_BASE}/sys/Makefile)
IGNORE= requires kernel source files
.elif ${OSVERSION} < 700055
IGNORE= requires FreeBSD 7.0 or superior
.endif

post-patch:
.if !empty(PORT_OPTIONS:MHSOCTL) && empty(PORT_OPTIONS:MDEBUG)
    @${PATCH} -d ${WRKSRC_HSOCTL} < ${PATCHDIR}/HSOCTL-NODEBUG-patch-Makefile
.endif

post-build:
.if ${PORT_OPTIONS:MHSOCTL}
    @cd ${WRKSRC_HSOCTL} && ${SETENV} NO_MANCOMPRESS= ${MAKE} all
.endif

post-install:
    ${INSTALL_MAN} ${MAN4:S|^|${WRKSRC}/|} ${PREFIX}/man/man4
.if ${PORT_OPTIONS:MHSOCTL}
    @cd ${WRKSRC_HSOCTL} && \
        ${SETENV} DESTDIR=${PREFIX}/ BINDIR=bin MANDIR=man/man NO_MANCOMPRESS= \
        ${MAKE} install
.endif
.if ${PORT_OPTIONS:MDEVD}
    ${MKDIR} ${PREFIX}/etc/devd
    ${INSTALL_DATA} ${FILESDIR}/option-icon.conf.sample ${PREFIX}/etc/devd/
    @if [ ! -f ${PREFIX}/etc/devd/option-icon.conf ]; then \
        ${CP} -p ${PREFIX}/etc/devd/option-icon.conf.sample ${PREFIX}/etc/devd/option-icon.conf; \
    fi
.endif
    @${CAT} ${PKGMESSAGE}

.include <bsd.port.post.mk>