From 1055dbd48c7efccbf2bf28d90f84f2e45f9b574c Mon Sep 17 00:00:00 2001 From: thomas Date: Tue, 15 Feb 2022 23:11:30 +0100 Subject: [PATCH] Add grocy update version element-web2deb joplin2deb update README --- README.MD | 27 +++- element-web2deb | 2 +- grocy2deb | 9 ++ joplin2deb | 2 +- lib/function (copie 1).sh | 138 ------------------ lib/function.sh | 19 +-- ressources/grocy/grocy | 40 +++++ ressources/grocy/rootfs/DEBIAN/changelog | 0 ressources/grocy/rootfs/DEBIAN/conffiles | 1 + ressources/grocy/rootfs/DEBIAN/control | 8 + ressources/grocy/rootfs/DEBIAN/postinst | 2 + .../usr/share/doc/grocy/apache2-grocy.conf | 11 ++ ressources/joplin/joplin | 6 +- 13 files changed, 112 insertions(+), 153 deletions(-) create mode 100755 grocy2deb delete mode 100644 lib/function (copie 1).sh create mode 100755 ressources/grocy/grocy create mode 100644 ressources/grocy/rootfs/DEBIAN/changelog create mode 100644 ressources/grocy/rootfs/DEBIAN/conffiles create mode 100644 ressources/grocy/rootfs/DEBIAN/control create mode 100755 ressources/grocy/rootfs/DEBIAN/postinst create mode 100644 ressources/grocy/rootfs/usr/share/doc/grocy/apache2-grocy.conf diff --git a/README.MD b/README.MD index b9cfbd5..4318b7c 100644 --- a/README.MD +++ b/README.MD @@ -15,7 +15,13 @@ allstep ### package are available without compilation -#### joplin server + - [joplin-server](#joplin-server) + - [rss-bridge](#rss-bridge) + - [vaultwarden](#vaultwarden) + - [zigbee2mqtt](#zigbee2mqtt) + - [element-web](#element-web) + +#### joplin-server ```bash apt install -y python wget ca-certificates @@ -70,3 +76,22 @@ apt-get install -y zigbee2mqtt systemctl enable --now zigbee2mqtt ``` + + +#### element-web + +```bash +wget -qO - https://deb.lgy.fr/install.sh | bash +apt install element-web + +# sample configuration for apache2 + +cp /usr/share/doc/element-web/apache2-element-web.conf /etc/apache2/sites-available/element-web.conf +a2ensite element-web + +# edit /etc/apache2/sites-available/element-web.conf +# edit /etc/element-web/config.json + +systemctl restart apache2 +``` + diff --git a/element-web2deb b/element-web2deb index 6bd2d9e..431ec79 100755 --- a/element-web2deb +++ b/element-web2deb @@ -1,7 +1,7 @@ #!/bin/bash APP=element-web -VERSION=1.10.1 +VERSION=1.10.2 GIT_VERSION=v$VERSION DEB_VERSION=$VERSION-2 DEBIAN_VERSION_CODENAME=bullseye diff --git a/grocy2deb b/grocy2deb new file mode 100755 index 0000000..c659a35 --- /dev/null +++ b/grocy2deb @@ -0,0 +1,9 @@ +#!/bin/bash + +APP=grocy +VERSION=3.2.0 +GIT_VERSION=v$VERSION +DEB_VERSION=$VERSION-5 +DEBIAN_VERSION_CODENAME=sid + +source ./lib/function.sh diff --git a/joplin2deb b/joplin2deb index eed7349..e5d7ead 100755 --- a/joplin2deb +++ b/joplin2deb @@ -1,7 +1,7 @@ #!/bin/bash APP=joplin -VERSION=2.7.11 +VERSION=2.7.12 GIT_VERSION=$VERSION DEB_VERSION=$VERSION-1 DEBIAN_VERSION_CODENAME=bullseye diff --git a/lib/function (copie 1).sh b/lib/function (copie 1).sh deleted file mode 100644 index e461161..0000000 --- a/lib/function (copie 1).sh +++ /dev/null @@ -1,138 +0,0 @@ -#!/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 dd7c204..7f910d9 100644 --- a/lib/function.sh +++ b/lib/function.sh @@ -22,12 +22,12 @@ step2(){ if [ ! -e ${CACHE_STEP2} ] ; then mkdir -p ${CACHE_APP} cp -a ${CACHE_STEP1}/ ${CACHE_STEP2} - cp ressources/${APP}/recette ${CACHE_STEP2}/tmp/recette + cp ressources/${APP}/${APP} ${CACHE_STEP2}/tmp/make mount -t proc proc ${CACHE_STEP2}/proc sleep 2 - chroot ${CACHE_STEP2} /tmp/recette envinit + chroot ${CACHE_STEP2} /tmp/make envinit umount ${CACHE_STEP2}/proc - rm ${CACHE_STEP2}/tmp/envinit + rm ${CACHE_STEP2}/tmp/${APP} fi } @@ -35,9 +35,9 @@ step2(){ step3(){ if [ ! -e ${CACHE_STEP3} ]; then cp -a ${CACHE_STEP2} ${CACHE_STEP3} - cp ressources/${APP}/recette ${CACHE_STEP3}/tmp/recette - chroot ${CACHE_STEP3} /tmp/recette prebuild ${GIT_VERSION} - rm ${CACHE_STEP3}/tmp/prebuild + cp ressources/${APP}/${APP} ${CACHE_STEP3}/tmp/make + chroot ${CACHE_STEP3} /tmp/make prebuild ${GIT_VERSION} + rm ${CACHE_STEP3}/tmp/make fi } @@ -45,11 +45,12 @@ step3(){ step4(){ if [ ! -e ${CACHE_STEP4} ] ; then cp -a ${CACHE_STEP3} ${CACHE_STEP4} - cp ressources/${APP}/recette ${CACHE_STEP4}/tmp/recette + cp ressources/${APP}/${APP} ${CACHE_STEP4}/tmp/make mount -t proc proc ${CACHE_STEP4}/proc/ sleep 2 - chroot ${CACHE_STEP4} /tmp/recette build + chroot ${CACHE_STEP4} /tmp/make build umount ${CACHE_STEP4}/proc/ + rm ${CACHE_STEP4}/tmp/make fi } @@ -58,7 +59,7 @@ step5(){ rm -fr dist/${APP} mkdir dist/${APP} cp -pfr ressources/${APP}/rootfs/* dist/$APP/ - bash ressources/${APP}/recette makedeb ${CACHE_STEP4} dist/${APP} ${GIT_VERSION} + bash ressources/${APP}/${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} diff --git a/ressources/grocy/grocy b/ressources/grocy/grocy new file mode 100755 index 0000000..3f983b9 --- /dev/null +++ b/ressources/grocy/grocy @@ -0,0 +1,40 @@ +#!/bin/bash + +envinit() { + apt-get install -y wget ca-certificates gnupg2 composer git php-simplexml php-gd + 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 +} + +prebuild(){ + VERSION=$1 + git clone https://github.com/grocy/grocy.git /tmp/grocy + cd /tmp/grocy/ + git checkout $VERSION +} + +build() { + set +x + cd /tmp/grocy + composer install -n + yarn install +} + +makedeb(){ + PATH_BUILD=$1 + PATH_DEB=$2 + GIT_VERSION=$3 + + find ${PATH_BUILD}/tmp/grocy -name .gitignore -exec rm {} \; + cp -fr ${PATH_BUILD}/tmp/grocy/* ${PATH_DEB}/usr/share/grocy/ + cp ${PATH_DEB}/usr/share/grocy/config-dist.php ${PATH_DEB}/etc/grocy/config.php + mv ${PATH_DEB}/usr/share/grocy/data ${PATH_DEB}/var/lib/grocy/ + ln -s /var/lib/grocy/data/ ${PATH_DEB}/usr/share/grocy/data + ln -s /etc/grocy/config.php ${PATH_DEB}/usr/share/grocy/config.php +} +echo $1 +FUNC=$1 +shift +${FUNC} $* diff --git a/ressources/grocy/rootfs/DEBIAN/changelog b/ressources/grocy/rootfs/DEBIAN/changelog new file mode 100644 index 0000000..e69de29 diff --git a/ressources/grocy/rootfs/DEBIAN/conffiles b/ressources/grocy/rootfs/DEBIAN/conffiles new file mode 100644 index 0000000..f54cdd9 --- /dev/null +++ b/ressources/grocy/rootfs/DEBIAN/conffiles @@ -0,0 +1 @@ +/etc/grocy/config.php diff --git a/ressources/grocy/rootfs/DEBIAN/control b/ressources/grocy/rootfs/DEBIAN/control new file mode 100644 index 0000000..1f5d3ba --- /dev/null +++ b/ressources/grocy/rootfs/DEBIAN/control @@ -0,0 +1,8 @@ +Package: grocy +Version: %VERSION% +Section: base +Priority: optional +Architecture: all +Depends: php-simplexml, php-gd, php-sqlite3, php-intl, php-mbstring +Maintainer: Thomas Legay +Description: grocy diff --git a/ressources/grocy/rootfs/DEBIAN/postinst b/ressources/grocy/rootfs/DEBIAN/postinst new file mode 100755 index 0000000..126929b --- /dev/null +++ b/ressources/grocy/rootfs/DEBIAN/postinst @@ -0,0 +1,2 @@ +#!/bin/bash +chown www-data:www-data /var/lib/grocy diff --git a/ressources/grocy/rootfs/usr/share/doc/grocy/apache2-grocy.conf b/ressources/grocy/rootfs/usr/share/doc/grocy/apache2-grocy.conf new file mode 100644 index 0000000..ad814b9 --- /dev/null +++ b/ressources/grocy/rootfs/usr/share/doc/grocy/apache2-grocy.conf @@ -0,0 +1,11 @@ + + ServerName grocy.net.lgy.fr + + DocumentRoot /usr/share/grocy/public/ + + + Options -Indexes -MultiViews +FollowSymLinks + AllowOverride all + Require all granted + + diff --git a/ressources/joplin/joplin b/ressources/joplin/joplin index 8561b9d..d6b76d6 100755 --- a/ressources/joplin/joplin +++ b/ressources/joplin/joplin @@ -1,15 +1,15 @@ #!/bin/bash envinit() { - + ls } prebuild(){ - + ls } build() { - + ls } makedeb(){