From c799f6ae2ec796e75d399028736c9d70c021dcd7 Mon Sep 17 00:00:00 2001 From: David P Date: Sat, 18 Nov 2017 15:35:46 -0300 Subject: Add runit & update openrc openrc-init has been packaged separately from the openrc package for OpenRC to gain compatibility with other init systems. As of now there's runit and openrc-init which provide and conflict 'init', meaning that those packages have a /sbin/init binary or symlink. Packages which provide 'init' will also go to the 'init' group. Note, however, that if attempting to install that package group all the packages will conflict, so purpose of it is to simply do 'pacman -Sg init' to see a list of the available inits. --- pcr/openrc/PKGBUILD | 110 ++++++++++++++++++++++++++++++++++------------------ 1 file changed, 72 insertions(+), 38 deletions(-) (limited to 'pcr/openrc/PKGBUILD') diff --git a/pcr/openrc/PKGBUILD b/pcr/openrc/PKGBUILD index dd3bfb97e..e33a1cbba 100644 --- a/pcr/openrc/PKGBUILD +++ b/pcr/openrc/PKGBUILD @@ -2,36 +2,22 @@ # Contributor (Artix): williamh # Maintainer: Omar Vega Ramos -_url="https://github.com/OpenRC/openrc/archive" - -pkgname=openrc -pkgver=0.34.3 -pkgrel=1.parabola1 -pkgdesc="Gentoo's universal init system" +pkgbase=openrc +pkgname=('openrc' 'openrc-init') +pkgver=0.34.8 +pkgrel=1.parabola3 arch=('i686' 'x86_64' 'armv7h') url="https://wiki.gentoo.org/wiki/Project:OpenRC" license=('BSD2') -depends=('psmisc' 'pam') -optdepends=('netifrc: Network Interface Management Scripts' - 'networkmanager-openrc: NetworkManager') -conflicts=('systemd-sysvcompat' 'sysvinit') -replaces=('sysvinit') -install=${pkgname}.install -backup=('etc/rc.conf' - 'etc/conf.d/consolefont' - 'etc/conf.d/keymaps' - 'etc/conf.d/hostname' - 'etc/conf.d/modules' - 'etc/conf.d/hwclock') options=('!emptydirs') -source=("${pkgname}-${pkgver}.tar.gz::${_url}/${pkgver}.tar.gz" - "${pkgname}.logrotate" +source=("${pkgbase}-${pkgver}.tar.gz::https://github.com/OpenRC/openrc/archive/${pkgver}.tar.gz" + "${pkgbase}.logrotate" 'openrc-install.hook' 'openrc-remove.hook') -sha256sums=('8e4c1f99727b7b91766fcd65e0a303240528bf0cb123a65e33adc904c67bf2bd' - '0b44210db9770588bd491cd6c0ac9412d99124c6be4c9d3f7d31ec8746072f5c' - '1d4d31a7275660e7b23778e6fceb0714cab8ed2793b04aa004b01d8e7bcd43bd' - 'cbb4d00262a55a508114cb31e3903350be2cff748a4fb5e120dc745292e3987e') +sha512sums=('2309e0d330c35467dd6008f1458ac9680207a4c783d4f4e6008a84a313088cfe796dd134dfec79699b8f9c90002b0ae621bb78a9925b987ae98fbd8ad75b947a' + '690612fddfb2c4cf8f6b5ba7239b9faf29eb3d9b152ab4dcf62694aa2852780440d08cee56d98a9597607f446b3697c911269562821a8402bb5747cbbae34bd9' + 'c31c94574f1c604930b572ed74eabdfcbedb344c54668ddeb3214d71de660e9fa8ff445b04ff817f16e62bce43376680d0a1b6c65baa8f6dba30e4ffa230c04a' + '96bd71dd4fbe1417a640ac7526e83e1b2290732d5e558d7942c87db0dc1ccb7614763d7748b219ac5982b0db66cba9c124506ec939a661d73db4d0b2642f431e') _args=( SYSCONFDIR=/etc @@ -43,32 +29,50 @@ _args=( MKTERMCAP=ncurses MKNET=no MKSYSVINIT=yes - BRANDING='Parabola' ) +if [ -f /usr/lib/os-release ]; then + . /usr/lib/os-release + _args+=(BRANDING="${NAME}") +else + _args+=(BRANDING='Unknown GNU/Linux') +fi + prepare(){ - cd "${srcdir}/${pkgname}-${pkgver}" + cd "${srcdir}/${pkgbase}-${pkgver}" sed -e "s|/sbin|/usr/bin|g" -i support/sysvinit/inittab sed -i 's:0444:0644:' mk/sys.mk } build(){ - cd "${srcdir}/${pkgname}-${pkgver}" + cd "${srcdir}/${pkgbase}-${pkgver}" make "${_args[@]}" } -package() { - cd "${srcdir}/${pkgname}-${pkgver}" +package_openrc() { + pkgdesc="Gentoo's universal init system" + install=${pkgbase}.install + depends=('psmisc' 'pam' 'init') + optdepends=('netifrc: Network Interface Management Scripts' + 'networkmanager-openrc: NetworkManager') + backup=('etc/rc.conf' + 'etc/conf.d/consolefont' + 'etc/conf.d/keymaps' + 'etc/conf.d/hostname' + 'etc/conf.d/modules' + 'etc/conf.d/hwclock') + + cd "${srcdir}/${pkgbase}-${pkgver}" make DESTDIR="${pkgdir}" "${_args[@]}" install - install -Dm644 "${srcdir}/${pkgname}.logrotate" "${pkgdir}/etc/logrotate.d/${pkgname}" + install -Dm644 "${srcdir}/${pkgbase}.logrotate" "${pkgdir}/etc/logrotate.d/${pkgbase}" sed -e 's/#unicode="NO"/unicode="YES"/' \ -e 's/#rc_logger="NO"/rc_logger="YES"/' \ -i "${pkgdir}/etc/rc.conf" - install -d ${pkgdir}/usr/lib/rc/cache + install -d ${pkgdir}/usr/lib/openrc/cache # getty sed -e 's|#baud=""|baud="38400"|' \ @@ -76,17 +80,47 @@ package() { -e 's|#agetty_options=""|agetty_options=""|' \ -i ${pkgdir}/etc/conf.d/agetty - for num in 1 2 3 4 5 6;do - cp -v ${pkgdir}/etc/conf.d/agetty ${pkgdir}/etc/conf.d/agetty.tty$num - ln -sf /etc/init.d/agetty ${pkgdir}/etc/init.d/agetty.tty$num - ln -sf /etc/init.d/agetty.tty$num ${pkgdir}/etc/runlevels/default/agetty.tty$num - done - # alpm hooks for h in openrc-{install,remove}.hook;do install -Dm644 ${srcdir}/$h ${pkgdir}/usr/share/libalpm/hooks/$h done # license - install -Dm644 ${srcdir}/${pkgname}-${pkgver}/LICENSE "$pkgdir/usr/share/licenses/${pkgname}/LICENSE" + install -Dm644 ${srcdir}/${pkgbase}-${pkgver}/LICENSE "$pkgdir/usr/share/licenses/${pkgbase}/LICENSE" + + # move these to $srcdir + for bin in shutdown reboot halt poweroff openrc-init init; do + mv -v ${pkgdir}/usr/bin/${bin} ${srcdir}/${bin} + done + mv -v ${pkgdir}/etc/conf.d/agetty ${srcdir}/agetty.confd + mv -v ${pkgdir}/etc/init.d/agetty ${srcdir}/agetty.initd +} + +package_openrc-init() { + pkgdesc="OpenRC replacement for /sbin/init" + depends=('openrc') + provides=('init') + groups=('init') + conflicts=('systemd-sysvcompat' 'sysvinit' 'init') + replaces=('sysvinit') + install=${pkgbase}-init.install + + cd ${srcdir} + install -d ${pkgdir}/usr/bin/ \ + -d ${pkgdir}/etc/conf.d/ \ + -d ${pkgdir}/etc/init.d/ \ + -d ${pkgdir}/etc/runlevels/default/ + + for bin in shutdown reboot halt poweroff openrc-init init; do + mv -v ${bin} ${pkgdir}/usr/bin/${bin} + done + + mv -v agetty.confd ${pkgdir}/etc/conf.d/agetty + mv -v agetty.initd ${pkgdir}/etc/init.d/agetty + for num in 1 2 3 4 5 6;do + cp -v ${pkgdir}/etc/conf.d/agetty ${pkgdir}/etc/conf.d/agetty.tty$num + ln -sf /etc/init.d/agetty ${pkgdir}/etc/init.d/agetty.tty$num + ln -sf /etc/init.d/agetty.tty$num ${pkgdir}/etc/runlevels/default/agetty.tty$num + done + } -- cgit v1.2.3