Contents of /branches/R11-stable/core/nss-myhostname/nss-myhostname-0.3-r1.smage2
Parent Directory | Revision Log
Revision 14889 -
(show annotations)
(download)
Wed Jan 2 09:37:15 2013 UTC (11 years, 8 months ago) by niro
File size: 1054 byte(s)
Wed Jan 2 09:37:15 2013 UTC (11 years, 8 months ago) by niro
File size: 1054 byte(s)
-release branches/R11-stable
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 |
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 | } |