Several changes rolled into one:

o Wedge in DESTDIR support.  This is a little tricky since the
   installation procedure wants to run scotty to parse and dump
   the MIB files, and this needs to be done in DESTDIR.  Therefore
   we use the post-install target, to fix things up before packaging
   and the real install.

 o Fix the "dns" functionality not to use _res, since this program
   is linked with libpthread that won't work on NetBSD (aborts the
   program).  Though the modified version still uses a global static
   variable.

 o Add comments to all the patch files.

 o Eliminate use of ${WRKSRC}/.., since pkglint objects to it.  Instead
   use BUILD_DIRS and CONFIGURE_DIRS.

 o Add a LICENSE setting, 2-clause-bsd appears most similar.

 o Bump PKGREVISION for the above changes.
This commit is contained in:
he 2011-09-02 08:06:55 +00:00
parent 85acbea9cf
commit b10e503727
9 changed files with 477 additions and 62 deletions

View file

@ -1,9 +1,9 @@
# $NetBSD: Makefile,v 1.24 2009/08/20 15:24:59 jwise Exp $
# $NetBSD: Makefile,v 1.25 2011/09/02 08:06:55 he Exp $
#
DISTNAME= scotty-${DIST_VERS}
PKGNAME= tcl-scotty-${DIST_VERS}
PKGREVISION= 4
PKGREVISION= 5
CATEGORIES= net tcl
MASTER_SITES= ftp://ftp.ibr.cs.tu-bs.de/pub/local/tkined/
@ -11,13 +11,18 @@ MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://www.nosuchname.net/scotty/
COMMENT= Network management extensions to TCL
LICENSE= 2-clause-bsd
BUILDLINK_API_DEPENDS.tcl+= tcl>=8.4.6nb4
PKG_INSTALLATION_TYPES= overwrite pkgviews
PKG_DESTDIR_SUPPORT= destdir
DIST_VERS= 2.1.11
WRKSRC= ${WRKDIR}/${DISTNAME}/unix
CONFIGURE_DIRS= unix
BUILD_DIRS= unix
GNU_CONFIGURE= yes
CONFIGURE_ARGS+=--with-tcl-config=${BUILDLINK_PREFIX.tcl}/lib \
--enable-multicast \
@ -27,17 +32,21 @@ CONFIGURE_ENV+= TARGET=scotty
USE_LIBTOOL= yes
USE_TOOLS+= lex yacc
INSTALL_TARGET= tnm-install install-man sinstall
.include "../../lang/tcl/buildlink3.mk"
post-extract:
@${RM} -f ${WRKSRC}/../doc/http.n
@${RM} -f ${WRKSRC}/../doc/tkined.1
cd ${WRKSRC}/${BUILD_DIRS} && ${RM} -f ../doc/http.n
cd ${WRKSRC}/${BUILD_DIRS} && ${RM} -f ../doc/tkined.1
do-install:
@${CP} ${WRKSRC}/../tnm/ntping/ntping.8 ${WRKSRC}/../doc
@cd ${WRKSRC} && ${MAKE_ENV} ${MAKE} tnm-install install-man sinstall
pre-install:
cd ${WRKSRC}/${BUILD_DIRS} && ${INSTALL} ../tnm/ntping/ntping.8 ../doc
post-install:
cd ${PREFIX}/bin && ${LN} -f -s scotty${DIST_VERS} scotty
cd ${DESTDIR}/${PREFIX}/bin && ${LN} -f -s scotty${DIST_VERS} scotty
cd ${DESTDIR}/${PREFIX}/lib/tcl/tnm${DIST_VERS}; \
sed -e 's:${DESTDIR}/::' <pkgIndex.tcl >pkgIndex.tcl.new; \
rm -f pkgIndex.tcl; mv pkgIndex.tcl.new pkgIndex.tcl
.include "../../mk/bsd.pkg.mk"

View file

@ -1,11 +1,12 @@
$NetBSD: distinfo,v 1.8 2005/05/16 17:04:03 veego Exp $
$NetBSD: distinfo,v 1.9 2011/09/02 08:06:55 he Exp $
SHA1 (scotty-2.1.11.tar.gz) = 819011f908c57e4591d6f50e51677c01eb55dc13
RMD160 (scotty-2.1.11.tar.gz) = 3b4d45f3db73f05b49a46017bf2ffed6d6464b00
Size (scotty-2.1.11.tar.gz) = 1381059 bytes
SHA1 (patch-aa) = 7d35e18fa738d6be6b627774f072c1f68200edd4
SHA1 (patch-ab) = 4edfac2aabaaf32537fc332b1e0c7f08959c6575
SHA1 (patch-ac) = 5414110cb56026e77dc96316e33ee07d1331b85f
SHA1 (patch-ad) = 64c2f53c0eb0e32af144ec6c4e2b0f55edc9b60a
SHA1 (patch-af) = 8915bfd1912e9255e39d2c3b5b49e0b5c518bb9c
SHA1 (patch-ag) = 83b5f0cbc677338afc9e3c3b8565b2a1d47faad0
SHA1 (patch-aa) = 6d2b4b522ba802d07c0bc8346330070ae7e0edea
SHA1 (patch-ab) = a948075a85ace0ab0cd2a0fe10a2a80f15f367dc
SHA1 (patch-ac) = bf067f64474dc3ed6306caa468f29a040023e165
SHA1 (patch-ad) = 7823f5deab60b7979c87c3a000ac638bf7bb7924
SHA1 (patch-af) = 0db13ef063f641559c3f7c98480ab99b4877451e
SHA1 (patch-ag) = 407aa9ab0276a4fe6afd0c522667e0a80008a7be
SHA1 (patch-ah) = 327f9a0dae60ceacc039e288946114e0bbdbebde

