2022-02-17 03:46:00 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2023-07-30 22:08:46 +02:00
|
|
|
VERSION=2.6.2
|
2022-08-17 20:35:16 +02:00
|
|
|
APP=wallabag
|
2022-02-28 23:26:47 +01:00
|
|
|
GIT_VERSION=$VERSION
|
2022-05-26 16:27:16 +02:00
|
|
|
DEB_VERSION=${VERSION}-$(date +%Y%m%d%H%M)
|
2023-07-27 16:29:59 +02:00
|
|
|
DEBIAN_VERSION_CODENAME=bookworm
|
2022-05-26 16:27:16 +02:00
|
|
|
IMAGE_SIZE=4
|
|
|
|
DEPOT=https://github.com/wallabag/wallabag.git
|
2022-02-28 23:26:47 +01:00
|
|
|
|
2023-07-30 22:08:46 +02:00
|
|
|
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"
|
2023-02-06 13:57:24 +01:00
|
|
|
|
|
|
|
main(){
|
|
|
|
base_package_upgrade
|
|
|
|
envinit
|
|
|
|
get_git_source
|
|
|
|
build
|
|
|
|
makedeb
|
|
|
|
}
|
2022-02-20 15:02:18 +01:00
|
|
|
|
2022-02-17 03:46:00 +01:00
|
|
|
envinit() {
|
2022-08-17 20:35:16 +02:00
|
|
|
configure_depot_yarn
|
2023-07-27 16:29:59 +02:00
|
|
|
configure_depot_nodejs 18
|
2023-02-06 13:57:24 +01:00
|
|
|
install_package_dependency
|
2023-07-30 22:08:46 +02:00
|
|
|
install_composer
|
2022-02-17 03:46:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
2022-05-26 16:27:16 +02:00
|
|
|
cd /tmp/${APP}
|
2023-07-30 22:08:46 +02:00
|
|
|
COMPOSER_ALLOW_SUPERUSER=1 SYMFONY_ENV=prod php /usr/bin/composer.phar install --no-dev -o --prefer-dist -n --no-scripts
|
2022-10-24 21:48:01 +02:00
|
|
|
ENV=PROD make build
|
2022-02-17 03:46:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
makedeb(){
|
2022-02-24 00:02:53 +01:00
|
|
|
PATH_DEB=/tmp/src/rootfs
|
2022-02-17 03:46:00 +01:00
|
|
|
|
2023-07-30 22:08:46 +02:00
|
|
|
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
|
|
|
|
|
2022-02-20 15:02:18 +01:00
|
|
|
cp /tmp/wallabag/app/config/parameters.yml.dist ${PATH_DEB}/etc/wallabag/parameters.yml
|
2022-10-24 21:48:01 +02:00
|
|
|
|
2022-05-26 16:27:16 +02:00
|
|
|
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
|
2022-02-24 00:02:53 +01:00
|
|
|
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
|
|
|
|
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
|
2022-02-17 03:46:00 +01:00
|
|
|
}
|