recipe 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. # Build recipe for dhcpcd.
  2. #
  3. # Copyright (c) 2017 MMPG, <mmpg@vp.pl>.
  4. # Copyright (c) 2017-2018 Matias Fonzo, <selk@dragora.org>.
  5. #
  6. # Licensed under the Apache License, Version 2.0 (the "License");
  7. # you may not use this file except in compliance with the License.
  8. # You may obtain a copy of the License at
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing, software
  13. # distributed under the License is distributed on an "AS IS" BASIS,
  14. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. # See the License for the specific language governing permissions and
  16. # limitations under the License.
  17. program=dhcpcd
  18. version=7.0.2
  19. release=1
  20. tarname=${program}-${version}.tar.xz
  21. # Remote source(s)
  22. fetch=http://roy.marples.name/downloads/dhcpcd/$tarname
  23. description="
  24. dhcpcd is an implementation of the DHCP client specified in RFC2131.
  25. A DHCP client is useful for connecting your computer to a network
  26. which uses DHCP to assign network addresses. dhcpcd strives to be
  27. a fully featured, yet very lightweight DHCP client.
  28. "
  29. homepage=http://roy.marples.name/projects/dhcpcd
  30. license="2-clause BSD"
  31. # Source documentation
  32. docs="LICENSE README.md"
  33. docsdir="${docdir}/${program}-${version}"
  34. build()
  35. {
  36. set -e
  37. unpack "${tardir}/$tarname"
  38. cd "$srcdir"
  39. ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  40. $configure_args \
  41. --libdir=/usr/lib${libSuffix} \
  42. --libexecdir=/usr/libexecdir/dhcpcd \
  43. --dbdir=/var/lib/dhcpcd \
  44. --build="$(cc -dumpmachine)"
  45. make -j${jobs}
  46. make -j${jobs} DESTDIR="$destdir" install
  47. # Install dhcpcd perp service(s)
  48. mkdir -p "${destdir}/etc/perp/dhcpcd"
  49. cp -p "${worktree}/archive/dhcpcd/rc.log" \
  50. "${worktree}/archive/dhcpcd/rc.main" \
  51. "${destdir}/etc/perp/dhcpcd/"
  52. chmod 755 "${destdir}"/etc/perp/dhcpcd/rc.*
  53. # Be an active service by default
  54. chmod +t "${destdir}/etc/perp/dhcpcd"
  55. # Manage (dot) new files via graft(1)
  56. touch "${destdir}/etc/.graft-config" \
  57. "${destdir}/etc/perp/dhcpcd/.graft-config"
  58. # Compress and link man pages (if needed)
  59. if test -d "${destdir}/$mandir"
  60. then
  61. (
  62. cd "${destdir}/$mandir"
  63. find . -type f -exec lzip -9 '{}' +
  64. find . -type l | while read -r file
  65. do
  66. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  67. rm -- "$file"
  68. done
  69. )
  70. fi
  71. # Copy documentation
  72. mkdir -p "${destdir}${docsdir}"
  73. cp -p $docs "${destdir}${docsdir}/"
  74. }