From c1c0f36778248c81aae2591334e760053f4f595c Mon Sep 17 00:00:00 2001 From: Integral Date: Mon, 18 Nov 2024 17:12:26 +0800 Subject: [PATCH] alarmcn/tunet-rust-git: initial commit --- alarmcn/tunet-rust-git/PKGBUILD | 53 +++++++++++++++++++++++++++++++ alarmcn/tunet-rust-git/lilac.yaml | 13 ++++++++ 2 files changed, 66 insertions(+) create mode 100644 alarmcn/tunet-rust-git/PKGBUILD create mode 100644 alarmcn/tunet-rust-git/lilac.yaml diff --git a/alarmcn/tunet-rust-git/PKGBUILD b/alarmcn/tunet-rust-git/PKGBUILD new file mode 100644 index 00000000000..5191e15565d --- /dev/null +++ b/alarmcn/tunet-rust-git/PKGBUILD @@ -0,0 +1,53 @@ +# Maintainer: Integral + +pkgname=tunet-rust-git +_pkgname=tunet-rust +pkgver=0.9.4.r34.g5acbc06 +pkgrel=1 +pkgdesc="A Tsinghua University network authentication client for Linux, written in Rust. 清华大学校园网 Rust 客户端" +url="https://github.com/Berrysoft/tunet-rust" +arch=('x86_64' 'aarch64') +license=('MIT') +depends=('openssl' 'freetype2' 'hicolor-icon-theme') +makedepends=('git' 'cargo') +conflicts=("${_pkgname}") +provides=("${_pkgname}") +source=("git+${url}.git") +sha512sums=('SKIP') + +pkgver() { + cd "${_pkgname}/" + ( + set -o pipefail + git describe --tags --long --abbrev=7 2>/dev/null | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' || + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)" + ) +} + +build() { + cd "${_pkgname}/" + cargo build --release --workspace --exclude native +} + +package() { + cd "${_pkgname}/" + + # Binaries + pushd "target/release/" + for bin in tunet tunet-gui tunet-cui tunet-service; do + install -Dm755 "${bin}" -t "${pkgdir}/usr/bin/" + done + + popd + # Desktop file + install -Dm644 "tunet/tunet.desktop" -t "${pkgdir}/usr/share/applications/" + + # Icon + install -Dm644 "logo.png" "${pkgdir}/usr/share/icons/hicolor/256x256/apps/tunet.png" + + # Service + install -Dm644 "tunet-service/tunet@.service" -t "${pkgdir}/usr/lib/systemd/system/" + + # License + install -Dm644 "LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}/" +} diff --git a/alarmcn/tunet-rust-git/lilac.yaml b/alarmcn/tunet-rust-git/lilac.yaml new file mode 100644 index 00000000000..89175d62adf --- /dev/null +++ b/alarmcn/tunet-rust-git/lilac.yaml @@ -0,0 +1,13 @@ +maintainers: + - github: Integral-Tech + email: integral@archlinuxcn.org + +pre_build_script: | + update_pkgrel() + vcs_update() + +post_build_script: git_pkgbuild_commit() + +update_on: + - source: github + github: Berrysoft/tunet-rust