recipe 3.7 KB

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