pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc Get rid of `hostname -s` in pkgsrc, on Solaris it sets...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/1cd2c9f5520a
branches:  trunk
changeset: 553084:1cd2c9f5520a
user:      sketch <sketch%pkgsrc.org@localhost>
date:      Wed Jan 14 12:20:57 2009 +0000

description:
Get rid of `hostname -s` in pkgsrc, on Solaris it sets the hostname to "-s".

diffstat:

 benchmarks/hbench/Makefile  |  13 +++++++++----
 mail/exmh/files/build       |   4 ++--
 misc/jitterbug/Makefile     |  12 ++++++------
 net/mrtg/Makefile           |   3 ++-
 net/mrtg/files/envstat2mrtg |   5 +++--
 net/mrtg/files/sys2mrtg     |   8 +++++---
 6 files changed, 27 insertions(+), 18 deletions(-)

diffs (166 lines):

diff -r f1c0154631bf -r 1cd2c9f5520a benchmarks/hbench/Makefile
--- a/benchmarks/hbench/Makefile        Wed Jan 14 11:34:32 2009 +0000
+++ b/benchmarks/hbench/Makefile        Wed Jan 14 12:20:57 2009 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.40 2008/04/05 14:09:18 chris Exp $
+# $NetBSD: Makefile,v 1.41 2009/01/14 12:20:57 sketch Exp $
 
 DISTNAME=              hbench-OS-1.0
 PKGNAME=               hbench-1.0
@@ -26,6 +26,11 @@
 GET_OS_CMD=            ${PKGSRCDIR:Q}/mk/gnu-config/config.guess | ${SED} -e 's/^.*-.*-//'
 PLIST_SUBST+=          PLATFORM=${GET_OS_CMD:sh:Q}-${GET_ARCH_CMD:sh:Q}
 
