debmaker/ressources/clouseau/debmaker

49 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
VERSION=2.21.6
APP=clouseau
DEPOT=https://github.com/cloudant-labs/clouseau.git
GIT_VERSION=${VERSION}
DEB_VERSION=${VERSION}-$(date +%Y%m%d%H%M)
DEBIAN_VERSION_CODENAME=bookworm
IMAGE_SIZE=3
PACKAGE_DEPENDENCY="software-properties-common erlang mvn"
main(){
envinit
get_git_source
build
makedeb
}
envinit() {
base_package_upgrade
install_package_dependency
wget https://repos.azul.com/azul-repo.key | gpg --dearmor -O /usr/share/keyrings/azul.gpg
echo "deb [signed-by=/usr/share/keyrings/azul.gpg] https://repos.azul.com/zulu/deb stable main" > /etc/apt/sources.list.d/zulu.list
apt-get update
apt-get install -y --no-install-recommends zulu-7
mkdir -p /usr/share/maven
wget -O - https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.tar.gz | tar -zxC /usr/share/maven --strip-components=1
rm -f /usr/bin/mvn
ln -s /usr/share/maven/bin/mvn /usr/bin/mvn
}
build() {
cd /tmp/${APP}
epmd -daemon &
mvn -B package --file pom.xml
skill -9 epmd
}
makedeb(){
PATH_DEB=/tmp/src/rootfs
mkdir ${PATH_DEB}/usr/lib/clouseau
tar -zxvf /tmp/${APP}/target/clouseau-*.tar.gz -C ${PATH_DEB}/usr/lib/clouseau --strip-components=1
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
}