diff --git a/PKGBUILD b/PKGBUILD index 33a7145..c23ad39 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -4,42 +4,144 @@ # then please put 'unknown'. # Maintainer: Future Linux Team -pkgname=curl -pkgver=8.7.1 -pkgrel=2 +pkgname=(curl libcurl-compat libcurl-gnutls) +pkgbase=curl +pkgver=8.10.1 +pkgrel=1 pkgdesc="command line tool and library for transferring data with URLs" arch=('x86_64') url="https://curl.se/" license=('MIT') -depends=('zlib' 'zstd' 'libpsl' 'ca-certificates' 'brotli' 'krb5' 'libidn2' 'libnghttp2' 'libssh2') -source=(https://curl.se/download/${pkgname}-${pkgver}.tar.xz) -sha256sums=(6fea2aac6a4610fbd0400afb0bcddbe7258a64c63f1f68e5855ebc0c659710cd) +depends=( + 'zlib' + 'zstd' + 'libpsl' + 'ca-certificates' + 'brotli' + 'krb5' + 'libidn2' + 'libnghttp2' + 'libnghttp3' + 'libssh2' +) +makedepends=('patchelf') +source=(https://curl.se/download/${pkgbase}-${pkgver}.tar.xz) +sha256sums=(73a4b0e99596a09fa5924a4fb7e4b995a85fda0d18a2c02ab9cf134bebce04ee) + +prepare() { + cd ${pkgbase}-${pkgver} + + mkdir build-curl{,-compat,-gnutls} +} build() { - cd ${pkgname}-${pkgver} + cd ${pkgbase}-${pkgver} - ${CONFIGURE} \ - --disable-static \ - --with-openssl \ - --enable-ipv6 \ - --with-gssapi \ - --with-libssh2 \ - --enable-threaded-resolver \ - --with-ca-path=/etc/ssl/certs + local _configure_options=( + --mandir=/usr/share/man + --disable-ldap + --disable-ldaps + --disable-manual + --enable-ipv6 + --enable-threaded-resolver + --enable-websockets + --with-gssapi + --with-libssh2 + --with-random=/dev/urandom + ) - make + + # build curl + ( + cd build-curl + + ${BUILD_CONFIGURE} \ + "${_configure_options[@]}" \ + --enable-versioned-symbols \ + --with-fish-functions-dir=/usr/share/fish/vendor_completions.d/ \ + --with-openssl \ + --with-openssl-quic \ + --with-ca-path=/etc/ssl/certs \ + --with-zsh-functions-dir=/usr/share/zsh/site-functions/ + + sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool + make + ) + + # build libcurl-compat + ( + cd build-curl-compat + + ${BUILD_CONFIGURE} \ + "${_configure_options[@]}" \ + --disable-versioned-symbols \ + --with-openssl \ + --with-openssl-quic \ + --with-ca-path=/etc/ssl/certs + + sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool + make -C lib + + patchelf --set-soname 'libcurl-compat.so.4' ./lib/.libs/libcurl.so + ) + + # build libcurl-gnutls + ( + cd build-curl-gnutls + + ${BUILD_CONFIGURE} \ + "${_configure_options[@]}" \ + --disable-versioned-symbols \ + --with-gnutls \ + --without-openssl \ + --with-ca-bundle=/etc/pki/tls/certs/ca-bundle.crt + + sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool + make -C lib + + patchelf --set-soname 'libcurl-gnutls.so.4' ./lib/.libs/libcurl.so + ) } -package() { - cd ${pkgname}-${pkgver} +package_curl() { + depends+=('openssl') - make DESTDIR=${pkgdir} install + cd ${pkgbase}-${pkgver}/build-curl - find docs \( -name Makefile\* -o \ - -name \*.1 -o \ - -name \*.3 -o \ - -name CMakeLists.txt \) -delete - - install -vdm755 ${pkgdir}/usr/share/doc/${pkgname}-${pkgver} - cp -v -R docs -T ${pkgdir}/usr/share/doc/${pkgname}-${pkgver} + make DESTDIR=${pkgdir} install + make -C scripts DESTDIR=${pkgdir} install +} + +package_libcurl-compat() { + pkgdesc='command line tool and library for transferring data with URLs (no versioned symbols)' + depends=('curl') + + cd ${pkgbase}-${pkgver}/build-curl-compat + + make -C lib DESTDIR=${pkgdir} install + + mv ${pkgdir}/usr/lib64/libcurl{,-compat}.so.4.8.0 + rm ${pkgdir}/usr/lib64/libcurl.{a,so}* + + 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 + ln -s libcurl-compat.so.4.8.0 ${pkgdir}/usr/lib64/libcurl.so.${version} + ln -s libcurl-compat.so.4.8.0 ${pkgdir}/usr/lib64/libcurl-compat.so.${version} + done +} + +package_libcurl-gnutls() { + pkgdesc='command line tool and library for transferring data with URLs (no versioned symbols, linked against gnutls)' + depends=('curl' 'gnutls') + + cd ${pkgbase}-${pkgver}/build-curl-gnutls + + make -C lib DESTDIR=${pkgdir} install + + mv ${pkgdir}/usr/lib64/libcurl{,-gnutls}.so.4.8.0 + rm ${pkgdir}/usr/lib64/libcurl.{a,so}* + ln -s libcurl-gnutls.so.4 ${pkgdir}/usr/lib64/libcurl-gnutls.so + + 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 + ln -s libcurl-gnutls.so.4.8.0 ${pkgdir}/usr/lib64/libcurl-gnutls.so.${version} + done }