Magellan Linux

Contents of /smage/trunk/core/nss-myhostname/nss-myhostname-0.3-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4161 - (show annotations) (download)
Wed Nov 7 14:41:30 2012 UTC (11 years, 6 months ago) by niro
File size: 1064 byte(s)
-alxify
1 # $Id$
2
3 PNAME="nss-myhostname"
4 PVER="0.3"
5 PBUILD="r1"
6
7 PCAT="net-dns"
8
9 DESCRIPTION="glibc plugin for local system host name resolution."
10 HOMEPAGE="http://0pointer.de/lennart/projects/nss-myhostname/"
11
12 DEPEND=">= virtual/glibc"
13
14 SRCFILE="${PNAME}-${PVER}.tar.gz"
15 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
16
17 sminclude multilib alx-split
18
19 SRC_URI=(
20 http://0pointer.de/lennart/projects/${PNAME}/${SRCFILE}
21 mirror://${PNAME}/${SRCFILE}
22 )
23
24 UP2DATE="updatecmd http://0pointer.de/lennart/projects/nss-myhostname/ | firsttarball gz"
25
26 postinstall()
27 {
28 # add myhostname to the hosts line of /etc/nsswitch.conf
29 if [ -f ${MROOT}/etc/nsswitch.conf ]
30 then
31 sed -i -e '
32 /^hosts:/ !b
33 /\<myhostname\>/ b
34 s/[[:blank:]]*$/ myhostname/
35 ' ${MROOT}/etc/nsswitch.conf
36 fi
37 }
38
39 postremove()
40 {
41 # remove myhostname from the hosts line of /etc/nsswitch.conf
42 if [ ! -e ${MROOT}/usr/$(mlibdir)/libnss_myhostname.so.* ]
43 then
44 if [ -f ${MROOT}/etc/nsswitch.conf ]
45 then
46 sed -i -e '
47 /^hosts:/ !b
48 s/[[:blank:]]\+myhostname\>//
49 ' ${MROOT}/etc/nsswitch.conf
50 fi
51 fi
52 }