From 853e9f431b5894783007cd7276534b6309cf7416 Mon Sep 17 00:00:00 2001 From: thomas Date: Sun, 6 Mar 2022 00:37:44 +0100 Subject: [PATCH] use generic file name to store compilation instruction Add GLPI (with github clone to patch install) --- README.MD | 35 +++++++++-- lib/exec_in_chroot.sh | 3 +- lib/function.sh | 2 +- .../adguardhome/{adguardhome => debmaker} | 0 ressources/authelia/{authelia => debmaker} | 2 +- .../element-web/{element-web => debmaker} | 2 +- ressources/gitea/{gitea => debmaker} | 0 ressources/glpi/debmaker | 61 +++++++++++++++++++ ressources/glpi/rootfs/DEBIAN/changelog | 0 ressources/glpi/rootfs/DEBIAN/control | 8 +++ ressources/glpi/rootfs/DEBIAN/postinst | 3 + ressources/glpi/rootfs/etc/glpi/.gitkeep | 1 + .../usr/share/doc/glpi/apache2-glpi.conf | 10 +++ ressources/glpi/rootfs/var/lib/glpi/.gitkeep | 1 + ressources/gotify/{gotify => debmaker} | 0 ressources/grocy/{grocy => debmaker} | 0 ressources/joplin/{joplin => debmaker} | 0 .../{mautrix-syncproxy => debmaker} | 0 .../{mautrix-whatsapp => debmaker} | 0 .../{mautrix-wsproxy => debmaker} | 0 ressources/metabase/debmaker | 52 ++++++++++++++++ ressources/metabase/metabase | 40 ------------ .../rss-bridge/{rss-bridge => debmaker} | 0 ressources/tt-rss/{tt-rss => debmaker} | 0 .../{vaultwarden-web => debmaker} | 0 .../vaultwarden/{vaultwarden => debmaker} | 0 ressources/wallabag/{wallabag => debmaker} | 0 .../zigbee2mqtt/{zigbee2mqtt => debmaker} | 0 28 files changed, 170 insertions(+), 50 deletions(-) rename ressources/adguardhome/{adguardhome => debmaker} (100%) rename ressources/authelia/{authelia => debmaker} (98%) rename ressources/element-web/{element-web => debmaker} (95%) rename ressources/gitea/{gitea => debmaker} (100%) create mode 100755 ressources/glpi/debmaker create mode 100644 ressources/glpi/rootfs/DEBIAN/changelog create mode 100644 ressources/glpi/rootfs/DEBIAN/control create mode 100755 ressources/glpi/rootfs/DEBIAN/postinst create mode 100644 ressources/glpi/rootfs/etc/glpi/.gitkeep create mode 100644 ressources/glpi/rootfs/usr/share/doc/glpi/apache2-glpi.conf create mode 100644 ressources/glpi/rootfs/var/lib/glpi/.gitkeep rename ressources/gotify/{gotify => debmaker} (100%) rename ressources/grocy/{grocy => debmaker} (100%) rename ressources/joplin/{joplin => debmaker} (100%) rename ressources/mautrix-syncproxy/{mautrix-syncproxy => debmaker} (100%) rename ressources/mautrix-whatsapp/{mautrix-whatsapp => debmaker} (100%) rename ressources/mautrix-wsproxy/{mautrix-wsproxy => debmaker} (100%) create mode 100755 ressources/metabase/debmaker delete mode 100755 ressources/metabase/metabase rename ressources/rss-bridge/{rss-bridge => debmaker} (100%) rename ressources/tt-rss/{tt-rss => debmaker} (100%) rename ressources/vaultwarden-web/{vaultwarden-web => debmaker} (100%) rename ressources/vaultwarden/{vaultwarden => debmaker} (100%) rename ressources/wallabag/{wallabag => debmaker} (100%) rename ressources/zigbee2mqtt/{zigbee2mqtt => debmaker} (100%) diff --git a/README.MD b/README.MD index 0bc939e..e651878 100644 --- a/README.MD +++ b/README.MD @@ -8,17 +8,17 @@ All package are install with chroot environnement. To create deb file you just need to run the bellow command : ```bash -. ressources/joplin/joplin +. ressources//debmaker debmaker_run ``` -This commande create joplin and joplin-server packages +after execution, .deb file is generate in 'dist' folder ### Debug To enter in temporary filesystem ```bash -debmaker_chroot cache/joplin +debmaker_chroot cache/ ``` ### packages available in shared repository @@ -27,6 +27,7 @@ debmaker_chroot cache/joplin - [authelia](#authelia) ([site](https://www.authelia.com/)) ([src](https://github.com/authelia/authelia)) - [element-web](#element-web) ([site](https://element.io/)) ([src](https://github.com/vector-im/element-web)) - [gitea](#gitea) ([site](https://gitea.io)) ([src](https://github.com/go-gitea/gitea/)) + - [glpi](#glpi) ([site](http://glpi-project.org/)) ([src](https://github.com/glpi-project/glpi)) - [gotify](#gotify) ([site](https://gotify.net/)) ([src](https://github.com/gotify)) - [grocy](#grocy) ([site](https://grocy.info/)) ([src](https://github.com/grocy/grocy)) - [joplin desktop](#joplin) ([site](https://joplinapp.org/)) ([src](https://github.com/laurent22/joplin)) @@ -68,6 +69,7 @@ systemctl enable --now authelia ```bash apt install -y wget ca-certificates wget -qO - https://deb.lgy.fr/install.sh | bash +apt-get update apt install element-web # sample configuration for apache2 @@ -92,8 +94,26 @@ apt-get install -y gitea systemctl enable --now gitea #configuration with http://:3000 - ``` + +#### glpi + +```bash +apt install -y wget ca-certificates +wget -qO - https://deb.lgy.fr/install.sh | bash +apt-get update +apt install glpi libapache2-mod-php apache2 -y + +gzip -dc /usr/share/doc/glpi/apache2-glpi.conf.gz > /etc/apache2/sites-available/glpi.conf + +#edité le fichier de configuration apache +nano /etc/apache2/sites-available/glpi.conf +a2ensite glpi +systemctl reload apache2 + +#configuration with http:// +``` + #### gotify ```bash @@ -131,7 +151,7 @@ systemctl restart apache2 ```bash apt install -y wget ca-certificates wget -qO - https://deb.lgy.fr/install.sh | bash - +apt-get update apt-get install -y joplin ``` @@ -177,7 +197,9 @@ systemctl enable --now metabase #### rss-bridge ```bash +apt install -y wget ca-certificates wget -qO - https://deb.lgy.fr/install.sh | bash +apt-get update apt install rss-bridge # sample configuration for apache2 @@ -216,6 +238,7 @@ systemctl restart apache2 ```bash apt install -y wget ca-certificates wget -qO - https://deb.lgy.fr/install.sh | bash +apt-get update apt install vaultwarden vaultwarden-web #Edit /etc/default/vaultwarden @@ -228,6 +251,7 @@ systemctl enable --now vaultwarden ```bash apt install -y wget ca-certificates wget -qO - https://deb.lgy.fr/install.sh | bash +apt-get update apt install wallabag # sample configuration for apache2 @@ -246,6 +270,7 @@ systemctl restart apache2 ```bash apt install -y wget ca-certificates wget -qO - https://deb.lgy.fr/install.sh | bash +apt-get update apt-get install -y zigbee2mqtt #Edit /etc/zigbee2mqtt/configuration.yaml diff --git a/lib/exec_in_chroot.sh b/lib/exec_in_chroot.sh index 4528d81..628f029 100755 --- a/lib/exec_in_chroot.sh +++ b/lib/exec_in_chroot.sh @@ -1,8 +1,7 @@ #!/bin/bash if [ ! "$1" == "" ]; then - source /tmp/src/$1 - shift + source /tmp/src/debmaker FUNC=$1 shift ${FUNC} $* diff --git a/lib/function.sh b/lib/function.sh index f4de886..73cb172 100644 --- a/lib/function.sh +++ b/lib/function.sh @@ -86,7 +86,7 @@ debmaker_run(){ debmaker_mount_proc_sys cache/${APP} ${MOUNT_PATH}/${APP}/ for CURRENT_STEP in ${STEP} do - sudo chroot ${MOUNT_PATH}/${APP}/ /tmp/src/exec_in_chroot.sh ${APP} ${CURRENT_STEP} ${GIT_VERSION} ${DEB_VERSION} + sudo chroot ${MOUNT_PATH}/${APP}/ /tmp/src/exec_in_chroot.sh ${CURRENT_STEP} done find ${MOUNT_PATH}/${APP}/tmp/dist/ -name *.deb -exec cp {} dist/ \; debmaker_umount_proc_sys ${MOUNT_PATH}/${APP}/ diff --git a/ressources/adguardhome/adguardhome b/ressources/adguardhome/debmaker similarity index 100% rename from ressources/adguardhome/adguardhome rename to ressources/adguardhome/debmaker diff --git a/ressources/authelia/authelia b/ressources/authelia/debmaker similarity index 98% rename from ressources/authelia/authelia rename to ressources/authelia/debmaker index 2a06c48..22f107f 100755 --- a/ressources/authelia/authelia +++ b/ressources/authelia/debmaker @@ -1,6 +1,6 @@ #!/bin/bash -VERSION=4.34.2 +VERSION=4.34.3 RELEASE=1 [ -e ./lib/function.sh ] && source ./lib/function.sh diff --git a/ressources/element-web/element-web b/ressources/element-web/debmaker similarity index 95% rename from ressources/element-web/element-web rename to ressources/element-web/debmaker index 51cbe92..df48b5e 100755 --- a/ressources/element-web/element-web +++ b/ressources/element-web/debmaker @@ -6,7 +6,7 @@ RELEASE=3 [ -e ./lib/function.sh ] && source ./lib/function.sh APP=element-web -DEPOT=https://github.com/vector-im/element-web.git /tmp/git +DEPOT=https://github.com/vector-im/element-web.git GIT_VERSION=v${VERSION} DEB_VERSION=${VERSION}-${RELEASE} DEBIAN_VERSION_CODENAME=bullseye diff --git a/ressources/gitea/gitea b/ressources/gitea/debmaker similarity index 100% rename from ressources/gitea/gitea rename to ressources/gitea/debmaker diff --git a/ressources/glpi/debmaker b/ressources/glpi/debmaker new file mode 100755 index 0000000..c23941f --- /dev/null +++ b/ressources/glpi/debmaker @@ -0,0 +1,61 @@ +#!/bin/bash + +VERSION=10.0.0-rc2-thl +RELEASE=1 + +[ -e ./lib/function.sh ] && source ./lib/function.sh + +APP=glpi +DEPOT=https://github.com/tomamplius/glpi.git +GIT_VERSION=${VERSION} +DEB_VERSION=${VERSION}-${RELEASE} +DEBIAN_VERSION_CODENAME=bullseye +IMAGE_SIZE=2 + +STEP="envinit prebuild build makedeb" + +envinit() { + if [ $(dpkg -l | grep -e 'ii composer ' | wc -l) -eq 1 ]; + then + apt-get update + apt-get dist-upgrade -y + else + apt install -y --no-install-recommends git fakeroot dpkg patch composer php-json php-xml php-curl php-gd php-intl php-ldap php-zip php-mysql wget gettext + wget -qO - https://deb.nodesource.com/setup_16.x | bash + apt install nodejs + fi +} + +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 -fr /tmp/git/. /tmp/${APP} +} + +build(){ + cd /tmp/${APP} + ./tools/make_release.sh -y . ${VERSION} +} + +makedeb(){ + PATH_DEB=/tmp/src/rootfs + + tar -zxvf /tmp/${APP}-${VERSION}.tgz -C ${PATH_DEB}/usr/share/ + mv ${PATH_DEB}/usr/share/glpi/*.md ${PATH_DEB}/usr/share/doc/glpi/ + gzip ${PATH_DEB}/usr/share/doc/glpi/* + + mv ${PATH_DEB}/usr/share/glpi/files ${PATH_DEB}/var/lib/glpi/ + ln -s /var/lib/glpi/files ${PATH_DEB}/usr/share/glpi/files + + mv ${PATH_DEB}/usr/share/glpi/marketplace ${PATH_DEB}/var/lib/glpi/ + ln -s /var/lib/glpi/marketplace ${PATH_DEB}/usr/share/glpi/marketplace + + cp -r ${PATH_DEB}/usr/share/glpi/config/. ${PATH_DEB}/etc/glpi/ + rm -fr ${PATH_DEB}/usr/share/glpi/config/ + ln -s /etc/glpi/ ${PATH_DEB}/usr/share/glpi/config + + sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control + fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist +} + diff --git a/ressources/glpi/rootfs/DEBIAN/changelog b/ressources/glpi/rootfs/DEBIAN/changelog new file mode 100644 index 0000000..e69de29 diff --git a/ressources/glpi/rootfs/DEBIAN/control b/ressources/glpi/rootfs/DEBIAN/control new file mode 100644 index 0000000..020ba4e --- /dev/null +++ b/ressources/glpi/rootfs/DEBIAN/control @@ -0,0 +1,8 @@ +Package: glpi +Version: %VERSION% +Section: base +Priority: optional +Architecture: all +Depends: php-json, php-xml, php-curl, php-gd, php-intl, php-ldap, php-zip, php-mysql, php-bz2, php-mbstring +Maintainer: Thomas Legay +Description: glpi diff --git a/ressources/glpi/rootfs/DEBIAN/postinst b/ressources/glpi/rootfs/DEBIAN/postinst new file mode 100755 index 0000000..68a153c --- /dev/null +++ b/ressources/glpi/rootfs/DEBIAN/postinst @@ -0,0 +1,3 @@ +#!/bin/bash +chown -R www-data:www-data /var/lib/glpi +chown -R www-data:www-data /etc/glpi diff --git a/ressources/glpi/rootfs/etc/glpi/.gitkeep b/ressources/glpi/rootfs/etc/glpi/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ressources/glpi/rootfs/etc/glpi/.gitkeep @@ -0,0 +1 @@ + diff --git a/ressources/glpi/rootfs/usr/share/doc/glpi/apache2-glpi.conf b/ressources/glpi/rootfs/usr/share/doc/glpi/apache2-glpi.conf new file mode 100644 index 0000000..5c5475b --- /dev/null +++ b/ressources/glpi/rootfs/usr/share/doc/glpi/apache2-glpi.conf @@ -0,0 +1,10 @@ + + ServerName glpi.domaine.com + DocumentRoot /usr/share/glpi + + + Options FollowSymLinks + AllowOverride all + Require all granted + + diff --git a/ressources/glpi/rootfs/var/lib/glpi/.gitkeep b/ressources/glpi/rootfs/var/lib/glpi/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ressources/glpi/rootfs/var/lib/glpi/.gitkeep @@ -0,0 +1 @@ + diff --git a/ressources/gotify/gotify b/ressources/gotify/debmaker similarity index 100% rename from ressources/gotify/gotify rename to ressources/gotify/debmaker diff --git a/ressources/grocy/grocy b/ressources/grocy/debmaker similarity index 100% rename from ressources/grocy/grocy rename to ressources/grocy/debmaker diff --git a/ressources/joplin/joplin b/ressources/joplin/debmaker similarity index 100% rename from ressources/joplin/joplin rename to ressources/joplin/debmaker diff --git a/ressources/mautrix-syncproxy/mautrix-syncproxy b/ressources/mautrix-syncproxy/debmaker similarity index 100% rename from ressources/mautrix-syncproxy/mautrix-syncproxy rename to ressources/mautrix-syncproxy/debmaker diff --git a/ressources/mautrix-whatsapp/mautrix-whatsapp b/ressources/mautrix-whatsapp/debmaker similarity index 100% rename from ressources/mautrix-whatsapp/mautrix-whatsapp rename to ressources/mautrix-whatsapp/debmaker diff --git a/ressources/mautrix-wsproxy/mautrix-wsproxy b/ressources/mautrix-wsproxy/debmaker similarity index 100% rename from ressources/mautrix-wsproxy/mautrix-wsproxy rename to ressources/mautrix-wsproxy/debmaker diff --git a/ressources/metabase/debmaker b/ressources/metabase/debmaker new file mode 100755 index 0000000..4ebdb72 --- /dev/null +++ b/ressources/metabase/debmaker @@ -0,0 +1,52 @@ +#!/bin/bash + +VERSION=0.42.2 +RELEASE=2 + +[ -e ./lib/function.sh ] && source ./lib/function.sh + +APP=metabase +DEPOT=https://github.com/metabase/metabase.git +GIT_VERSION=v$VERSION +DEB_VERSION=${VERSION}-${RELEASE} +DEBIAN_VERSION_CODENAME=bullseye +IMAGE_SIZE=10 + +STEP="envinit prebuild build makedeb" + +envinit() { + if [ $(dpkg -l | grep -e 'ii nodejs ' | wc -l) -eq 1 ]; + then + apt-get update + apt-get dist-upgrade -y + else + apt install -y --no-install-recommends build-essential git wget ca-certificates dpkg fakeroot openjdk-17-jdk curl + 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 + curl https://download.clojure.org/install/linux-install-1.10.3.1087.sh | bash + fi +} + +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/bin + ./bin/build +} + +makedeb(){ + PATH_DEB=/tmp/src/rootfs + + cp /tmp/${APP}/target/uberjar/metabase.jar ${PATH_DEB}/usr/share/metabase/ + sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control + fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist +} diff --git a/ressources/metabase/metabase b/ressources/metabase/metabase deleted file mode 100755 index 45fb72f..0000000 --- a/ressources/metabase/metabase +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash - -[ -e ./lib/function.sh ] && source ./lib/function.sh - -APP=metabase -VERSION=0.42.2 -GIT_VERSION=v$VERSION -DEB_VERSION=$VERSION-1 -DEBIAN_VERSION_CODENAME=bullseye -IMAGE_SIZE=10 - -STEP="envinit prebuild build makedeb" - -envinit() { - apt install -y --no-install-recommends build-essential git wget ca-certificates dpkg fakeroot openjdk-17-jdk curl - 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 - curl https://download.clojure.org/install/linux-install-1.10.3.1087.sh | bash -} - -prebuild(){ - git clone --depth 1 -b ${GIT_VERSION} https://github.com/metabase/metabase.git /tmp/metabase -} - -build() { - cd /tmp/metabase/ - PATH=$PATH:/usr/local/bin - ./bin/build -} - -makedeb(){ - PATH_DEB=/tmp/src/rootfs - - cp /tmp/metabase/target/uberjar/metabase.jar ${PATH_DEB}/usr/share/metabase/ - sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control - fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist -} diff --git a/ressources/rss-bridge/rss-bridge b/ressources/rss-bridge/debmaker similarity index 100% rename from ressources/rss-bridge/rss-bridge rename to ressources/rss-bridge/debmaker diff --git a/ressources/tt-rss/tt-rss b/ressources/tt-rss/debmaker similarity index 100% rename from ressources/tt-rss/tt-rss rename to ressources/tt-rss/debmaker diff --git a/ressources/vaultwarden-web/vaultwarden-web b/ressources/vaultwarden-web/debmaker similarity index 100% rename from ressources/vaultwarden-web/vaultwarden-web rename to ressources/vaultwarden-web/debmaker diff --git a/ressources/vaultwarden/vaultwarden b/ressources/vaultwarden/debmaker similarity index 100% rename from ressources/vaultwarden/vaultwarden rename to ressources/vaultwarden/debmaker diff --git a/ressources/wallabag/wallabag b/ressources/wallabag/debmaker similarity index 100% rename from ressources/wallabag/wallabag rename to ressources/wallabag/debmaker diff --git a/ressources/zigbee2mqtt/zigbee2mqtt b/ressources/zigbee2mqtt/debmaker similarity index 100% rename from ressources/zigbee2mqtt/zigbee2mqtt rename to ressources/zigbee2mqtt/debmaker