debmaker/ressources/wallabag/debmaker

46 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
VERSION=2.6.9
APP=wallabag
GIT_VERSION=$VERSION
DEB_VERSION=${VERSION}-$(date +%Y%m%d%H%M)
DEBIAN_VERSION_CODENAME=bookworm
IMAGE_SIZE=4
DEPOT=https://github.com/wallabag/wallabag.git
PACKAGE_DEPENDENCY="php-common php-xml php-json php-gd php-mbstring php-xml php-tidy php-curl php-tokenizer php-bcmath php-intl php-fpm unzip make yarn nodejs"
main(){
base_package_upgrade
configure_depot_yarn
configure_depot_nodejs 20
install_package_dependency
install_composer
get_git_source
build
makedeb
}
build() {
cd /tmp/${APP}
COMPOSER_ALLOW_SUPERUSER=1 SYMFONY_ENV=prod php /usr/bin/composer install --no-dev -o --prefer-dist -n --no-scripts
ENV=PROD make build
}
makedeb(){
PATH_DEB=/tmp/src/rootfs
cp -fr /tmp/${APP}/* ${PATH_DEB}/usr/share/wallabag/
rm -fr ${PATH_DEB}/usr/share/wallabag/node_modules
mv ${PATH_DEB}/usr/share/wallabag/data ${PATH_DEB}/var/lib/wallabag/data
mv ${PATH_DEB}/usr/share/wallabag/var ${PATH_DEB}/var/lib/wallabag/var
cp /tmp/wallabag/app/config/parameters.yml.dist ${PATH_DEB}/etc/wallabag/parameters.yml
ln -s /var/lib/${APP}/data ${PATH_DEB}/usr/share/wallabag/data
ln -s /var/lib/${APP}/var ${PATH_DEB}/usr/share/wallabag/var
ln -s /etc/${APP}/parameters.yml ${PATH_DEB}/usr/share/wallabag/app/config/parameters.yml
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
}