[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tkined
Subject:    [tkined] unix/Makefile.in patch
From:       George Ross <gdmr () dcs ! ed ! ac ! uk>
Date:       2002-08-30 12:31:34
[Download RAW message or body]

[Attachment #2 (multipart/mixed)]
This is a multipart MIME message.


Here's a patch to today's CVS version of unix/Makefile.in to allow the use 
of an INSTALL_ROOT variable for make install and make sinstall.  It's 
necessary when installing into a temporary location for later packaging, 
such as when building with rpm.

A rather basic rpm spec file is attached below, which makes use of the 
feature added by this patch.  You'll need to put the .tar.gz and patch into 
the right places yourself if you want to use it.

--- unix/Makefile.in.CVS	Fri Aug 30 11:48:05 2002
+++ unix/Makefile.in	Fri Aug 30 12:38:47 2002
@@ -28,22 +28,22 @@
 exec_prefix =	@exec_prefix@
 
 # Directory in which to install the program scotty:
-BIN_INSTALL_DIR =	$(exec_prefix)/bin
+BIN_INSTALL_DIR =	$(INSTALL_ROOT)$(exec_prefix)/bin
 
 # Directory in which to install dynamic loadable modules:
-LIB_INSTALL_DIR =       $(exec_prefix)/lib
+LIB_INSTALL_DIR =       $(INSTALL_ROOT)$(exec_prefix)/lib
 
 # Directory in which dynamic loadable modules are installed:
 LIB_RUNTIME_DIR =       $(exec_prefix)/lib
 
 # Directory in which to install library files belonging to the extension.
-TNM_INSTALL_DIR =	$(prefix)/lib/tnm$(TNM_VERSION)
+TNM_INSTALL_DIR =	$(INSTALL_ROOT)$(prefix)/lib/tnm$(TNM_VERSION)
 
 # Directory in which to install the library of tkined scripts.
-TKI_INSTALL_DIR =	$(prefix)/lib/tkined$(TKI_VERSION)
+TKI_INSTALL_DIR =	$(INSTALL_ROOT)$(prefix)/lib/tkined$(TKI_VERSION)
 
 # Top-level directory for manual entries:
-MAN_INSTALL_DIR =	$(prefix)/man
+MAN_INSTALL_DIR =	$(INSTALL_ROOT)$(prefix)/man
 
 # Directory in which to install the manual entries:
 MAN1_INSTALL_DIR =	$(MAN_INSTALL_DIR)/man1
@@ -525,7 +525,7 @@
 tki-install: tki-install-bin tki-install-man tki-install-library tki-install-bitmaps \
tki-install-apps  
 tnm-install-bin: scotty tnm$(SHLIB_SUFFIX)
-	@for i in $(BIN_INSTALL_DIR) $(LIB_RUNTIME_DIR) $(TNM_INSTALL_DIR) ; \
+	@for i in $(BIN_INSTALL_DIR) $(LIB_INSTALL_DIR) $(TNM_INSTALL_DIR) ; \
 	    do \
 	    if [ ! -d $$i ] ; then \
 		echo "Making directory $$i"; \
@@ -537,9 +537,11 @@
 	@echo "Installing scotty as $(BIN_INSTALL_DIR)/scotty$(TNM_VERSION)"
 	@$(INSTALL_PROGRAM) scotty $(BIN_INSTALL_DIR)/scotty$(TNM_VERSION)
 	@echo "Installing tnm$(TNM_VERSION)$(SHLIB_SUFFIX) as \
                $(LIB_RUNTIME_DIR)/tnm$(TNM_VERSION)$(SHLIB_SUFFIX)"
-	@$(INSTALL_DATA) tnm$(SHLIB_SUFFIX) \
                $(LIB_RUNTIME_DIR)/tnm$(TNM_VERSION)$(SHLIB_SUFFIX)
-	@chmod 555 $(LIB_RUNTIME_DIR)/tnm$(TNM_VERSION)$(SHLIB_SUFFIX)
+	@$(INSTALL_DATA) tnm$(SHLIB_SUFFIX) \
$(LIB_INSTALL_DIR)/tnm$(TNM_VERSION)$(SHLIB_SUFFIX) +	@chmod 555 \
$(LIB_INSTALL_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 +	@[ -d tmp-install-tnm ] || mkdir tmp-install-tnm
+	@echo 'package ifneeded Tnm $(TNM_VERSION) "load \
$(LIB_INSTALL_DIR)/tnm$(TNM_VERSION)[info sharedlibextension]"' > \
tmp-install-tnm/pkgIndex.tcl  
 tnm-install-man:
 	@for i in $(MAN_INSTALL_DIR) $(MAN1_INSTALL_DIR) $(MAN8_INSTALL_DIR) \
$(MANN_INSTALL_DIR) ; \ @@ -600,8 +602,10 @@
 		    $(INSTALL_DATA) $$i $(TNM_INSTALL_DIR)/mibs ; \
 		done ; \
 	    done
-	@TCLLIBPATH="$(TNM_INSTALL_DIR) $$TCLLIBPATH"; \
+	@TCLLIBPATH="tmp-install-tnm $(TNM_INSTALL_DIR) $$TCLLIBPATH"; \
 	export TCLLIBPATH; \
+	TNM_LIBRARY="$(TNM_INSTALL_DIR)"; \
+	export TNM_LIBRARY; \
 	echo 'foreach f $$tnm(mibs) {puts "Parsing $$f"; Tnm::mib load $$f}; exit' | \
 		./scotty
 
@@ -709,7 +713,7 @@
 	    done;
 
 tki-install-bin: tkined$(SHLIB_SUFFIX) tkined $(TKI_LIBRARY_DIR)/pkgIndex.tcl
-	@for i in $(BIN_INSTALL_DIR) $(LIB_RUNTIME_DIR) $(TKI_INSTALL_DIR) ; \
+	@for i in $(BIN_INSTALL_DIR) $(LIB_INSTALL_DIR) $(TKI_INSTALL_DIR) ; \
 	    do \
 	    if [ ! -d $$i ] ; then \
 		echo "Making directory $$i"; \
@@ -721,8 +725,8 @@
 	@echo "Installing tkined as $(BIN_INSTALL_DIR)/tkined$(TKI_VERSION)"
 	@$(INSTALL_PROGRAM) tkined $(BIN_INSTALL_DIR)/tkined$(TKI_VERSION)
 	@echo "Installing tkined$(TKI_VERSION)$(SHLIB_SUFFIX) as \
                $(LIB_RUNTIME_DIR)/tkined$(TKI_VERSION)$(SHLIB_SUFFIX)"
-	@$(INSTALL_DATA) tkined$(SHLIB_SUFFIX) \
                $(LIB_RUNTIME_DIR)/tkined$(TKI_VERSION)$(SHLIB_SUFFIX)
-	@chmod 555 $(LIB_RUNTIME_DIR)/tkined$(TKI_VERSION)$(SHLIB_SUFFIX)
+	@$(INSTALL_DATA) tkined$(SHLIB_SUFFIX) \
$(LIB_INSTALL_DIR)/tkined$(TKI_VERSION)$(SHLIB_SUFFIX) +	@chmod 555 \
$(LIB_INSTALL_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)  
@@ -841,7 +845,7 @@
 tnm-uninstall:
 	@echo "Removing scotty$(TNM_VERSION) and tnm$(TNM_VERSION)$(SHLIB_SUFFIX)"
 	@rm -f $(BIN_INSTALL_DIR)/scotty$(TNM_VERSION)
-	@rm -f $(LIB_RUNTIME_DIR)/tnm$(TNM_VERSION)$(SHLIB_SUFFIX)
+	@rm -f $(LIB_INSTALL_DIR)/tnm$(TNM_VERSION)$(SHLIB_SUFFIX)
 	@for i in $(LIB_INSTALL_DIR)/tnm$(TNM_VERSION)/* ; \
 	    do \
 	    if [ "`basename $$i`" != "site" ] ; then \
@@ -858,7 +862,7 @@
 tki-uninstall:
 	@echo "Removing tkined$(TNM_VERSION) and tkined$(TNM_VERSION)$(SHLIB_SUFFIX)"
 	@rm -f $(BIN_INSTALL_DIR)/tkined$(TKI_VERSION)
-	@rm -f $(LIB_RUNTIME_DIR)/tkined$(TKI_VERSION)$(SHLIB_SUFFIX)
+	@rm -f $(LIB_INSTALL_DIR)/tkined$(TKI_VERSION)$(SHLIB_SUFFIX)
 	@for i in $(LIB_INSTALL_DIR)/tkined$(TKI_VERSION)/* ; \
 	    do \
 	    if [ "`basename $$i`" != "site" ] ; then \


["tkined.spec" (text/plain)]

Summary: tkined (tk-based SNMP manager)
Name: tkined
Version: 02.08.30
Release: 1
Group: Networking/Utilities
Packager: George Ross <gdmr@inf.ed.ac.uk>
Source: scotty-cvs020830.tar.gz
Patch0: scotty-Makefile.in.p2
Copyright: Freely distributable (see "license.terms")
BuildRoot: /var/tmp/%{name}-build

%description
This is "scotty, a software package which
allows to build network management applications using Tcl (and
Tk). The scotty package includes the Tnm Tcl extension which provides
Tcl commands to

        - send and receive ICMP packets
        - query the Domain Name System (DNS)
        - access UDP sockets from Tcl
        - probe and use some selected SUN RPCs
        - retrieve and serve documents via HTTP
        - send and reveice SNMP messages (SNMPv1, SNMPv2USEC, SNMPv2C)
        - write special purpose SNMP agents in Tcl
        - parse and access SNMP MIB definitions
        - schedule jobs that are to be done regularly
        - realize event driven programming on network maps
This scotty distributions also includes the sources for Tkined. Tkined
is a network editor which allows to draw maps showing your network
configuration. The most important feature of Tkined is its programming
interface which allows network management applications to extend the
capabilities of Tkined. Most applications for Tkined are written using
the Tnm Tcl extension."

%prep
%setup -n scotty
%patch -p0

%build
cd unix
./configure --prefix=/usr
make
mv README README.unix

%install
rm -rf $RPM_BUILD_ROOT/usr/bin $RPM_BUILD_ROOT/usr/lib $RPM_BUILD_ROOT/usr/man
cd unix
make install INSTALL_ROOT=$RPM_BUILD_ROOT
make -i sinstall INSTALL_ROOT=$RPM_BUILD_ROOT

%clean

%files
%defattr(-,root,root)
%doc README
%doc unix/README.unix
%doc unix/INSTALL
%doc license.terms
%doc doc
%attr(4755,root,-) /usr/bin/nmicmpd
%attr(4755,root,-) /usr/bin/nmtrapd
/usr/bin/scotty3.0.0
/usr/bin/tkined1.5.0
/usr/lib
/usr/man


Dr George D M Ross, School of Informatics, University of Edinburgh
   Kings Buildings, Mayfield Road, Edinburgh, Scotland, EH9 3JZ
Mail: gdmr@inf.ed.ac.uk   Voice: +44 131 650 5147   Fax: +44 131 667 7209
PGP DSA: 1024/AD758CC5 B91E D430 1E0D 5883 EF6A  426C B676 5C2B AD75 8CC5

[Attachment #7 (application/pgp-signature)]
-- 
!! This message is brought to you via the `tkined' mailing list.
!! Please do not reply to this message to unsubscribe. To unsubscribe or adjust
!! your settings, send a mail message to <tkined-request@ibr.cs.tu-bs.de>
!! or look at https://www.ibr.cs.tu-bs.de/mailman/listinfo/tkined.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic