From 9bacd04eb0ca33dbcfd4aa1ce74faa04136c5a85 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 19 Aug 2018 15:51:26 -0400 Subject: pcr/openrc: Upgrade 0.38.{1→2}, improve packaging MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Use git signed commits to get the source - /etc/conf.d/agetty: * Don't set term_type=linux (that's the default anyway) * Don't set agetty_options="" (that's the default anyway) - Split the package in build(): * Move /usr/lib/rc/bin/{shutdown,reboot,halt,poweroff} files openrc→openrc-init * Move the openrc-shutdown(8) and openrc-init(8) files openrc→openrc-init * Move the base 'agetty' service openrc-init→openrc - package_openrc(): * Don't mention Gentoo in pkgdesc, OpenRC is now separate fron Gentoo * Holy cow, there were a bunch of files that should have been listed in backup=() * Don't create /usr/lib/openrc/cache: 1. it was removed by options=('!emptydirs') anyway 2. we set LIBEXECDIR=/usr/lib/rc, not =/usr/lib/openrc; it was at the wrong location anyway 3. init.d/savecache creates it at runtime, we don't need to create it - package_openrc-init(): * Mention the conf.d/agetty.tty* files in backup=() * Include the LICENSE file * Replace the conf.d/agetty.tty$X copies of conf.d/agetty with a file containing a comment noting that it inherits from the conf.d/agetty file. --- pcr/openrc/PKGBUILD | 121 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 70 insertions(+), 51 deletions(-) (limited to 'pcr') diff --git a/pcr/openrc/PKGBUILD b/pcr/openrc/PKGBUILD index f5b66d8b9..4597d663d 100644 --- a/pcr/openrc/PKGBUILD +++ b/pcr/openrc/PKGBUILD @@ -12,15 +12,17 @@ pkgbase=openrc pkgname=('openrc' 'openrc-init' 'openrc-sysvinit') -pkgver=0.38.1 +pkgver=0.38.2 pkgrel=1 arch=('i686' 'x86_64' 'armv7h') url="https://github.com/OpenRC/" license=('BSD2') options=('!emptydirs') -source=("${pkgbase}-${pkgver}.tar.gz::https://github.com/OpenRC/openrc/archive/${pkgver}.tar.gz" +makedepends=('git') +validpgpkeys=('D57AEC44668E2E5073A440096E5416F430C46538') # William Hubbs +source=("git+https://github.com/OpenRC/openrc?signed#tag=${pkgver}" "${pkgbase}.logrotate") -sha512sums=('3fc4fef60e25ae34039753c3de6471baba89a7ffcd25f6756cf00954ab63262d07c749441a53198099678e5769c9547179074152872aebc66fe7a220d0302804' +sha512sums=('SKIP' '690612fddfb2c4cf8f6b5ba7239b9faf29eb3d9b152ab4dcf62694aa2852780440d08cee56d98a9597607f446b3697c911269562821a8402bb5747cbbae34bd9') _makeargs=( @@ -37,51 +39,71 @@ _makeargs=( ) build(){ - cd "${srcdir}/${pkgbase}-${pkgver}" + cd "$srcdir/$pkgbase" make "${_makeargs[@]}" + + # Go ahead and split the package now + rm -rf "$srcdir/dest" + + # Put things in the main openrc package by default + make DESTDIR="$srcdir/dest/openrc" "${_makeargs[@]}" install + + for file in \ + {usr,usr/lib/rc}/bin/shutdown \ + {usr,usr/lib/rc}/bin/reboot \ + {usr,usr/lib/rc}/bin/halt \ + {usr,usr/lib/rc}/bin/poweroff \ + usr/bin/openrc-shutdown \ + usr/bin/openrc-init \ + usr/bin/init \ + usr/share/man/man8/openrc-shutdown.8 \ + usr/share/man/man8/openrc-init.8 + do + install -d -- "$srcdir/dest/openrc-init/${file%/*}" + mv -T -- "$srcdir"/dest/{openrc,openrc-init}/"$file" + done } package_openrc() { - pkgdesc="Gentoo's universal init system" + pkgdesc="A dependency based init system" groups=('base-openrc') depends=('psmisc' 'pam' 'openrc-pid1') optdepends=('netifrc: Network Interface Management Scripts' 'networkmanager-openrc: NetworkManager') - backup=('etc/rc.conf' + backup=('etc/conf.d/agetty' + 'etc/conf.d/bootmisc' 'etc/conf.d/consolefont' - 'etc/conf.d/keymaps' + 'etc/conf.d/devfs' + 'etc/conf.d/dmesg' + 'etc/conf.d/fsck' 'etc/conf.d/hostname' - 'etc/conf.d/modules' 'etc/conf.d/hwclock' - etc/conf.d/agetty.tty{1,2,3,4,5,6}) + 'etc/conf.d/keymaps' + 'etc/conf.d/killprocs' + 'etc/conf.d/localmount' + 'etc/conf.d/modules' + 'etc/conf.d/mtab' + 'etc/conf.d/net-online' + 'etc/conf.d/netmount' + 'etc/conf.d/swap' + 'etc/conf.d/urandom' + 'etc/logrotate.d/openrc' + 'etc/pam.d/start-stop-daemon' + 'etc/pam.d/supervise-daemon' + 'etc/rc.conf') - cd "${srcdir}/${pkgbase}-${pkgver}" - - make DESTDIR="${pkgdir}" "${_makeargs[@]}" install - - install -Dm644 "${srcdir}/${pkgbase}.logrotate" "${pkgdir}/etc/logrotate.d/${pkgbase}" + cp -rT -d --no-preserve=ownership,timestamp "$srcdir/dest/$pkgname" "$pkgdir" + # Configuration 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/openrc/cache - - # getty + -i "$pkgdir/etc/rc.conf" sed -e 's|#baud=""|baud="38400"|' \ - -e 's|#term_type="linux"|term_type="linux"|' \ - -e 's|#agetty_options=""|agetty_options=""|' \ - -i ${pkgdir}/etc/conf.d/agetty + -i "$pkgdir"/etc/conf.d/agetty + install -Dm644 "$srcdir/${pkgbase}.logrotate" "$pkgdir/etc/logrotate.d/${pkgbase}" - # 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 openrc-shutdown; 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 + # License + install -Dm644 "$srcdir/$pkgbase/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE" } package_openrc-sysvinit() { @@ -91,9 +113,9 @@ package_openrc-sysvinit() { conflicts=('openrc-pid1' 'initscripts') backup=('etc/inittab') - cd "${srcdir}/${pkgbase}-${pkgver}" - install -Dm644 LICENSE "$pkgdir/usr/share/licenses/${pkgname}/LICENSE" - install -Dm644 support/sysvinit/inittab "${pkgdir}/etc/inittab" + cd "$srcdir/$pkgbase" + install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" + install -Dm644 support/sysvinit/inittab "$pkgdir/etc/inittab" } package_openrc-init() { @@ -102,24 +124,21 @@ package_openrc-init() { depends=('openrc') provides=('openrc-pid1' 'init') conflicts=('openrc-pid1' 'init') - - cd ${srcdir} - install -d ${pkgdir}/usr/bin/ \ - -d ${pkgdir}/etc/conf.d/ \ - -d ${pkgdir}/etc/init.d/ \ - -d ${pkgdir}/etc/runlevels/default/ + backup=('etc/conf.d/agetty'.tty{1..6}) - local bin - for bin in shutdown reboot halt poweroff openrc-init init openrc-shutdown; 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 + cp -rT -d --no-preserve=ownership,timestamp "$srcdir/dest/$pkgname" "$pkgdir" + + # Enable agetty.tty{1..6} by default + install -d "$pkgdir"/etc/conf.d/ \ + "$pkgdir"/etc/init.d/ \ + "$pkgdir"/etc/runlevels/default/ + local num + for num in {1..6}; do + echo "# This file inherits from '/etc/conf.d/agetty'" > "$pkgdir/etc/conf.d/agetty.tty$num" + ln -sT agetty "$pkgdir/etc/init.d/agetty.tty$num" + ln -sT "/etc/init.d/agetty.tty$num" "$pkgdir/etc/runlevels/default/agetty.tty$num" done + # License + install -Dm644 "$srcdir/$pkgbase/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE" } -- cgit v1.2.3