recipe 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. # Build recipe for connman.
  2. #
  3. # Copyright (c) 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=connman
  17. version=1.37
  18. release=2
  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://mirrors.edge.kernel.org/pub/linux/network/connman/$tarname
  24. description="
  25. A connection manager.
  26. ConnMan is a daemon for managing Internet connections within embedded
  27. device and integrates a vast range of communication features usually
  28. split between many daemons such as DHCP, DNS and NTP. The result of
  29. this consolidation is low memory consumption with a fast, coherent,
  30. synchronized reaction to changing network conditions.
  31. "
  32. homepage=http://01.org/connman
  33. license=GPLv2+
  34. # Source documentation
  35. docs="AUTHORS COPYING ChangeLog NEWS README TODO"
  36. docsdir="${docdir}/${program}-${version}"
  37. build()
  38. {
  39. set -e
  40. unpack "${tardir}/$tarname"
  41. cd "$srcdir"
  42. # A patch to compile under Musl (Thanks to "Alpine Linux")
  43. patch -Np1 -i "${worktree}/patches/connman/libresolv.patch"
  44. # Update for hosts based on musl
  45. cp -f "${worktree}/archive/common/config.guess" config.guess
  46. cp -f "${worktree}/archive/common/config.sub" config.sub
  47. # Set sane permissions
  48. chmod -R u+w,go-w,a+rX-s .
  49. ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  50. $configure_args \
  51. --libdir=/usr/lib${libSuffix} \
  52. --mandir=$mandir \
  53. --docdir=$docsdir \
  54. --enable-pie \
  55. --enable-static=no \
  56. --enable-shared=yes \
  57. --disable-wispr \
  58. --with-firewall=iptables \
  59. --with-dns-backend=internal \
  60. --build="$(cc -dumpmachine)"
  61. make -j${jobs} V=1
  62. make -j${jobs} DESTDIR="$destdir" install-strip
  63. # Install perp service for connman
  64. mkdir -p "${destdir}/etc/perp/connmand" \
  65. "${destdir}/var/lib/connman"
  66. cp -p "${worktree}/archive/connman/etc/perp/rc.log" \
  67. "${worktree}/archive/connman/etc/perp/rc.main" \
  68. "${destdir}/etc/perp/connmand/"
  69. chmod 755 "${destdir}"/etc/perp/connmand/rc.*
  70. # Be an active service by default
  71. chmod +t "${destdir}/etc/perp/connmand"
  72. # Inset configuration file from source
  73. mkdir -p "${destdir}/etc/connman"
  74. cp -p src/main.conf "${destdir}/etc/connman"/
  75. chmod 644 "${destdir}/etc/connman/main.conf"
  76. # To handle config file(s)
  77. touch "${destdir}/etc/connman/.graft-config" \
  78. "${destdir}/etc/perp/connmand/.graft-config"
  79. # Compress and link man pages (if needed)
  80. if test -d "${destdir}/$mandir"
  81. then
  82. (
  83. cd "${destdir}/$mandir"
  84. find . -type f -exec lzip -9 '{}' +
  85. find . -type l | while read -r file
  86. do
  87. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  88. rm -- "$file"
  89. done
  90. )
  91. fi
  92. # Copy documentation
  93. mkdir -p "${destdir}${docsdir}"
  94. cp -p $docs "${destdir}${docsdir}"/
  95. }