upgpkg: ufw 0.36.2-1
[ArchLinux/community.git] / xh / trunk / PKGBUILD
blob4ebd4d649436099c7831c8ed8bf5e582aacccc4a
1 # Maintainer: Orhun Parmaksız <orhun@archlinux.org>
2 # Maintainer: Caleb Maclennan <caleb@alerque.com>
3 # Contributor: Wesley Moore <wes@wezm.net>
5 pkgname=xh
6 pkgver=0.18.0
7 pkgrel=1
8 pkgdesc="Friendly and fast tool for sending HTTP requests"
9 arch=('x86_64')
10 url="https://github.com/ducaale/xh"
11 license=('MIT')
12 depends=('gcc-libs' 'openssl')
13 makedepends=('cargo')
14 replaces=('ht-rs' 'ht')
15 source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
16 sha256sums=('ed16781248d60a1f86d8da206440e9c761520bcd00917213dc6eb68fe357999e')
18 prepare() {
19   cd "$pkgname-$pkgver"
20   cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
23 build() {
24   cd "$pkgname-$pkgver"
25   CFLAGS+=" -ffat-lto-objects"
26   cargo build --frozen --release --features native-tls
29 check() {
30   cd "$pkgname-$pkgver"
31   cargo test --frozen --features native-tls
34 package() {
35   cd "$pkgname-$pkgver"
36   install -Dm 755 "target/release/$pkgname" -t "$pkgdir/usr/bin"
37   install -Dm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
38   install -Dm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
39   install -Dm 644 "doc/$pkgname.1" -t "$pkgdir/usr/share/man/man1"
40   install -Dm 644 "completions/$pkgname.bash" "${pkgdir}/usr/share/bash-completion/completions/$pkgname"
41   install -Dm 644 "completions/$pkgname.fish" -t "${pkgdir}/usr/share/fish/vendor_completions.d"
42   install -Dm 644 "completions/_$pkgname" -t "${pkgdir}/usr/share/zsh/site-functions"
43   # `xh` will default to HTTPS scheme if the binary name is one of `xhs`, `https`, or `xhttps`
44   ln -s "/usr/bin/$pkgname" "$pkgdir/usr/bin/${pkgname}s"
47 # vim: ts=2 sw=2 et: