debmaker/ressources/clouseau/debmaker
2022-10-12 03:19:49 +02:00

48 lines
1.2 KiB
Bash
Executable file

#!/bin/bash
VERSION=2.21.1
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=bullseye
IMAGE_SIZE=3
PACKAGE_DEPENDENCY="software-properties-common erlang"
main(){
envinit
get_git_source
build
makedeb
}
envinit() {
base_package_upgrade
install_package_dependency
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0xB1998361219BD9C9
apt-add-repository 'deb http://repos.azulsystems.com/debian stable main'
apt-get update
apt-get install -y --no-install-recommends zulu-7
mkdir -p /usr/share/maven
wget -O - https://dlcdn.apache.org/maven/maven-3/3.2.5/binaries/apache-maven-3.2.5-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
}