recipe 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. # Build recipe for lynx.
  2. #
  3. # Copyright (c) 2016-2018 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=lynx
  19. version=2.8.9rel.1
  20. pkgversion=2.8.9
  21. release=2
  22. # Define a category for the output of the package name
  23. pkgcategory=networking
  24. tarname=${program}${version}.tar.bz2
  25. # Remote source(s)
  26. fetch=https://invisible-mirror.net/archives/lynx/tarballs/$tarname
  27. description="
  28. A text browser for the World Wide Web.
  29. Lynx is a general purpose distributed information browser for the
  30. World Wide Web.
  31. Use \"lynx -help\" to display a complete list of current options.
  32. "
  33. homepage=https://lynx.browser.org
  34. license=GPLv2+
  35. # Source documentation
  36. docsdir="${docdir}/${program}-${pkgversion}"
  37. # Custom source directory
  38. srcdir=${program}${version}
  39. build()
  40. {
  41. unpack "${tardir}/$tarname"
  42. cd "$srcdir"
  43. # Set sane permissions
  44. chmod -R u+w,go-w,a+rX-s .
  45. ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  46. $configure_args \
  47. --sysconfdir=/etc/lynx \
  48. --datadir=$docsdir \
  49. --mandir=$mandir \
  50. --with-zlib \
  51. --with-bzlib \
  52. --with-ssl \
  53. --with-screen=ncursesw \
  54. --enable-locale-charset \
  55. --enable-ipv6 \
  56. --enable-japanese-utf8 \
  57. --enable-nested-tables \
  58. --build="$(gcc -dumpmachine)"
  59. make -j${jobs} V=1
  60. make -j${jobs} DESTDIR="$destdir" install-full
  61. # Tweak configuration file (thanks to BLFS!)
  62. sed \
  63. -e '/#LOCALE/ a LOCALE_CHARSET:TRUE' \
  64. -e '/#DEFAULT_ED/ a DEFAULT_EDITOR:vi' \
  65. -e '/#PERSIST/ a PERSISTENT_COOKIES:TRUE' \
  66. -i "${destdir}/etc/lynx/lynx.cfg"
  67. # To handle dow new files via graft(8)
  68. touch "${destdir}/etc/lynx/.graft-config"
  69. # Compress and link man pages (if needed)
  70. if test -d "${destdir}/$mandir"
  71. then
  72. (
  73. cd "${destdir}/$mandir"
  74. find . -type f -exec lzip -9 {} +
  75. find . -type l | while read -r file
  76. do
  77. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  78. rm -- "$file"
  79. done
  80. )
  81. fi
  82. }