On 2007/10/07, Ulrich Mueller <[EMAIL PROTECTED]> wrote:
> Which leads me to the question: What is the recommended way to add a
> service to /etc/services?
FYI, attached is a list of ebuilds which touch /etc/services. I count
eight packages, which do it in either src_install, pkg_postinst, or
pkg_config. Plus a few ones with just some einfos about what should
be done by hand.
Maybe that's worth a small eclass, with a "useradd"-like function?
--
TGL.app-emacs/[EMAIL PROTECTED]
app-emacs/[EMAIL PROTECTED] elisp-site-file-install
${FILESDIR}/50lookup-gentoo.el
app-emacs/[EMAIL PROTECTED]
app-emacs/[EMAIL PROTECTED]:if ! $(grep 2010/tcp /etc/services >/dev/null
2>&1) ; then
app-emacs/[EMAIL PROTECTED]:cp /etc/services ${T}/services
app-emacs/[EMAIL PROTECTED] cat >>${T}/services<<-EOF
app-emacs/[EMAIL PROTECTED] ndtp2010/tcp
# Network Dictionary Transfer Protocol
app-emacs/[EMAIL PROTECTED] EOF
...
dev-db/[EMAIL PROTECTED]ln -s /var/log/firebird.log firebird.log
dev-db/[EMAIL PROTECTED]fi
dev-db/[EMAIL PROTECTED]
dev-db/[EMAIL PROTECTED]: # add gds_db to /etc/services
dev-db/[EMAIL PROTECTED]: if [ -z "`grep gds_db /etc/services`" ]
dev-db/[EMAIL PROTECTED]then
dev-db/[EMAIL PROTECTED]: echo -e "#\n#Service added for gds_db
(firebird)\n#" >> /etc/services
dev-db/[EMAIL PROTECTED]: echo "gds_db3050/tcp" >>
/etc/services
dev-db/[EMAIL PROTECTED]: einfo "added gds_db to /etc/services"
dev-db/[EMAIL PROTECTED]fi
dev-db/[EMAIL PROTECTED]
dev-db/[EMAIL PROTECTED]# if found /etc/isc4.gdb from previous install,
backup, and restore as
...
media-gfx/[EMAIL PROTECTED]() {
media-gfx/[EMAIL PROTECTED] # What follows is modified from rpm -qp
--scripts Maya6_5-6.5-253.i686.rpm
media-gfx/[EMAIL PROTECTED]:cp ${ROOT}/etc/services ${T}/services.maya_save
media-gfx/[EMAIL PROTECTED]:awk '/mi-ray/ { found++; print ; next } {print}
END {if (0==found) print "mi-ray 7003/tcp" }' ${T}/services.maya_save >
${ROOT}/etc/services
media-gfx/[EMAIL PROTECTED]
media-gfx/[EMAIL PROTECTED]:cp ${ROOT}/etc/services ${T}/services.maya_save
media-gfx/[EMAIL PROTECTED]:awk '/mi-raysat/ { found++; print ; next }
{print} END {if (0==found) print "mi-raysat 7103/tcp" }'
${T}/services.maya_save > ${ROOT}/etc/services
media-gfx/[EMAIL PROTECTED]
media-gfx/[EMAIL PROTECTED] # update the magic file
media-gfx/[EMAIL PROTECTED] if [[ -e ${ROOT}/usr/share/magic ]]; then
...
media-libs/[EMAIL PROTECTED]() {
media-libs/[EMAIL PROTECTED]make DESTDIR=${D} install || die
media-libs/[EMAIL PROTECTED]
media-libs/[EMAIL PROTECTED]: # Add to /etc/services
media-libs/[EMAIL PROTECTED]: if ! grep -q ^ladcca /etc/services; then
media-libs/[EMAIL PROTECTED]dodir /etc
media-libs/[EMAIL PROTECTED]insinto /etc
media-libs/[EMAIL PROTECTED]: doins /etc/services
media-libs/[EMAIL PROTECTED]: echo -e "\nladcca\t\t14541/tcp\t\t\t#
LADCCA client/server protocol" >> ${D}/etc/services
media-libs/[EMAIL PROTECTED]fi
media-libs/[EMAIL PROTECTED]
media-libs/[EMAIL PROTECTED]dodoc AUTHORS ChangeLog NEWS README TODO
...
media-libs/[EMAIL PROTECTED]() {
media-libs/[EMAIL PROTECTED]make DESTDIR=${D} install || die
media-libs/[EMAIL PROTECTED]
media-libs/[EMAIL PROTECTED]: # Add to /etc/services
media-libs/[EMAIL PROTECTED]: if ! grep -q ^ladcca /etc/services; then
media-libs/[EMAIL PROTECTED]dodir /etc
media-libs/[EMAIL PROTECTED]insinto /etc
media-libs/[EMAIL PROTECTED]: doins /etc/services
media-libs/[EMAIL PROTECTED]: echo -e "\nladcca\t\t14541/tcp\t\t\t#
LADCCA client/server protocol" >> ${D}/etc/services
media-libs/[EMAIL PROTECTED]fi
media-libs/[EMAIL PROTECTED]
media-libs/[EMAIL PROTECTED]dodoc AUTHORS ChangeLog NEWS README TODO
...
media-sound/[EMAIL PROTECTED]() {
media-sound/[EMAIL PROTECTED] make DESTDIR=${D} install || die
media-sound/[EMAIL PROTECTED]
media-sound/[EMAIL PROTECTED]: # Add to /etc/services
media-sound/[EMAIL PROTECTED]: if ! grep -q ^lash /etc/services; then
media-sound/[EMAIL PROTECTED] dodir /etc
media-sound/[EMAIL PROTECTED] insinto /etc
media-sound/[EMAIL PROTECTED]: doins /etc/services
media-sound/[EMAIL PROTECTED]: echo -e "\nlash\t\t14541/tcp\t\t\t#
LASH client/server protocol" >> ${D}/etc/services
media-sound/[EMAIL PROTECTED] fi
media-sound/[EMAIL PROTECTED]
media-sound/[EMAIL PROTECTED] dodoc AUTHORS ChangeLog NEWS README TODO
...
media-sound/[EMAIL PROTECTED]() {
media-sound/[EMAIL PROTECTED] make DESTDIR=${D} install || die
media-sound/[EMAIL PROTECTED]
media-sound/[EMAIL PROTECTED]: # Add to /etc/services
media-sound/[EMAIL PROTECTED]: if ! grep -q ^lash /etc/services; then
media-sound/[EMAIL PROTECTED] dodir /etc
media