Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 43657 Details for
Bug 58106
baselayout virtual needed for macos
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
darwin-initd.eclass
darwin-initd.eclass (text/plain), 3.35 KB, created by
Mamoru KOMACHI (RETIRED)
on 2004-11-10 07:20:48 UTC
(
hide
)
Description:
darwin-initd.eclass
Filename:
MIME Type:
Creator:
Mamoru KOMACHI (RETIRED)
Created:
2004-11-10 07:20:48 UTC
Size:
3.35 KB
patch
obsolete
># Copyright 1999-2004 Gentoo Foundation ># Distributed under the terms of the GNU General Public License v2 ># $Header: /var/cvsroot/gentoo-x86/eclass/x11.eclass,v 1.3 2004/10/29 07:11:35 spyderous Exp $ ># ># Author: Mamoru KOMACHI <usata@gentoo.org> ># ># The darwin-daemon.eclass is designed to convert Gentoo init.d scripts ># into Mac OS X compatible format. It should be called from src_install() ># and will create necessary files in /Library/System/StartupItems. ># > ># External function: ># register-StartupItems ># Internal functions: ># create-plist ># convert-initd ># parse-Items ># map-Items ># fakeuse ># fakeneed > >ECLASS=darwin-initd >INHERITED="${INHERITED} ${ECLASS}" > >EXPORT_FUNCTIONS register-StartupItems > ># ># Register StartupItems: ># ># register-StartupItems [StartupItem [init.d]] ># >register-StartupItems() { > if [ -n "$1" ] ; then > local StartupItem="$1" > fi > if [ -n "$2" ] ; then > local INITD="$2" > fi > : ${StartupItem:=${PN}} > : ${INITD:=/etc/init.d/${PN}} > > local StartupItemsDir=${D}/Library/StartupItems/${StartupItem} > mkdir -p ${StartupItemsDir} || die "mkdir failed" > > create-plist "${INITD}" "${StartupItem}" > ${StartupItemsDir}/StartupParameters.plist || die "creating StartupParameters.plist failed" > convert-initd "${INITD}" > ${StartupItemsDir}/${StartupItem} || die "creating Service failed" > chmod +x ${StartupItemsDir}/${StartupItem} || die "chmod failed" >} > ># ># Function to create StartupParameters.plist ># ># create-plist path_to_init.d_script StartupItem ># >create-plist() { > local INITD="$1" > local StartupItem="$2" > alias use=fakeuse > alias need=fakeneed > cat <<EOH >/* Copyright 1999-2004 Gentoo Foundation > * Distributed under the terms of GNU General Public License v2 > */ >EOH > if [ -e "${D}/${INITD}" ] ; then > source "${D}${INITD}" > else > ewarn > ewarn "${INITD} not found. Perhaps you forgot to specify correct path?" > ewarn > fi > > echo "{" > echo " Description = \"${DESCRIPTION}\";" > echo " Provides = (\"${StartupItem}\");" > depend > echo " OrderPreference = \"None\";" > echo "}" > unalias use need >} > ># ># Function to convert Gentoo init.d to StartupItems compat ># ># convert-initd path_to_init.d_script ># >convert-initd() { > INITD="$1" > cat <<EOH >#!/bin/sh ># Copyright 1999-2004 Gentoo Foundation ># Distributed under the terms of the GNU General Public License v2 > >## ># ${DESCRIPTION} >## > >. /etc/rc.common > >StartService () >{ > ${INITD} start >} > >StopService () >{ > ${INITD} stop >} > >RestartService () >{ > ${INITD} restart >} > >RunService "\$1" >EOH >} > ># ># Fake routine to parse depend() ># >fakeneed() { > echo -n " Requires = " > parse-Items "$@" > echo ";" >} > ># ># Fake routine to parse depend() ># >fakeuse() { > echo -n " Uses = " > parse-Items "$@" > echo ";" >} > ># ># parse StartupItems entry: ># ># parse-Items foo -> ("foo") ># parse-Items foo bar -> ("foo", "bar") ># >parse-Items() { > echo -n "(" > while [ "$#" -gt 1 ] ; do > echo -n "\"$(map-Items $1)\", " > shift > done > echo -n "\"$(map-Items $1)\"" > echo -n ")" >} > ># ># Function to map Gentoo init.d naming convension to Mac OS X ># StartupItems naming convension ># >map-Items() { > local gen2mac sedlist > > # one line for one map > gen2mac="net Network > logger System Log > netmount NFS > dns Resolver > portmap Portmap > ypserv NIS > domainname Network Configuration" > > echo "$gen2mac" | while read gen mac ; do > sedlist="${sedlist} s:^${gen}\$:${mac}: >" > done > > if [ "$#" -eq 0 ] ; then > sed -e "{ $sedlist }" > else > echo "$@" | sed -e "{ $sedlist }" > fi >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 58106
: 43657 |
49123