template (2788B)
1 # Template file for 'curl' 2 pkgname=curl 3 version=8.18.0 4 revision=0 5 short_desc="Command line HTTP/HTTPS client and libcurl" 6 maintainer="finwo <finwo@pm.me>" 7 license="curl" 8 homepage="https://curl.se/" 9 distfiles="https://curl.se/download/curl-${version}.tar.xz" 10 checksum=40df79166e74aa20149365e11ee4c798a46ad57c34e4f68fd13100e2c9a91946 11 depends="glibc busybox openssl zlib" 12 makedepends="openssl zlib" 13 14 # Notes: 15 # - Why: a rescue image needs to pull things onto the box -- an installer 16 # payload, a replacement config, a kernel. tinyssh is daemon-only (upstream 17 # ships no client, so no scp/sftp either), which left busybox wget as the 18 # sole inbound path. wget is fine until you need TLS with a real CA store, 19 # redirects, or a useful error message when a fetch fails at 3am. 20 # - Protocol surface is cut hard: this is a recovery tool, not a general 21 # purpose client. HTTP/HTTPS/FTP stay; everything else goes. Each disabled 22 # protocol is one less parser reachable from the network. 23 # - OpenSSL backend (we already package it) rather than bundling another TLS 24 # stack. CA bundle comes from the system path, not baked in here. 25 # - libcurl ships too: it is the same build, and shipping only the binary 26 # would mean statically linking it for no reason. 27 28 do_configure() { 29 cd "${WRKSRC}" 30 ./configure \ 31 --prefix=/usr \ 32 --libdir=/usr/lib \ 33 --disable-static \ 34 --enable-shared \ 35 --with-openssl \ 36 --with-zlib \ 37 --without-libpsl \ 38 --without-libidn2 \ 39 --without-brotli \ 40 --without-zstd \ 41 --without-nghttp2 \ 42 --without-libssh2 \ 43 --disable-ldap \ 44 --disable-ldaps \ 45 --disable-rtsp \ 46 --disable-dict \ 47 --disable-telnet \ 48 --disable-tftp \ 49 --disable-pop3 \ 50 --disable-imap \ 51 --disable-smb \ 52 --disable-smtp \ 53 --disable-gopher \ 54 --disable-mqtt \ 55 --disable-manual \ 56 --enable-optimize 57 } 58 59 do_build() { 60 cd "${WRKSRC}" 61 make -j"$(nproc)" 62 } 63 64 do_install() { 65 cd "${WRKSRC}" 66 make install DESTDIR="${DESTDIR}" 67 68 # Sysroot seed: anything later linking libcurl builds against ours. 69 make install DESTDIR="${SYSROOT}" 70 71 rm -f "${DESTDIR}"/usr/lib/*.la "${SYSROOT}"/usr/lib/*.la 72 rm -rf "${DESTDIR}/usr/share/man" "${DESTDIR}/usr/share/doc" 73 # curl-config is a build-time helper for consumers, not a switch tool. 74 rm -f "${DESTDIR}/usr/bin/curl-config" 75 76 [ -x "${DESTDIR}/usr/bin/curl" ] || die "curl: no curl binary" 77 [ -e "${DESTDIR}/usr/lib/libcurl.so" ] || die "curl: no libcurl" 78 # Prove TLS is actually wired up; a curl without HTTPS is a trap in a 79 # rescue image, and configure will happily build one. 80 readelf -d "${DESTDIR}/usr/bin/curl" | grep -q 'libcurl\.so' \ 81 || die "curl: binary does not link libcurl" 82 readelf -d "${DESTDIR}/usr/lib/libcurl.so."* | grep -q 'libssl\.so' \ 83 || die "curl: libcurl not linked against OpenSSL (no HTTPS)" 84 }