debmaker/ressources/grocy/debmaker
2022-11-21 22:52:21 +01:00

40 lines
1,003 B
Bash
Executable file

#!/bin/bash
VERSION=3.3.2
APP=grocy
DEPOT=https://github.com/grocy/grocy.git
GIT_VERSION=v$VERSION
DEB_VERSION=${VERSION}-$(date +%Y%m%d%H%M)
DEBIAN_VERSION_CODENAME=bookworm
IMAGE_SIZE=4
PACKAGE_DEPENDENCY="composer php-simplexml php-gd unzip yarn nodejs"
main() {
base_package_upgrade
configure_depot_yarn
install_package_dependency
get_git_source
build
makedeb
}
build() {
set +x
cd /tmp/grocy
export COMPOSER_ALLOW_SUPERUSER=1
composer install -n
yarn install
}
makedeb(){
PATH_DEB=/tmp/src/rootfs
find /tmp/grocy -name .gitignore -exec rm {} \;
mv /tmp/grocy/data ${PATH_DEB}/var/lib/grocy/
cp -fr /tmp/grocy/* ${PATH_DEB}/usr/share/grocy/
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
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
}