summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorKuoi2022-11-10 02:22:18 +0800
committerKuoi2022-11-10 02:22:18 +0800
commit927bf3472fe19abe2a4ef1efbe2265c95ac88e8f (patch)
tree66d4933a6c7eb3428963e78829233b308ceeac9d
parent9dc1716def773c98a2f2bc8e6661e2326ce86066 (diff)
downloadaur-927bf3472fe19abe2a4ef1efbe2265c95ac88e8f.tar.gz
plume: make it flexiable and add details
-rw-r--r--PKGBUILD23
1 files changed, 20 insertions, 3 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 10748a32a03f..57f522828a24 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,4 +1,5 @@
-# Maintainer: Jiuyang Liu <liujiuyang1994@gmail.com>
+# Maintainer: Guoyi Zhang <guoyizhang at malacology dot net>
+# Contributor: Jiuyang Liu <liujiuyang1994@gmail.com>
pkgname=plume
_pkgname=Plume
@@ -32,14 +33,30 @@ prepare(){
build() {
cd $_pkgname-$pkgver
+
+ # test the databse type
+if [ -f "/usr/bin/sqlite3" ]; then
+ if [ -f "/usr/bin/postgres" ]; then
+ echo "Please definate \$DATABASE"
+ else
+ echo "Plume will be build with sqlite" && export DATABASE="postgres"
+ fi
+ else
+ if [ -f "/usr/bin/postgres" ]; then
+ echo "Plume will be build with postgresql"
+ else
+ echo "Please install postgresql or sqlite" && export DATABASE="sqlite"
+ fi
+fi
+
# build the font-end
rustup target add wasm32-unknown-unknown
#env PATH=$HOME/.cargo/bin/:$PATH wasm-pack build --target web --release plume-front
wasm-pack build --target web --release plume-front
# build the back-end
- cargo install --no-default-features --features postgres --path .
- cargo install --no-default-features --features postgres --path plume-cli
+ cargo install --no-default-features --features $DATABASE --path .
+ cargo install --no-default-features --features $DATABASE --path plume-cli
}