1 # Maintainer: Frederik Schwan <freswa at archlinux dot org>
2 # Maintainer: Orhun Parmaksız <orhun@archlinux.org>
7 pkgdesc='A minimal file upload/pastebin service'
9 url='https://github.com/orhun/rustypaste'
11 depends=('gcc-libs' 'openssl')
13 backup=('etc/rustypaste/config.toml')
14 source=(${pkgname}-${pkgver}.tar.gz::https://github.com/orhun/rustypaste/archive/refs/tags/v${pkgver}.tar.gz)
15 b2sums=('537d1e25cb019a78c36457dc775f74968c38c43594f1b1bb8a45d6c3ebc50c9fe7a00c2c77109f9613b78c11ce9709f343d22c829b0ef9e56260dd7dbf8f04b5')
18 cd ${pkgname}-${pkgver}
19 cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
23 cd ${pkgname}-${pkgver}
24 export RUSTUP_TOOLCHAIN=stable
25 export CARGO_TARGET_DIR=target
26 CFLAGS+=' -ffat-lto-objects'
27 cargo build --release --frozen --no-default-features --features openssl
31 cd ${pkgname}-${pkgver}
32 export RUSTUP_TOOLCHAIN=stable
33 CFLAGS+=' -ffat-lto-objects'
34 cargo test --frozen -- --test-threads 1
37 sed -i "s|target/debug|target/release|" test-fixtures.sh
42 cd ${pkgname}-${pkgver}
43 install -Dm755 target/release/${pkgname} -t "${pkgdir}"/usr/bin
44 install -Dm644 config.toml -t "${pkgdir}"/etc/rustypaste
45 install -Dm644 README.md -t "${pkgdir}"/usr/share/doc/${pkgname}
46 install -Dm644 LICENSE -t "${pkgdir}"/usr/share/licenses/${pkgname}
47 install -Dm644 extra/systemd/rustypaste.env -t "${pkgdir}"/etc/rustypaste
48 install -Dm644 extra/systemd/rustypaste.service -t "$pkgdir"/usr/lib/systemd/system/
49 install -Dm644 extra/systemd/rustypaste.sysusers "${pkgdir}"/usr/lib/sysusers.d/rustypaste.conf
50 install -Dm644 extra/systemd/rustypaste.tmpfiles "${pkgdir}"/usr/lib/tmpfiles.d/rustypaste.conf