recipe 3.8 KB

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