debmaker/ressources/keycloak/debmaker

42 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
VERSION=26.0.5
APP=keycloak
DEPOT=https://github.com/keycloak/keycloak.git
GIT_VERSION=${VERSION}
DEB_VERSION=${VERSION}-$(date +%Y%m%d%H%M)
DEBIAN_VERSION_CODENAME=bookworm
IMAGE_SIZE=12
PACKAGE_DEPENDENCY="default-jdk maven"
STEP="base_package_upgrade install_package_dependency default_prebuild build makedeb"
#makedeb
build() {
cd /tmp/${APP}
mkdir ~/.m2/
cp .github/settings.xml ~/.m2/
cd quarkus
mvn -f ../pom.xml clean install -DskipTestsuite -DskipExamples -DskipTests
}
makedeb(){
PATH_DEB=/tmp/src/rootfs
mkdir -p ${PATH_DEB}/etc/
mkdir -p ${PATH_DEB}/usr/lib/keycloak
mkdir -p ${PATH_DEB}/var/lib/
tar -zxf /tmp/${APP}/quarkus/dist/target/keycloak-*tar.gz -C ${PATH_DEB}/usr/lib/keycloak --strip-components=1
mv ${PATH_DEB}/usr/lib/keycloak/conf ${PATH_DEB}/etc/keycloak
#mv ${PATH_DEB}/usr/lib/keycloak/data ${PATH_DEB}/var/lib/keycloak
ln -s /etc/keycloak ${PATH_DEB}/usr/lib/keycloak/conf
ln -s /var/lib/keycloak ${PATH_DEB}/usr/lib/keycloak/data
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
}