Add debian build script

This commit is contained in:
Nicolas 2022-04-15 14:13:36 +02:00
parent 1a3f09f35d
commit 1b49403057
2 changed files with 48 additions and 1 deletions

View File

@ -1,4 +1,6 @@
# Don't forget to update PKGBUILD # Don't forget to update
# - dist/arch/PKGBUILD
# - dist/deb/build
[package] [package]
name = "wipe" name = "wipe"

45
dist/deb/build vendored Executable file
View File

@ -0,0 +1,45 @@
#!/usr/bin/env bash
set -e
pkgname='wipe-terminal'
version='1.0.0-3'
maintainer='Maintainer: Rico Riedel <rico.riedel@protonmail.ch>'
description='Description: Wipe your terminal with a random animation.'
arch='x86_64'
debarch='amd64'
pkgdir="$PWD/$pkgname"
srcdir="$PWD/../.."
build() {
cd "$srcdir"
export RUSTUP_TOOLCHAIN=stable
export CARGO_TARGET_DIR=target
cargo fetch --locked --target "$arch-unknown-linux-gnu"
cargo build --frozen --release --all-features
cargo test --frozen --all-features
}
package() {
cd "$srcdir"
install -Dm0644 'LICENSE' "$pkgdir/usr/share/doc/$pkgname/copyright"
install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/wipe"
mkdir -p "$pkgdir/DEBIAN"
echo "Package: $pkgname" > "$pkgdir/DEBIAN/control"
echo "Version: $version" >> "$pkgdir/DEBIAN/control"
echo "Section: utils" >> "$pkgdir/DEBIAN/control"
echo "Priority: optional" >> "$pkgdir/DEBIAN/control"
echo "Architecture: $debarch" >> "$pkgdir/DEBIAN/control"
echo "Maintainer: $maintainer" >> "$pkgdir/DEBIAN/control"
echo "Description: $description" >> "$pkgdir/DEBIAN/control"
dpkg-deb --root-owner-group --build "$pkgdir"
}
mkdir -p "$pkgdir"
build
package