eiwd-2.22-r1.ebuild 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. # Copyright 2021-2024 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=8
  4. inherit flag-o-matic linux-info systemd
  5. DESCRIPTION="iwd without dbus"
  6. HOMEPAGE="https://github.com/illiliti/eiwd"
  7. SRC_URI="${HOMEPAGE}/releases/download/${PVR/r/}/${P##e}.tar.xz -> ${PF}.tar.xz"
  8. S="${WORKDIR}/${P#e}"
  9. LICENSE="LGPL-2.1"
  10. SLOT="0"
  11. KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86"
  12. IUSE="cpu_flags_x86_aes cpu_flags_x86_ssse3 monitor ofono selinux systemd wired"
  13. DEPEND=">=dev-libs/ell-0.69"
  14. RDEPEND="
  15. ${DEPEND}
  16. !net-wireless/iwd
  17. acct-group/netdev
  18. net-wireless/wireless-regdb
  19. selinux? ( sec-policy/selinux-networkmanager )
  20. systemd? ( sys-apps/systemd )
  21. !systemd? ( virtual/resolvconf )
  22. "
  23. BDEPEND="virtual/pkgconfig"
  24. pkg_setup() {
  25. CONFIG_CHECK="
  26. ~ASYMMETRIC_KEY_TYPE
  27. ~ASYMMETRIC_PUBLIC_KEY_SUBTYPE
  28. ~CFG80211
  29. ~CRYPTO_AES
  30. ~CRYPTO_CBC
  31. ~CRYPTO_CMAC
  32. ~CRYPTO_DES
  33. ~CRYPTO_ECB
  34. ~CRYPTO_HMAC
  35. ~CRYPTO_MD4
  36. ~CRYPTO_MD5
  37. ~CRYPTO_RSA
  38. ~CRYPTO_SHA1
  39. ~CRYPTO_SHA256
  40. ~CRYPTO_SHA512
  41. ~CRYPTO_USER_API_HASH
  42. ~CRYPTO_USER_API_SKCIPHER
  43. ~KEY_DH_OPERATIONS
  44. ~PKCS7_MESSAGE_PARSER
  45. ~RFKILL
  46. ~X509_CERTIFICATE_PARSER
  47. "
  48. if use amd64;then
  49. CONFIG_CHECK="${CONFIG_CHECK} ~CRYPTO_DES3_EDE_X86_64"
  50. WARNING_CRYPTO_DES3_EDE_X86_64="CRYPTO_DES3_EDE_X86_64: enable for increased performance"
  51. fi
  52. if use cpu_flags_x86_aes;then
  53. CONFIG_CHECK="${CONFIG_CHECK} ~CRYPTO_AES_NI_INTEL"
  54. WARNING_CRYPTO_AES_NI_INTEL="CRYPTO_AES_NI_INTEL: enable for increased performance"
  55. fi
  56. if use cpu_flags_x86_ssse3 && use amd64; then
  57. CONFIG_CHECK="${CONFIG_CHECK} ~CRYPTO_SHA1_SSSE3 ~CRYPTO_SHA256_SSSE3 ~CRYPTO_SHA512_SSSE3"
  58. WARNING_CRYPTO_SHA1_SSSE3="CRYPTO_SHA1_SSSE3: enable for increased performance"
  59. WARNING_CRYPTO_SHA256_SSSE3="CRYPTO_SHA256_SSSE3: enable for increased performance"
  60. WARNING_CRYPTO_SHA512_SSSE3="CRYPTO_SHA512_SSSE3: enable for increased performance"
  61. fi
  62. if use kernel_linux && kernel_is -ge 4 20; then
  63. CONFIG_CHECK="${CONFIG_CHECK} ~PKCS8_PRIVATE_KEY_PARSER"
  64. fi
  65. check_extra_config
  66. }
  67. src_prepare() {
  68. default
  69. sed -e "s:Exec=/bin/false:Exec=${EPREFIX}/usr/libexec/iwd:g" -i src/net.connman.iwd.service || die
  70. }
  71. src_configure() {
  72. append-cflags "-fsigned-char"
  73. local myeconfargs=(
  74. --sysconfdir="${EPREFIX}"/etc/iwd --localstatedir="${EPREFIX}"/var
  75. --disable-client
  76. --disable-dbus
  77. --enable-external-ell
  78. "$(use_enable monitor)"
  79. "$(use_enable ofono)"
  80. "$(use_enable wired)"
  81. --enable-systemd-service
  82. --with-systemd-unitdir="$(systemd_get_systemunitdir)"
  83. --with-systemd-modloaddir="${EPREFIX}/usr/lib/modules-load.d"
  84. --with-systemd-networkdir="$(systemd_get_utildir)/network"
  85. )
  86. econf "${myeconfargs[@]}"
  87. }
  88. src_compile() {
  89. emake RST2MAN=:
  90. }
  91. src_install() {
  92. emake RST2MAN=: DESTDIR="${D}" install
  93. keepdir "/var/lib/${PN}"
  94. newinitd "${FILESDIR}/iwd.initd" iwd
  95. if use wired;then
  96. newinitd "${FILESDIR}/ead.initd" ead
  97. fi
  98. local iwdconf="${ED}/etc/iwd/main.conf"
  99. insinto /etc/iwd/
  100. cat << EOF > newins - main.conf
  101. [General]
  102. EnableNetworkConfiguration=true
  103. [Network]
  104. NameResolvingService=$(usex systemd systemd resolvconf)
  105. EOF
  106. echo 'rc_provide="net"' | newconfd - iwd
  107. }