commit 858974f789048aa7b8b230c625ceef4340814235 Author: MrMelon Date: Sat Apr 24 11:06:38 2021 +0100 Project setup diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..849ddff --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +dist/ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..0ec1207 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "simple-vpn"] + path = simple-vpn + url = https://codehub.onpointcoding.net/sean/simple-vpn.git diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..5c3a9c9 --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,12 @@ +{ + "configurations": [ + { + "name": "Linux", + "includePath": [ + "${workspaceFolder}/src/intf/**" + ], + "compilerPath": "/usr/bin/gcc", + } + ], + "version": 4 +} \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..86a91dc --- /dev/null +++ b/Makefile @@ -0,0 +1,67 @@ +cli_sourcefiles := $(shell find src/impl/cli/ -name *.c) +gui_sourcefiles := $(shell find src/impl/gui/ -name *.c) +daemon_sourcefiles := $(shell find src/impl/daemon/ -name *.c) +refreshpeers_sourcefiles := $(shell find src/impl/refresh-peers/ -name *.c) +shared_sourcefiles := $(shell find src/impl/shared/ -name *.c) +libshared := "src/intf/" +libappindicator := "/usr/include/libappindicator3-0.1/" + +proj_version := $(shell cat project.json | jq .Version -r) + + +main: + make build-logo && \ + make build-shared && \ + make build-daemon && \ + make build-refreshpeers && \ + make build-user + +all: + make main + +build-shared: + mkdir -p dist/ && \ + mkdir -p dist/libmelonvpnshared-obj/ && \ + ./scripts/gcc_multiwrap.sh -I ${libshared} -- dist/libmelonvpnshared.a dist/libmelonvpnshared-obj/ ${shared_sourcefiles} + +build-daemon: + mkdir -p dist/ && \ + gcc -o dist/melonvpndaemon -I ${libshared} ${daemon_sourcefiles} dist/libmelonvpnshared.a -pthread + +build-refreshpeers: + mkdir -p dist/ && \ + gcc -o dist/melonvpnrefreshpeers -I ${libshared} ${refreshpeers_sourcefiles} dist/libmelonvpnshared.a obj/mjson.o + +build-user: + mkdir -p dist/ && \ + make build-gui && \ + make build-cli + +build-cli: + mkdir -p dist/ && \ + gcc -rdynamic -o dist/melonvpn -I ${libshared} ${cli_sourcefiles} dist/libmelonvpnshared.a -DPROJ_VERSION=\"${proj_version}\" -ldl + +build-gui: + mkdir -p dist/ && \ + gcc `pkg-config --cflags gtk+-3.0` -shared -fPIC -o dist/libmelonvpngui.so -I ${libshared} -I ${libappindicator} ${gui_sourcefiles} dist/libmelonvpnshared.a `pkg-config --libs gtk+-3.0 appindicator3-0.1` + +build-logo: + mkdir -p dist/ && \ + cp "assets/melonvpn.svg" "dist/melonvpn.svg" && \ + cp "assets/statusmelonoff.png" "dist/statusmelonoff.png" && \ + cp "assets/statusmelonon.png" "dist/statusmelonon.png" && \ + inkscape "assets/melonvpn.svg" -o "dist/melonvpn.png" -w 128 -h 128 + +package: + ./scripts/package-melonvpn.sh && \ + ./scripts/package-melonvpngui.sh + +deb: + make clean && \ + make all && \ + make package + +clean: + rm -rf dist/ && \ + rm -rf package/ + diff --git a/project-gui.json b/project-gui.json new file mode 100644 index 0000000..b42cafd --- /dev/null +++ b/project-gui.json @@ -0,0 +1,10 @@ +{ + "Package": "melonvpngui", + "Version": "1.0-1", + "Section": "base", + "Priority": "optional", + "Architecture": "amd64", + "Depends": "libappindicator3-1, melonvpn", + "Maintainer": "MrMelon54 ", + "Description": "A GUI addon for the Melon VPN client" +} diff --git a/project.json b/project.json new file mode 100644 index 0000000..5ebb3f0 --- /dev/null +++ b/project.json @@ -0,0 +1,10 @@ +{ + "Package": "melonvpn", + "Version": "1.0-1", + "Section": "base", + "Priority": "optional", + "Architecture": "amd64", + "Depends": "simple-vpn", + "Maintainer": "MrMelon54 ", + "Description": "A client for Melon VPN server" +}