2022-02-15 23:11:30 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2023-11-21 01:24:31 +01:00
|
|
|
VERSION=4.0.3
|
2022-02-28 23:26:47 +01:00
|
|
|
APP=grocy
|
2022-04-10 17:02:07 +02:00
|
|
|
DEPOT=https://github.com/grocy/grocy.git
|
2022-02-28 23:26:47 +01:00
|
|
|
GIT_VERSION=v$VERSION
|
2022-04-10 17:02:07 +02:00
|
|
|
DEB_VERSION=${VERSION}-$(date +%Y%m%d%H%M)
|
2022-11-19 19:56:01 +01:00
|
|
|
DEBIAN_VERSION_CODENAME=bookworm
|
2022-04-10 17:02:07 +02:00
|
|
|
IMAGE_SIZE=4
|
2022-11-21 22:52:21 +01:00
|
|
|
PACKAGE_DEPENDENCY="composer php-simplexml php-gd unzip yarn nodejs"
|
2022-02-28 23:26:47 +01:00
|
|
|
|
2022-11-21 22:52:21 +01:00
|
|
|
main() {
|
|
|
|
base_package_upgrade
|
2022-08-17 20:35:16 +02:00
|
|
|
configure_depot_yarn
|
2022-11-21 22:52:21 +01:00
|
|
|
install_package_dependency
|
|
|
|
get_git_source
|
|
|
|
build
|
|
|
|
makedeb
|
2022-02-15 23:11:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
|
|
set +x
|
|
|
|
cd /tmp/grocy
|
2022-11-21 22:52:21 +01:00
|
|
|
export COMPOSER_ALLOW_SUPERUSER=1
|
2022-02-15 23:11:30 +01:00
|
|
|
composer install -n
|
|
|
|
yarn install
|
|
|
|
}
|
|
|
|
|
|
|
|
makedeb(){
|
2022-02-24 00:02:53 +01:00
|
|
|
PATH_DEB=/tmp/src/rootfs
|
2022-02-15 23:11:30 +01:00
|
|
|
|
2022-02-20 15:02:18 +01:00
|
|
|
find /tmp/grocy -name .gitignore -exec rm {} \;
|
2022-02-24 00:02:53 +01:00
|
|
|
mv /tmp/grocy/data ${PATH_DEB}/var/lib/grocy/
|
2022-02-20 15:02:18 +01:00
|
|
|
cp -fr /tmp/grocy/* ${PATH_DEB}/usr/share/grocy/
|
2022-02-15 23:11:30 +01:00
|
|
|
cp ${PATH_DEB}/usr/share/grocy/config-dist.php ${PATH_DEB}/etc/grocy/config.php
|
|
|
|
ln -s /var/lib/grocy/data/ ${PATH_DEB}/usr/share/grocy/data
|
2022-02-24 00:02:53 +01:00
|
|
|
ln -s /etc/grocy/config.php ${PATH_DEB}/var/lib/grocy/data/config.php
|
|
|
|
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
|
|
|
|
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
|
2022-02-15 23:11:30 +01:00
|
|
|
}
|