1 # Maintainer: Dave Reisner <dreisner@archlinux.org>
2 # Contributor: Angel Velasquez <angvp@archlinux.org>
3 # Contributor: Eric Belanger <eric@archlinux.org>
4 # Contributor: Lucien Immink <l.immink@student.fnt.hvu.nl>
5 # Contributor: Daniel J Griffiths <ghost1227@archlinux.us>
8 pkgname=(curl libcurl-compat libcurl-gnutls)
9 _tag='6b77e19466486b37f93d07d2107579f9508a6645' # git rev-parse v${_tag_name}
11 pkgver="${_tag_name//_/.}"
13 pkgdesc='command line tool and library for transferring data with URLs'
15 url='https://curl.se/'
17 depends=('ca-certificates' 'brotli' 'libbrotlidec.so' 'krb5' 'libgssapi_krb5.so'
18 'libidn2' 'libidn2.so' 'libnghttp2' 'libpsl' 'libpsl.so' 'libssh2' 'libssh2.so'
19 'openssl' 'zlib' 'zstd' 'libzstd.so')
20 makedepends=('git' 'patchelf')
21 provides=('libcurl.so')
22 validpgpkeys=('27EDEAF22F3ABCEB50DB9A125CC908FDB71E12C2') # Daniel Stenberg
23 source=("git+https://github.com/bagder/curl.git#tag=${_tag}?signed")
36 for _c in "${_backports[@]}"; do
37 if [[ $_c == *..* ]]; then
38 git log --oneline --reverse "${_c}"
40 git log --oneline -1 "${_c}"
42 git cherry-pick -n -m1 "${_c}"
44 for _c in "${_reverts[@]}"; do
45 git log --oneline -1 "${_c}"
49 # no '-DEV' in version, release date from tagged commit...
51 -e "/\WLIBCURL_VERSION\W/c #define LIBCURL_VERSION \"${pkgver}\"" \
52 -e "/\WLIBCURL_TIMESTAMP\W/c #define LIBCURL_TIMESTAMP \"$(git log -1 --format=%cs "${_tag}")\"" \
53 include/curl/curlver.h
59 local _configure_options=(
61 --mandir='/usr/share/man'
66 --enable-threaded-resolver
69 --with-random='/dev/urandom'
70 --with-ca-bundle='/etc/ssl/certs/ca-certificates.crt'
73 mkdir build-curl{,-compat,-gnutls}
76 cd "${srcdir}"/build-curl
78 "${srcdir}/${pkgbase}"/configure \
79 "${_configure_options[@]}" \
81 --enable-versioned-symbols
82 sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
85 # build libcurl-compat
86 cd "${srcdir}"/build-curl-compat
88 "${srcdir}/${pkgbase}"/configure \
89 "${_configure_options[@]}" \
91 --disable-versioned-symbols
92 sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
95 # build libcurl-gnutls
96 cd "${srcdir}"/build-curl-gnutls
98 "${srcdir}/${pkgbase}"/configure \
99 "${_configure_options[@]}" \
100 --disable-versioned-symbols \
103 sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
105 patchelf --set-soname 'libcurl-gnutls.so.4' ./lib/.libs/libcurl.so
111 make DESTDIR="${pkgdir}" install
112 make DESTDIR="${pkgdir}" install -C scripts
114 cd "${srcdir}/${pkgname}"
117 install -Dt "${pkgdir}/usr/share/licenses/${pkgname}" -m0644 COPYING
120 package_libcurl-compat() {
121 pkgdesc='command line tool and library for transferring data with URLs (no versioned symbols)'
122 depends=('curl' 'openssl')
123 provides=('libcurl-compat.so')
125 cd "${srcdir}"/build-curl-compat
127 make -C lib DESTDIR="${pkgdir}" install
129 mv "${pkgdir}"/usr/lib/libcurl{,-compat}.so.4.8.0
130 rm "${pkgdir}"/usr/lib/libcurl.{a,so}*
131 for version in 3 4.0.0 4.1.0 4.2.0 4.3.0 4.4.0 4.5.0 4.6.0 4.7.0; do
132 ln -s libcurl-compat.so.4.8.0 "${pkgdir}"/usr/lib/libcurl.so.${version}
135 install -dm 0755 "${pkgdir}"/usr/share/licenses
136 ln -s curl "${pkgdir}"/usr/share/licenses/libcurl-compat
139 package_libcurl-gnutls() {
140 pkgdesc='command line tool and library for transferring data with URLs (no versioned symbols, linked against gnutls)'
141 depends=('curl' 'gnutls')
142 provides=('libcurl-gnutls.so')
144 cd "${srcdir}"/build-curl-gnutls
146 make -C lib DESTDIR="${pkgdir}" install
148 mv "${pkgdir}"/usr/lib/libcurl{,-gnutls}.so.4.8.0
149 rm "${pkgdir}"/usr/lib/libcurl.{a,so}*
150 ln -s libcurl-gnutls.so.4 "${pkgdir}"/usr/lib/libcurl-gnutls.so
151 for version in 3 4 4.0.0 4.1.0 4.2.0 4.3.0 4.4.0 4.5.0 4.6.0 4.7.0; do
152 ln -s libcurl-gnutls.so.4.8.0 "${pkgdir}"/usr/lib/libcurl-gnutls.so.${version}
155 install -dm 0755 "${pkgdir}"/usr/share/licenses
156 ln -s curl "${pkgdir}"/usr/share/licenses/libcurl-gnutls