+.include "../../mk/bsd.prefs.mk"
+
+HB_HOSTNAME!=          ${UNAME} -n
+HB_SHORTNAME=          ${HB_HOSTNAME:C/\..*//}
+
 post-extract:
        ${CP} ${FILESDIR}/do-install ${WRKSRC}
 
@@ -48,12 +53,12 @@
        ${MKDIR} conf;                                                  \
        ${MKDIR} results;                                               \
        ${SED} -e 's|@pwd@|'`/bin/pwd`'|g'                              \
-               -e 's|@hostname@|'`/bin/hostname -s`'|g'                \
+               -e 's|@hostname@|${HB_SHORTNAME}|g'                     \
                -e 's|@wrksrc@|'`/bin/pwd`'|g'                          \
                ${FILESDIR}/setup.answers | ${MAKE} setup;              \
-       ${MV} conf/`/bin/hostname -s`.run conf/foo ;                    \
+       ${MV} conf/${HB_SHORTNAME}.run conf/foo ;                       \
        ${SED} -e 's|#PLAINBINDIR=${HBENCHROOT}|PLAINBINDIR='`/bin/pwd`'|' \
-               < conf/foo > conf/`/bin/hostname -s`.run ;              \
+               < conf/foo > conf/${HB_SHORTNAME}.run ;                 \
        ${MAKE} run
 
 results:
diff -r f1c0154631bf -r 1cd2c9f5520a mail/exmh/files/build
--- a/mail/exmh/files/build     Wed Jan 14 11:34:32 2009 +0000
+++ b/mail/exmh/files/build     Wed Jan 14 12:20:57 2009 +0000
@@ -1,6 +1,6 @@
 #! /bin/sh
 #
-# $NetBSD: build,v 1.2 2006/10/20 08:15:15 dsainty Exp $
+# $NetBSD: build,v 1.3 2009/01/14 12:20:57 sketch Exp $
 # FreeBSD Id: build,v 1.5 1997/08/21 08:09:56 peter Exp
 #
 
@@ -29,7 +29,7 @@
 
 if [ -d ${PREFIX}/share/faces ]; then
   FACES=${PREFIX}/share/faces          #dir
-  shortname="`hostname -s`"
+  shortname="`hostname | sed -e 's/\..*//'`"
   domain="`hostname | sed -e s/^${shortname}// -e s/^.// | tr A-Z a-z`"
   if [ "${domain}" != "" ]; then
     DOMAIN="{${domain}}"
diff -r f1c0154631bf -r 1cd2c9f5520a misc/jitterbug/Makefile
--- a/misc/jitterbug/Makefile   Wed Jan 14 11:34:32 2009 +0000
+++ b/misc/jitterbug/Makefile   Wed Jan 14 12:20:57 2009 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.31 2008/06/16 14:39:35 joerg Exp $
+# $NetBSD: Makefile,v 1.32 2009/01/14 12:20:57 sketch Exp $
 
 DISTNAME=      jitterbug-1.6.2
 PKGREVISION=   2
@@ -29,10 +29,10 @@
 
 JB_LOCALMAIL?= ${JB_PACKAGE}-bugs
 
-JB_HOSTNAME=   `hostname -s`
-JB_LONGNAME=   `hostname`
+JB_HOSTNAME!=  ${UNAME} -n
+JB_SHORTNAME=  ${JB_HOSTNAME:C/\..*//}
 .if !defined(JB_FQHOSTNAME)
-JB_FQHOSTNAME= ${JB_LONGNAME}
+JB_FQHOSTNAME= ${JB_HOSTNAME}
 .endif
 JB_EMAIL?=     ${JB_LOCALMAIL}@${JB_FQHOSTNAME}
 
@@ -64,7 +64,7 @@
                CHGRP=${CHGRP} ID=${ID} TOUCH=${TOUCH} RM=${RM}
 
 pre-extract:
-       @(if [ "X${JB_HOSTNAME}" = "X${JB_LONGNAME}" ]; then                  \
+       @(if [ "X${JB_HOSTNAME}" = "X${JB_SHORTNAME}" ]; then                 \
        ${ECHO};                                                              \
        ${ECHO} "Warning: could not determine your fully qualified host";     \
        ${ECHO} "         name. Please set the JB_FQHOSTNAME environment";    \
@@ -96,7 +96,7 @@
        @${ECHO} "  (default='${JB_LOCALMAIL}@${JB_FQHOSTNAME}')"
        @${ECHO}
 .endif
-.if ${JB_FQHOSTNAME} == ${JB_HOSTNAME}
+.if ${JB_FQHOSTNAME} == ${JB_SHORTNAME}
        @${ECHO} "Warning: Could not determine your fully qualified hostname."
        @${ECHO} "You must set the JB_FQHOSTNAME environment variable."
        @${ECHO}
diff -r f1c0154631bf -r 1cd2c9f5520a net/mrtg/Makefile
--- a/net/mrtg/Makefile Wed Jan 14 11:34:32 2009 +0000
+++ b/net/mrtg/Makefile Wed Jan 14 12:20:57 2009 +0000
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.89 2008/08/10 16:50:56 adrianp Exp $
+# $NetBSD: Makefile,v 1.90 2009/01/14 12:20:57 sketch Exp $
 
 DISTNAME=      mrtg-2.16.2
+PKGREVISION=   1
 CATEGORIES=    net
 MASTER_SITES=  http://oss.oetiker.ch/mrtg/pub/ \
                http://oss.oetiker.ch/mrtg/pub/old/
diff -r f1c0154631bf -r 1cd2c9f5520a net/mrtg/files/envstat2mrtg
--- a/net/mrtg/files/envstat2mrtg       Wed Jan 14 11:34:32 2009 +0000
+++ b/net/mrtg/files/envstat2mrtg       Wed Jan 14 12:20:57 2009 +0000
@@ -1,5 +1,5 @@
 #! @PREFIX@/bin/perl
-#      $NetBSD: envstat2mrtg,v 1.2 2005/06/23 08:12:13 martti Exp $
+#      $NetBSD: envstat2mrtg,v 1.3 2009/01/14 12:20:57 sketch Exp $
 
 if (@ARGV == 1)
 {
@@ -63,9 +63,10 @@
                }
        }
        close(UP);
-       open(HOST, "hostname -s|");
+       open(HOST, "hostname|");
        while (<HOST>)
        {
+               s/\..*//;
                print $_;
        }
        exit(0);
diff -r f1c0154631bf -r 1cd2c9f5520a net/mrtg/files/sys2mrtg
--- a/net/mrtg/files/sys2mrtg   Wed Jan 14 11:34:32 2009 +0000
+++ b/net/mrtg/files/sys2mrtg   Wed Jan 14 12:20:57 2009 +0000
@@ -1,5 +1,5 @@
 #! @PREFIX@/bin/perl
-#      $NetBSD: sys2mrtg,v 1.3 2001/06/19 12:32:18 hubertf Exp $
+#      $NetBSD: sys2mrtg,v 1.4 2009/01/14 12:20:57 sketch Exp $
 
 
 if (@ARGV < 1)
@@ -112,9 +112,10 @@
              }
        }
        close(UP);
-       open(HOST, "hostname -s|");
+       open(HOST, "hostname|");
        while (<HOST>)
        {
+               s/\..*//;
                print $_;
        }
        close(HOST);
@@ -181,9 +182,10 @@
 sub end
 {
        &uptime;
-       open(HOST, "hostname -s|");
+       open(HOST, "hostname|");
        while (<HOST>)
        {
+               s/\..*//;
                print $_;
        }
        exit(0);



Home | Main Index | Thread Index | Old Index