Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

FL-832: bring back libenfo library to openrc, it is still used by pac…

…kages.
  • Loading branch information...
commit 0c2b07a9e958f8eb32d2cdb15b1f31d7dddc565b 1 parent afa706d
@angryvincent angryvincent authored
Showing with 231 additions and 0 deletions.
  1. +1 −0  sys-apps/openrc/Manifest
  2. +230 −0 sys-apps/openrc/openrc-0.12.1-r1.ebuild
View
1  sys-apps/openrc/Manifest
@@ -7,4 +7,5 @@ DIST openrc-funtoo-openrc-0.10.2-r4.tar.gz 214794 SHA256 f134da20ea689b4fff938a4
DIST openrc-funtoo-openrc-0.10.2-r7.tar.gz 214846 SHA256 71c1663eb0f2cd0593d634123ee47f2bc1fcfeca2bfbbd694ed2a5f2e4fc2970 SHA512 2992108fde145e5221a435456bc1e4f7357d04a8c97e40ad7d10ae51ed7457a58eff8f16ebf14dc3a04e880778e9ce27a8e19b53d87b4de4b2db37311d9f86ef WHIRLPOOL 21679d721f7c9690e245b076d531c6bbad558195fb274dac96e0512642d37a75c3f622ccfdc3b06179ff50fa72566d7a6f48a4ba669eb349afc6c8f8b13c4415
DIST openrc-funtoo-openrc-0.10.3.tar.gz 215104 SHA256 4dbcdf207b23ec54bb97c83890c0926d75b512a64559946bc40765fc1dd79a8b SHA512 ea11dfc24ae7cb0c3b4bab775f5d95bae59ac67f9fe5f1ce312410032a9f6554a944ede9f886bad48986edff4405ebd5234e87e624e06aec137aaad460fec6e3 WHIRLPOOL 010722504d91ed05e3d6d20235386b3d0be085157e5e3742c4ee5c1c346dba3a4d7c2e6749f62008918202bb0ec05b533088e448964f6e5226c44f1c12db65c8
DIST openrc-funtoo-openrc-0.12-r2.tar.gz 167041 SHA256 f210a55697efa1307200b26d18d07b35f162d16f99c1ee3b3c396b293955fd78 SHA512 b0abcf1add48a9166e2e456f2748fc42bd59497216b7d5d16904b41fb3f40f46559a6b60a757909dc7b059ec6f5dc759e08798d413d81a78d183e5d29522b898 WHIRLPOOL 3a5c19f3d19156208219ee44cf806b42d3d91ce6a98bbf5418283495eae460640d0135ba824e857d97e8ad1c8429550b27394ebe9e8a12dbce336ce50a99ceed
+DIST openrc-funtoo-openrc-0.12.1-r0.tar.gz 167052 SHA256 3853f858cc318c20f8bde1a183d5b3f7264ceea03d1a0ba8f9f091ee6b1d440e SHA512 3bdc28aeeb9f9e47002e96e2fd5c1f47eb79f43756404fbd7cce2d23b17975d9516df0bf868a24be4b54ecc0b51a97b23fbb4434673fcefee256e495ddd650dc WHIRLPOOL c9164a768084887f3c56f8d86973e4b7b086f5bce042c3c8baf6ab1586d7d369c0fc08772f00db8dd6d7a46957af1942265de8cafcf8789ec7efa5d81031b8d7
DIST openrc-funtoo-openrc-0.12.1.tar.gz 164787 SHA256 b61c2cef7359982e8a74d269135ba95a115ad703d927e68a1933e0790a56b475 SHA512 4a766c461b76465fc5750bc05a7c6aa7bf1d59667653d3edff03177676ac223103e4193904b0f77f3f5fb5cd16d00e721493f861fa75d385f56b454aea865081 WHIRLPOOL 681f31dc6586aada74e4369696f0cdf4cbbabb2ecd5dab34cc4e47f9fb9d77dc8d3101f0558ae7f5ec66c01c3ef1b047ac8545388386e325046e843c3d85aeaa
View
230 sys-apps/openrc/openrc-0.12.1-r1.ebuild
@@ -0,0 +1,230 @@
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils flag-o-matic multilib pam toolchain-funcs
+
+DESCRIPTION="OpenRC manages the services, startup and shutdown of a host"
+HOMEPAGE="http://roy.marples.name/openrc"
+RESTRICT="mirror"
+
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="*"
+IUSE="debug elibc_glibc ncurses pam selinux static-libs unicode kernel_linux kernel_FreeBSD"
+
+RDEPEND="kernel_linux? ( >=sys-apps/sysvinit-2.86-r11 )
+ kernel_FreeBSD? ( sys-process/fuser-bsd )
+ pam? ( virtual/pam )
+ >=sys-apps/baselayout-2.2
+ sys-apps/iproute2"
+
+DEPEND="ncurses? ( sys-libs/ncurses ) pam? ( virtual/pam ) virtual/os-headers virtual/pkgconfig"
+
+GITHUB_REPO="${PN}"
+GITHUB_USER="funtoo"
+GITHUB_TAG="funtoo-openrc-0.12.1-r0"
+NETV="1.3.6"
+GITHUB_REPO_CN="corenetwork"
+GITHUB_TAG_CN="$NETV"
+
+SRC_URI="
+ https://www.github.com/${GITHUB_USER}/${GITHUB_REPO}/tarball/${GITHUB_TAG} -> ${PN}-${GITHUB_TAG}.tar.gz
+ https://www.github.com/${GITHUB_USER}/${GITHUB_REPO_CN}/tarball/${GITHUB_TAG_CN} -> corenetwork-${NETV}.tar.gz
+ "
+
+make_args() {
+ unset LIBDIR #266688
+
+ MAKE_ARGS="${MAKE_ARGS} LIBNAME=$(get_libdir) LIBEXECDIR=/$(get_libdir)/rc MKNET=no"
+
+ local brand="Unknown"
+ if use kernel_linux ; then
+ MAKE_ARGS="${MAKE_ARGS} OS=Linux"
+ brand="Linux"
+ elif use kernel_FreeBSD ; then
+ MAKE_ARGS="${MAKE_ARGS} OS=FreeBSD"
+ brand="FreeBSD"
+ fi
+ if use selinux; then
+ MAKE_ARGS="${MAKE_ARGS} MKSELINUX=yes"
+ fi
+ export BRANDING="Funtoo ${brand}"
+ if ! use static-libs; then
+ MAKE_ARGS="${MAKE_ARGS} MKSTATICLIBS=no"
+ fi
+}
+
+pkg_setup() {
+ export DEBUG=$(usev debug)
+ export MKPAM=$(usev pam)
+ export MKTERMCAP=$(usev ncurses)
+}
+
+src_unpack() {
+ unpack $A
+ # rename github directories to the names we're expecting:
+ local old=${WORKDIR}/${GITHUB_USER}-${PN}-*
+ mv $old "${WORKDIR}/${P}" || die "move fail 1"
+ old="${WORKDIR}/${GITHUB_USER}-corenetwork-*"
+ mv $old "${WORKDIR}/corenetwork-${NETV}" || die "move fail 2"
+}
+
+src_prepare() {
+ sed -i 's:0444:0644:' mk/sys.mk || die
+
+ if [[ ${PV} == "9999" ]] ; then
+ local ver="git-${EGIT_VERSION:0:6}"
+ sed -i "/^GITVER[[:space:]]*=/s:=.*:=${ver}:" mk/git.mk || die
+ fi
+ ##epatch "${FILESDIR}/openrc-nodevfs.patch"
+}
+src_compile() {
+ make_args
+
+ tc-export CC AR RANLIB
+ emake ${MAKE_ARGS}
+}
+
+# set_config <file> <option name> <yes value> <no value> test
+# a value of "#" will just comment out the option
+set_config() {
+ local file="${D}/$1" var=$2 val com
+ eval "${@:5}" && val=$3 || val=$4
+ [[ ${val} == "#" ]] && com="#" && val='\2'
+ sed -i -r -e "/^#?${var}=/{s:=([\"'])?([^ ]*)\1?:=\1${val}\1:;s:^#?:${com}:}" "${file}"
+}
+
+set_config_yes_no() {
+ set_config "$1" "$2" YES NO "${@:3}"
+}
+
+src_install() {
+ make_args
+ emake ${MAKE_ARGS} DESTDIR="${D}" install
+
+ # move the shared libs back to /usr so ldscript can install
+ # more of a minimal set of files
+ # disabled for now due to #270646
+ #mv "${D}"/$(get_libdir)/lib{einfo,rc}* "${D}"/usr/$(get_libdir)/ || die
+ #gen_usr_ldscript -a einfo rc
+ gen_usr_ldscript libeinfo.so
+ gen_usr_ldscript librc.so
+
+ if ! use kernel_linux; then
+ keepdir /$(get_libdir)/rc/init.d
+ fi
+ keepdir /$(get_libdir)/rc/tmp
+
+ # Backup our default runlevels
+ dodir /usr/share/"${PN}"
+ cp -PR "${D}"/etc/runlevels "${D}"/usr/share/${PN} || die
+ rm -rf "${D}"/etc/runlevels
+
+ # Setup unicode defaults for silly unicode users
+ set_config_yes_no /etc/rc.conf unicode use unicode
+
+ # Cater to the norm
+ set_config_yes_no /etc/conf.d/keymaps windowkeys '(' use x86 '||' use amd64 ')'
+
+ # On HPPA, do not run consolefont by default (bug #222889)
+ if use hppa; then
+ rm -f "${D}"/usr/share/openrc/runlevels/boot/consolefont
+ fi
+
+ # Support for logfile rotation
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/openrc.logrotate openrc
+
+ # install the gentoo pam.d file
+ newpamd "${FILESDIR}"/start-stop-daemon.pam start-stop-daemon
+
+ # Install funtoo networking parts:
+
+ cd ${WORKDIR}/corenetwork-${NETV} || die
+ dodoc docs/index.rst || die
+ exeinto /etc/init.d || die
+ doexe init.d/{netif.tmpl,netif.lo} || die
+ cp -a netif.d ${D}/etc || die
+ chown -R root:root ${D}/etc/netif.d || die
+ chmod 0755 ${D}/etc/netif.d || die
+ chmod -R 0644 ${D}/etc/netif.d/* || die
+ ln -s /etc/init.d/netif.lo ${D}/usr/share/openrc/runlevels/sysinit/netif.lo || die
+}
+
+add_init() {
+ local runl=$1
+ shift
+ if [ ! -e ${ROOT}/etc/runlevels/${runl} ]
+ then
+ install -d -m0755 ${ROOT}/etc/runlevels/${runl}
+ fi
+ for initd in $*
+ do
+ [[ -e ${ROOT}/etc/runlevels/${runl}/${initd} ]] && continue
+ elog "Auto-adding '${initd}' service to your ${runl} runlevel"
+ ln -snf /etc/init.d/${initd} "${ROOT}"/etc/runlevels/${runl}/${initd}
+ done
+}
+
+pkg_postinst() {
+ local runl
+ install -d -m0755 ${ROOT}/etc/runlevels
+ local runldir="${ROOT}usr/share/openrc/runlevels"
+
+ # Remove old baselayout links
+ rm -f "${ROOT}"/etc/runlevels/boot/{check{fs,root},rmnologin}
+ rm -f "${ROOT}"/etc/init.d/{depscan,runscript}.sh
+ rm -f "${ROOT}"/etc/runlevels/boot/netif.lo
+
+ # CREATE RUNLEVEL DIRECTORIES
+ # ===========================
+
+ # To ensure proper system operation, this portion of the script ensures that
+ # all of OpenRC's default initscripts in all runlevels are properly
+ # installed.
+
+ for runl in $( cd "$runldir"; echo * )
+ do
+ einfo "Processing $runl..."
+ einfo "Ensuring runlevel $runl has all required scripts..."
+ add_init $runl $( cd "$runldir/$runl"; echo * )
+ done
+
+ # Rather than try to migrate everyone using complex scripts, simply print
+ # names of initscripts that are in the user's runlevels but not provided by
+ # OpenRC. This loop can be upgraded to look for particular scripts that
+ # might have come from baselayout.
+
+ for runl in $( cd ${ROOT}/etc/runlevels; echo * )
+ do
+ [ ! -d ${runldir}/${runl} ] && continue
+ for init in $( cd "$runldir/$runl"; echo * )
+ do
+ if [ -e ${ROOT}/etc/runlevels/${runl}/${init} ] && [ ! -e ${runldir}/${runl}/${init} ]
+ then
+ echo "Initscript ${init} exists in runlevel ${runl} but not in OpenRC."
+ fi
+ done
+ done
+
+ chmod +x ${ROOT}/etc/netif.d
+
+ # OTHER STUFF
+ # ===========
+
+ # update the dependency tree bug #224171
+ [[ "${ROOT}" = "/" ]] && "${ROOT}/$(get_libdir)"/rc/bin/rc-depend -u
+
+ elog "You should now update all files in /etc, using etc-update"
+ elog "or equivalent before rebooting."
+ elog
+
+ if path_exists -o "${ROOT}"/etc/conf.d/local.{start,stop} ; then
+ ewarn "/etc/conf.d/local.{start,stop} are deprecated. Please convert"
+ ewarn "your files to /etc/conf.d/local and delete the files."
+ fi
+
+ ewarn "Make sure that correct symlink exist"
+ ewarn "Re-establish it by ln -s /etc/init.d/netif.tmpl /etc/init.d/netif.ethX"
+}
Please sign in to comment.
Something went wrong with that request. Please try again.