From 4f96934f3f29f7fcbfccb9de54cdb6bcf1ad2750 Mon Sep 17 00:00:00 2001 From: DarkFeather Date: Thu, 6 Jul 2017 12:10:56 -0500 Subject: [PATCH] pacman support --- .gitignore | 3 +++ Makefile | 21 ++++++++++++--------- PKGBUILD | 43 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 9 deletions(-) create mode 100644 PKGBUILD diff --git a/.gitignore b/.gitignore index 4f489ab..565fb72 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ CryptoApplet.java cryptoworkbench.exe +pkg/ +src/ +cryptoworkbench-*.pkg.tar.xz diff --git a/Makefile b/Makefile index ce880af..9307e15 100644 --- a/Makefile +++ b/Makefile @@ -1,26 +1,29 @@ -TMUXSetting != grep -c "cryptoworkbench" /etc/tmux.conf INSTALLER != curl -s https://aninix.net/foundation/installer-test.bash | /bin/bash +tester: + echo ${pkgbuild}/opt + compile: clean /usr/bin/mcs CryptoWorkbench.csharp if [ ! -d ../SharedLibraries ]; then git -C /usr/local/src clone https://aninix.net/foundation/SharedLibraries; fi - git -c /usr/local/src/SharedLibraries pull + git -C /usr/local/src/SharedLibraries pull /usr/bin/mcs -out:cryptoworkbench.exe ../SharedLibraries/CSharp/*.csharp *.csharp 2>&1 test: /usr/bin/mono compile - /usr/bin/mono cryptoworkbench.exe ./sample.txt + echo quit | /usr/bin/mono cryptoworkbench.exe ./sample.txt clean: if [ -f cryptoworkbench.exe ]; then rm cryptoworkbench.exe; fi install: compile /bin/bash bash.cryptoworkbench - mv cryptoworkbench.exe /opt - cp bash.cryptoworkbench /usr/local/bin/cryptoworkbench - cp captivecrypto.bash /usr/local/bin/captivecrypto + mkdir -p ${pkgdir}/opt ${pkgdir}/usr/local/bin/ ${pkgdir}/usr/local/bin/ + mv cryptoworkbench.exe ${pkgdir}/opt + cp bash.cryptoworkbench ${pkgdir}/usr/local/bin/cryptoworkbench + cp captivecrypto.bash ${pkgdir}/usr/local/bin/captivecrypto make checkperm checkperm: - chmod 0555 /opt/cryptoworkbench.exe /usr/local/bin/cryptoworkbench /usr/local/bin/captivecrypto - chown root:root /usr/local/bin/captivecrypto /opt/cryptoworkbench.exe + chmod 0555 ${pkgdir}/opt/cryptoworkbench.exe ${pkgdir}/usr/local/bin/cryptoworkbench ${pkgdir}/usr/local/bin/captivecrypto + chown root:root ${pkgdir}/usr/local/bin/captivecrypto ${pkgdir}/opt/cryptoworkbench.exe sshuser: install ForceCommand.txt grep captivecrypto /etc/shells || echo '/usr/local/bin/captivecrypto' /etc/shells @@ -30,7 +33,7 @@ sshuser: install ForceCommand.txt tmux: /usr/bin/tmux @echo Making sure cryptoworkbench setting isn\'t already in /etc/tmux.conf... - [ "${TMUXSetting}" -eq 0 ] + [ `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 --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..002dd74 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,43 @@ +# Maintainer: Shikoba Kage +pkgname=cryptoworkbench +pkgver=0.1 +pkgrel=1 +epoch= +pkgdesc="Simple cryptography utilities." +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') +makedepends=('make>=4.2') +checkdepends=() +optdepends=() +provides=('cryptoworkbench') +conflicts=() +replaces=() +backup=() +options=() +install= +changelog= +source=() +noextract=() +md5sums=() +validpgpkeys=() + +prepare() { + git pull +} + +build() { + make -C .. +} + +check() { + printf 'quit\n\n' | make -C .. test +} + +package() { + export pkgdir="${pkgdir}" + make -C .. install + install -D -m644 ../LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" +}