recipe 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. # Build recipe for rp-pppoe.
  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=rp-pppoe
  17. version=3.13
  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://dianne.skoll.ca/projects/rp-pppoe/download/$tarname
  24. description="
  25. PPP over Ethernet (xDSL support).
  26. PPPoE (Point-to-Point Protocol over Ethernet) is a protocol used by many
  27. DSL Internet Service Providers. RP-PPPoE is a free PPPoE client, relay
  28. and server for GNU/Linux.
  29. "
  30. homepage=http://dianne.skoll.ca/projects/rp-pppoe/
  31. license=GPLv2+
  32. # Source documentation
  33. docs="README SERVPOET doc/*"
  34. docsdir="${docdir}/${program}-${version}"
  35. build()
  36. {
  37. set -e
  38. unpack "${tardir}/$tarname"
  39. cd "$srcdir"
  40. # Apply a patch from "Alpine Linux"
  41. patch -Np1 -i "${worktree}/patches/rp-pppoe/musl-fix.patch"
  42. # Apply patches from "Fedora" to make it more reliable
  43. patch -Np1 -i "${worktree}/patches/rp-pppoe/rp-pppoe-3.12-ip-allocation.patch"
  44. patch -Np1 -i "${worktree}/patches/rp-pppoe/rp-pppoe-3.12-plugin.patch"
  45. patch -Np1 -i "${worktree}/patches/rp-pppoe/rp-pppoe-3.12-pluginpath.patch"
  46. patch -Np1 -i "${worktree}/patches/rp-pppoe/rp-pppoe-manpages.patch"
  47. # Set sane permissions
  48. chmod -R u+w,go-w,a+rX-s .
  49. cd src
  50. ./configure CFLAGS="$QICFLAGS -D_GNU_SOURCE -fno-strict-aliasing" \
  51. LDFLAGS="$QILDFLAGS" \
  52. $configure_args \
  53. --libdir=/usr/lib${libSuffix} \
  54. --mandir=$mandir \
  55. --docdir=$docsdir \
  56. --enable-plugin \
  57. --build="$(cc -dumpmachine)"
  58. make -j${jobs} V=1 PLUGIN_DIR="/usr/libexec/rp-pppoe" all rp-pppoe.so
  59. make -j${jobs} PLUGIN_DIR="/usr/libexec/rp-pppoe" DESTDIR="$destdir" install
  60. cd ..
  61. # To manage .new configs via graft(1)
  62. touch "${destdir}/etc/ppp/.graft-config"
  63. # Compress and link man pages (if needed)
  64. if test -d "${destdir}/$mandir"
  65. then
  66. (
  67. cd "${destdir}/$mandir"
  68. find . -type f -exec lzip -9 '{}' +
  69. find . -type l | while read -r file
  70. do
  71. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  72. rm -- "$file"
  73. done
  74. )
  75. fi
  76. # Copy documentation
  77. mkdir -p "${destdir}${docsdir}"
  78. cp -p $docs "${destdir}${docsdir}"
  79. }