archrelease: copy trunk to community-x86_64
[ArchLinux/community.git] / rustypaste / repos / community-x86_64 / PKGBUILD
blob2edc7ca49f5059a624f30399bc346d583bd4c302
1 # Maintainer: Frederik Schwan <freswa at archlinux dot org>
2 # Maintainer: Orhun Parmaksız <orhun@archlinux.org>
4 pkgname=rustypaste
5 pkgver=0.9.0
6 pkgrel=2
7 pkgdesc='A minimal file upload/pastebin service'
8 arch=('x86_64')
9 url='https://github.com/orhun/rustypaste'
10 license=('MIT')
11 depends=('gcc-libs' 'openssl')
12 makedepends=('cargo')
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')
17 prepare() {
18   cd ${pkgname}-${pkgver}
19   cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
22 build() {
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
30 check() {
31   cd ${pkgname}-${pkgver}
32   export RUSTUP_TOOLCHAIN=stable
33   CFLAGS+=' -ffat-lto-objects'
34   cargo test --frozen -- --test-threads 1
36   cd fixtures
37   sed -i "s|target/debug|target/release|" test-fixtures.sh
38   ./test-fixtures.sh
41 package() {
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