diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d5c9366 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +./helloworld +./helloworld.class +./helloworld.exe diff --git a/Makefile b/Makefile index eb67588..793e7f6 100644 --- a/Makefile +++ b/Makefile @@ -1,45 +1,13 @@ -INSTALLER != curl -s https://aninix.net/foundation/installer-test.bash | /bin/bash - -all: c csharp java bash php hack perl - echo Done; - -compile: - [ -f helloworld.c ] +compile: c cs java bash php perl python install: compile @echo This project cannot be installed. -test: all +test: compile + python3 -m pytest clean: - @echo Nothing to do. - -c: helloworld.c /usr/bin/gcc - gcc -o helloworld helloworld.c - ./helloworld - rm ./helloworld - -java: helloworld.java /usr/bin/java /usr/bin/javac - javac helloworld.java - java helloworld - rm helloworld.class - -bash: helloworld.bash /usr/bin/bash - bash helloworld.bash - -php: helloworld.php /usr/bin/php - php helloworld.php - -hack: helloworld.php /usr/bin/hhvm - hhvm --php helloworld.php - -perl: helloworld.pl /usr/bin/perl - perl ./helloworld.pl - -csharp: helloworld.csharp /usr/bin/mono /usr/bin/mcs - mcs helloworld.csharp - mono helloworld.exe - rm helloworld.exe + cat .gitignore | xargs -n 1 rm -Rf diff: @echo Nothing to do. @@ -49,3 +17,27 @@ reverse: checkperm: @echo Nothing to do. + +c: helloworld.c /usr/bin/gcc + gcc -o helloworld helloworld.c + +java: helloworld.java /usr/bin/java /usr/bin/javac + javac helloworld.java + +bash: helloworld.bash /usr/bin/bash + #bash helloworld.bash + +php: helloworld.php /usr/bin/php + #php helloworld.php + +#hack: helloworld.php /usr/bin/hhvm + #hhvm --php helloworld.php + +perl: helloworld.pl /usr/bin/perl + #perl ./helloworld.pl + +python: helloworld.py /usr/bin/python3 + #python3 ./helloworld.py + +cs: helloworld.cs /usr/bin/mono /usr/bin/mcs + mcs helloworld.cs diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..2876458 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,46 @@ +# Maintainer: Shikoba Kage +pkgname=cryptoworkbench +pkgver=0.1.ac4a8cb406377081eb1c1de2a3abe482508d6f57 +pkgver() { + printf "0.1.""$(git rev-parse 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') +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 "${srcdir}/.." test +} + +package() { + export pkgdir="${pkgdir}" + make -C .. install + install -D -m644 ../LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" +} diff --git a/README b/README new file mode 100644 index 0000000..54412a8 --- /dev/null +++ b/README @@ -0,0 +1 @@ +This project is enabled for AniNIX::Foundation. You can check it out remotely with the git package. It is intended to display example source for all of our projects. diff --git a/README.bzr b/README.bzr deleted file mode 100644 index 2be0f40..0000000 --- a/README.bzr +++ /dev/null @@ -1,2 +0,0 @@ -This project is enabled for AniNIX::Bazaar. You can check it out remotely with the bzr package. -Project URL is bzr://bazaar.aninix.net/HelloWorld diff --git a/helloworld.bash b/helloworld.bash index 8d6ea8b..8dc340f 100644 --- a/helloworld.bash +++ b/helloworld.bash @@ -1,2 +1,22 @@ #!/usr/bin/bash -printf "Hello world!\n" + +# File: helloworld.bash +# +# Description: This file exemplifies printing 'Hello world!' in bash. +# +# Package: AniNIX::Foundation/HelloWorld +# Copyright: WTFPL +# +# Author: DarkFeather + +### +### Prints 'Hello world!' +### +function helloWorld() { + printf "Hello world!\n" +} + +## MAIN +if [ `echo "$0" | egrep '(^|/)helloworld.bash'` ]; then + helloWorld +fi diff --git a/helloworld.c b/helloworld.c index f526931..da9f16e 100644 --- a/helloworld.c +++ b/helloworld.c @@ -1,6 +1,27 @@ #include -int main(int argc, char* argv[]) { - printf("Hello world!\n"); - return 0; +/* + * File: helloworld.c + * + * Description: This file exemplifies printing 'Hello world!' in C. + * + * Package: AniNIX::Foundation/HelloWorld + * Copyright: WTFPL + * + * Author: DarkFeather + */ + +static char * message = "Hello world!"; + +/// +/// Prints 'Hello world!' +/// +void HelloWorld() { + printf("%s\n",message); +} + +// MAIN +int main(int argc, char* argv[]) { + HelloWorld(); + return 0; } diff --git a/helloworld.cs b/helloworld.cs index 8f1b297..42a8e3a 100644 --- a/helloworld.cs +++ b/helloworld.cs @@ -1,9 +1,31 @@ using System; +/* + * File: helloworld.cs + * + * Description: This file exemplifies printing 'Hello world!' in C#. + * + * Package: AniNIX::Foundation/HelloWorld + * Copyright: WTFPL + * + * Author: DarkFeather + */ + namespace AniNIX { - class HelloWorld { - public static void Main(string[] args) { - Console.WriteLine("Hello world!"); - } + + public sealed class HelloWorld { + + /// + /// Print 'Hello world!' + /// + public static void PrintHelloWorld() { + Console.WriteLine("Hello world!"); + } + + // Main + public static void Main(string[] args) { + HelloWorld.PrintHelloWorld(); + return; + } } } diff --git a/helloworld.csharp b/helloworld.csharp deleted file mode 100644 index 8f1b297..0000000 --- a/helloworld.csharp +++ /dev/null @@ -1,9 +0,0 @@ -using System; - -namespace AniNIX { - class HelloWorld { - public static void Main(string[] args) { - Console.WriteLine("Hello world!"); - } - } -} diff --git a/helloworld.py b/helloworld.py new file mode 100644 index 0000000..2449cad --- /dev/null +++ b/helloworld.py @@ -0,0 +1,3 @@ +#!/usr/bin/python3 + +print('Hello World!\n'); diff --git a/tests/__pycache__/test_unit.cpython-37-PYTEST.pyc b/tests/__pycache__/test_unit.cpython-37-PYTEST.pyc new file mode 100644 index 0000000..627b2d6 Binary files /dev/null and b/tests/__pycache__/test_unit.cpython-37-PYTEST.pyc differ diff --git a/tests/test_unit.py b/tests/test_unit.py new file mode 100644 index 0000000..bc28811 --- /dev/null +++ b/tests/test_unit.py @@ -0,0 +1,15 @@ +import os +import re +import shutil + +def checkOutput(output): + for line in output.split('\n'): + if line == 'Hello world!': return True + return False + +def test_c(): + print(os.getcwd()) + fh = os.popen("./helloworld", mode='r', buffering=-1) + output = fh.read() + retcode = fh.close() + assert retcode == None and checkOutput(output)