recipes: Rename 'pkghashtag' variable to 'pkgcategory'
[dragora.git] / recipes / libs / libetpan / recipe
blob344561867d5119d6891be044e4768f9d72ec1ffc
1 # Build recipe for libetpan.
3 # Copyright (c) 2018 Markus Tornow, <tornow@riseup.net>.
4 # Copyright (c) 2018-2019 Matias Fonzo, <selk@dragora.org>.
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
10 #    http://www.apache.org/licenses/LICENSE-2.0
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.
18 program=libetpan
19 version=1.9.3
20 release=1
22 # Define a category for the output of the package name
23 pkgcategory=libs
25 tarname=${program}-${version}.tar.gz
27 # Remote source(s)
28 fetch=http://github.com/dinhviethoa/libetpan/archive/${version}/$tarname
30 description="
31 A library that will handle all kind of mailbox access.
33 The purpose of this mail library is to provide a portable, efficient
34 framework for different kinds of mail access: IMAP, SMTP, POP and NNTP.
36 It provides an API for C language.
39 homepage=http://www.etpan.org/libetpan.html
40 license="3-clause BSD"
42 # Source documentation
43 docs="AUTHORS COPYRIGHT NEWS README.md"
44 docsdir="${docdir}/${program}-${version}"
46 build()
48     set -e
50     unpack "${tardir}/$tarname"
52     cd "$srcdir"
54     # Reported on http://github.com/dinhviethoa/libetpan/issues/336
55     patch -Np1 -i "${worktree}/patches/libetpan/clientid_missing-header.patch"
57     # Set sane permissions
58     chmod -R u+w,go-w,a+rX-s .
60     # TODO: SASL support for build against `--with-sasl'.
62     sh ./autogen.sh CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
63      $configure_args \
64      --libdir=/usr/lib${libSuffix} \
65      --mandir=$mandir \
66      --docdir=$docsdir \
67      --enable-static=no \
68      --enable-shared=yes \
69      --enable-db \
70      --enable-ipv6 \
71      --with-zlib \
72      --with-sasl=no \
73      --with-openssl=no --with-gnutls=yes \
74      --build="$(cc -dumpmachine)"
76     make -j${jobs} V=1
77     make -j${jobs} DESTDIR="$destdir" install-strip
79     # Compress and link man pages (if needed)
80     if test -d "${destdir}/$mandir"
81     then
82         (
83             cd "${destdir}/$mandir"
84             find . -type f -exec lzip -9 '{}' +
85             find . -type l | while read -r file
86             do
87                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
88                 rm -- "$file"
89             done
90         )
91     fi
93     # Copy documentation
94     mkdir -p "${destdir}${docsdir}"
95     cp -p $docs "${destdir}${docsdir}/"