recipe 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. # Build recipe for libetpan.
  2. #
  3. # Copyright (c) 2018 Markus Tornow, <tornow@riseup.net>.
  4. # Copyright (c) 2018-2019 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=libetpan
  18. version=1.9.3
  19. release=1
  20. # Set 'outdir' for a nice and well-organized output directory
  21. outdir="${outdir}/${arch}/libs"
  22. tarname=${program}-${version}.tar.gz
  23. # Remote source(s)
  24. fetch=http://github.com/dinhviethoa/libetpan/archive/${version}/$tarname
  25. description="
  26. A library that will handle all kind of mailbox access.
  27. The purpose of this mail library is to provide a portable, efficient
  28. framework for different kinds of mail access: IMAP, SMTP, POP and NNTP.
  29. It provides an API for C language.
  30. "
  31. homepage=http://www.etpan.org/libetpan.html
  32. license="3-clause BSD"
  33. # Source documentation
  34. docs="AUTHORS COPYRIGHT NEWS README.md"
  35. docsdir="${docdir}/${program}-${version}"
  36. build()
  37. {
  38. set -e
  39. unpack "${tardir}/$tarname"
  40. cd "$srcdir"
  41. # Reported on http://github.com/dinhviethoa/libetpan/issues/336
  42. patch -Np1 -i "${worktree}/patches/libetpan/clientid_missing-header.patch"
  43. # Set sane permissions
  44. chmod -R u+w,go-w,a+rX-s .
  45. # TODO: SASL support for build against `--with-sasl'.
  46. sh ./autogen.sh CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  47. $configure_args \
  48. --libdir=/usr/lib${libSuffix} \
  49. --mandir=$mandir \
  50. --docdir=$docsdir \
  51. --enable-static=no \
  52. --enable-shared=yes \
  53. --enable-db \
  54. --enable-ipv6 \
  55. --with-zlib \
  56. --with-sasl=no \
  57. --with-openssl=no --with-gnutls=yes \
  58. --build="$(cc -dumpmachine)"
  59. make -j${jobs} V=1
  60. make -j${jobs} DESTDIR="$destdir" install-strip
  61. # Compress and link man pages (if needed)
  62. if test -d "${destdir}/$mandir"
  63. then
  64. (
  65. cd "${destdir}/$mandir"
  66. find . -type f -exec lzip -9 '{}' +
  67. find . -type l | while read -r file
  68. do
  69. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  70. rm -- "$file"
  71. done
  72. )
  73. fi
  74. # Copy documentation
  75. mkdir -p "${destdir}${docsdir}"
  76. cp -p $docs "${destdir}${docsdir}/"
  77. }