debmaker/ressources/adguardhome/adguardhome
thomas 55beb0e2e3 Another refactor
merge joplin and joplin-server
2022-02-28 23:26:47 +01:00

40 lines
1.2 KiB
Bash
Executable file

#!/bin/bash
[ -e ./lib/function.sh ] && source ./lib/function.sh
APP=adguardhome
VERSION=0.108.0-b.3
GIT_VERSION=v$VERSION
DEB_VERSION=$VERSION-1
DEBIAN_VERSION_CODENAME=bullseye
IMAGE_SIZE=4
STEP="envinit prebuild build makedeb"
envinit() {
apt install -y --no-install-recommends build-essential git wget ca-certificates dpkg fakeroot
wget -qO - https://deb.nodesource.com/setup_16.x | bash
wget -qO - https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor > /usr/share/keyrings/yarnkey.gpg
echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" > /etc/apt/sources.list.d/yarn.list
apt-get update
apt-get install -y nodejs yarn
wget -qO - https://go.dev/dl/go1.17.7.linux-amd64.tar.gz | tar -C /usr/local -xz
}
prebuild(){
git clone --depth 1 -b ${GIT_VERSION} https://github.com/AdguardTeam/AdGuardHome.git /tmp/adguardhome
}
build() {
cd /tmp/adguardhome
PATH=$PATH:/usr/local/go/bin
make
}
makedeb(){
PATH_DEB=/tmp/src/rootfs
cp /tmp/adguardhome/AdGuardHome ${PATH_DEB}/usr/bin/adguardhome
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
}