From 484eac9d1b79b0a77ed4a521a8cba865bba31557 Mon Sep 17 00:00:00 2001 From: Jules Sagot--Gentil Date: Sat, 25 Feb 2023 17:54:33 +0100 Subject: [PATCH] feat: Makefile to build Mobilizon release for Chapril --- README.md | 12 ++++++++++ build/.gitignore | 3 +++ build/Makefile | 59 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 build/.gitignore create mode 100644 build/Makefile diff --git a/README.md b/README.md index 409cc9d..f0d87ef 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,17 @@ # Mobilizon Chapril Tools +## Build + +Le dossier build contient un Makefile permettant de construire la version Chapril de Mobilizon. + +```sh +# Dans le dossier build +cd build + +# Affichez le manuel d'utilisation de ce Makefile +make help +``` + ## Monitoring Surveiller les signes de vie du site depuis Icinga. https://icinga.chapril.org diff --git a/build/.gitignore b/build/.gitignore new file mode 100644 index 0000000..1e9246a --- /dev/null +++ b/build/.gitignore @@ -0,0 +1,3 @@ +elixir-1.14.1 +mobilizon +dist \ No newline at end of file diff --git a/build/Makefile b/build/Makefile new file mode 100644 index 0000000..76d5500 --- /dev/null +++ b/build/Makefile @@ -0,0 +1,59 @@ +dist: + mkdir -p dist + +# Debian packages required for build +install-build-tools: + apt install erlang build-essential curl unzip openssl git cmake file + +# Elixir +elixir-1.14.1: dist + wget https://codeload.github.com/elixir-lang/elixir/tar.gz/refs/tags/v1.14.1 \ + -O elixir-1.14.1.tar.gz + tar zxf elixir-1.14.1.tar.gz + rm elixir-1.14.1.tar.gz + +build-elixir: elixir-1.14.1 + make -C elixir-1.14.1 -j$(shell nproc --ignore=1) + make -C elixir-1.14.1 Precompiled.zip + mv elixir-1.14.1/Precompiled.zip dist/elixir-1.14.1.zip + +install-elixir: build-elixir + make -C elixir-1.14.1 install + /usr/local/bin/elixir --version + +# NodeJS +node-v18.12.1-linux-x64.tar.xz: dist + wget --inet4-only https://nodejs.org/dist/v18.12.1/node-v18.12.1-linux-x64.tar.xz \ + -O dist/node-v18.12.1-linux-x64.tar.xz + +install-nodejs: node-v18.12.1-linux-x64.tar.xz + tar --directory=/usr/local/ \ + --strip-components=1 \ + -Jxf $(shell pwd)/dist/node-v18.12.1-linux-x64.tar.xz + /usr/local/bin/node --version + +# Mobilizon +build-release: dist + git clone \ + --branch chapril-v3 \ + https://forge.april.org/Chapril/mobilizon.chapril.org-mobilizon.git \ + mobilizon + make -C mobilizon release + mv mobilizon/*.tar.gz dist/ + +# Show results +list-built-packages: + ls -l dist + +clean: + rm node-v18.12.1-linux-x64.tar.xz + +help: + @echo To compile and release, Mobilizon you need to install build tools + @echo Run \`sudo make install-build-tools install-elixir install-nodejs\` + @echo + @echo You are now able to compile and package Mobilizon + @echo Run \`make build-release\` + @echo + @echo The resulting packages will be located under dist. + @echo Run \`make list-built-packages\` to see them