From 6148b1fa7545125ce5f8b9661c4344d4b0628ee8 Mon Sep 17 00:00:00 2001 From: thomas Date: Tue, 19 Apr 2022 01:23:36 +0200 Subject: [PATCH] Fix flame package upgrade version of adguardhome element-web mautrix-whatsapp use new debian packaging process for mautrix-whatsapp --- README.MD | 3 +- lib/function.sh | 5 +++ ressources/adguardhome/debmaker | 5 +-- ressources/element-web/debmaker | 2 +- ressources/flame/debmaker | 1 + ressources/flame/rootfs/DEBIAN/control | 4 +- ressources/flame/rootfs/etc/default/flame | 1 - ressources/joplin/debmaker | 7 ++-- ressources/mautrix-whatsapp/debmaker | 42 +++++++------------ .../mautrix-whatsapp/rootfs/DEBIAN/changelog | 0 .../mautrix-whatsapp/rootfs/DEBIAN/conffiles | 1 - .../mautrix-whatsapp/rootfs/DEBIAN/control | 8 ---- .../mautrix-whatsapp/rootfs/DEBIAN/postinst | 4 -- .../rootfs/etc/mautrix-whatsapp/.gitkeep | 1 - .../rootfs/usr/lib/mautrix-whatsapp/.gitkeep | 1 - .../systemd/system/mautrix-whatsapp.service | 35 ---------------- ressources/zigbee2mqtt/debmaker | 3 +- 17 files changed, 32 insertions(+), 91 deletions(-) delete mode 100644 ressources/mautrix-whatsapp/rootfs/DEBIAN/changelog delete mode 100644 ressources/mautrix-whatsapp/rootfs/DEBIAN/conffiles delete mode 100644 ressources/mautrix-whatsapp/rootfs/DEBIAN/control delete mode 100755 ressources/mautrix-whatsapp/rootfs/DEBIAN/postinst delete mode 100644 ressources/mautrix-whatsapp/rootfs/etc/mautrix-whatsapp/.gitkeep delete mode 100644 ressources/mautrix-whatsapp/rootfs/usr/lib/mautrix-whatsapp/.gitkeep delete mode 100644 ressources/mautrix-whatsapp/rootfs/usr/lib/systemd/system/mautrix-whatsapp.service diff --git a/README.MD b/README.MD index 56d1492..036024f 100644 --- a/README.MD +++ b/README.MD @@ -110,6 +110,7 @@ systemctl restart apache2 ```bash apt install -y wget ca-certificates wget -qO - https://deb.lgy.fr/install.sh | bash +wget -qO - https://deb.nodesource.com/setup_16.x | bash apt-get update apt-get install -y flame @@ -198,7 +199,7 @@ apt install -y wget ca-certificates wget -qO - https://deb.lgy.fr/install.sh | bash wget -qO - https://deb.nodesource.com/setup_16.x | bash apt-get update -apt-get install -y joplin-server +apt-get install -y joplin-server #Edit /etc/default/joplin-server diff --git a/lib/function.sh b/lib/function.sh index 6de6fc3..1bbd38c 100644 --- a/lib/function.sh +++ b/lib/function.sh @@ -1,4 +1,7 @@ #!/bin/bash +LANGUAGE=C +LC_ALL=C +LANG=C DEBOOTSTRAP_DIR=cache/debootstrap/ MOUNT_PATH=/mnt/debmaker @@ -74,6 +77,8 @@ debmaker_umount_proc_sys(){ debmaker_chroot() { OPEN_FILE=cache/$2${APP} zdebmaker_getDep + [ -f cache/${APP} ] || zdebmaker_createAppOS + zdebmaker_inject debmaker_mount_proc_sys ${OPEN_FILE} ${MOUNT_PATH}/${APP}/ sudo chroot ${MOUNT_PATH}/${APP}/ debmaker_umount_proc_sys ${MOUNT_PATH}/${APP}/ diff --git a/ressources/adguardhome/debmaker b/ressources/adguardhome/debmaker index df8d1ca..b1c9136 100755 --- a/ressources/adguardhome/debmaker +++ b/ressources/adguardhome/debmaker @@ -1,14 +1,13 @@ #!/bin/bash -VERSION=0.108.0-b.5 -RELEASE=1 +VERSION=0.108.0-b.6 [ -e ./lib/function.sh ] && source ./lib/function.sh APP=adguardhome DEPOT=https://github.com/AdguardTeam/AdGuardHome.git GIT_VERSION=v${VERSION} -DEB_VERSION=${VERSION}-${RELEASE} +DEB_VERSION=${VERSION}-$(date +%Y%m%d%H%M) DEBIAN_VERSION_CODENAME=bullseye IMAGE_SIZE=4 STEP="envinit prebuild build makedeb" diff --git a/ressources/element-web/debmaker b/ressources/element-web/debmaker index c100a7f..e64a350 100755 --- a/ressources/element-web/debmaker +++ b/ressources/element-web/debmaker @@ -1,6 +1,6 @@ #!/bin/bash -VERSION=1.10.9 +VERSION=1.10.10 [ -e ./lib/function.sh ] && source ./lib/function.sh diff --git a/ressources/flame/debmaker b/ressources/flame/debmaker index e9b501f..e05a5ff 100755 --- a/ressources/flame/debmaker +++ b/ressources/flame/debmaker @@ -44,6 +44,7 @@ makedeb(){ PATH_DEB=/tmp/src/rootfs cp -fr /tmp/${APP}/* ${PATH_DEB}/usr/share/flame/ + cp -fr /tmp/${APP}/.env ${PATH_DEB}/usr/share/flame/ mv ${PATH_DEB}/usr/share/flame/data ${PATH_DEB}/var/lib/${APP}/data mv ${PATH_DEB}/usr/share/flame/public ${PATH_DEB}/var/lib/${APP}/public ln -fs /var/lib/${APP}/data ${PATH_DEB}/usr/share/${APP}/data diff --git a/ressources/flame/rootfs/DEBIAN/control b/ressources/flame/rootfs/DEBIAN/control index 0fad2ae..a0723f1 100644 --- a/ressources/flame/rootfs/DEBIAN/control +++ b/ressources/flame/rootfs/DEBIAN/control @@ -4,5 +4,5 @@ Section: base Priority: optional Architecture: all Depends:nodejs -Maintainer: Thomas Legay -Description: flame +Maintainer: Thomas Legay +Description: Flame is self-hosted startpage for your server. Its design is inspired (heavily) by SUI. Flame is very easy to setup and use. With built-in editors, it allows you to setup your very own application hub in no time - no file editing necessary. diff --git a/ressources/flame/rootfs/etc/default/flame b/ressources/flame/rootfs/etc/default/flame index 5bc878f..cc9966f 100644 --- a/ressources/flame/rootfs/etc/default/flame +++ b/ressources/flame/rootfs/etc/default/flame @@ -1,5 +1,4 @@ PORT=5005 NODE_ENV=production -VERSION=2.3.0 PASSWORD=flame_password SECRET=e02eb43d69953658c6d07311d6313f2d4467672cb881f96b29368ba1f3f4da4b diff --git a/ressources/joplin/debmaker b/ressources/joplin/debmaker index cdbdbc5..724155f 100755 --- a/ressources/joplin/debmaker +++ b/ressources/joplin/debmaker @@ -1,7 +1,7 @@ #!/bin/bash -GIT_VERSION=v2.8.1 -DEB_VERSION_DESKTOP=2.8.1-$(date +%Y%m%d%H%M) +GIT_VERSION=v2.8.2 +DEB_VERSION_DESKTOP=2.8.2-$(date +%Y%m%d%H%M) DEB_VERSION_SERVER=2.7.4-$(date +%Y%m%d%H%M) [ -e ./lib/function.sh ] && source ./lib/function.sh @@ -38,6 +38,7 @@ prebuild(){ build() { cd /tmp/${APP}/ + rm packages/app-desktop/dist/Joplin-*.AppImage BUILD_SEQUENCIAL=1 yarn install cd packages/app-desktop npm run dist @@ -64,6 +65,4 @@ makedeb(){ cp /tmp/joplin/packages/app-desktop/dist/Joplin-*.AppImage ${PATH_DEB}/usr/share/joplin/Joplin.AppImage sed -i "s/%VERSION%/$DEB_VERSION_DESKTOP/" ${PATH_DEB}/DEBIAN/control fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist - } - diff --git a/ressources/mautrix-whatsapp/debmaker b/ressources/mautrix-whatsapp/debmaker index a75c23e..9409870 100755 --- a/ressources/mautrix-whatsapp/debmaker +++ b/ressources/mautrix-whatsapp/debmaker @@ -1,47 +1,35 @@ #!/bin/bash -VERSION=0.3.0 -RELEASE=1 +VERSION=0.3.1 [ -e ./lib/function.sh ] && source ./lib/function.sh APP=mautrix-whatsapp DEPOT=https://github.com/mautrix/whatsapp.git GIT_VERSION=v${VERSION} -DEB_VERSION=${VERSION}-${RELEASE} DEBIAN_VERSION_CODENAME=bullseye IMAGE_SIZE=4 -STEP="envinit prebuild build makedeb" +STEP="envinit prebuild makedeb" envinit() { - if [ $(dpkg -l | grep -e 'ii libolm3 ' | wc -l) -eq 1 ]; - then - apt-get update - apt-get dist-upgrade -y - else - apt install -y --no-install-recommends wget fakeroot dpkg ca-certificates git libolm3 libolm-dev build-essential - wget -qO - https://go.dev/dl/go1.17.7.linux-amd64.tar.gz | tar -C /usr/local -xz - fi + echo deb http://deb.debian.org/debian bullseye-backports main > /etc/apt/sources.list.d/backports.list + apt-get update + apt-get dist-upgrade -y + apt install -y --no-install-recommends ca-certificates git libolm-dev debhelper-compat build-essential + apt install -y --no-install-recommends -t bullseye-backports golang } prebuild(){ - [ -e /tmp/git ] && rm -fr /tmp/git - [ -e /tmp/${APP} ] || mkdir /tmp/${APP} - git clone --depth 1 -b ${GIT_VERSION} ${DEPOT} /tmp/git - cp -r /tmp/git/. /tmp/${APP} -} - -build() { - cd /tmp/${APP}/ - PATH=$PATH:/usr/local/go/bin ./build.sh + rm /tmp/*.deb + [ -e /tmp/${APP}] && rm -fr /tmp/${APP} + mkdir /tmp/${APP} + git clone --depth 1 -b ${GIT_VERSION} ${DEPOT} /tmp/${APP} + cp -fr /tmp/src/debian /tmp/${APP} } makedeb(){ - PATH_DEB=/tmp/src/rootfs - - cp /tmp/mautrix-whatsapp/mautrix-whatsapp ${PATH_DEB}/usr/lib/mautrix-whatsapp/mautrix-whatsapp - cp /tmp/mautrix-whatsapp/example-config.yaml ${PATH_DEB}/etc/mautrix-whatsapp/config.yaml - sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control - fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist + cd /tmp/${APP}/ + dpkg-buildpackage -us -uc + cp /tmp/*.deb /tmp/dist } diff --git a/ressources/mautrix-whatsapp/rootfs/DEBIAN/changelog b/ressources/mautrix-whatsapp/rootfs/DEBIAN/changelog deleted file mode 100644 index e69de29..0000000 diff --git a/ressources/mautrix-whatsapp/rootfs/DEBIAN/conffiles b/ressources/mautrix-whatsapp/rootfs/DEBIAN/conffiles deleted file mode 100644 index 6dd2818..0000000 --- a/ressources/mautrix-whatsapp/rootfs/DEBIAN/conffiles +++ /dev/null @@ -1 +0,0 @@ -/etc/mautrix-whatsapp/config.yaml diff --git a/ressources/mautrix-whatsapp/rootfs/DEBIAN/control b/ressources/mautrix-whatsapp/rootfs/DEBIAN/control deleted file mode 100644 index 283d8f1..0000000 --- a/ressources/mautrix-whatsapp/rootfs/DEBIAN/control +++ /dev/null @@ -1,8 +0,0 @@ -Package: mautrix-whatsapp -Version: %VERSION% -Section: base -Priority: optional -Architecture: all -Depends: libolm3 -Maintainer: Thomas Legay -Description: mautrix-whatsapp bridge diff --git a/ressources/mautrix-whatsapp/rootfs/DEBIAN/postinst b/ressources/mautrix-whatsapp/rootfs/DEBIAN/postinst deleted file mode 100755 index 9aa9e5b..0000000 --- a/ressources/mautrix-whatsapp/rootfs/DEBIAN/postinst +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -id mautrix-whatsapp &> /dev/null || useradd mautrix-whatsapp -r -s /bin/false -md /var/lib/mautrix-whatsapp -chown mautrix-whatsapp:mautrix-whatsapp /etc/mautrix-whatsapp/ diff --git a/ressources/mautrix-whatsapp/rootfs/etc/mautrix-whatsapp/.gitkeep b/ressources/mautrix-whatsapp/rootfs/etc/mautrix-whatsapp/.gitkeep deleted file mode 100644 index 8b13789..0000000 --- a/ressources/mautrix-whatsapp/rootfs/etc/mautrix-whatsapp/.gitkeep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/ressources/mautrix-whatsapp/rootfs/usr/lib/mautrix-whatsapp/.gitkeep b/ressources/mautrix-whatsapp/rootfs/usr/lib/mautrix-whatsapp/.gitkeep deleted file mode 100644 index 8b13789..0000000 --- a/ressources/mautrix-whatsapp/rootfs/usr/lib/mautrix-whatsapp/.gitkeep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/ressources/mautrix-whatsapp/rootfs/usr/lib/systemd/system/mautrix-whatsapp.service b/ressources/mautrix-whatsapp/rootfs/usr/lib/systemd/system/mautrix-whatsapp.service deleted file mode 100644 index 2f1c8ed..0000000 --- a/ressources/mautrix-whatsapp/rootfs/usr/lib/systemd/system/mautrix-whatsapp.service +++ /dev/null @@ -1,35 +0,0 @@ -[Unit] -Description=mautrix-whatsapp bridge - -[Service] -Type=exec -User=mautrix-whatsapp -WorkingDirectory=/var/lib/mautrix-whatsapp -ExecStart=/usr/lib/mautrix-whatsapp/mautrix-whatsapp -c /etc/mautrix-whatsapp/config.yaml -Restart=on-failure -RestartSec=30s - -# Optional hardening to improve security -ReadWritePaths=/var/lib/mautrix-whatsapp /etc/mautrix-whatsapp -NoNewPrivileges=yes -MemoryDenyWriteExecute=true -PrivateDevices=yes -PrivateTmp=yes -ProtectHome=yes -ProtectSystem=strict -ProtectControlGroups=true -RestrictSUIDSGID=true -RestrictRealtime=true -LockPersonality=true -ProtectKernelLogs=true -ProtectKernelTunables=true -ProtectHostname=true -ProtectKernelModules=true -PrivateUsers=true -ProtectClock=true -SystemCallArchitectures=native -SystemCallErrorNumber=EPERM -SystemCallFilter=@system-service - -[Install] -WantedBy=multi-user.target diff --git a/ressources/zigbee2mqtt/debmaker b/ressources/zigbee2mqtt/debmaker index 7b1f10b..54aa6ca 100755 --- a/ressources/zigbee2mqtt/debmaker +++ b/ressources/zigbee2mqtt/debmaker @@ -1,14 +1,13 @@ #!/bin/bash VERSION=1.25.0 -RELEASE=1 [ -e ./lib/function.sh ] && source ./lib/function.sh APP=zigbee2mqtt DEPOT=https://github.com/Koenkk/zigbee2mqtt.git GIT_VERSION=${VERSION} -DEB_VERSION=${VERSION}-${RELEASE} +DEB_VERSION=${VERSION}-$(date +%Y%m%d%H%M) DEBIAN_VERSION_CODENAME=bullseye IMAGE_SIZE=2