148 lines
4.1 KiB
Bash
148 lines
4.1 KiB
Bash
# This is an example PKGBUILD file. Use this as a start to creating your own,
|
|
# and remove these comments. For more information, see 'man PKGBUILD'.
|
|
# NOTE: Please fill out the license field for your package! If it is unknown,
|
|
# then please put 'unknown'.
|
|
|
|
# Maintainer: Future Linux Team <future_linux@163.com>
|
|
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'
|
|
'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 ${pkgbase}-${pkgver}
|
|
|
|
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
|
|
)
|
|
|
|
|
|
# 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_curl() {
|
|
depends+=('openssl')
|
|
|
|
cd ${pkgbase}-${pkgver}/build-curl
|
|
|
|
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
|
|
}
|