aboutsummaryrefslogtreecommitdiff
path: root/net/ipw-firmware/Makefile
blob: 0c80647ecf380e858d664b3ded4c97f6ef3bd337 (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
# 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?=	4
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"	off

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

MAN8=		${DRIVERNAME}control.8
MANCOMPRESSED=	yes

.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=		Need a fresh version of RELENG_5
.endif

.if defined(WITH_MODULE)
. if ${OSVERSION} > 600023
IGNORE=		${DRIVERNAME}(4) support is already included in your tree
. else
PLIST_SUB+=	WITH_MODULE=""
MAN4+=		${DRIVERNAME}.4
. endif
.else
PLIST_SUB+=	WITH_MODULE="@comment MODULE "
.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)
	cd ${WRKSRC}/${DRIVERDISTNAME}/src/; make all
.else
	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
	${MKDIR} ${DATADIR}
.if defined(WITH_MODULE)
	cd ${WRKSRC}/${DRIVERDISTNAME}/src/; make install ${MAKE_ENV}
.else
	cd ${WRKSRC}/${DRIVERDISTNAME}/src/usr.sbin/${DRIVERNAME}control/; make install ${MAKE_ENV}
.endif
	${INSTALL_DATA} ${WRKSRC}/LICENSE ${DATADIR}/
.for i in ${FIRMWARES}
	${INSTALL_DATA} ${WRKSRC}/${i:C/:.*//} ${DATADIR}/${i:C/.*://}
.endfor

post-install:
	@${CAT} ${PKGMESSAGE}

.include <bsd.port.post.mk>