summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxengineering <mail2xengineering@protonmail.com>2021-06-10 11:10:57 +0200
committerxengineering <mail2xengineering@protonmail.com>2021-06-10 11:10:57 +0200
commitcce4dd8af1ceec9ad9c1097ee584af87e4033a2a (patch)
tree02dd1aa1e11e8bf49a622a39e269c73cf5660967
parent2adbac8efc7d651dd9cdf806fcbb59016a37126b (diff)
downloadbirdscan-cce4dd8af1ceec9ad9c1097ee584af87e4033a2a.tar
birdscan-cce4dd8af1ceec9ad9c1097ee584af87e4033a2a.tar.zst
birdscan-cce4dd8af1ceec9ad9c1097ee584af87e4033a2a.zip
Implement basic Structure and Buildsystem
-rw-r--r--.gitignore1
-rw-r--r--Makefile19
-rw-r--r--python/Makefile14
-rw-r--r--python/birdscan/__init__.py0
-rw-r--r--python/birdscan/__main__.py11
-rw-r--r--python/setup.py15
-rw-r--r--src/Makefile24
-rw-r--r--src/go.mod3
-rw-r--r--src/main.go16
9 files changed, 103 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..378eac2
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+build
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..cd4cbb5
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,19 @@
+# vim: shiftwidth=4 tabstop=4 noexpandtab
+
+DESTDIR="" # leave empty for the current system or provide a fakeroot here
+PREFIX="/usr"
+
+.PHONY: all clean install
+
+all:
+ make -C python all
+ make -C src all
+
+clean:
+ make -C python clean
+ make -C src clean
+
+install: all
+ make -C python install DESTDIR=$(abspath $(DESTDIR))
+ make -C src install DESTDIR=$(abspath $(DESTDIR))
+
diff --git a/python/Makefile b/python/Makefile
new file mode 100644
index 0000000..c3a3660
--- /dev/null
+++ b/python/Makefile
@@ -0,0 +1,14 @@
+# vim: shiftwidth=4 tabstop=4 noexpandtab
+
+DESTDIR="" # leave empty for the current system or provide a fakeroot here
+
+.PHONY: all clean install
+
+all:
+ python setup.py build
+
+clean:
+ rm -rf build
+
+install: all
+ python setup.py install --root=$(DESTDIR) --optimize=1 --skip-build
diff --git a/python/birdscan/__init__.py b/python/birdscan/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/python/birdscan/__init__.py
diff --git a/python/birdscan/__main__.py b/python/birdscan/__main__.py
new file mode 100644
index 0000000..34eb665
--- /dev/null
+++ b/python/birdscan/__main__.py
@@ -0,0 +1,11 @@
+#!/usr/bin/python3
+# vim: shiftwidth=4 tabstop=4 expandtab
+
+
+import time
+
+
+while True:
+ print("Active!")
+ time.sleep(2)
+
diff --git a/python/setup.py b/python/setup.py
new file mode 100644
index 0000000..0cfafbd
--- /dev/null
+++ b/python/setup.py
@@ -0,0 +1,15 @@
+#!/usr/bin/python3
+# vim: shiftwidth=4 tabstop=4 expandtab
+
+
+from distutils.core import setup
+
+setup(name="birdscan",
+ version="0.0.1",
+ description="A software to take nice pictures of birds with a Raspberry Pi Camera",
+ author="xengineering",
+ author_email="mail2xengineering@protonmail.com",
+ url="https://xengineering.eu",
+ packages=["birdscan"],
+)
+
diff --git a/src/Makefile b/src/Makefile
new file mode 100644
index 0000000..02e9e39
--- /dev/null
+++ b/src/Makefile
@@ -0,0 +1,24 @@
+# vim: shiftwidth=4 tabstop=4 noexpandtab
+
+DESTDIR="" # leave empty for the current system or provide a fakeroot here
+PREFIX="/usr"
+
+.PHONY: all clean install
+
+all:
+ # some recommended options for Go building (https://wiki.archlinux.org/title/Go_package_guidelines)
+ export CGO_CPPFLAGS="${CPPFLAGS}"
+ export CGO_CFLAGS="${CFLAGS}"
+ export CGO_CXXFLAGS="${CXXFLAGS}"
+ export CGO_LDFLAGS="${LDFLAGS}"
+ export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
+
+ mkdir -p build
+ go build -o build/birdscan ./...
+
+clean:
+ rm -rf build
+
+install: all
+ install -Dm 755 build/birdscan $(DESTDIR)$(PREFIX)/bin/birdscan
+
diff --git a/src/go.mod b/src/go.mod
new file mode 100644
index 0000000..33a7a6a
--- /dev/null
+++ b/src/go.mod
@@ -0,0 +1,3 @@
+module src.xengineering.eu/xengineering/birdscan
+
+go 1.16
diff --git a/src/main.go b/src/main.go
new file mode 100644
index 0000000..6e413c8
--- /dev/null
+++ b/src/main.go
@@ -0,0 +1,16 @@
+// vim: shiftwidth=4 tabstop=4 noexpandtab
+
+package main
+
+import (
+ "fmt"
+ "time"
+)
+
+func main() {
+ for {
+ fmt.Println("Hey!")
+ time.Sleep(2 * time.Second)
+ }
+}
+