summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Beste2017-06-02 13:46:11 -0500
committerDan Beste2017-06-02 13:46:11 -0500
commit2939b1781f9930d6223284d9f8b19146af3e5ff4 (patch)
tree5a205ba9a6546c32ef5f0d6ed0e35b8f71ffb459
parent31c622d8367016d4aaaff076e59500de72b93268 (diff)
downloadaur-2939b1781f9930d6223284d9f8b19146af3e5ff4.tar.gz
Add check function
-rw-r--r--PKGBUILD31
1 files changed, 19 insertions, 12 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 272b42e2d07a..eff3e3fa0107 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@
# 1. Firejail profile + script
pkgname='rust-doom-git'
-_reponame='rust-doom'
+_gitname='rust-doom'
_execname='rs_doom'
pkgver=r325.5b2a843
pkgrel=1
@@ -15,31 +15,38 @@ license=('Apache')
depends_x86_64=('sdl2' 'sdl2_ttf')
depends_i686=('lib32-sdl2' 'lib32-sdl2_ttf')
makedepends=('cargo' 'git' 'rust')
-provides=("${_reponame}")
-conflicts=("${_reponame}")
+provides=("${_gitname}")
+conflicts=("${_gitname}")
source=('git+https://github.com/cristicbz/rust-doom.git')
sha256sums=('SKIP')
pkgver() {
- cd "${_reponame}"
+ cd "${_gitname}"
+
printf "r%s.%s" \
"$(git rev-list --count HEAD)" \
"$(git rev-parse --short HEAD)"
}
build() {
- cd "${_reponame}"
+ cd "${_gitname}"
+
cargo build --release
}
-package() {
- cd "${_reponame}"
+check() {
+ cd "${_gitname}"
- install -Dm 755 \
- "target/release/${_execname}" \
- "${pkgdir}/usr/bin/${_reponame}"
+ cargo test
+}
+
+package() {
+ cd "${_gitname}"
- install -Dm 644 \
- LICENSE \
+ install -D -m 755 \
+ "target/release/${_execname}" \
+ "${pkgdir}/usr/bin/${_gitname}"
+ install -D -m 644 \
+ LICENSE \
"${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}