#!/usr/bin/env bash name='openrc' release='9' version='0.63' 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/nosuid.initd" "extras/disable-secondary-gpu.initd" "extras/disable-secondary-gpu.sh") depends=(libcap) makedepends=() sha256sums=('7b3e85813246acde1a562af2b5d34baab5a0e9c5575f86644ff03af84f0bf452' 'SKIP' '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,gid=31&/g" sh/init.sh.Linux.in # remove user service sed -i "/subdir('openrc-user')/d" src/meson.build } setup(){ meson setup build \ --sysconfdir=/etc \ --prefix=/usr \ -Ddefault_library=both \ -Dzsh-completions=true \ -Dbash-completions=true \ -Dpam=$(use_opt pam true false) \ -Dpkgconfig=true } build(){ ninja -C build } package(){ ninja -C build install # disable all services rm -f ${DESTDIR}/etc/runlevels/*/* rm ${DESTDIR}/etc/init.d/functions.sh ln -s ../../usr/libexec/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 # GID: uucp 14 # GID: proc 31 echo "uucp:x:14:" >> ${DESTDIR}/etc/group.d/openrc echo "proc:x:31:" >> ${DESTDIR}/etc/group.d/openrc echo "uucp:x:14:14:uucp:/var/spool/uucp:/bin/false" > ${DESTDIR}/etc/passwd.d/uucp # move /share to /usr/share mkdir -p ${DESTDIR}/usr ${DESTDIR}/sbin # 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/disable-secondary-gpu install ../backlight-restore.initd ${DESTDIR}/etc/init.d/backlight-restore install ../nosuid.initd ${DESTDIR}/etc/init.d/nosuid # systemd /proc/1/comm hack # move openrc-run as systemd path and symlink mkdir -p $DESTDIR/lib/systemd/ mv $DESTDIR/sbin/openrc-init $DESTDIR/lib/systemd/systemd ln -s ../lib/systemd/systemd $DESTDIR/sbin/openrc-init # remove user service stuff rm -f $DESTDIR/etc/init.d/user rm -f $DESTDIR/libexec/rc/sh/openrc-user.sh }