summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatheus Gabriel Werny de Lima2021-03-01 09:09:41 +0100
committerMatheus Gabriel Werny de Lima2021-03-01 09:09:41 +0100
commite4a49026fcd302575184980d0d454020ad100515 (patch)
treec628a53f085e69dd46e0a517793fe8d16991da07
parent1c8b8dd0670e20d9fc31b051c91ed51dde997578 (diff)
downloadaur-e4a49026fcd302575184980d0d454020ad100515.tar.gz
Added a README file. Removed the service. Added start and stop commands. These use tmux as the software depends on a home directory. Thus, a service is not universally usable.
-rwxr-xr-x.SRCINFO1
-rwxr-xr-xPKGBUILD36
2 files changed, 15 insertions, 22 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 568d40095f8..57b970197a2 100755
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -12,6 +12,7 @@ pkgbase = nbxplorer-git
depends = dotnet-host
depends = dotnet-runtime
depends = dotnet-sdk
+ depends = tmux
provides = nbxplorer
conflicts = nbxplorer
source = git+https://github.com/dgarage/NBXplorer.git
diff --git a/PKGBUILD b/PKGBUILD
index 90b4972fa6b..c6a9749eb4d 100755
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -12,7 +12,7 @@ arch=("any")
url="https://github.com/dgarage/${_pkgname}"
license=("MIT")
groups=()
-depends=("aspnet-runtime" "bitcoin-cli" "bitcoin-daemon" "dotnet-host" "dotnet-runtime" "dotnet-sdk")
+depends=("aspnet-runtime" "bitcoin-cli" "bitcoin-daemon" "dotnet-host" "dotnet-runtime" "dotnet-sdk" "tmux")
makedepends=("git")
checkdepends=()
optdepends=()
@@ -47,39 +47,31 @@ package()
# Assure that the folders exist.
mkdir -p ${pkgdir}/usr/bin/
mkdir -p ${pkgdir}/usr/lib/
- mkdir -p ${pkgdir}/usr/lib/systemd/system/
mkdir -p ${pkgdir}/usr/share/doc/${_pkgname}/
mkdir -p ${pkgdir}/usr/share/licenses/${_pkgname}/
- # Create the systemd service.
- echo -e "[Unit]
- Description=${pkgdesc}
- Requires=bitcoind.service
- After=bitcoind.service
- After=network.target
-
- [Service]
- Type=simple
- Environment=DOTNET_CLI_HOME=/tmp/
- ExecStart=/usr/bin/${_pkgname_lc}
- Restart=on-failure
-
- [Install]
- WantedBy=multi-user.target" > ${srcdir}/${_pkgname}/${_pkgname_lc}.service
-
# Modify run.sh to state the absolute path of the .csproj.
echo -e "#!/bin/bash
dotnet run --no-launch-profile --no-build -c Release -p \"/usr/lib/${_pkgname}/NBXplorer/NBXplorer.csproj\" -- $@" > ${srcdir}/${_pkgname}/run.sh
+ # Create nbxplorer-start.sh.
+ echo -e "#!/bin/bash
+ tmux new-session -s ${_pkgname_lc} -d \"${_pkgname_lc}\";bash -i" > ${srcdir}/${_pkgname}/${_pkgname_lc}-start.sh
+
+ # Create nbxplorer-stop.sh.
+ echo -e "#!/bin/bash
+ tmux kill-session -t ${_pkgname_lc}" > ${srcdir}/${_pkgname}/${_pkgname_lc}-stop.sh
+
# Put the installation at the right place.
cp -r ${srcdir}/${_pkgname}/ ${pkgdir}/usr/lib/
- # Symlinking run.sh to /usr/bin/${_pkgname_lc}.
+ # Symlinking the scripts.
ln -sfrT ${pkgdir}/usr/lib/${_pkgname}/run.sh ${pkgdir}/usr/bin/${_pkgname_lc}
chmod 755 ${pkgdir}/usr/bin/${_pkgname_lc}
-
- # Install the systemd service.
- install -Dm644 ${pkgdir}/usr/lib/${_pkgname}/${_pkgname_lc}.service ${pkgdir}/usr/lib/systemd/system/
+ ln -sfrT ${pkgdir}/usr/lib/${_pkgname}/${_pkgname_lc}-start.sh ${pkgdir}/usr/bin/${_pkgname_lc}-start
+ chmod 755 ${pkgdir}/usr/bin/${_pkgname_lc}-start
+ ln -sfrT ${pkgdir}/usr/lib/${_pkgname}/${_pkgname_lc}-stop.sh ${pkgdir}/usr/bin/${_pkgname_lc}-stop
+ chmod 755 ${pkgdir}/usr/bin/${_pkgname_lc}-stop
# Install the documentation.
install -Dm644 ${pkgdir}/usr/lib/${_pkgname}/README.md ${pkgdir}/usr/share/doc/${_pkgname}/