1 # Build recipe for wpa_supplicant.
3 # Copyright (c) 2018-2022 Matias Fonzo, <selk@dragora.org>.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 # Exit immediately on any error
20 program=wpa_supplicant
24 # Define a category for the output of the package name
25 pkgcategory=networking
27 tarname=${program}-${version}.tar.gz
30 fetch=https://w1.fi/releases/$tarname
33 IEEE 802.1X/WPA supplicant wireless client.
35 wpa_supplicant is a WPA Supplicant for Linux, BSD, Mac OS X, and
36 Windows with support for WPA and WPA2 (IEEE 802.11i / RSN). It is
37 suitable for both desktop/laptop computers and embedded systems.
39 Supplicant is the IEEE 802.1X/WPA component that is used in the client
40 stations. It implements key negotiation with a WPA Authenticator and
41 it controls the roaming and IEEE 802.11 authentication/association of
45 homepage=https://w1.fi/wpa_supplicant/
48 # Source documentation
49 docs="README README-WPS examples/ ../CONTRIBUTIONS ../COPYING"
50 docsdir="${docdir}/${program}-${version}"
54 unpack "${tardir}/$tarname"
58 # Set sane permissions
59 chmod -R u+w,go-w,a+rX-s .
62 cat "${worktree}/archive/wpa_supplicant/buildconfig" > .config
63 make -j${jobs} V=1 BINDIR=/usr/sbin
64 make -j${jobs} V=1 BINDIR=/usr/sbin DESTDIR="$destdir" install
66 strip --strip-unneeded "${destdir}"/usr/sbin/*
68 # Copy template config as main config, and also include the example
70 mkdir -p "${destdir}/etc"
71 cp -p wpa_supplicant_template.conf "${destdir}/etc/wpa_supplicant.conf"
72 cp -p wpa_supplicant.conf "${destdir}/etc/wpa_supplicant-sample.conf"
73 chmod 644 "${destdir}/etc"/*.conf
74 chown root:root "${destdir}/etc"/*.conf
76 # Install D-Bus configuration
78 mkdir -p "${destdir}/usr/share/dbus-1/system-services"
79 for file in dbus/*.service
81 cp -p $file "${destdir}/usr/share/dbus-1/system-services/"
82 chmod 644 "${destdir}/usr/share/dbus-1/system-services/${file##*/}"
84 chown root:root "${destdir}"/usr/share/dbus-1/system-services/*
86 mkdir -p "${destdir}/etc/dbus-1/system.d"
87 cp -p dbus/dbus-wpa_supplicant.conf "${destdir}/etc/dbus-1/system.d/"
88 chmod 644 "${destdir}/etc/dbus-1/system.d/dbus-wpa_supplicant.conf"
89 chown root:root "${destdir}/etc/dbus-1/system.d/dbus-wpa_supplicant.conf"
91 # To manage dot (new) files via graft(1)
93 touch "${destdir}/etc/.graft-config" \
94 "${destdir}/etc/dbus-1/system.d/.graft-config"
96 # Install (missing) manpages
98 mkdir -p "${destdir}/${mandir}/man8" "${destdir}/${mandir}/man5"
100 cd doc/docbook || exit 1;
103 lzip -9c < $page > "${destdir}/${mandir}/man8/${page}.lz"
105 rm -f "${destdir}/${mandir}/man8/wpa_gui.8.lz"
107 lzip -9c < wpa_supplicant.conf.5 \
108 > "${destdir}/${mandir}/man5/wpa_supplicant.conf.5.lz"
112 mkdir -p "${destdir}${docsdir}"
113 cp -Rp $docs "${destdir}${docsdir}"