debmaker/ressources/humhub/debmaker

47 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
VERSION=1.16.2
APP=humhub
DEPOT=https://github.com/humhub/humhub.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-curl php-ldap php-xml php-dom php-zip php-gd unzip npm grunt"
main(){
base_package_upgrade
install_package_dependency
get_git_source
build
makedeb
}
build() {
cd /tmp/${APP}
export COMPOSER_ALLOW_SUPERUSER=1
composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
npm install
grunt build-assets
}
makedeb(){
PATH_DEB=/tmp/src/rootfs
mkdir -p ${PATH_DEB}/usr/share/
mkdir -p ${PATH_DEB}/var/lib/${APP}/protected
cp -fr /tmp/${APP} ${PATH_DEB}/usr/share/
mv ${PATH_DEB}/usr/share/${APP}/{assets,uploads} ${PATH_DEB}/var/lib/${APP}/
mv ${PATH_DEB}/usr/share/${APP}/protected/{config,modules,runtime} ${PATH_DEB}/var/lib/${APP}/protected
ln -s /var/lib/${APP}/assets ${PATH_DEB}/usr/share/${APP}/assets
ln -s /var/lib/${APP}/protected/config ${PATH_DEB}/usr/share/${APP}/protected/config
ln -s /var/lib/${APP}/protected/modules ${PATH_DEB}/usr/share/${APP}/protected/modules
ln -s /var/lib/${APP}/protected/runtime ${PATH_DEB}/usr/share/${APP}/protected/runtime
ln -s /var/lib/${APP}/uploads ${PATH_DEB}/usr/share/${APP}/uploads
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
}