aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipw-firmware/Makefile
blob: 20e5f64e3dcf57e6bf57d3093cd1822ca611ff6a (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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# New ports collection makefile for:    ipw-firmware
# Date created:             May 11 2005
# Whom:                 Florent Thoumie <flz@FreeBSD.org>
#
# $FreeBSD$
#

PORTNAME?=  ipw-firmware
RELNAME?=   ipw2100
PORTVERSION?=   1.3
PORTREVISION?=  5
CATEGORIES= net sysutils
MASTER_SITES=   ${MASTER_SITE_LOCAL}
MASTER_SITE_SUBDIR= flz/ipw
DISTFILES=  ${RELNAME}-fw-${PORTVERSION}.tgz

MAINTAINER= flz@FreeBSD.org
COMMENT?=   Intel PRO/Wireless 2100 Driver Firmware

DRIVERNAME?=    ipw
DRIVERVERSION?= 1.6.4
DRIVERDISTNAME= ${DRIVERNAME}-freebsd-${DRIVERVERSION}
DISTFILES+= ${DRIVERDISTNAME}.tgz
FIRMWARES?= ${RELNAME}-${PORTVERSION}-i.fw:${DRIVERNAME}-i.fw \
        ${RELNAME}-${PORTVERSION}-p.fw:${DRIVERNAME}-p.fw \
        ${RELNAME}-${PORTVERSION}.fw:${DRIVERNAME}.fw

OPTIONS=    MODULE  "Install ${DRIVERNAME}(4) kernel module (very old snapshot)" off \
        CONTROL "Install ${DRIVERNAME}control(8) utility" on

# Override PREFIX to install ${DRIVERNAME}control(8) somewhere we hope it'll
# be available soon enough.
PREFIX=     /usr

WRKSRC=     ${WRKDIR}
KERNDIR=    /boot/kernel
KMODDIR=    /boot/modules
FWDIR=      /boot/firmware
SUB_FILES=  pkg-message
SUB_LIST=   DRIVERNAME="${DRIVERNAME}" \
        RELNAME="${RELNAME}" \
        KMODDIR="${KMODDIR}" \
        FWDIR="${FWDIR}"
PLIST_SUB:= ${SUB_LIST}
MAKE_ENV=   BINDIR="${PREFIX}/sbin" \
        MANDIR="${PREFIX}/share/man/man" \
        KMODDIR="${KMODDIR}"

MANCOMPRESSED=  yes

# Dummy OSVERSION for ipw.
MIN7OSVERSION?= 999999

.if !defined(PACKAGE_BUILDING)
IS_INTERACTIVE= yes
.endif

.include <bsd.port.pre.mk>

# That's a bit arbitrary since I have no idea if ${DRIVERNAME}(4) can be
# compiled on FreeBSD previous to 5.3-RELEASE. This is just too old, people
# should move on. I may change this if I get successful reports though.
# Comment this IGNORE line if you want to test it anyway.
.if ${OSVERSION} < 503000
IGNORE=     needs at least FreeBSD 5.3-RELEASE
.endif

.if ${OSVERSION} > ${MIN7OSVERSION}
SUB_LIST+=  DONT_NEED_CONTROL="@comment "
PLIST_SUB+= MTREE_DIRRM="@comment "
. if !defined(WITHOUT_CONTROL)
IGNORE=     is configured with ${DRIVERNAME}control(8) which you don't need
. endif
.else
SUB_LIST+=  DONT_NEED_CONTROL=""
PLIST_SUB+= MTREE_DIRRM=""
MAN8+=      ${DRIVERNAME}control.8
USE_RCORDER=    ${DRIVERNAME}.sh
.endif

.if defined(WITH_MODULE)
. if ${OSVERSION} > 600023
IGNORE=     is configured with ${DRIVERNAME}(4) support which you don't need
. else
PLIST_SUB+= WITH_MODULE=""
MAN4+=      ${DRIVERNAME}.4
. endif
.else
PLIST_SUB+= WITH_MODULE="@comment MODULE "
.endif

.if !defined(WITHOUT_CONTROL)
PLIST_SUB+= WITH_CONTROL=""
.else
PLIST_SUB+= WITH_CONTROL="@comment CONTROL "
.endif

# "Might" because people still can include ${DRIVERNAME}(4) support in kernel by extracting
# its source in src/ and tweaking src/sys/conf/files.
.if ${OSVERSION} <= 600023 && !exists(${KERNDIR}/if_${DRIVERNAME}.ko) && !defined(WITH_MODULE)
SUB_LIST+=  MIGHT_NEED_MODULE=""
.else
SUB_LIST+=  MIGHT_NEED_MODULE="@comment "
.endif

do-build:
.if defined(WITH_MODULE)
. for i in share sys
    cd ${WRKSRC}/${DRIVERDISTNAME}/src/${i}; make all
. endfor
.endif
.if !defined(WITHOUT_CONTROL)
    cd ${WRKSRC}/${DRIVERDISTNAME}/src/usr.sbin/${DRIVERNAME}control/; make all
.endif

do-install:
.if !defined(PACKAGE_BUILDING)
# Let pointyhat build the package, anyway the user will have to agree with license
# terms to install the port/package.
    ${SH} ${PKGREQ} ${PORTNAME} INSTALL
.endif
.if defined(WITH_MODULE)
. for i in share sys
    cd ${WRKSRC}/${DRIVERDISTNAME}/src/${i}; make install ${MAKE_ENV}
. endfor
.endif
.if !defined(WITHOUT_CONTROL)
    cd ${WRKSRC}/${DRIVERDISTNAME}/src/usr.sbin/${DRIVERNAME}control/; make install ${MAKE_ENV}
.endif
    ${MKDIR} ${FWDIR}
    ${INSTALL_DATA} ${WRKSRC}/LICENSE ${FWDIR}/LICENSE.${DRIVERNAME}
.for i in ${FIRMWARES}
    ${INSTALL_DATA} ${WRKSRC}/${i:C/:.*//} ${FWDIR}/${i:C/.*://}
.endfor

post-install:
    @${CAT} ${PKGMESSAGE}
.if defined(WITH_MODULE)
    @${ECHO_CMD} "You asked for ${DRIVERNAME}(4) module to be installed but"
    @${ECHO_CMD} "be aware that this is a *very* *old* snapshot of the code"
    @${ECHO_CMD} "and that it probably won't work correctly."
    @${ECHO_CMD} "This option will probably go away in a near future."
    @${ECHO_CMD} "SLIPPERY WHEN WET ! BEWARE OF THE DOGS !"
    @${ECHO_CMD} "You have been warned."
.endif


.include <bsd.port.post.mk>