aboutsummaryrefslogtreecommitdiff
path: root/base/wireless/wireless.build
blob: b3373a70cbae1463bdbd275697e4e4c70e263d38 (plain)
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
#!/bin/bash
#
# Maintainer: Deposite Pirate <ofni.sknuplatem@etaripd>

source /usr/src/ports/Build/build.sh

NAME=wireless
VERSION=$(date '+%Y%m%d')
BUILD=1
DEPENDS=('tcpip >= 20130209-1' 'gnutls >= 3.1.10-1' 'dbus >= 1.4.24-1')
#FIXME: enable EAP_FAST

# Description

cat > ${PKG}/install/slack-desc <<EOF
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description.  Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct.  It's also
# customary to leave one space after the ':'.

$(padd)|-----handy-ruler------------------------------------------------------|
${NAME}: wireless
${NAME}:
${NAME}: This package includes the central regulatory domain agent (crda),
${NAME}: the 'iw' command line tool and the 'wpa_supplicant' daemon. It must
${NAME}: be installed in order for wireless networking (such as WiFi) to work.
${NAME}:
${NAME}: Homepage: http://linuxwireless.org
${NAME}:
${NAME}:
${NAME}:
${NAME}:
EOF

cat >> ${PKG}/install/doinst.sh <<EOF
#!/bin/sh

config() {
  NEW="\$1"
  OLD="\$(dirname \$NEW)/\$(basename \$NEW .new)"
  # If there's no config file by that name, mv it over:
  if [ ! -r \$OLD ]; then
    mv \$NEW \$OLD
  elif [ "\$(cat \$OLD | md5sum)" = "\$(cat \$NEW | md5sum)" ]; then
    # toss the redundant copy
    rm \$NEW
  fi
  # Otherwise, we leave the .new copy for the admin to consider...
}

config etc/conf.d/wpa_supplicant.conf.new
config etc/logrotate.d/wpa_supplicant.new
EOF

REGBINLOCATION="${SYS_DIR[share]}/net"

# Sources

SRCNAME[0]=wireless-regdb
SRCVERS[0]=2013.02.13
SRCPACK[0]=http://linuxwireless.org/download/${SRCNAME[0]}/${SRCNAME[0]}-${SRCVERS[0]}.tar.xz
SRCCOPY[0]="MIT"

build0()
{
install.dir ${PKG}${REGBINLOCATION}
install.dat regulatory.bin ${PKG}${REGBINLOCATION}
install.dir ${PKG}${SYS_DIR[man]}/man5
install.man regulatory.bin.5 ${PKG}${SYS_DIR[man]}/man5
}

SRCNAME[1]=crda
SRCVERS[1]=1.1.3
SRCPACK[1]=http://linuxwireless.org/download/${SRCNAME[1]}/${SRCNAME[1]}-${SRCVERS[1]}.tar.bz2
SRCCOPY[1]="MIT"

build1()
{
make ${JOBS} \
 OPTFLAGS="${FLAGS} -I${SYS_DIR[include]}/gcrypt -I${SYS_DIR[include]}/gpg-error" \
 REG_BIN="${PKG}${REGBINLOCATION}/regulatory.bin" \
 UDEV_RULE_DIR="${SYS_DIR[udevrules]}"
make install DESTDIR="${PKG}" \
 SBINDIR="${SYS_DIR[sbin]}" \
 UDEV_RULE_DIR="${SYS_DIR[udevrules]}"
#FIXME: packages should never compress manual pages!
gunzip ${PKG}${SYS_DIR[man]}/man?/*.?.gz
#FIXME: compat
install.dir ${PKG}/sbin
(
  cd ${PKG}/sbin
  ln -sf ${SYS_DIR[sbin]}/crda
  ln -sf ${SYS_DIR[sbin]}/regdbdump
)
}

SRCNAME[2]=iw
SRCVERS[2]=3.8
SRCPACK[2]=http://linuxwireless.org/download/${SRCNAME[2]}/${SRCNAME[2]}-${SRCVERS[2]}.tar.bz2
SRCCOPY[2]="MIT"

build2()
{
make OPTFLAGS="${FLAGS}" V="1"
make install DESTDIR="${PKG}" MANDIR="${SYS_DIR[man]}" BINDIR="${SYS_DIR[sbin]}"
#FIXME: packages should never compress manual pages!
gunzip ${PKG}${SYS_DIR[man]}/man?/*.?.gz
}

SRCNAME[3]=wpa_supplicant
SRCVERS[3]=2.0
SRCPACK[3]=http://hostap.epitest.fi/releases/${SRCNAME[3]}-${SRCVERS[3]}.tar.gz
SRCCOPY[3]="BSD3"

build3()
{
( cd wpa_supplicant ; make OPTS="${FLAGS}" )
(
cd wpa_supplicant
make install \
 DESTDIR="${PKG}" \
 CONFDIR="${SYS_DIR[conf]}" \
 MANDIR="${SYS_DIR[man]}" \
 DOCDIR="${SYS_DIR[doc]}/${SRCNAME[3]}-${SRCVERS[3]}"
)
mv \
 ${PKG}${SYS_DIR[conf]}/wpa_supplicant.conf \
 ${PKG}${SYS_DIR[conf]}/wpa_supplicant.conf.sample
install -m 0600 wpa_supplicant.conf.new ${PKG}${SYS_DIR[conf]}
install.dir ${PKG}${SYS_DIR[etc]}/{logrotate,tmpfiles}.d
install.cfg wpa_supplicant.logrotate ${PKG}${SYS_DIR[etc]}/logrotate.d/wpa_supplicant.new
install.cfg wpa_supplicant.conf.tmpfiles ${PKG}${SYS_DIR[etc]}/tmpfiles.d/wpa_supplicant.conf
}