systemd migration

This commit is contained in:
thomas 2022-03-22 22:24:15 +01:00
parent a20c6440ee
commit 188ffb6c70
17 changed files with 35 additions and 19 deletions

View File

@ -1,32 +1,43 @@
#!/bin/bash
VERSION=0.108.0-b.4
RELEASE=1
[ -e ./lib/function.sh ] && source ./lib/function.sh
APP=adguardhome
VERSION=0.108.0-b.3
GIT_VERSION=v$VERSION
DEB_VERSION=$VERSION-1
DEPOT=https://github.com/AdguardTeam/AdGuardHome.git
GIT_VERSION=v${VERSION}
DEB_VERSION=${VERSION}-${RELEASE}
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
if [ $(dpkg -l | grep -e 'ii nodejs ' | wc -l) -eq 1 ];
then
apt-get update
apt-get dist-upgrade -y
else
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.18.linux-amd64.tar.gz | tar -C /usr/local -xz
fi
}
prebuild(){
git clone --depth 1 -b ${GIT_VERSION} https://github.com/AdguardTeam/AdGuardHome.git /tmp/adguardhome
[ -e /tmp/git ] && rm -fr /tmp/git
[ -e /tmp/${APP} ] || mkdir /tmp/${APP}
git clone --depth 1 -b ${GIT_VERSION} ${DEPOT} /tmp/git
cp -r /tmp/git/. /tmp/${APP}
}
build() {
cd /tmp/adguardhome
cd /tmp/${APP}
PATH=$PATH:/usr/local/go/bin
make
}

View File

@ -0,0 +1 @@
/etc/defaults/adguardhome

View File

@ -3,5 +3,5 @@ Version: %VERSION%
Section: base
Priority: optional
Architecture: amd64
Maintainer: Thomas Legay <thomas@syngate.fr>
Description: adguardhome
Maintainer: Thomas Legay <thomas@lgy.fr>
Description: AdGuard Home is a network-wide software for blocking ads & tracking. After you set it up, itll cover ALL your home devices, and you dont need any client-side software for that. With the rise of Internet-Of-Things and connected devices, it becomes more and more important to be able to control your whole network.

View File

@ -0,0 +1,4 @@
# Options to pass to adguardhome
# see /usr/bin/adguardhome --help
ADGH_OPTS=-c /etc/adguardhome.yaml -w /var/lib/adguardhome

View File

@ -4,10 +4,10 @@ ConditionFileIsExecutable=/usr/bin/adguardhome
After=syslog.target network-online.target
[Service]
EnvironmentFile=-/etc/default/adguardhome
EnvironmentFile=/etc/default/adguardhome
StartLimitInterval=5
StartLimitBurst=10
ExecStart=/usr/bin/adguardhome -c /etc/adguardhome.yaml -w /var/lib/adguardhome
ExecStart=/usr/bin/adguardhome $ADGH_OPTS
WorkingDirectory=/var/lib/adguardhome
Restart=always

View File

@ -1,6 +1,6 @@
#!/bin/bash
VERSION=10.0.0-rc2
VERSION=10.0.0-rc3
[ -e ./lib/function.sh ] && source ./lib/function.sh