59 lines
1.7 KiB
Bash
Executable File
59 lines
1.7 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
VERSION=10.0.10
|
|
APP=glpi
|
|
DEPOT=https://github.com/glpi-project/glpi.git
|
|
GIT_VERSION=${VERSION}
|
|
DEB_VERSION=${VERSION}-$(date +%Y%m%d%H%M)
|
|
DEBIAN_VERSION_CODENAME=bookworm
|
|
IMAGE_SIZE=4
|
|
PACKAGE_DEPENDENCY="patch composer php-json php-xml php-curl php-gd php-intl php-ldap php-zip php-mysql gettext nodejs"
|
|
|
|
main() {
|
|
base_package_upgrade
|
|
configure_depot_nodejs
|
|
install_package_dependency
|
|
get_git_source
|
|
build
|
|
makedeb
|
|
}
|
|
|
|
build(){
|
|
cd /tmp/${APP}
|
|
./tools/make_release.sh -y . ${VERSION}
|
|
}
|
|
|
|
makedeb(){
|
|
PATH_DEB=/tmp/src/rootfs
|
|
PATH_DEB_INSTALL=/tmp/src/rootfs-install
|
|
|
|
mkdir -p ${PATH_DEB}/usr/share/doc/glpi/
|
|
mkdir -p ${PATH_DEB}/var/lib/glpi/
|
|
mkdir -p ${PATH_DEB}/etc/cron.d/
|
|
|
|
tar -zxvf /tmp/${APP}-${VERSION}.tgz -C ${PATH_DEB}/usr/share/
|
|
|
|
mv ${PATH_DEB}/usr/share/glpi/install ${PATH_DEB_INSTALL}/usr/share/glpi/
|
|
|
|
mv ${PATH_DEB}/usr/share/glpi/*.md ${PATH_DEB}/usr/share/doc/glpi/
|
|
gzip ${PATH_DEB}/usr/share/doc/glpi/*
|
|
|
|
mv ${PATH_DEB}/usr/share/glpi/files ${PATH_DEB}/var/lib/glpi/
|
|
mv ${PATH_DEB}/usr/share/glpi/config ${PATH_DEB}/etc/glpi
|
|
|
|
mv ${PATH_DEB}/usr/share/glpi/marketplace ${PATH_DEB}/var/lib/glpi/
|
|
ln -s /var/lib/glpi/marketplace ${PATH_DEB}/usr/share/glpi/marketplace
|
|
|
|
mv ${PATH_DEB}/downstream.php ${PATH_DEB}/usr/share/glpi/inc/
|
|
mv ${PATH_DEB}/local_define.php ${PATH_DEB}/etc/glpi
|
|
mv ${PATH_DEB}/apache2-glpi.conf ${PATH_DEB}/usr/share/doc/glpi/
|
|
mv ${PATH_DEB}/glpi.cron ${PATH_DEB}/etc/cron.d/glpi
|
|
|
|
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
|
|
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
|
|
|
|
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB_INSTALL}/DEBIAN/control
|
|
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB_INSTALL} /tmp/dist
|
|
}
|
|
|