Skip to content

Commit

Permalink
openresolv: add new ceras
Browse files Browse the repository at this point in the history
  • Loading branch information
firasuke committed May 18, 2024
1 parent 531c951 commit c212b29
Show file tree
Hide file tree
Showing 3 changed files with 148 additions and 0 deletions.
43 changes: 43 additions & 0 deletions openresolv/build.native
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Copyright (c) 2018-2024, Firas Khalil Khana
# Distributed under the terms of the ISC License

# Voyager: Firas Khalil Khana (firasuke) <[email protected]>

cerasPrepare() {
rsync $RAD_RSYNC_FLAGS $SRCD/$nom/$nom-$ver/ $TSRC/$nom --delete
cd $TSRC/$nom

patch --no-backup-if-mismatch -p1 -i $CERD/$nom/patches/alpine/detect_init-remove-irrelevant.patch
}

cerasConfigure() {
./configure \
--prefix=/usr \
--bindir=/usr/bin \
--sbindir=/usr/bin \
--libexecdir=/usr/lib/$nom \
--sysconfdir=/etc \
--statedir=/var \
--localstatedir=/var \
--runstatedir=/run \
--libdir=/usr/lib \
--includedir=/usr/include \
--datadir=/usr/share \
--infodir=/usr/share/info \
--mandir=/usr/share/man \
--disable-debug
}

cerasBuild() {
make
}

cerasCheck() {
:
}

cerasInstall() {
make \
DESTDIR=$SACD \
install
}
10 changes: 10 additions & 0 deletions openresolv/ceras
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (c) 2018-2024, Firas Khalil Khana
# Distributed under the terms of the ISC License

# Voyager: Firas Khalil Khana (firasuke) <[email protected]>

nom="openresolv"
ver="3.13.2"
url="https://github.com/NetworkConfiguration/openresolv/archive/v3.13.2.tar.gz"
sum="d81d17de985d5eb8f9e175d47d9af9f0a0122ab9547ac8ee969da795f616a8af"
bld="make"
95 changes: 95 additions & 0 deletions openresolv/patches/alpine/detect_init-remove-irrelevant.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
From: Jakub Jirutka <[email protected]>
Date: Sat, 25 Jun 2022 19:51:00 +0200
Subject: Remove support for init systems we don't have, add support for s6

Don't waste resources looking for init systems we don't have in Alpine.

diff --git a/resolvconf.in b/resolvconf.in
index d1cdc71..42023ff 100644
--- a/resolvconf.in
+++ b/resolvconf.in
@@ -299,80 +299,25 @@ detect_init()
[ -n "$RESTARTCMD" ] && return 0

# Detect the running init system.
- # As systemd and OpenRC can be installed on top of legacy init
- # systems we try to detect them first.
status="@STATUSARG@"
: ${status:=status}
- if [ -x /bin/systemctl ] && [ -S /run/systemd/private ]; then
- RESTARTCMD='
- if /bin/systemctl --quiet is-active $1.service
- then
- /bin/systemctl restart $1.service
- fi'
- elif [ -x /usr/bin/systemctl ] && [ -S /run/systemd/private ]; then
- RESTARTCMD='
- if /usr/bin/systemctl --quiet is-active $1.service
- then
- /usr/bin/systemctl restart $1.service
- fi'
- elif [ -x /sbin/rc-service ] &&
+ if [ -x /sbin/rc-service ] &&
{ [ -s /libexec/rc/init.d/softlevel ] ||
[ -s /run/openrc/softlevel ]; }
then
RESTARTCMD='/sbin/rc-service -i $1 -- -Ds restart'
- elif [ -x /usr/sbin/invoke-rc.d ]; then
- RCDIR=/etc/init.d
- RESTARTCMD='
- if /usr/sbin/invoke-rc.d --quiet $1 status >/dev/null 2>&1
- then
- /usr/sbin/invoke-rc.d $1 restart
- fi'
elif [ -x /usr/bin/s6-rc ] && [ -x /usr/bin/s6-svc ]; then
RESTARTCMD='
if s6-rc -a list | grep -qFx $1-srv
then
s6-svc -r /run/service/$1-srv
fi'
- elif [ -x /sbin/service ]; then
- # Old RedHat
- RCDIR=/etc/init.d
- RESTARTCMD='
- if /sbin/service $1; then
- /sbin/service $1 restart
- fi'
- elif [ -x /usr/sbin/service ]; then
- # Could be FreeBSD
- RESTARTCMD="
- if /usr/sbin/service \$1 $status >/dev/null 2>&1
- then
- /usr/sbin/service \$1 restart
- fi"
elif [ -x /bin/sv ]; then
RESTARTCMD='/bin/sv status $1 >/dev/null 2>&1 &&
/bin/sv try-restart $1'
- elif [ -x /usr/bin/sv ]; then
- RESTARTCMD='/usr/bin/sv status $1 >/dev/null 2>&1 &&
- /usr/bin/sv try-restart $1'
- elif [ -e /etc/arch-release ] && [ -d /etc/rc.d ]; then
- RCDIR=/etc/rc.d
- RESTARTCMD='
- if [ -e /var/run/daemons/$1 ]
- then
- /etc/rc.d/$1 restart
- fi'
- elif [ -e /etc/slackware-version ] && [ -d /etc/rc.d ]; then
- RESTARTCMD='
- if /etc/rc.d/rc.$1 status >/dev/null 2>&1
- then
- /etc/rc.d/rc.$1 restart
- fi'
- elif [ -e /etc/rc.d/rc.subr ] && [ -d /etc/rc.d ]; then
- # OpenBSD
- RESTARTCMD='
- if /etc/rc.d/$1 check >/dev/null 2>&1
- then
- /etc/rc.d/$1 restart
- fi'
+ # TODO: Test if this works correctly.
+ elif [ -x /bin/s6-svc ] && [ -e /run/s6-rc ]; then
+ RESTARTCMD='/bin/s6-svc -r /run/service/$1'
elif [ -d /etc/dinit.d ] && command -v dinitctl >/dev/null 2>&1; then
RESTARTCMD='dinitctl --quiet restart --ignore-unstarted $1'
else

0 comments on commit c212b29

Please sign in to comment.