recipe 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. # Build recipe for lpppd (a fork of ppp).
  2. #
  3. # Copyright (c) 2019-2020 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=lpppd
  17. version=20190505_bb70b17
  18. release=4
  19. # Set 'outdir' for a nice and well-organized output directory
  20. outdir="${outdir}/${arch}/networking"
  21. tarname=${program}-${version}.tar.lz
  22. # Remote source(s)
  23. fetch="
  24. http://rsync.dragora.org/current/sources/$tarname
  25. http://mirror.cedia.org.ec/dragora/current/sources/$tarname
  26. "
  27. description="
  28. PPP daemon and associated utilities.
  29. The lpppd package is a fork based on Paul Mackerras' PPP:
  30. Targets glibc, musl libc and uClibc.
  31. Collecting patches from various sources.
  32. Use CMake build system.
  33. Support for non-Linux systems removed.
  34. Legacy protocol and library support removed.
  35. Some general code modernization.
  36. Building of plugins not supported at this time.
  37. "
  38. homepage=http://github.com/snickl/lpppd
  39. license="GPLv2+ | Public domain, BSD-style notices"
  40. # Source documentation
  41. docs="CHANGELOG.md FAQ PLUGINS README* SETUP"
  42. docsdir="${docdir}/${program}-${version}"
  43. build()
  44. {
  45. set -e
  46. unpack "${tardir}/$tarname"
  47. cd "$srcdir"
  48. mkdir BUILD
  49. cd BUILD
  50. cmake \
  51. -DCMAKE_C_FLAGS_RELEASE:STRING="$QICFLAGS -fPIC -Wall -fno-strict-aliasing" \
  52. -DCMAKE_EXE_LINKER_FLAGS:STRING="$QILDFLAGS" \
  53. -DCMAKE_INSTALL_PREFIX=/usr \
  54. -DCMAKE_BUILD_TYPE=Release \
  55. -DCMAKE_VERBOSE_MAKEFILE=ON \
  56. -DOPTION_LPPPD_INET6=ON \
  57. -DOPTION_LPPPD_PPPD_FILTER=ON \
  58. -DOPTION_LPPPD_PPPD_MULTILINK=ON \
  59. ..
  60. make -j${jobs}
  61. make -j${jobs} DESTDIR="$destdir" install
  62. cd ..
  63. # Include pppd headers to expose rp-pppoe plugins
  64. mkdir -p "${destdir}/usr/include/pppd"
  65. for file in pppd/*.h
  66. do
  67. cp -p $file "${destdir}/usr/include/pppd"/
  68. chmod 644 "${destdir}/usr/include/pppd/${file##*/}"
  69. done
  70. unset file
  71. mkdir -p "${destdir}/usr/include/net"
  72. cp -p include/net/ppp_defs.h "${destdir}/usr/include/net"/
  73. chmod 644 "${destdir}/usr/include/net/ppp_defs.h"
  74. # Add configuration files
  75. mkdir -p "${destdir}/etc/ppp/peers"
  76. for file in etc.ppp/*
  77. do
  78. cp -p $file "${destdir}/etc/ppp"/
  79. chmod 644 "${destdir}/etc/ppp/${file##*/}"
  80. done
  81. unset file
  82. chmod 600 "${destdir}"/etc/ppp/*-secrets*
  83. touch "${destdir}/etc/ppp/.graft-config"
  84. # Include scripts
  85. for file in plog poff pon
  86. do
  87. cp -p scripts/${file} "${destdir}/usr/sbin"/
  88. chmod 755 "${destdir}/usr/sbin/$file"
  89. done
  90. unset file
  91. # Include manual page for pon
  92. mkdir -p "${destdir}/${mandir}/man1"
  93. cp -p scripts/pon.1 "${destdir}/${mandir}/man1"/
  94. # Compress and link man pages (if needed)
  95. if test -d "${destdir}/$mandir"
  96. then
  97. (
  98. cd "${destdir}/$mandir"
  99. find . -type f -exec lzip -9 '{}' +
  100. find . -type l | while read -r file
  101. do
  102. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  103. rm -- "$file"
  104. done
  105. )
  106. fi
  107. # Copy documentation
  108. mkdir -p "${destdir}${docsdir}"
  109. cp -p $docs "${destdir}${docsdir}"/
  110. }