From dd0aad6740f83c46e43f1334a0b42c0b357b1a3e Mon Sep 17 00:00:00 2001 From: root Date: Sat, 12 Feb 2022 18:30:28 +0100 Subject: [PATCH] refactor --- README.MD | 2 + joplin2deb | 4 +- lib/function (copie 1).sh | 138 ++++++++++++++++++ lib/function.sh | 20 +-- ressources/authelia/authelia | 40 +++++ ressources/authelia/build | 5 - ressources/authelia/envinit | 9 -- ressources/authelia/makedeb | 8 - ressources/authelia/prebuild | 6 - ressources/element-web/build | 4 - ressources/element-web/element-web | 37 +++++ ressources/element-web/envinit | 7 - ressources/element-web/makedeb | 7 - ressources/element-web/prebuild | 6 - ressources/gotify/build | 4 - ressources/gotify/envinit | 8 - ressources/gotify/gotify | 38 +++++ ressources/gotify/makedeb | 8 - ressources/gotify/prebuild | 6 - ressources/joplin-server/build | 3 - ressources/joplin-server/envinit | 7 - ressources/joplin-server/joplin-server | 39 +++++ ressources/joplin-server/makedeb | 7 - ressources/joplin-server/prebuild | 10 -- ressources/joplin/joplin | 26 ++++ ressources/joplin/makedeb | 7 - ressources/mautrix-whatsapp/build | 4 - ressources/mautrix-whatsapp/envinit | 3 - ressources/mautrix-whatsapp/makedeb | 7 - ressources/mautrix-whatsapp/mautrix-whatsapp | 33 +++++ ressources/mautrix-whatsapp/prebuild | 6 - ressources/rss-bridge/build | 2 - ressources/rss-bridge/envinit | 2 - ressources/rss-bridge/makedeb | 16 -- ressources/rss-bridge/prebuild | 6 - ressources/rss-bridge/rss-bridge | 39 +++++ ressources/standardnotes-web/build | 5 - ressources/standardnotes-web/envinit | 7 - ressources/standardnotes-web/makedeb | 6 - ressources/standardnotes-web/prebuild | 6 - .../standardnotes-web/standardnotes-web | 37 +++++ ressources/vaultwarden-web/build | 4 - ressources/vaultwarden-web/envinit | 8 - ressources/vaultwarden-web/makedeb | 6 - ressources/vaultwarden-web/prebuild | 19 --- ressources/vaultwarden-web/vaultwarden-web | 49 +++++++ ressources/vaultwarden/build | 4 - ressources/vaultwarden/envinit | 6 - ressources/vaultwarden/makedeb | 7 - ressources/vaultwarden/prebuild | 6 - ressources/vaultwarden/vaultwarden | 35 +++++ ressources/zigbee2mqtt/build | 4 - ressources/zigbee2mqtt/envinit | 3 - ressources/zigbee2mqtt/makedeb | 8 - ressources/zigbee2mqtt/prebuild | 6 - ressources/zigbee2mqtt/zigbee2mqtt | 33 +++++ 56 files changed, 555 insertions(+), 278 deletions(-) create mode 100644 lib/function (copie 1).sh create mode 100755 ressources/authelia/authelia delete mode 100755 ressources/authelia/build delete mode 100755 ressources/authelia/envinit delete mode 100644 ressources/authelia/makedeb delete mode 100755 ressources/authelia/prebuild delete mode 100755 ressources/element-web/build create mode 100755 ressources/element-web/element-web delete mode 100755 ressources/element-web/envinit delete mode 100644 ressources/element-web/makedeb delete mode 100755 ressources/element-web/prebuild delete mode 100755 ressources/gotify/build delete mode 100755 ressources/gotify/envinit create mode 100755 ressources/gotify/gotify delete mode 100644 ressources/gotify/makedeb delete mode 100755 ressources/gotify/prebuild delete mode 100755 ressources/joplin-server/build delete mode 100755 ressources/joplin-server/envinit create mode 100755 ressources/joplin-server/joplin-server delete mode 100644 ressources/joplin-server/makedeb delete mode 100755 ressources/joplin-server/prebuild create mode 100755 ressources/joplin/joplin delete mode 100644 ressources/joplin/makedeb delete mode 100755 ressources/mautrix-whatsapp/build delete mode 100755 ressources/mautrix-whatsapp/envinit delete mode 100644 ressources/mautrix-whatsapp/makedeb create mode 100755 ressources/mautrix-whatsapp/mautrix-whatsapp delete mode 100755 ressources/mautrix-whatsapp/prebuild delete mode 100755 ressources/rss-bridge/build delete mode 100755 ressources/rss-bridge/envinit delete mode 100644 ressources/rss-bridge/makedeb delete mode 100755 ressources/rss-bridge/prebuild create mode 100755 ressources/rss-bridge/rss-bridge delete mode 100755 ressources/standardnotes-web/build delete mode 100755 ressources/standardnotes-web/envinit delete mode 100644 ressources/standardnotes-web/makedeb delete mode 100755 ressources/standardnotes-web/prebuild create mode 100755 ressources/standardnotes-web/standardnotes-web delete mode 100755 ressources/vaultwarden-web/build delete mode 100755 ressources/vaultwarden-web/envinit delete mode 100644 ressources/vaultwarden-web/makedeb delete mode 100755 ressources/vaultwarden-web/prebuild create mode 100755 ressources/vaultwarden-web/vaultwarden-web delete mode 100755 ressources/vaultwarden/build delete mode 100755 ressources/vaultwarden/envinit delete mode 100644 ressources/vaultwarden/makedeb delete mode 100755 ressources/vaultwarden/prebuild create mode 100755 ressources/vaultwarden/vaultwarden delete mode 100755 ressources/zigbee2mqtt/build delete mode 100755 ressources/zigbee2mqtt/envinit delete mode 100644 ressources/zigbee2mqtt/makedeb delete mode 100755 ressources/zigbee2mqtt/prebuild create mode 100755 ressources/zigbee2mqtt/zigbee2mqtt diff --git a/README.MD b/README.MD index caa2b8c..b9cfbd5 100644 --- a/README.MD +++ b/README.MD @@ -1,4 +1,6 @@ ## DEBMAKER +The main goal of this repository is allow to create application from source without install all compilation utility directly on the main system. +All package are install in folder in chroot environnement with only one script. ### Requirement - debootstrap (ie apt install debootstrap) diff --git a/joplin2deb b/joplin2deb index 7b098e5..eed7349 100755 --- a/joplin2deb +++ b/joplin2deb @@ -1,9 +1,9 @@ #!/bin/bash APP=joplin -VERSION=2.7.8 +VERSION=2.7.11 GIT_VERSION=$VERSION -DEB_VERSION=$VERSION-6 +DEB_VERSION=$VERSION-1 DEBIAN_VERSION_CODENAME=bullseye source ./lib/function.sh diff --git a/lib/function (copie 1).sh b/lib/function (copie 1).sh new file mode 100644 index 0000000..e461161 --- /dev/null +++ b/lib/function (copie 1).sh @@ -0,0 +1,138 @@ +#!/bin/bash +CACHE_APP=cache/${APP}/ +CACHE_STEP1=cache/${DEBIAN_VERSION_CODENAME} +CACHE_STEP2=cache/${APP}/envinit +CACHE_STEP3=cache/${APP}/prebuild +CACHE_STEP4=cache/${APP}/build + +#DownloadOs +step1() { + if [ ! -e ${CACHE_STEP1} ] + then + mkdir -p ${CACHE_STEP1}/proc + mount -t proc proc ${CACHE_STEP1}/proc + sleep 2 + debootstrap ${DEBIAN_VERSION_CODENAME} ${CACHE_STEP1} + umount ${CACHE_STEP1}/proc + fi +} + +#InstallOs +step2(){ + if [ -e ressources/${APP}/envinit ]; then + if [ ! -e ${CACHE_STEP2} ] ; then + mkdir -p ${CACHE_APP} + cp -a ${CACHE_STEP1}/ ${CACHE_STEP2} + cp ressources/${APP}/envinit ${CACHE_STEP2}/tmp/envinit + mount -t proc proc ${CACHE_STEP2}/proc + sleep 2 + chroot ${CACHE_STEP2} /tmp/envinit + umount ${CACHE_STEP2}/proc + rm ${CACHE_STEP2}/tmp/envinit + fi + fi +} + +#ConfigureBeforeBuild +step3(){ + if [ -e ressources/${APP}/prebuild ]; then + if [ ! -e ${CACHE_STEP3} ]; then + cp -a ${CACHE_STEP2} ${CACHE_STEP3} + cp ressources/${APP}/prebuild ${CACHE_STEP3}/tmp/prebuild + chroot ${CACHE_STEP3} /tmp/prebuild ${GIT_VERSION} + rm ${CACHE_STEP3}/tmp/prebuild + fi + fi +} + +#Build +step4(){ + if [ -e ressources/${APP}/build ]; then + if [ ! -e ${CACHE_STEP4} ] ; then + cp -a ${CACHE_STEP3} ${CACHE_STEP4} + cp ressources/${APP}/build ${CACHE_STEP4}/tmp/build + mount -t proc proc ${CACHE_STEP4}/proc/ + sleep 2 + chroot ${CACHE_STEP4} /tmp/build + umount ${CACHE_STEP4}/proc/ + fi + fi +} + +#PackageDeb +step5(){ + rm -fr dist/${APP} + mkdir dist/${APP} + cp -pfr ressources/${APP}/rootfs/* dist/$APP/ + bash ressources/${APP}/makedeb ${CACHE_STEP4} dist/${APP} ${GIT_VERSION} + sed -i "s/%VERSION%/$DEB_VERSION/" dist/${APP}/DEBIAN/control + fakeroot dpkg-deb -Z gzip --build dist/${APP} dist + rm -fr dist/${APP} +} + +allstep(){ + step1 + step2 + step3 + step4 + step5 +} + +DeleteStep1(){ + rm -fr ${CACHE_STEP1} ${CACHE_STEP2} ${CACHE_STEP3} ${CACHE_STEP4} +} +DeleteStep2(){ + rm -fr ${CACHE_STEP2} ${CACHE_STEP3} ${CACHE_STEP4} +} +DeleteStep3(){ + rm -fr ${CACHE_STEP3} ${CACHE_STEP4} +} +DeleteStep4(){ + rm -fr ${CACHE_STEP4} +} + +StartFromStep1(){ + DeleteStep1 + allstep +} + +StartFromStep2(){ + DeleteStep2 + allstep +} + +StartFromStep3(){ + DeleteStep3 + allstep +} + +StartFromStep4(){ + DeleteStep4 + allstep +} + +GotoStep1(){ + chroot ${CACHE_STEP1} +} + +GotoStep2(){ + chroot ${CACHE_STEP2} +} + +GotoStep3(){ + chroot ${CACHE_STEP3} +} + +GotoStep4(){ + mount -t proc proc ${CACHE_STEP4}/proc/ + chroot ${CACHE_STEP4} + umount ${CACHE_STEP4}/proc/ +} + +Clean(){ + rm -fr cache/* +} + +CleanAll(){ + rm -fr cache/* +} diff --git a/lib/function.sh b/lib/function.sh index e461161..dd7c204 100644 --- a/lib/function.sh +++ b/lib/function.sh @@ -19,44 +19,38 @@ step1() { #InstallOs step2(){ - if [ -e ressources/${APP}/envinit ]; then if [ ! -e ${CACHE_STEP2} ] ; then mkdir -p ${CACHE_APP} cp -a ${CACHE_STEP1}/ ${CACHE_STEP2} - cp ressources/${APP}/envinit ${CACHE_STEP2}/tmp/envinit + cp ressources/${APP}/recette ${CACHE_STEP2}/tmp/recette mount -t proc proc ${CACHE_STEP2}/proc sleep 2 - chroot ${CACHE_STEP2} /tmp/envinit + chroot ${CACHE_STEP2} /tmp/recette envinit umount ${CACHE_STEP2}/proc rm ${CACHE_STEP2}/tmp/envinit fi - fi } #ConfigureBeforeBuild step3(){ - if [ -e ressources/${APP}/prebuild ]; then if [ ! -e ${CACHE_STEP3} ]; then cp -a ${CACHE_STEP2} ${CACHE_STEP3} - cp ressources/${APP}/prebuild ${CACHE_STEP3}/tmp/prebuild - chroot ${CACHE_STEP3} /tmp/prebuild ${GIT_VERSION} + cp ressources/${APP}/recette ${CACHE_STEP3}/tmp/recette + chroot ${CACHE_STEP3} /tmp/recette prebuild ${GIT_VERSION} rm ${CACHE_STEP3}/tmp/prebuild fi - fi } #Build step4(){ - if [ -e ressources/${APP}/build ]; then if [ ! -e ${CACHE_STEP4} ] ; then cp -a ${CACHE_STEP3} ${CACHE_STEP4} - cp ressources/${APP}/build ${CACHE_STEP4}/tmp/build + cp ressources/${APP}/recette ${CACHE_STEP4}/tmp/recette mount -t proc proc ${CACHE_STEP4}/proc/ sleep 2 - chroot ${CACHE_STEP4} /tmp/build + chroot ${CACHE_STEP4} /tmp/recette build umount ${CACHE_STEP4}/proc/ fi - fi } #PackageDeb @@ -64,7 +58,7 @@ step5(){ rm -fr dist/${APP} mkdir dist/${APP} cp -pfr ressources/${APP}/rootfs/* dist/$APP/ - bash ressources/${APP}/makedeb ${CACHE_STEP4} dist/${APP} ${GIT_VERSION} + bash ressources/${APP}/recette makedeb ${CACHE_STEP4} dist/${APP} ${GIT_VERSION} sed -i "s/%VERSION%/$DEB_VERSION/" dist/${APP}/DEBIAN/control fakeroot dpkg-deb -Z gzip --build dist/${APP} dist rm -fr dist/${APP} diff --git a/ressources/authelia/authelia b/ressources/authelia/authelia new file mode 100755 index 0000000..352860c --- /dev/null +++ b/ressources/authelia/authelia @@ -0,0 +1,40 @@ +#!/bin/bash + +envinit() { + apt install -y build-essential git wget ca-certificates + wget -qO - https://deb.nodesource.com/setup_16.x | bash + #wget -qO - https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor > /usr/share/keyrings/yarnkey.gpg + #echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" > /etc/apt/sources.list.d/yarn.list + apt-get update + apt-get install -y nodejs + wget -qO - https://go.dev/dl/go1.17.3.linux-amd64.tar.gz | tar -C /usr/local -xz + wget -qO - https://get.pnpm.io/install.sh | sh - +} + +prebuild(){ + VERSION=$1 + cd /tmp/ + git clone https://github.com/authelia/authelia.git + cd authelia/ + git checkout $VERSION +} + +build() { + cd /tmp/authelia/ + . /root/.bashrc + PATH=$PATH:/usr/local/go/bin bash bootstrap.sh + PATH=$PATH:/usr/local/go/bin ./cmd/authelia-scripts/authelia-scripts build +} + +makedeb(){ + PATH_BUILD=$1 + PATH_DEB=$2 + GIT_VERSION=$3 + + cp ${PATH_BUILD}/tmp/authelia/dist/authelia ${PATH_DEB}/usr/bin/authelia + cp ${PATH_BUILD}/tmp/authelia/config.template.yml ${PATH_DEB}/etc/authelia/configuration.yml +} +echo $1 +FUNC=$1 +shift +${FUNC} $* diff --git a/ressources/authelia/build b/ressources/authelia/build deleted file mode 100755 index a048473..0000000 --- a/ressources/authelia/build +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -cd /tmp/authelia/ -. /root/.bashrc -PATH=$PATH:/usr/local/go/bin bash bootstrap.sh -PATH=$PATH:/usr/local/go/bin ./cmd/authelia-scripts/authelia-scripts build diff --git a/ressources/authelia/envinit b/ressources/authelia/envinit deleted file mode 100755 index 6864d65..0000000 --- a/ressources/authelia/envinit +++ /dev/null @@ -1,9 +0,0 @@ -#/bin/bash -apt install -y build-essential git wget ca-certificates -wget -qO - https://deb.nodesource.com/setup_16.x | bash -#wget -qO - https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor > /usr/share/keyrings/yarnkey.gpg -#echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" > /etc/apt/sources.list.d/yarn.list -apt-get update -apt-get install -y nodejs -wget -qO - https://go.dev/dl/go1.17.3.linux-amd64.tar.gz | tar -C /usr/local -xz -wget -qO - https://get.pnpm.io/install.sh | sh - diff --git a/ressources/authelia/makedeb b/ressources/authelia/makedeb deleted file mode 100644 index 306c022..0000000 --- a/ressources/authelia/makedeb +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -PATH_BUILD=$1 -PATH_DEB=$2 -GIT_VERSION=$3 - -cp ${PATH_BUILD}/tmp/authelia/dist/authelia ${PATH_DEB}/usr/bin/authelia -cp ${PATH_BUILD}/tmp/authelia/config.template.yml ${PATH_DEB}/etc/authelia/configuration.yml - diff --git a/ressources/authelia/prebuild b/ressources/authelia/prebuild deleted file mode 100755 index 0491775..0000000 --- a/ressources/authelia/prebuild +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -VERSION=$1 -cd /tmp/ -git clone https://github.com/authelia/authelia.git -cd authelia/ -git checkout $VERSION diff --git a/ressources/element-web/build b/ressources/element-web/build deleted file mode 100755 index ebb4cb8..0000000 --- a/ressources/element-web/build +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -cd /tmp/element-web -yarn install -yarn dist diff --git a/ressources/element-web/element-web b/ressources/element-web/element-web new file mode 100755 index 0000000..09eb636 --- /dev/null +++ b/ressources/element-web/element-web @@ -0,0 +1,37 @@ +#!/bin/bash + +envinit() { + apt install -y build-essential git python wget ca-certificates + wget -qO - https://deb.nodesource.com/setup_16.x | bash + wget -qO - https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor > /usr/share/keyrings/yarnkey.gpg + echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" > /etc/apt/sources.list.d/yarn.list + apt-get update + apt-get install -y yarn nodejs +} + +prebuild(){ + VERSION=$1 + cd /tmp/ + git clone https://github.com/vector-im/element-web.git + cd element-web/ + git checkout $VERSION +} + +build() { + cd /tmp/element-web + yarn install + yarn dist +} + +makedeb(){ + PATH_BUILD=$1 + PATH_DEB=$2 + GIT_VERSION=$3 + + tar -zxf ${PATH_BUILD}/tmp/element-web/dist/element-${GIT_VERSION}-dirty.tar.gz --strip-components=1 -C ${PATH_DEB}/usr/lib/element-web/ + cp ${PATH_DEB}/usr/lib/element-web/config.sample.json ${PATH_DEB}/etc/element-web/config.json +} +echo $1 +FUNC=$1 +shift +${FUNC} $* diff --git a/ressources/element-web/envinit b/ressources/element-web/envinit deleted file mode 100755 index f98a073..0000000 --- a/ressources/element-web/envinit +++ /dev/null @@ -1,7 +0,0 @@ -#/bin/bash -apt install -y build-essential git python wget ca-certificates -wget -qO - https://deb.nodesource.com/setup_16.x | bash -wget -qO - https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor > /usr/share/keyrings/yarnkey.gpg -echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" > /etc/apt/sources.list.d/yarn.list -apt-get update -apt-get install -y yarn nodejs diff --git a/ressources/element-web/makedeb b/ressources/element-web/makedeb deleted file mode 100644 index 6ee9ba1..0000000 --- a/ressources/element-web/makedeb +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -PATH_BUILD=$1 -PATH_DEB=$2 -GIT_VERSION=$3 - -tar -zxf ${PATH_BUILD}/tmp/element-web/dist/element-${GIT_VERSION}-dirty.tar.gz --strip-components=1 -C ${PATH_DEB}/usr/lib/element-web/ -cp ${PATH_DEB}/usr/lib/element-web/config.sample.json ${PATH_DEB}/etc/element-web/config.json diff --git a/ressources/element-web/prebuild b/ressources/element-web/prebuild deleted file mode 100755 index 1d808ca..0000000 --- a/ressources/element-web/prebuild +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -VERSION=$1 -cd /tmp/ -git clone https://github.com/vector-im/element-web.git -cd element-web/ -git checkout $VERSION diff --git a/ressources/gotify/build b/ressources/gotify/build deleted file mode 100755 index 0332f67..0000000 --- a/ressources/gotify/build +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -cd /tmp/server/ -. /root/.bashrc -PATH=$PATH:/usr/local/go/bin make diff --git a/ressources/gotify/envinit b/ressources/gotify/envinit deleted file mode 100755 index a661b77..0000000 --- a/ressources/gotify/envinit +++ /dev/null @@ -1,8 +0,0 @@ -#/bin/bash -apt install -y build-essential git wget ca-certificates -wget -qO - https://deb.nodesource.com/setup_16.x | bash -wget -qO - https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor > /usr/share/keyrings/yarnkey.gpg -echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" > /etc/apt/sources.list.d/yarn.list -apt-get update -apt-get install -y nodejs yarn -wget -qO - https://go.dev/dl/go1.17.6.linux-amd64.tar.gz | tar -C /usr/local -xz diff --git a/ressources/gotify/gotify b/ressources/gotify/gotify new file mode 100755 index 0000000..b3d373e --- /dev/null +++ b/ressources/gotify/gotify @@ -0,0 +1,38 @@ +#!/bin/bash + +envinit() { + apt install -y build-essential git wget ca-certificates + wget -qO - https://deb.nodesource.com/setup_16.x | bash + wget -qO - https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor > /usr/share/keyrings/yarnkey.gpg + echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" > /etc/apt/sources.list.d/yarn.list + apt-get update + apt-get install -y nodejs yarn + wget -qO - https://go.dev/dl/go1.17.6.linux-amd64.tar.gz | tar -C /usr/local -xz +} + +prebuild(){ + VERSION=$1 + cd /tmp/ + git clone https://github.com/gotify/server.git + cd server/ + git checkout ${VERSION} +} + +build() { + cd /tmp/server/ + . /root/.bashrc + PATH=${PATH}:/usr/local/go/bin make +} + +makedeb(){ + PATH_BUILD=$1 + PATH_DEB=$2 + GIT_VERSION=$3 + + cp ${PATH_BUILD}/tmp/gotify/dist/gotify ${PATH_DEB}/usr/bin/gotify + cp ${PATH_BUILD}/tmp/authelia/config.template.yml ${PATH_DEB}/etc/authelia/configuration.yml +} +echo $1 +FUNC=$1 +shift +${FUNC} $* diff --git a/ressources/gotify/makedeb b/ressources/gotify/makedeb deleted file mode 100644 index a69b1d3..0000000 --- a/ressources/gotify/makedeb +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -PATH_BUILD=$1 -PATH_DEB=$2 -GIT_VERSION=$3 - -cp ${PATH_BUILD}/tmp/gotify/dist/gotify ${PATH_DEB}/usr/bin/gotify -cp ${PATH_BUILD}/tmp/authelia/config.template.yml ${PATH_DEB}/etc/authelia/configuration.yml - diff --git a/ressources/gotify/prebuild b/ressources/gotify/prebuild deleted file mode 100755 index 397f4f8..0000000 --- a/ressources/gotify/prebuild +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -VERSION=$1 -cd /tmp/ -git clone https://github.com/gotify/server.git -cd server/ -git checkout $VERSION diff --git a/ressources/joplin-server/build b/ressources/joplin-server/build deleted file mode 100755 index a050dc0..0000000 --- a/ressources/joplin-server/build +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -cd /tmp/joplin/ -BUILD_SEQUENCIAL=1 yarn install diff --git a/ressources/joplin-server/envinit b/ressources/joplin-server/envinit deleted file mode 100755 index f98a073..0000000 --- a/ressources/joplin-server/envinit +++ /dev/null @@ -1,7 +0,0 @@ -#/bin/bash -apt install -y build-essential git python wget ca-certificates -wget -qO - https://deb.nodesource.com/setup_16.x | bash -wget -qO - https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor > /usr/share/keyrings/yarnkey.gpg -echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" > /etc/apt/sources.list.d/yarn.list -apt-get update -apt-get install -y yarn nodejs diff --git a/ressources/joplin-server/joplin-server b/ressources/joplin-server/joplin-server new file mode 100755 index 0000000..743a230 --- /dev/null +++ b/ressources/joplin-server/joplin-server @@ -0,0 +1,39 @@ +#!/bin/bash + +envinit() { + apt install -y build-essential git python wget ca-certificates + wget -qO - https://deb.nodesource.com/setup_16.x | bash + wget -qO - https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor > /usr/share/keyrings/yarnkey.gpg + echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" > /etc/apt/sources.list.d/yarn.list + apt-get update + apt-get install -y yarn nodejs +} + +prebuild(){ + VERSION=$1 + cd /tmp/ + git clone https://github.com/laurent22/joplin.git + cd joplin/ + git checkout $VERSION + rm -fr packages/app* + rm -fr packages/generator-joplin + rm -fr packages/plugin-repo-cli + rm -fr packages/plugins +} + +build() { + cd /tmp/joplin/ + BUILD_SEQUENCIAL=1 yarn install +} + +makedeb(){ + PATH_BUILD=$1 + PATH_DEB=$2 + GIT_VERSION=$3 + + cp -fr ${PATH_BUILD}/tmp/joplin/packages/* ${PATH_DEB}/usr/lib/joplin-server/ +} +echo $1 +FUNC=$1 +shift +${FUNC} $* diff --git a/ressources/joplin-server/makedeb b/ressources/joplin-server/makedeb deleted file mode 100644 index ba61045..0000000 --- a/ressources/joplin-server/makedeb +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -PATH_BUILD=$1 -PATH_DEB=$2 -GIT_VERSION=$3 - -cp -fr ${PATH_BUILD}/tmp/joplin/packages/* ${PATH_DEB}/usr/lib/joplin-server/ - diff --git a/ressources/joplin-server/prebuild b/ressources/joplin-server/prebuild deleted file mode 100755 index 3a2b4fa..0000000 --- a/ressources/joplin-server/prebuild +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -VERSION=$1 -cd /tmp/ -git clone https://github.com/laurent22/joplin.git -cd joplin/ -git checkout $VERSION -rm -fr packages/app* -rm -fr packages/generator-joplin -rm -fr packages/plugin-repo-cli -rm -fr packages/plugins diff --git a/ressources/joplin/joplin b/ressources/joplin/joplin new file mode 100755 index 0000000..8561b9d --- /dev/null +++ b/ressources/joplin/joplin @@ -0,0 +1,26 @@ +#!/bin/bash + +envinit() { + +} + +prebuild(){ + +} + +build() { + +} + +makedeb(){ + PATH_BUILD=$1 + PATH_DEB=$2 + GIT_VERSION=$3 + + wget https://github.com/laurent22/joplin/releases/download/v${GIT_VERSION}/Joplin-${GIT_VERSION}.AppImage -qO ${PATH_DEB}/usr/share/joplin/Joplin.AppImage + chmod +x ${PATH_DEB}/usr/share/joplin/Joplin.AppImage +} +echo $1 +FUNC=$1 +shift +${FUNC} $* diff --git a/ressources/joplin/makedeb b/ressources/joplin/makedeb deleted file mode 100644 index 1bdd522..0000000 --- a/ressources/joplin/makedeb +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -PATH_BUILD=$1 -PATH_DEB=$2 -GIT_VERSION=$3 - -wget https://github.com/laurent22/joplin/releases/download/v${GIT_VERSION}/Joplin-${GIT_VERSION}.AppImage -qO ${PATH_DEB}/usr/share/joplin/Joplin.AppImage -chmod +x ${PATH_DEB}/usr/share/joplin/Joplin.AppImage diff --git a/ressources/mautrix-whatsapp/build b/ressources/mautrix-whatsapp/build deleted file mode 100755 index 2673991..0000000 --- a/ressources/mautrix-whatsapp/build +++ /dev/null @@ -1,4 +0,0 @@ -#/bin/bash -cd /tmp/whatsapp/ -git checkout $1 -PATH=$PATH:/usr/local/go/bin ./build.sh diff --git a/ressources/mautrix-whatsapp/envinit b/ressources/mautrix-whatsapp/envinit deleted file mode 100755 index fb96686..0000000 --- a/ressources/mautrix-whatsapp/envinit +++ /dev/null @@ -1,3 +0,0 @@ -#/bin/bash -apt install -y ca-certificates git libolm3 libolm-dev build-essential wget -wget -qO - https://go.dev/dl/go1.17.3.linux-amd64.tar.gz | tar -C /usr/local -xz diff --git a/ressources/mautrix-whatsapp/makedeb b/ressources/mautrix-whatsapp/makedeb deleted file mode 100644 index 8604020..0000000 --- a/ressources/mautrix-whatsapp/makedeb +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -PATH_BUILD=$1 -PATH_DEB=$2 -GIT_VERSION=$3 - -cp ${PATH_BUILD}/tmp/whatsapp/mautrix-whatsapp ${PATH_DEB}/usr/lib/mautrix-whatsapp/mautrix-whatsapp -cp ${PATH_BUILD}/tmp/whatsapp/example-config.yaml ${PATH_DEB}/etc/mautrix-whatsapp/config.yaml diff --git a/ressources/mautrix-whatsapp/mautrix-whatsapp b/ressources/mautrix-whatsapp/mautrix-whatsapp new file mode 100755 index 0000000..d8512c4 --- /dev/null +++ b/ressources/mautrix-whatsapp/mautrix-whatsapp @@ -0,0 +1,33 @@ +#!/bin/bash + +envinit() { + apt install -y ca-certificates git libolm3 libolm-dev build-essential wget + wget -qO - https://go.dev/dl/go1.17.3.linux-amd64.tar.gz | tar -C /usr/local -xz +} + +prebuild(){ + VERSION=$1 + cd /tmp/ + git clone https://github.com/mautrix/whatsapp.git + cd whatsapp/ + git checkout $VERSION +} + +build() { + cd /tmp/whatsapp/ + git checkout $1 + PATH=$PATH:/usr/local/go/bin ./build.sh +} + +makedeb(){ + PATH_BUILD=$1 + PATH_DEB=$2 + GIT_VERSION=$3 + + cp ${PATH_BUILD}/tmp/whatsapp/mautrix-whatsapp ${PATH_DEB}/usr/lib/mautrix-whatsapp/mautrix-whatsapp + cp ${PATH_BUILD}/tmp/whatsapp/example-config.yaml ${PATH_DEB}/etc/mautrix-whatsapp/config.yaml +} +echo $1 +FUNC=$1 +shift +${FUNC} $* diff --git a/ressources/mautrix-whatsapp/prebuild b/ressources/mautrix-whatsapp/prebuild deleted file mode 100755 index 090b647..0000000 --- a/ressources/mautrix-whatsapp/prebuild +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -VERSION=$1 -cd /tmp/ -git clone https://github.com/mautrix/whatsapp.git -cd whatsapp/ -git checkout $VERSION diff --git a/ressources/rss-bridge/build b/ressources/rss-bridge/build deleted file mode 100755 index 05a7907..0000000 --- a/ressources/rss-bridge/build +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash - diff --git a/ressources/rss-bridge/envinit b/ressources/rss-bridge/envinit deleted file mode 100755 index 21f4ffc..0000000 --- a/ressources/rss-bridge/envinit +++ /dev/null @@ -1,2 +0,0 @@ -#/bin/bash -apt install -y git diff --git a/ressources/rss-bridge/makedeb b/ressources/rss-bridge/makedeb deleted file mode 100644 index 6dcbd19..0000000 --- a/ressources/rss-bridge/makedeb +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -PATH_BUILD=$1 -PATH_DEB=$2 -GIT_VERSION=$3 - -cp -fr ${PATH_BUILD}/tmp/rss-bridge ${PATH_DEB}/usr/share/ - -cp ${PATH_DEB}/usr/share/rss-bridge/config.default.ini.php ${PATH_DEB}/etc/rss-bridge/config.ini.php -cp ${PATH_DEB}/usr/share/rss-bridge/whitelist.default.txt ${PATH_DEB}/etc/rss-bridge/whitelist.txt - -ln -s /etc/rss-bridge/config.ini.php ${PATH_DEB}/usr/share/rss-bridge/config.ini.php -ln -s /etc/rss-bridge/whitelist.txt ${PATH_DEB}/usr/share/rss-bridge/whitelist.txt - -mkdir -p ${PATH_DEB}/var/cache/rss-bridge/cache/ -rm ${PATH_DEB}/usr/share/rss-bridge/cache -ln -s /var/cache/rss-bridge/cache/ ${PATH_DEB}/usr/share/rss-bridge/cache diff --git a/ressources/rss-bridge/prebuild b/ressources/rss-bridge/prebuild deleted file mode 100755 index f486be7..0000000 --- a/ressources/rss-bridge/prebuild +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -VERSION=$1 -cd /tmp/ -git clone https://github.com/RSS-Bridge/rss-bridge.git -cd rss-bridge/ -git checkout $VERSION diff --git a/ressources/rss-bridge/rss-bridge b/ressources/rss-bridge/rss-bridge new file mode 100755 index 0000000..b55e97a --- /dev/null +++ b/ressources/rss-bridge/rss-bridge @@ -0,0 +1,39 @@ +#!/bin/bash + +envinit() { + apt install -y git +} + +prebuild(){ + VERSION=$1 + cd /tmp/ + git clone https://github.com/RSS-Bridge/rss-bridge.git + cd rss-bridge/ + git checkout $VERSION +} + +build() { + +} + +makedeb(){ + PATH_BUILD=$1 + PATH_DEB=$2 + GIT_VERSION=$3 + + cp -fr ${PATH_BUILD}/tmp/rss-bridge ${PATH_DEB}/usr/share/ + + cp ${PATH_DEB}/usr/share/rss-bridge/config.default.ini.php ${PATH_DEB}/etc/rss-bridge/config.ini.php + cp ${PATH_DEB}/usr/share/rss-bridge/whitelist.default.txt ${PATH_DEB}/etc/rss-bridge/whitelist.txt + + ln -s /etc/rss-bridge/config.ini.php ${PATH_DEB}/usr/share/rss-bridge/config.ini.php + ln -s /etc/rss-bridge/whitelist.txt ${PATH_DEB}/usr/share/rss-bridge/whitelist.txt + + mkdir -p ${PATH_DEB}/var/cache/rss-bridge/cache/ + rm ${PATH_DEB}/usr/share/rss-bridge/cache + ln -s /var/cache/rss-bridge/cache/ ${PATH_DEB}/usr/share/rss-bridge/cache +} +echo $1 +FUNC=$1 +shift +${FUNC} $* diff --git a/ressources/standardnotes-web/build b/ressources/standardnotes-web/build deleted file mode 100755 index 11717cf..0000000 --- a/ressources/standardnotes-web/build +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -cd /tmp/web -PATH=$PATH:/tmp/web/bin -npm install -npm run build diff --git a/ressources/standardnotes-web/envinit b/ressources/standardnotes-web/envinit deleted file mode 100755 index 95f0ae1..0000000 --- a/ressources/standardnotes-web/envinit +++ /dev/null @@ -1,7 +0,0 @@ -#/bin/bash -apt install -y git build-essential python2 wget ruby-dev libxml2 libz-dev -wget -qO - https://deb.nodesource.com/setup_16.x | bash -wget -qO - https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor > /usr/share/keyrings/yarnkey.gpg -echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" > /etc/apt/sources.list.d/yarn.list -apt-get update -apt-get install -y yarn nodejs diff --git a/ressources/standardnotes-web/makedeb b/ressources/standardnotes-web/makedeb deleted file mode 100644 index 160270f..0000000 --- a/ressources/standardnotes-web/makedeb +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -PATH_BUILD=$1 -PATH_DEB=$2 -GIT_VERSION=$3 - -cp -fr ${PATH_BUILD}/tmp/web/* ${PATH_DEB}/usr/lib/standardnotes/web/ diff --git a/ressources/standardnotes-web/prebuild b/ressources/standardnotes-web/prebuild deleted file mode 100755 index 76d9a2c..0000000 --- a/ressources/standardnotes-web/prebuild +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -VERSION=$1 -cd /tmp/ -git clone https://github.com/standardnotes/web.git -cd web/ -git checkout $VERSION diff --git a/ressources/standardnotes-web/standardnotes-web b/ressources/standardnotes-web/standardnotes-web new file mode 100755 index 0000000..fe668cd --- /dev/null +++ b/ressources/standardnotes-web/standardnotes-web @@ -0,0 +1,37 @@ +#!/bin/bash + +envinit() { + apt install -y git build-essential python2 wget ruby-dev libxml2 libz-dev + wget -qO - https://deb.nodesource.com/setup_16.x | bash + wget -qO - https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor > /usr/share/keyrings/yarnkey.gpg + echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" > /etc/apt/sources.list.d/yarn.list + apt-get update + apt-get install -y yarn nodejs +} + +prebuild(){ + VERSION=$1 + cd /tmp/ + git clone https://github.com/standardnotes/web.git + cd web/ + git checkout $VERSION +} + +build() { + cd /tmp/web + PATH=$PATH:/tmp/web/bin + npm install + npm run build +} + +makedeb(){ + PATH_BUILD=$1 + PATH_DEB=$2 + GIT_VERSION=$3 + + cp -fr ${PATH_BUILD}/tmp/web/* ${PATH_DEB}/usr/lib/standardnotes/web/ +} +echo $1 +FUNC=$1 +shift +${FUNC} $* diff --git a/ressources/vaultwarden-web/build b/ressources/vaultwarden-web/build deleted file mode 100755 index d9f6bfb..0000000 --- a/ressources/vaultwarden-web/build +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -cd /tmp/web-vault -npm install -npm run dist:oss:selfhost diff --git a/ressources/vaultwarden-web/envinit b/ressources/vaultwarden-web/envinit deleted file mode 100755 index 1e027d0..0000000 --- a/ressources/vaultwarden-web/envinit +++ /dev/null @@ -1,8 +0,0 @@ -#/bin/bash -apt install -y build-essential git python wget ca-certificates -wget -qO - https://deb.nodesource.com/setup_16.x | bash -#wget -qO - https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor > /usr/share/keyrings/yarnkey.gpg -#echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" > /etc/apt/sources.list.d/yarn.list -apt-get update -#apt-get install -y yarn nodejs -apt-get install -y nodejs diff --git a/ressources/vaultwarden-web/makedeb b/ressources/vaultwarden-web/makedeb deleted file mode 100644 index 7cb0f12..0000000 --- a/ressources/vaultwarden-web/makedeb +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -PATH_BUILD=$1 -PATH_DEB=$2 -GIT_VERSION=$3 - -cp -fr ${PATH_BUILD}/tmp/web-vault/build/* ${PATH_DEB}/usr/share/vaultwarden-web diff --git a/ressources/vaultwarden-web/prebuild b/ressources/vaultwarden-web/prebuild deleted file mode 100755 index d76bd65..0000000 --- a/ressources/vaultwarden-web/prebuild +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -VERSION=$1 - -cd /tmp -git clone https://github.com/bitwarden/web.git web-vault -cd /tmp/web-vault -git checkout ${VERSION} -git submodule update --init --recursive -cd .. - -git clone https://github.com/dani-garcia/bw_web_builds.git -cd bw_web_builds -PATCH=$(git tag --sort=v:refname | tail -n1) -git checkout ${PATCH} -cp patches/${PATCH}.patch ../web-vault/ - -cd /tmp/web-vault -git apply ${PATCH}.patch - diff --git a/ressources/vaultwarden-web/vaultwarden-web b/ressources/vaultwarden-web/vaultwarden-web new file mode 100755 index 0000000..0ceb1ba --- /dev/null +++ b/ressources/vaultwarden-web/vaultwarden-web @@ -0,0 +1,49 @@ +#!/bin/bash + +envinit() { + apt install -y build-essential git python wget ca-certificates + wget -qO - https://deb.nodesource.com/setup_16.x | bash + #wget -qO - https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor > /usr/share/keyrings/yarnkey.gpg + #echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" > /etc/apt/sources.list.d/yarn.list + apt-get update + #apt-get install -y yarn nodejs + apt-get install -y nodejs +} + +prebuild(){ + VERSION=$1 + + cd /tmp + git clone https://github.com/bitwarden/web.git web-vault + cd /tmp/web-vault + git checkout ${VERSION} + git submodule update --init --recursive + cd .. + + git clone https://github.com/dani-garcia/bw_web_builds.git + cd bw_web_builds + PATCH=$(git tag --sort=v:refname | tail -n1) + git checkout ${PATCH} + cp patches/${PATCH}.patch ../web-vault/ + + cd /tmp/web-vault + git apply ${PATCH}.patch +} + +build() { + cd /tmp/web-vault + npm install + npm run dist:oss:selfhost +} + +makedeb(){ + PATH_BUILD=$1 + PATH_DEB=$2 + GIT_VERSION=$3 + + cp -fr ${PATH_BUILD}/tmp/web-vault/build/* ${PATH_DEB}/usr/share/vaultwarden-web +} +echo $1 +FUNC=$1 +shift +${FUNC} $* diff --git a/ressources/vaultwarden/build b/ressources/vaultwarden/build deleted file mode 100755 index 483991a..0000000 --- a/ressources/vaultwarden/build +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -cd /tmp/vaultwarden/ -source ~/.cargo/env -cargo build --features sqlite,mysql,postgresql --release diff --git a/ressources/vaultwarden/envinit b/ressources/vaultwarden/envinit deleted file mode 100755 index 41375e3..0000000 --- a/ressources/vaultwarden/envinit +++ /dev/null @@ -1,6 +0,0 @@ -#/bin/bash -apt install -y --no-install-recommends build-essential git wget ca-certificates libmariadb-dev libpq-dev pkg-config libmysql++-dev -cd /tmp -wget -qO - https://sh.rustup.rs > rustup -bash rustup -qy -apt clean diff --git a/ressources/vaultwarden/makedeb b/ressources/vaultwarden/makedeb deleted file mode 100644 index 4b8c245..0000000 --- a/ressources/vaultwarden/makedeb +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -PATH_BUILD=$1 -PATH_DEB=$2 -GIT_VERSION=$3 - -cp -fr ${PATH_BUILD}/tmp/vaultwarden/target/release/vaultwarden ${PATH_DEB}/usr/lib/vaultwarden/ - diff --git a/ressources/vaultwarden/prebuild b/ressources/vaultwarden/prebuild deleted file mode 100755 index 0d09fee..0000000 --- a/ressources/vaultwarden/prebuild +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -VERSION=$1 -cd /tmp/ -git clone https://github.com/dani-garcia/vaultwarden.git -cd vaultwarden/ -git checkout $VERSION diff --git a/ressources/vaultwarden/vaultwarden b/ressources/vaultwarden/vaultwarden new file mode 100755 index 0000000..a23a9c3 --- /dev/null +++ b/ressources/vaultwarden/vaultwarden @@ -0,0 +1,35 @@ +#!/bin/bash + +envinit() { + apt install -y --no-install-recommends build-essential git wget ca-certificates libmariadb-dev libpq-dev pkg-config libmysql++-dev + cd /tmp + wget -qO - https://sh.rustup.rs > rustup + bash rustup -qy + apt clean +} + +prebuild(){ + VERSION=$1 + cd /tmp/ + git clone https://github.com/dani-garcia/vaultwarden.git + cd vaultwarden/ + git checkout $VERSION +} + +build() { + cd /tmp/vaultwarden/ + source ~/.cargo/env + cargo build --features sqlite,mysql,postgresql --release +} + +makedeb(){ + PATH_BUILD=$1 + PATH_DEB=$2 + GIT_VERSION=$3 + + cp -fr ${PATH_BUILD}/tmp/vaultwarden/target/release/vaultwarden ${PATH_DEB}/usr/lib/vaultwarden/ +} +echo $1 +FUNC=$1 +shift +${FUNC} $* diff --git a/ressources/zigbee2mqtt/build b/ressources/zigbee2mqtt/build deleted file mode 100755 index 950a1be..0000000 --- a/ressources/zigbee2mqtt/build +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -cd /tmp/zigbee2mqtt/ -npm ci -npm run build diff --git a/ressources/zigbee2mqtt/envinit b/ressources/zigbee2mqtt/envinit deleted file mode 100755 index 4a9e8d7..0000000 --- a/ressources/zigbee2mqtt/envinit +++ /dev/null @@ -1,3 +0,0 @@ -#/bin/bash -apt install -y wget ca-certificates nodejs npm git make g++ gcc - diff --git a/ressources/zigbee2mqtt/makedeb b/ressources/zigbee2mqtt/makedeb deleted file mode 100644 index e7dd874..0000000 --- a/ressources/zigbee2mqtt/makedeb +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -PATH_BUILD=$1 -PATH_DEB=$2 -GIT_VERSION=$3 - -cp -fr ${PATH_BUILD}/tmp/zigbee2mqtt/data/configuration.yaml ${PATH_DEB}/etc/zigbee2mqtt/configuration.yaml -cp -fr ${PATH_BUILD}/tmp/zigbee2mqtt/* ${PATH_DEB}/usr/lib/zigbee2mqtt/ - diff --git a/ressources/zigbee2mqtt/prebuild b/ressources/zigbee2mqtt/prebuild deleted file mode 100755 index dde8021..0000000 --- a/ressources/zigbee2mqtt/prebuild +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -VERSION=$1 -cd /tmp/ -git clone https://github.com/Koenkk/zigbee2mqtt.git -cd zigbee2mqtt/ -git checkout $VERSION diff --git a/ressources/zigbee2mqtt/zigbee2mqtt b/ressources/zigbee2mqtt/zigbee2mqtt new file mode 100755 index 0000000..2ad950c --- /dev/null +++ b/ressources/zigbee2mqtt/zigbee2mqtt @@ -0,0 +1,33 @@ +#!/bin/bash + +envinit() { + apt install -y wget ca-certificates nodejs npm git make g++ gcc +} + +prebuild(){ + VERSION=$1 + cd /tmp/ + git clone https://github.com/Koenkk/zigbee2mqtt.git + cd zigbee2mqtt/ + git checkout $VERSION +} + +build() { + cd /tmp/zigbee2mqtt/ + npm ci + npm run build +} + +makedeb(){ + PATH_BUILD=$1 + PATH_DEB=$2 + GIT_VERSION=$3 + + cp -fr ${PATH_BUILD}/tmp/zigbee2mqtt/data/configuration.yaml ${PATH_DEB}/etc/zigbee2mqtt/configuration.yaml + cp -fr ${PATH_BUILD}/tmp/zigbee2mqtt/* ${PATH_DEB}/usr/lib/zigbee2mqtt/ +} + +echo $1 +FUNC=$1 +shift +${FUNC} $*