aboutsummaryrefslogtreecommitdiffstats
path: root/comms/uhso-kmod/Makefile
blob: 26b609c4c02fbce01b2467d14ea43f43a2f15709 (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
# Created by: Ganael Laplanche <ganael.laplanche@martymac.org>
# $FreeBSD$

PORTNAME=   uhso
PORTVERSION=    20100416
PORTREVISION=   2
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 (USB2 version)

LICENSE=    BSD

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

DEPRECATED= included in base system on all supported releases
EXPIRATION_DATE=2013-12-01

NO_PACKAGE= should be recompiled for a particular FreeBSD kernel

OPTIONS_DEFINE= UHSOCTL DEBUG
OPTIONS_DEFAULT=    UHSOCTL

UHSOCTL_DESC=   Build uhsoctl tool

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

MAN4=       uhso.4

.include <bsd.port.pre.mk>

.if !exists(${SRC_BASE}/sys/Makefile)
IGNORE=     requires kernel source files
.elif ${OSVERSION} <= 800063
IGNORE=     requires FreeBSD 8.0 or later, please try comms/hso-kmod instead
.elif ${OSVERSION} >= 800501
IGNORE= the uhso driver is already available in the base system
.endif

.if ${PORT_OPTIONS:MUHSOCTL}
UHSOCTL_VERSION=    20100416
DISTFILES+= uhsoctl-${UHSOCTL_VERSION}${EXTRACT_SUFX}
WRKSRC_UHSOCTL= ${WRKDIR}/uhsoctl-${UHSOCTL_VERSION}
PLIST_SUB+= PL_UHSOCTL=""
MAN1=   uhsoctl.1
.else
PLIST_SUB+= PL_UHSOCTL="@comment "
.endif

.if empty(PORT_OPTIONS:MDEBUG)
EXTRA_PATCHES+= ${PATCHDIR}/UHSO-NODEBUG-patch-Makefile
.endif

post-patch:
.if !empty(PORT_OPTIONS:MUHSOCTL) && !empty(PORT_OPTIONS:MDEBUG)
    @${PATCH} -d ${WRKSRC_UHSOCTL} < ${PATCHDIR}/UHSOCTL-DEBUG-patch-Makefile
.endif

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

post-install:
    ${INSTALL_MAN} ${MAN4:S|^|${WRKSRC}/|} ${PREFIX}/man/man4
.if ${PORT_OPTIONS:MUHSOCTL}
    @cd ${WRKSRC_UHSOCTL} && \
        ${SETENV} DESTDIR=${PREFIX}/ BINDIR=bin MANDIR=man/man NO_MANCOMPRESS= \
        ${MAKE} install
.endif
    @${CAT} ${PKGMESSAGE}

.include <bsd.port.post.mk>