recipe 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. # Build recipe for wpa_supplicant.
  2. #
  3. # Copyright (c) 2018-2022 Matias Fonzo, <selk@dragora.org>.
  4. #
  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
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  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.
  16. # Exit immediately on any error
  17. set -e
  18. program=wpa_supplicant
  19. version=2.10
  20. release=1
  21. # Define a category for the output of the package name
  22. pkgcategory=networking
  23. tarname=${program}-${version}.tar.gz
  24. # Remote source(s)
  25. fetch=https://w1.fi/releases/$tarname
  26. description="
  27. IEEE 802.1X/WPA supplicant wireless client.
  28. wpa_supplicant is a WPA Supplicant for Linux, BSD, Mac OS X, and
  29. Windows with support for WPA and WPA2 (IEEE 802.11i / RSN). It is
  30. suitable for both desktop/laptop computers and embedded systems.
  31. Supplicant is the IEEE 802.1X/WPA component that is used in the client
  32. stations. It implements key negotiation with a WPA Authenticator and
  33. it controls the roaming and IEEE 802.11 authentication/association of
  34. the WLAN driver.
  35. "
  36. homepage=https://w1.fi/wpa_supplicant/
  37. license=BSD
  38. # Source documentation
  39. docs="README README-WPS examples/ ../CONTRIBUTIONS ../COPYING"
  40. docsdir="${docdir}/${program}-${version}"
  41. build()
  42. {
  43. unpack "${tardir}/$tarname"
  44. cd "$srcdir"
  45. # Set sane permissions
  46. chmod -R u+w,go-w,a+rX-s .
  47. cd wpa_supplicant
  48. cat "${worktree}/archive/wpa_supplicant/buildconfig" > .config
  49. make -j${jobs} V=1 BINDIR=/usr/sbin
  50. make -j${jobs} V=1 BINDIR=/usr/sbin DESTDIR="$destdir" install
  51. strip --strip-unneeded "${destdir}"/usr/sbin/*
  52. # Copy template config as main config, and also include the example
  53. mkdir -p "${destdir}/etc"
  54. cp -p wpa_supplicant_template.conf "${destdir}/etc/wpa_supplicant.conf"
  55. cp -p wpa_supplicant.conf "${destdir}/etc/wpa_supplicant-sample.conf"
  56. chmod 644 "${destdir}/etc"/*.conf
  57. chown root:root "${destdir}/etc"/*.conf
  58. # Install D-Bus configuration
  59. mkdir -p "${destdir}/usr/share/dbus-1/system-services"
  60. for file in dbus/*.service
  61. do
  62. cp -p $file "${destdir}/usr/share/dbus-1/system-services/"
  63. chmod 644 "${destdir}/usr/share/dbus-1/system-services/${file##*/}"
  64. done
  65. chown root:root "${destdir}"/usr/share/dbus-1/system-services/*
  66. mkdir -p "${destdir}/etc/dbus-1/system.d"
  67. cp -p dbus/dbus-wpa_supplicant.conf "${destdir}/etc/dbus-1/system.d/"
  68. chmod 644 "${destdir}/etc/dbus-1/system.d/dbus-wpa_supplicant.conf"
  69. chown root:root "${destdir}/etc/dbus-1/system.d/dbus-wpa_supplicant.conf"
  70. # To manage dot (new) files via graft(1)
  71. touch "${destdir}/etc/.graft-config" \
  72. "${destdir}/etc/dbus-1/system.d/.graft-config"
  73. # Install (missing) manpages
  74. mkdir -p "${destdir}/${mandir}/man8" "${destdir}/${mandir}/man5"
  75. (
  76. cd doc/docbook || exit 1;
  77. for page in *.8
  78. do
  79. lzip -9c < $page > "${destdir}/${mandir}/man8/${page}.lz"
  80. done
  81. rm -f "${destdir}/${mandir}/man8/wpa_gui.8.lz"
  82. lzip -9c < wpa_supplicant.conf.5 \
  83. > "${destdir}/${mandir}/man5/wpa_supplicant.conf.5.lz"
  84. )
  85. # Copy documentation
  86. mkdir -p "${destdir}/$docsdir"
  87. cp -Rp $docs "${destdir}/$docsdir"
  88. }