From 70bb70b3ed47de760b49fd94ab0504b8e5db2a65 Mon Sep 17 00:00:00 2001 From: DarkFeather Date: Fri, 25 Dec 2020 05:36:38 -0600 Subject: [PATCH] Fixing for Maat CI/CD and displaytext standards --- .gitignore | 4 ++-- CryptoWorkbench.csharp | 2 +- Makefile | 18 +++--------------- PKGBUILD | 36 ++++++++++++++++++------------------ 4 files changed, 24 insertions(+), 36 deletions(-) diff --git a/.gitignore b/.gitignore index 565fb72..ab88ca6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ CryptoApplet.java -cryptoworkbench.exe +shell.exe pkg/ src/ -cryptoworkbench-*.pkg.tar.xz +CryptoWorkbench-*.pkg.tar.zst diff --git a/CryptoWorkbench.csharp b/CryptoWorkbench.csharp index 7885924..b9de09a 100644 --- a/CryptoWorkbench.csharp +++ b/CryptoWorkbench.csharp @@ -202,7 +202,7 @@ namespace AniNIX.Crypto { public void Run() { // Display the header. Console.ForegroundColor = ConsoleColor.Red; - Console.WriteLine("### Welcome to the AniNIX::CryptoWorkbench ###"); + Console.WriteLine("### Welcome to the AniNIX/CryptoWorkbench ###"); Console.ResetColor(); Console.WriteLine("Type help for assistance.\n"); Print(); diff --git a/Makefile b/Makefile index 27eae1d..c455a2c 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,8 @@ -execDir=/usr/local/bin -optDir=/opt/aninix/CryptoWorkbench +execDir=/usr/local/bin/ +optDir=/opt/aninix/CryptoWorkbench/ compile: /usr/bin/mcs CryptoWorkbench.csharp /opt/aninix/Uniglot/ + if ! id crypto &>/dev/null; then sudo useradd -d /home/crypto -s /sbin/nologin crypto; echo "crypto:$$(pwgen 24 1)" | sudo chpasswd; fi /usr/bin/mcs -out:shell.exe /opt/aninix/Uniglot/CSharp/*.csharp *.csharp 2>&1 test: /usr/bin/mono compile @@ -24,19 +25,6 @@ checkperm: chmod 0755 ${pkgdir}${execDir}cryptoworkbench ${pkgdir}${execDir}captivecrypto chown root:root ${pkgdir}${execDir}cryptoworkbench ${pkgdir}${execDir}captivecrypto ${pkgdir}${optDir}shell.exe -sshuser: install ForceCommand.txt pwgen /usr/sbin/ssh /usr/sbin/sshd - grep captivecrypto /etc/shells || echo '${execDir}captivecrypto' /etc/shells - if ! id crypto &>/dev/null; then useradd -k -d /home/crypto -s ${execDir}captivecrypto crypto; fi - echo "crypto:$(pwgen 24 1)" | chpasswd; - cat ./ForceCommand.txt >> /etc/ssh/sshd_config - echo crypto | passwd --stdin crypto - -tmux: /usr/bin/tmux - @echo Making sure cryptoworkbench setting isn\'t already in /etc/tmux.conf... - [ `grep -c "cryptoworkbench" /etc/tmux.conf` -eq 0 ] - echo "bind-key -T prefix x new-window cryptoworkbench" >> /etc/tmux.conf - echo 'bind-key -T prefix X confirm-before -p "kill-pane #P? (y/n)" kill-pane' >> /etc/tmux.conf - diff: ${execDir}captivecrypto ${execDir}cryptoworkbench diff ./captivecrypto ${execDir}captivecrypto diff ./cryptoworkbench ${execDir}cryptoworkbench diff --git a/PKGBUILD b/PKGBUILD index d25a947..fc9869f 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,23 +1,22 @@ -# Maintainer: Shikoba Kage -pkgname=cryptoworkbench -pkgver=0.2.4b6f343 -pkgver() { - printf "0.2.""$(git rev-parse --short HEAD)" -} -pkgrel=1 -epoch= -pkgdesc="AniNIX::CryptoWorkbench \\\\ Simple Cryptography Utility" -arch=("x86_64") -url="https://aninix.net/foundation/CryptoWorkbench" -license=('custom') -groups=() -depends=('mono>=5.0.0' 'curl' 'grep' 'bash>=4.4' 'git>=2.13' 'Uniglot') -makedepends=('make>=4.2') +depends=('mono>=5.0.0' 'curl' 'grep' 'bash>=4.4') +makedepends=('make>=4.2' 'Uniglot') checkdepends=() optdepends=() -provides=('cryptoworkbench') +pkgname="$(git config remote.origin.url | rev | cut -f 1 -d '/' | rev | sed 's/.git$//')" +pkgver="$(git describe --tag --abbrev=0)"."$(git rev-parse --short HEAD)" +pkgrel=1 +pkgrel() { + echo $(( `git log "$(git describe --tag --abbrev=0)"..HEAD | grep -c commit` + 1 )) +} +epoch="$(git log | grep -c commit)" +pkgdesc="$(head -n 1 README.md)" +arch=("x86_64") +url="$(git config remote.origin.url | sed 's/.git$//')" +license=('custom') +groups=() +provides=("${pkgname}") conflicts=() -replaces=() +replaces=("${pkgname,,}", "aninix-${pkgname,,}") backup=() options=() install= @@ -36,7 +35,8 @@ build() { } check() { - printf 'quit\n\n' | make -C "${srcdir}/.." test + chmod -R u+r ../pkg + make -C .. test } package() {