View file

@ -1,7 +1,10 @@
$NetBSD: patch-aa,v 1.2 2004/05/13 12:07:49 he Exp $
$NetBSD: patch-aa,v 1.3 2011/09/02 08:06:55 he Exp $
--- configure.orig 1998-11-03 16:16:50.000000000 +0100
+++ configure
Default target to build & install scotty & tkined.
Append TCL_LIBS to library setting, so that tcl library is picked up.
--- unix/configure.orig 1998-11-03 16:16:50.000000000 +0100
+++ unix/configure
@@ -1059,7 +1059,11 @@ fi
fi

View file

@ -1,8 +1,16 @@
$NetBSD: patch-ab,v 1.4 2005/05/17 06:26:40 veego Exp $
$NetBSD: patch-ab,v 1.5 2011/09/02 08:06:55 he Exp $
--- Makefile.in.orig 2001-06-15 12:06:35.000000000 +0200
+++ Makefile.in 2005-05-16 18:28:53.000000000 +0200
@@ -35,13 +35,13 @@
Put installed files under lib/tcl, so that tcl more easily picks it
up using e.g. "package require Tnm".
Don't initialize $(LD_SEARCH_FLAGS), fixes PR#30241.
Support DESTDIR installs, but not yet for the "uninstall" target,
since that's not used in pkgsrc.
--- unix/Makefile.in.orig 2001-06-15 10:06:35.000000000 +0000
+++ unix/Makefile.in
@@ -35,13 +35,13 @@ LIB_INSTALL_DIR = $(exec_prefix)/l
LIB_RUNTIME_DIR = $(exec_prefix)/lib
# Directory in which to install library files belonging to the extension.
@ -18,7 +26,7 @@ $NetBSD: patch-ab,v 1.4 2005/05/17 06:26:40 veego Exp $
# Top-level directory for manual entries:
MAN_INSTALL_DIR = $(prefix)/man
@@ -82,7 +82,7 @@
@@ -82,7 +82,7 @@ TCL_EXEC_PREFIX=@TCL_EXEC_PREFIX@
# The full name of the tclsh executable (including the full path
# and the Tcl version number).
@ -27,7 +35,7 @@ $NetBSD: patch-ab,v 1.4 2005/05/17 06:26:40 veego Exp $
# Top-level directory in which Tk's platform-specific files (e.g.
# executables) are installed.
@@ -90,7 +90,7 @@
@@ -90,7 +90,7 @@ TK_EXEC_PREFIX=@TK_EXEC_PREFIX@
# The full name of the wish executable (including the full path
# and the Tk version number).
@ -36,7 +44,7 @@ $NetBSD: patch-ab,v 1.4 2005/05/17 06:26:40 veego Exp $
# A "-I" switch that can be used when compiling to make all the
# Tcl include files accessible (the configure script will try to
@@ -197,8 +197,8 @@
@@ -197,8 +197,8 @@ LD_FLAGS = @LD_FLAGS@
# Flags to pass to the compiler to tell the run-time dynamic linker
# where to look for shared libraries.
@ -47,7 +55,7 @@ $NetBSD: patch-ab,v 1.4 2005/05/17 06:26:40 veego Exp $
#----------------------------------------------------------------
# The information below is modified by the configure script when
@@ -207,8 +207,8 @@
@@ -207,8 +207,8 @@ LD_SEARCH_FLAGS = @LD_SEARCH_FLAGS@
#----------------------------------------------------------------
INSTALL = @INSTALL@
@ -58,7 +66,7 @@ $NetBSD: patch-ab,v 1.4 2005/05/17 06:26:40 veego Exp $
RPCGEN = @RPCGEN@
LEX = @LEX@
YACC = @YACC@
@@ -244,8 +244,8 @@
@@ -244,8 +244,8 @@ TKI_LIBRARY_DIR = $(TKI_DIR)/library
# either.
#----------------------------------------------------------------
@ -69,7 +77,7 @@ $NetBSD: patch-ab,v 1.4 2005/05/17 06:26:40 veego Exp $
CC_SWITCHES = $(CFLAGS) $(PROTO_FLAGS) $(SHLIB_CFLAGS) $(MEM_DEBUG_FLAGS)
@@ -261,13 +261,14 @@
@@ -261,13 +261,14 @@ TNM_GENERIC_SRCS = $(TNM_GENERIC_DIR)/tn
$(TNM_GENERIC_DIR)/tnmHttp.c $(TNM_GENERIC_DIR)/tnmNetdb.c \
$(UNIX_DIR)/tnmUnixInit.c $(UNIX_DIR)/tnmUnixLog.c \
$(UNIX_DIR)/tnmUnixSocket.c $(UNIX_DIR)/tnmUnixIcmp.c
@ -86,7 +94,7 @@ $NetBSD: patch-ab,v 1.4 2005/05/17 06:26:40 veego Exp $
SNMP_SRCS = $(TNM_SNMP_DIR)/tnmAsn1.c $(TNM_SNMP_DIR)/tnmMD5.c \
$(TNM_SNMP_DIR)/tnmSnmpNet.c $(TNM_SNMP_DIR)/tnmSnmpUtil.c \
@@ -406,21 +407,23 @@
@@ -406,21 +407,23 @@ TKI_OBJS = $(TKI_GENERIC_OBJS)
all: @TARGET@
@ -116,40 +124,221 @@ $NetBSD: patch-ab,v 1.4 2005/05/17 06:26:40 veego Exp $
test:
@echo
@@ -495,7 +498,7 @@
chmod 444 $(MANN_INSTALL_DIR)/$$i; \
@@ -457,128 +460,135 @@ tki-install: tki-install-bin tki-install
install-man:
@for i in $(MAN_INSTALL_DIR) $(MAN1_INSTALL_DIR) $(MAN8_INSTALL_DIR) $(MANN_INSTALL_DIR) ; \
do \
- if [ ! -d $$i ] ; then \
- echo "Making directory $$i"; \
- $(MKDIR) -p $$i; \
- chmod 755 $$i; \
+ if [ ! -d ${DESTDIR}/$$i ] ; then \
+ echo "Making directory ${DESTDIR}/$$i"; \
+ $(MKDIR) -p ${DESTDIR}/$$i; \
+ chmod 755 ${DESTDIR}/$$i; \
else true; \
fi; \
done;
@cd $(TOP_DIR)/doc; for i in *.1; \
do \
echo "Installing $(TOP_DIR)/doc/$$i"; \
- rm -f $(MAN1_INSTALL_DIR)/$$i; \
+ rm -f ${DESTDIR}/$(MAN1_INSTALL_DIR)/$$i; \
sed -e '/man\.macros/r man.macros' -e '/man\.macros/d' \
-e 's/%TNM_VERSION%/$(TNM_VERSION)/' \
-e 's/%TKI_VERSION%/$(TKI_VERSION)/' \
- $$i > $(MAN1_INSTALL_DIR)/$$i; \
- chmod 444 $(MAN1_INSTALL_DIR)/$$i; \
+ $$i > ${DESTDIR}/$(MAN1_INSTALL_DIR)/$$i; \
+ chmod 444 ${DESTDIR}/$(MAN1_INSTALL_DIR)/$$i; \
done;
@cd $(TOP_DIR)/doc; for i in *.8; \
do \
echo "Installing $(TOP_DIR)/doc/$$i"; \
- rm -f $(MAN8_INSTALL_DIR)/$$i; \
+ rm -f ${DESTDIR}/$(MAN8_INSTALL_DIR)/$$i; \
sed -e '/man\.macros/r man.macros' -e '/man\.macros/d' \
-e 's/%TNM_VERSION%/$(TNM_VERSION)/' \
-e 's/%TKI_VERSION%/$(TKI_VERSION)/' \
- $$i > $(MAN8_INSTALL_DIR)/$$i; \
- chmod 444 $(MAN8_INSTALL_DIR)/$$i; \
+ $$i > ${DESTDIR}/$(MAN8_INSTALL_DIR)/$$i; \
+ chmod 444 ${DESTDIR}/$(MAN8_INSTALL_DIR)/$$i; \
done;
@cd $(TOP_DIR)/doc; for i in *.n; \
do \
echo "Installing $(TOP_DIR)/doc/$$i"; \
- rm -f $(MANN_INSTALL_DIR)/$$i; \
+ rm -f ${DESTDIR}/$(MANN_INSTALL_DIR)/$$i; \
sed -e '/man\.macros/r man.macros' -e '/man\.macros/d' \
-e 's/%TNM_VERSION%/$(TNM_VERSION)/' \
-e 's/%TKI_VERSION%/$(TKI_VERSION)/' \
- $$i > $(MANN_INSTALL_DIR)/$$i; \
- chmod 444 $(MANN_INSTALL_DIR)/$$i; \
+ $$i > ${DESTDIR}/$(MANN_INSTALL_DIR)/$$i; \
+ chmod 444 ${DESTDIR}/$(MANN_INSTALL_DIR)/$$i; \
done;
-tnm-install-bin: scotty tnm$(SHLIB_SUFFIX)
+tnm-install-bin: scotty libtnm$(SHLIB_SUFFIX)
@for i in $(BIN_INSTALL_DIR) $(LIB_RUNTIME_DIR) $(TNM_INSTALL_DIR) ; \
do \
if [ ! -d $$i ] ; then \
@@ -505,11 +508,10 @@
- if [ ! -d $$i ] ; then \
- echo "Making directory $$i"; \
- $(MKDIR) -p $$i; \
- chmod 755 $$i; \
+ if [ ! -d ${DESTDIR}/$$i ] ; then \
+ echo "Making directory ${DESTDIR}/$$i"; \
+ $(MKDIR) -p ${DESTDIR}/$$i; \
+ chmod 755 ${DESTDIR}/$$i; \
else true; \
fi; \
done;
- @echo "Installing scotty$(TNM_VERSION) and tnm$(TNM_VERSION)$(SHLIB_SUFFIX)"
+ @echo "Installing scotty$(TNM_VERSION) and libtnm$(SHLIB_SUFFIX)"
@$(INSTALL_PROGRAM) scotty $(BIN_INSTALL_DIR)/scotty$(TNM_VERSION)
- @$(INSTALL_PROGRAM) scotty $(BIN_INSTALL_DIR)/scotty$(TNM_VERSION)
- @$(INSTALL_DATA) tnm$(SHLIB_SUFFIX) $(LIB_RUNTIME_DIR)/tnm$(TNM_VERSION)$(SHLIB_SUFFIX)
- @chmod 555 $(LIB_RUNTIME_DIR)/tnm$(TNM_VERSION)$(SHLIB_SUFFIX)
- @echo 'package ifneeded Tnm $(TNM_VERSION) "load $(LIB_RUNTIME_DIR)/tnm$(TNM_VERSION)[info sharedlibextension]"' > $(TNM_INSTALL_DIR)/pkgIndex.tcl
+ @$(INSTALL_DATA) libtnm$(SHLIB_SUFFIX:C/\.so.*/.la/) $(LIB_RUNTIME_DIR)
+ @echo 'package ifneeded Tnm $(TNM_VERSION) "load $(LIB_RUNTIME_DIR)/libtnm[info sharedlibextension]"' > $(TNM_INSTALL_DIR)/pkgIndex.tcl
+ @echo "Installing scotty$(TNM_VERSION) and libtnm$(SHLIB_SUFFIX)"
+ @$(INSTALL_PROGRAM) scotty ${DESTDIR}/$(BIN_INSTALL_DIR)/scotty$(TNM_VERSION)
+ @$(INSTALL_DATA) libtnm$(SHLIB_SUFFIX:C/\.so.*/.la/) ${DESTDIR}/$(LIB_RUNTIME_DIR)
+ @echo 'package ifneeded Tnm $(TNM_VERSION) "load ${DESTDIR}/$(LIB_RUNTIME_DIR)/libtnm[info sharedlibextension]"' > ${DESTDIR}/$(TNM_INSTALL_DIR)/pkgIndex.tcl
tnm-install-mibs:
@for i in $(TNM_INSTALL_DIR)/mibs ; \
@@ -597,7 +599,7 @@
$(INSTALL_DATA) $$i $(TNM_INSTALL_DIR)/agents; \
do \
- if [ ! -d $$i ] ; then \
- echo "Making directory $$i"; \
- $(MKDIR) -p $$i; \
- chmod 755 $$i; \
+ if [ ! -d ${DESTDIR}/$$i ] ; then \
+ echo "Making directory ${DESTDIR}/$$i"; \
+ $(MKDIR) -p ${DESTDIR}/$$i; \
+ chmod 755 ${DESTDIR}/$$i; \
else true; \
fi; \
done;
@for i in $(TNM_MIB_DIR)/*.mib $(TNM_MIB_DIR)/*.smi $(TNM_MIB_DIR)/*.tc $(TNM_MIB_DIR)/*.gdmo ; \
do \
echo "Installing $$i"; \
- $(INSTALL_DATA) $$i $(TNM_INSTALL_DIR)/mibs ; \
+ $(INSTALL_DATA) $$i ${DESTDIR}/$(TNM_INSTALL_DIR)/mibs ; \
done
- @TCLLIBPATH="$(TNM_INSTALL_DIR) $$TCLLIBPATH"; \
+ @TCLLIBPATH="${DESTDIR}/$(TNM_INSTALL_DIR) $$TCLLIBPATH"; \
export TCLLIBPATH; \
+ LD_LIBRARY_PATH="${DESTDIR}/${LIB_RUNTIME_DIR}:/usr/lib"; \
+ export LD_LIBRARY_PATH; \
+ TNM_LIBRARY="${DESTDIR}/${TNM_INSTALL_DIR}"; \
+ export TNM_LIBRARY; \
echo 'foreach f $$tnm(mibs) {puts "Parsing $$f"; mib load $$f}; exit' | \
./scotty
tnm-install-library:
@for i in $(TNM_INSTALL_DIR)/library ; \
do \
- if [ ! -d $$i ] ; then \
- echo "Making directory $$i"; \
- $(MKDIR) -p $$i; \
- chmod 755 $$i; \
+ if [ ! -d ${DESTDIR}/$$i ] ; then \
+ echo "Making directory ${DESTDIR}/$$i"; \
+ $(MKDIR) -p ${DESTDIR}/$$i; \
+ chmod 755 ${DESTDIR}/$$i; \
else true; \
fi; \
done;
@for i in $(TNM_LIBRARY_DIR)/README $(TNM_LIBRARY) ; \
do \
echo "Installing $$i"; \
- $(INSTALL_DATA) $$i $(TNM_INSTALL_DIR)/library; \
+ $(INSTALL_DATA) $$i ${DESTDIR}/$(TNM_INSTALL_DIR)/library; \
done
- @TCLLIBPATH="$(TNM_INSTALL_DIR) $$TCLLIBPATH"; \
+ @TCLLIBPATH="${DESTDIR}/$(TNM_INSTALL_DIR) $$TCLLIBPATH"; \
export TCLLIBPATH; \
- echo 'cd $(TNM_INSTALL_DIR)/library; auto_mkindex . *.tcl; exit' | \
+ LD_LIBRARY_PATH="${DESTDIR}/${LIB_RUNTIME_DIR}:/usr/lib"; \
+ export LD_LIBRARY_PATH; \
+ TNM_LIBRARY="${DESTDIR}/${TNM_INSTALL_DIR}"; \
+ export TNM_LIBRARY; \
+ echo 'cd ${DESTDIR}/$(TNM_INSTALL_DIR)/library; auto_mkindex . *.tcl; exit' | \
./scotty
tnm-install-examples:
@for i in $(TNM_INSTALL_DIR)/examples ; \
do \
- if [ ! -d $$i ] ; then \
- echo "Making directory $$i"; \
- $(MKDIR) -p $$i; \
- chmod 755 $$i; \
+ if [ ! -d ${DESTDIR}/$$i ] ; then \
+ echo "Making directory ${DESTDIR}/$$i"; \
+ $(MKDIR) -p ${DESTDIR}/$$i; \
+ chmod 755 ${DESTDIR}/$$i; \
else true; \
fi; \
done;
@for i in $(TNM_EXAMPLES) ; do \
echo "Installing $$i"; \
base=`basename $$i`; \
- rm -f $(TNM_INSTALL_DIR)/examples/$$base; \
+ rm -f ${DESTDIR}/$(TNM_INSTALL_DIR)/examples/$$base; \
sed -e 's/^exec scotty.*$$/exec scotty$(TNM_VERSION) "$$0" "$$@"/'\
-e 's+^exec wish.*$$+exec $(TK_WISH) "$$0" "$$@"+'\
- $$i > $(TNM_INSTALL_DIR)/examples/$$base; \
- chmod 755 $(TNM_INSTALL_DIR)/examples/$$base; \
- $(INSTALL_DATA) $$i.n $(TNM_INSTALL_DIR)/examples; \
+ $$i > ${DESTDIR}/$(TNM_INSTALL_DIR)/examples/$$base; \
+ chmod 755 ${DESTDIR}/$(TNM_INSTALL_DIR)/examples/$$base; \
+ $(INSTALL_DATA) $$i.n ${DESTDIR}/$(TNM_INSTALL_DIR)/examples; \
done
tnm-install-agents:
@for i in $(TNM_INSTALL_DIR)/agents ; \
do \
- if [ ! -d $$i ] ; then \
- echo "Making directory $$i"; \
- $(MKDIR) -p $$i; \
- chmod 755 $$i; \
+ if [ ! -d ${DESTDIR}/$$i ] ; then \
+ echo "Making directory ${DESTDIR}/$$i"; \
+ $(MKDIR) -p ${DESTDIR}/$$i; \
+ chmod 755 ${DESTDIR}/$$i; \
else true; \
fi; \
done;
@@ -586,74 +596,73 @@ tnm-install-agents:
do \
echo "Installing $$i"; \
base=`basename $$i`; \
- rm -f $(TNM_INSTALL_DIR)/agents/$$base; \
+ rm -f ${DESTDIR}/$(TNM_INSTALL_DIR)/agents/$$base; \
sed -e 's/^exec scotty.*$$/exec scotty$(TNM_VERSION) "$$0" "$$@"/'\
- $$i > $(TNM_INSTALL_DIR)/agents/$$base; \
- chmod 755 $(TNM_INSTALL_DIR)/agents/$$base; \
+ $$i > ${DESTDIR}/$(TNM_INSTALL_DIR)/agents/$$base; \
+ chmod 755 ${DESTDIR}/$(TNM_INSTALL_DIR)/agents/$$base; \
done
@for i in $(TNM_AGENTS) $(TNM_AGENT_DIR)/README ; \
do \
echo "Installing $$i"; \
- $(INSTALL_DATA) $$i $(TNM_INSTALL_DIR)/agents; \
+ $(INSTALL_DATA) $$i ${DESTDIR}/$(TNM_INSTALL_DIR)/agents; \
done
-tki-install-bin: tkined tkined$(SHLIB_SUFFIX) $(TKI_LIBRARY_DIR)/pkgIndex.tcl
+tki-install-bin: tkined libtkined$(SHLIB_SUFFIX) $(TKI_LIBRARY_DIR)/pkgIndex.tcl
@for i in $(BIN_INSTALL_DIR) $(LIB_RUNTIME_DIR) $(TKI_INSTALL_DIR) ; \
do \
if [ ! -d $$i ] ; then \
@@ -607,11 +609,10 @@
- if [ ! -d $$i ] ; then \
- echo "Making directory $$i"; \
- $(MKDIR) -p $$i; \
- chmod 755 $$i; \
+ if [ ! -d ${DESTDIR}/$$i ] ; then \
+ echo "Making directory ${DESTDIR}/$$i"; \
+ $(MKDIR) -p ${DESTDIR}/$$i; \
+ chmod 755 ${DESTDIR}/$$i; \
else true; \
fi; \
done;
@ -158,14 +347,118 @@ $NetBSD: patch-ab,v 1.4 2005/05/17 06:26:40 veego Exp $
- @$(INSTALL_DATA) tkined$(SHLIB_SUFFIX) $(LIB_RUNTIME_DIR)/tkined$(TKI_VERSION)$(SHLIB_SUFFIX)
- @chmod 555 $(LIB_RUNTIME_DIR)/tkined$(TKI_VERSION)$(SHLIB_SUFFIX)
- @echo 'package ifneeded Tkined $(TKI_VERSION) "load $(LIB_RUNTIME_DIR)/tkined$(TKI_VERSION)[info sharedlibextension]"' > $(TKI_INSTALL_DIR)/pkgIndex.tcl
- @$(INSTALL_DATA) $(TKI_DIR)/tkined.defaults $(TKI_INSTALL_DIR)
+ @echo "Installing tkined$(TKI_VERSION) and libtkined$(SHLIB_SUFFIX)"
+ $(BSD_INSTALL_SCRIPT) tkined $(BIN_INSTALL_DIR)/tkined$(TKI_VERSION)
+ $(INSTALL_DATA) libtkined$(SHLIB_SUFFIX:C/\.so.*/.la/) $(LIB_RUNTIME_DIR)
+ @echo 'package ifneeded Tkined $(TKI_VERSION) "load $(LIB_RUNTIME_DIR)/libtkined[info sharedlibextension]"' > $(TKI_INSTALL_DIR)/pkgIndex.tcl
@$(INSTALL_DATA) $(TKI_DIR)/tkined.defaults $(TKI_INSTALL_DIR)
+ $(BSD_INSTALL_SCRIPT) tkined ${DESTDIR}/$(BIN_INSTALL_DIR)/tkined$(TKI_VERSION)
+ $(INSTALL_DATA) libtkined$(SHLIB_SUFFIX:C/\.so.*/.la/) ${DESTDIR}/$(LIB_RUNTIME_DIR)
+ @echo 'package ifneeded Tkined $(TKI_VERSION) "load $(LIB_RUNTIME_DIR)/libtkined[info sharedlibextension]"' > ${DESTDIR}/$(TKI_INSTALL_DIR)/pkgIndex.tcl
+ @$(INSTALL_DATA) $(TKI_DIR)/tkined.defaults ${DESTDIR}/$(TKI_INSTALL_DIR)
tki-install-library:
@@ -696,9 +697,9 @@
@for i in $(TKI_INSTALL_DIR)/library ; \
do \
- if [ ! -d $$i ] ; then \
- echo "Making directory $$i"; \
- $(MKDIR) -p $$i; \
- chmod 755 $$i; \
+ if [ ! -d ${DESTDIR}/$$i ] ; then \
+ echo "Making directory ${DESTDIR}/$$i"; \
+ $(MKDIR) -p ${DESTDIR}/$$i; \
+ chmod 755 ${DESTDIR}/$$i; \
else true; \
fi; \
done;
@for i in $(TKI_LIBRARY) ; \
do \
echo "Installing $$i"; \
- $(INSTALL_DATA) $$i $(TKI_INSTALL_DIR)/library; \
+ $(INSTALL_DATA) $$i ${DESTDIR}/$(TKI_INSTALL_DIR)/library; \
done
- @$(INSTALL_DATA) $(TKI_LIBRARY_DIR)/pkgIndex.tcl $(TKI_INSTALL_DIR)/library
+ @$(INSTALL_DATA) $(TKI_LIBRARY_DIR)/pkgIndex.tcl ${DESTDIR}/$(TKI_INSTALL_DIR)/library
tki-install-bitmaps:
@for i in $(TKI_INSTALL_DIR)/bitmaps ; \
do \
- if [ ! -d $$i ] ; then \
- echo "Making directory $$i"; \
- $(MKDIR) -p $$i; \
- chmod 755 $$i; \
+ if [ ! -d ${DESTDIR}/$$i ] ; then \
+ echo "Making directory ${DESTDIR}/$$i"; \
+ $(MKDIR) -p ${DESTDIR}/$$i; \
+ chmod 755 ${DESTDIR}/$$i; \
else true; \
fi; \
done;
@for i in $(TKI_DIR)/bitmaps/*.xbm ; \
do \
echo "Installing $$i"; \
- $(INSTALL_DATA) $$i $(TKI_INSTALL_DIR)/bitmaps ; \
+ $(INSTALL_DATA) $$i ${DESTDIR}/$(TKI_INSTALL_DIR)/bitmaps ; \
done
tki-install-apps:
@for i in $(TKI_INSTALL_DIR)/apps ; \
do \
- if [ ! -d $$i ] ; then \
- echo "Making directory $$i"; \
- $(MKDIR) -p $$i; \
- chmod 755 $$i; \
+ if [ ! -d ${DESTDIR}/$$i ] ; then \
+ echo "Making directory ${DESTDIR}/$$i"; \
+ $(MKDIR) -p ${DESTDIR}/$$i; \
+ chmod 755 ${DESTDIR}/$$i; \
else true; \
fi; \
done;
@@ -661,44 +670,44 @@ tki-install-apps:
do \
echo "Installing $$i"; \
base=`basename $$i`; \
- rm -f $(TKI_INSTALL_DIR)/apps/$$base; \
+ rm -f ${DESTDIR}/$(TKI_INSTALL_DIR)/apps/$$base; \
sed -e 's/^exec scotty.*$$/exec scotty$(TNM_VERSION) "$$0" "$$@"/'\
-e 's+^exec wish.*$$+exec $(TK_WISH) "$$0" "$$@"+'\
- $$i > $(TKI_INSTALL_DIR)/apps/$$base; \
- chmod 755 $(TKI_INSTALL_DIR)/apps/$$base; \
+ $$i > ${DESTDIR}/$(TKI_INSTALL_DIR)/apps/$$base; \
+ chmod 755 ${DESTDIR}/$(TKI_INSTALL_DIR)/apps/$$base; \
done
@for i in $(TKI_MISC) ; \
do \
echo "Installing $$i"; \
- $(INSTALL_DATA) $$i $(TKI_INSTALL_DIR)/apps; \
+ $(INSTALL_DATA) $$i ${DESTDIR}/$(TKI_INSTALL_DIR)/apps; \
done
- @TCLLIBPATH="$(TNM_INSTALL_DIR) $$TCLLIBPATH"; \
+ @TCLLIBPATH="${DESTDIR}/$(TNM_INSTALL_DIR) $$TCLLIBPATH"; \
export TCLLIBPATH; \
- echo 'cd $(TKI_INSTALL_DIR)/apps; auto_mkindex . library.tcl; exit' | \
+ echo 'cd ${DESTDIR}/$(TKI_INSTALL_DIR)/apps; auto_mkindex . library.tcl; exit' | \
$(TCL_TCLSH)
sinstall: ntping straps
@for i in $(BIN_INSTALL_DIR) ; \
do \
- if [ ! -d $$i ] ; then \
- echo "Making directory $$i"; \
- $(MKDIR) -p $$i; \
- chmod 755 $$i; \
+ if [ ! -d ${DESTDIR}/$$i ] ; then \
+ echo "Making directory ${DESTDIR}/$$i"; \
+ $(MKDIR) -p ${DESTDIR}/$$i; \
+ chmod 755 ${DESTDIR}/$$i; \
else true; \
fi; \
done;
@for i in ntping straps ; \
do \
echo "Installing $$i"; \
- $(INSTALL_PROGRAM) -o root -m 4755 $$i $(BIN_INSTALL_DIR)/$$i; \
+ $(INSTALL_PROGRAM) -o root -m 4555 $$i ${DESTDIR}/$(BIN_INSTALL_DIR)/$$i; \
done
uninstall: tnm-uninstall uninstall-man tki-uninstall
tnm-uninstall:
@ -177,7 +470,7 @@ $NetBSD: patch-ab,v 1.4 2005/05/17 06:26:40 veego Exp $
@for i in $(LIB_INSTALL_DIR)/tnm$(TNM_VERSION)/* ; \
do \
if [ "`basename $$i`" != "site" ] ; then \
@@ -713,9 +714,9 @@
@@ -713,9 +722,9 @@ tnm-uninstall:
fi
tki-uninstall:
@ -189,7 +482,7 @@ $NetBSD: patch-ab,v 1.4 2005/05/17 06:26:40 veego Exp $
@for i in $(LIB_INSTALL_DIR)/tkined$(TKI_VERSION)/* ; \
do \
if [ "`basename $$i`" != "site" ] ; then \
@@ -750,7 +751,7 @@
@@ -750,7 +759,7 @@ clean:
@rm -f $(TNM_OBJS) $(TKI_OBJS) scotty.o ntping.o straps.o
@rm -f tnmGdmoScan.c tnmGdmoParser.c tnmGdmoParser.h
@rm -f scotty ntping straps tkined
@ -198,7 +491,7 @@ $NetBSD: patch-ab,v 1.4 2005/05/17 06:26:40 veego Exp $
@rm -f core *_svc.c *~ *.bak so_locations lmake.???
@rm -f map.so tnmMap.o tnmMapUtil.o
@rm -f tnmMapNode.o tnmMapClnt.o tnmMapAppl.o
@@ -821,8 +822,8 @@
@@ -821,8 +830,8 @@ BIN_FILES = $(BIN_INSTALL_DIR)/tkined$(T
$(MAN8_INSTALL_DIR)/straps.8 \
$(BIN_INSTALL_DIR)/ntping \
$(MAN8_INSTALL_DIR)/ntping.8 \

View file

@ -1,6 +1,9 @@
$NetBSD: patch-ac,v 1.1.1.1 2000/09/07 17:38:46 jwise Exp $
--- ../tkined/apps/ip_discover.tcl.orig Fri Jun 12 09:23:35 1998
+++ ../tkined/apps/ip_discover.tcl Wed Sep 6 22:56:34 2000
$NetBSD: patch-ac,v 1.2 2011/09/02 08:06:55 he Exp $
Ensure we unset the global variable...
--- tkined/apps/ip_discover.tcl.orig Fri Jun 12 09:23:35 1998
+++ tkined/apps/ip_discover.tcl Wed Sep 6 22:56:34 2000
@@ -56,7 +56,10 @@
foreach name {
nodes networks links ids trace mask fip name address gateways

View file

@ -1,7 +1,9 @@
$NetBSD: patch-ad,v 1.2 2001/01/24 18:49:56 he Exp $
$NetBSD: patch-ad,v 1.3 2011/09/02 08:06:55 he Exp $
--- ../tnm/generic/tnmInit.c.orig Mon Jan 26 16:35:26 1998
+++ ../tnm/generic/tnmInit.c Wed Jan 24 19:09:20 2001
Don't try to include OS version in directory name for mib files.
--- tnm/generic/tnmInit.c.orig Mon Jan 26 16:35:26 1998
+++ tnm/generic/tnmInit.c Wed Jan 24 19:09:20 2001
@@ -83,15 +83,12 @@
machine = Tcl_GetVar2(interp, "tcl_platform", "machine", TCL_GLOBAL_ONLY);

View file

@ -1,6 +1,9 @@
$NetBSD: patch-af,v 1.2 2002/12/08 13:31:24 cjep Exp $
--- ../tnm/generic/tnmUdp.c.orig Mon Nov 25 12:35:13 2002
+++ ../tnm/generic/tnmUdp.c Mon Nov 25 12:35:27 2002
$NetBSD: patch-af,v 1.3 2011/09/02 08:06:55 he Exp $
Correct typo.
--- tnm/generic/tnmUdp.c.orig Mon Nov 25 12:35:13 2002
+++ tnm/generic/tnmUdp.c Mon Nov 25 12:35:27 2002
@@ -643,7 +643,7 @@
}

View file

@ -1,7 +1,9 @@
$NetBSD: patch-ag,v 1.1 2004/07/07 14:39:33 he Exp $
$NetBSD: patch-ag,v 1.2 2011/09/02 08:06:55 he Exp $
--- ../tnm/snmp/straps.c.orig Tue Mar 9 18:06:10 1999
+++ ../tnm/snmp/straps.c
Provide more robustness for the straps helper program.
--- tnm/snmp/straps.c.orig Tue Mar 9 18:06:10 1999
+++ tnm/snmp/straps.c
@@ -246,6 +246,17 @@ main(argc, argv)
#endif

View file

@ -0,0 +1,99 @@
$NetBSD: patch-ah,v 1.1 2011/09/02 08:06:55 he Exp $
Avoid use of _res, since scotty is a pthread-linked program.
Instead, use the newer resolver interfaces.
--- tnm/generic/tnmDns.c.orig 1997-11-13 11:17:41.000000000 +0000
+++ tnm/generic/tnmDns.c
@@ -141,6 +141,8 @@ AssocDeleteProc(clientData, interp)
*----------------------------------------------------------------------
*/
+static struct __res_state rs;
+
static void
DnsInit(timeout, retries, server)
int timeout;
@@ -150,20 +152,20 @@ DnsInit(timeout, retries, server)
static int initialized = 0;
if (! initialized) {
- res_init();
- _res.options |= RES_RECURSE | RES_DNSRCH | RES_DEFNAMES | RES_AAONLY;
+ res_ninit(&rs);
+ rs.options |= RES_RECURSE | RES_DNSRCH | RES_DEFNAMES | RES_AAONLY;
initialized = 1;
- if (_res.nscount > 0) {
- *server = _res.nsaddr.sin_addr;
+ if (rs.nscount > 0) {
+ *server = rs.nsaddr.sin_addr;
}
if (! server->s_addr) {
server->s_addr = htonl(INADDR_LOOPBACK);
}
}
- _res.retrans = timeout;
- _res.retry = retries + 1;
- _res.nsaddr.sin_addr = *server;
+ rs.retrans = timeout;
+ rs.retry = retries + 1;
+ rs.nsaddr.sin_addr = *server;
}
/*
@@ -248,7 +250,7 @@ DnsDoQuery(query_string, query_type, que
* res_mkquery(op, dname, class, type, data, datalen, newrr, buf, buflen)
*/
- qlen = res_mkquery(QUERY, query_string, C_IN, query_type,
+ qlen = res_nmkquery(&rs, QUERY, query_string, C_IN, query_type,
(u_char *) 0, 0, 0,
(u_char *) &query, sizeof(query));
if (qlen <= 0) {
@@ -261,7 +263,7 @@ DnsDoQuery(query_string, query_type, que
* res_send(msg, msglen, answer, anslen)
*/
- alen = res_send((u_char *) &query, qlen,
+ alen = res_nsend(&rs, (u_char *) &query, qlen,
(u_char *) &answer, sizeof (answer));
if (alen <= 0) {
query_result->n = -1;
@@ -499,10 +501,10 @@ DnsHaveQuery(query_string, query_type, q
if (i == -1) {
strcpy(tmp, query_string);
- } else if (! _res.dnsrch[i]) {
+ } else if (! rs.dnsrch[i]) {
break;
} else {
- sprintf(tmp, "%s.%s", query_string, _res.dnsrch[i]);
+ sprintf(tmp, "%s.%s", query_string, rs.dnsrch[i]);
}
DnsDoQuery(tmp, query_type, &res);
@@ -529,10 +531,10 @@ DnsHaveQuery(query_string, query_type, q
if (i == -1) {
strcpy(tmp, query_string);
- } else if (! _res.dnsrch[i]) {
+ } else if (! rs.dnsrch[i]) {
break;
} else {
- sprintf(tmp, "%s.%s", query_string, _res.dnsrch[i]);
+ sprintf(tmp, "%s.%s", query_string, rs.dnsrch[i]);
}
DnsDoQuery(tmp, query_type, &res);
@@ -562,8 +564,8 @@ DnsHaveQuery(query_string, query_type, q
if (tmpres.type != T_A || tmpres.n <= 0) {
return;
}
- _res.nsaddr.sin_addr = tmpres.u.addr[0];
- _res.nscount = 1;
+ rs.nsaddr.sin_addr = tmpres.u.addr[0];
+ rs.nscount = 1;
DnsHaveQuery(query_string, query_type, query_result, depth + 1);
return;
}