82 lines
2.2 KiB
Bash
82 lines
2.2 KiB
Bash
#!/usr/bin/env bash
|
|
name='openrc'
|
|
release='4'
|
|
version='0.54'
|
|
url='https://github.com/OpenRC/openrc'
|
|
description='The OpenRC init system'
|
|
email='aliriza.keskin@pardus.org.tr'
|
|
maintainer='aliriza'
|
|
license=('GPLv3')
|
|
source=("https://github.com/OpenRC/openrc/archive/refs/tags/$version.zip"
|
|
"openrc.sysconf"
|
|
"reboot"
|
|
"poweroff"
|
|
"extras/backlight-restore.initd"
|
|
"extras/disable-secondary-gpu.initd"
|
|
"extras/disable-secondary-gpu.sh")
|
|
depends=()
|
|
makedepends=()
|
|
sha256sums=('ad808516cb9b9a6e031ac2faeef88214164db3b11d5659a542501491e48b298d'
|
|
'SKIP'
|
|
'SKIP'
|
|
'SKIP'
|
|
'SKIP'
|
|
'SKIP'
|
|
'SKIP')
|
|
group=(sys.apps)
|
|
uses=()
|
|
uses_extra=(pam)
|
|
pam_depends=(pam)
|
|
arch=('x86_64')
|
|
|
|
cd $name-$version
|
|
|
|
prepare(){
|
|
# hidepid=2 by default
|
|
sed -i "s/ proc \/proc/,hidepid=2&/g" sh/init.sh.Linux.in
|
|
}
|
|
|
|
setup(){
|
|
meson setup build \
|
|
--sysconfdir=/etc \
|
|
--prefix=/ \
|
|
-Ddefault_library=both \
|
|
-Dzsh-completions=true \
|
|
-Dbash-completions=true \
|
|
-Dpam=$(use_opt pam true false) \
|
|
-Dpkgconfig=true
|
|
}
|
|
|
|
build(){
|
|
ninja -C build
|
|
}
|
|
|
|
package(){
|
|
export DESTDIR=${DESTDIR}//
|
|
ninja -C build install
|
|
# disable all services
|
|
rm -f ${DESTDIR}/etc/runlevels/*/*
|
|
rm ${DESTDIR}//etc/init.d/functions.sh
|
|
ln -s ../../lib/rc/sh/functions.sh ${DESTDIR}/etc/init.d/functions.sh
|
|
# install sysconf script
|
|
mkdir -p ${DESTDIR}/etc/sysconf.d/
|
|
install ../openrc.sysconf ${DESTDIR}/etc/sysconf.d/openrc
|
|
mkdir -p ${DESTDIR}/etc/group.d
|
|
mkdir -p ${DESTDIR}/etc/passwd.d
|
|
echo "uucp:x:14:" > ${DESTDIR}/etc/group.d/uucp
|
|
echo "uucp:x:10:14:uucp:/var/spool/uucp:/bin/false" > ${DESTDIR}/etc/passwd.d/uucp
|
|
# move /share to /usr/share
|
|
mkdir -p ${DESTDIR}/usr ${DESTDIR}/sbin
|
|
mv ${DESTDIR}/{,usr}/share
|
|
# reboot and poweroff script
|
|
install ../reboot ${DESTDIR}/sbin/reboot
|
|
install ../poweroff ${DESTDIR}/sbin/poweroff
|
|
ln -s openrc-shutdown ${DESTDIR}/sbin/shutdown
|
|
# install extras
|
|
mkdir -p ${DESTDIR}/usr/libexec
|
|
install ../disable-secondary-gpu.sh ${DESTDIR}/usr/libexec/disable-secondary-gpu
|
|
install ../disable-secondary-gpu.initd ${DESTDIR}/etc/init.d
|
|
install ../backlight-restore.initd ${DESTDIR}/etc/init.d
|
|
}
|
|
|