Typo
[linux_from_scratch_hints.git] / OLD / portmapper.txt
blobe69ce2a08492e4bb69be24f69f8b07b17f56778b
1 TITLE:          Portmapper Installation
2 LFS VERSION:    All
3 AUTHOR:         Wolfgang Arendt <wolare@gmx.de>
5 SYNOPSIS:
6         How to install the portmapper
8 HINT:
9 ver 1.0
10 07/03/2001
13 Contents
14 --------
16    1. Introduction
17    2. Where to get the necessary files
18    3. Compiling tcp-wrappers
19    4. Installing tcp-wrappers
20    5. Compiling the portmapper.
21    6. Installing the portmapper
22    7. Creating a start/stop script 
23        
26 1. Introduction
27 ---------------
29 You need the portmapper, if you intend to build a system, that offers NFS or
30 NIS services.
34 2. Where to get the necessary files
35 -----------------------------------
37 You can find the tcp_wrappers package and the portmapper at
38 ftp.porcupine.org/pub/security
39    
40 The latest packages are named tcp_wrappers_7.6-ipv6.1.tar.gz and
41 portmap_5beta.tar.gz.
45 3. Compiling tcp-wrappers
46 -------------------------
48 First, unpack the source package. This creates a directory named
49 tcp_wrappers_7.6-ipv6.1. Make a symbolic link from this directory to
50 tcp_wrappers. This is needed during the compilation of the portmapper. Then
51 enter the top level directory of the tcp wrappers package.
53 First, alter the file percent_m.c by running:
55 cp percent_m.c percent_m.c.backup &&
56 chmod u+w percent_m.c &&
57 cat percent_m.c.backup |\
58 sed -e '/extern char \*sys_errlist\[\];/d' > percent_m.c
60 Then issue:
62 make REAL_DAEMON_DIR=/usr/sbin linux
66 4. Installing tcp-wrappers
67 --------------------------
69 In order to install the tcp wrappers create this file and run it:
71 #!/bin/bash
73 # compress and copy man pages
74 for THIS_FILE in *.[0123456789]; do
75   THIS_SECTION=$(echo $THIS_FILE |\
76     cut -d "." -f 2)
77   cat $THIS_FILE |\
78     gzip > /usr/share/man/man${THIS_SECTION}/${THIS_FILE}.gz
79   echo $THIS_FILE -\> /usr/share/man/man${THIS_SECTION}/${THIS_FILE}.gz
80 done
82 # copy headers
83 cp -v *.h /usr/include
85 # copy libraries
86 cp -v *.a /usr/lib
88 # copy executables
89 for THIS_EXECUTABLE in *; do
90   if [ -x $THIS_EXECUTABLE ]; then
91     # the next 'if' avoids copying this script itself
92     if [ ! $THIS_EXECUTABLE = $(basename $0) ]; then
93       cp -v $THIS_EXECUTABLE /usr/sbin
94     fi
95   fi
96 done
99 This script copies all the manual pages to the /usr/share/man directory. Then it
100 copies the header files to the /usr/include directory and the file libwrap.a to
101 the /usr/lib directory. After that, it copies all the executables to the
102 /usr/sbin directory.
103    
104 That is all, that is to be done for tcp_wrappers. Do not delete the source tree
105 yet, as it is needed during compilation of the portmapper.
106    
109 5. Compiling the portmapper
110 ---------------------------
112 Unpack the source package and change to the top level directory of the unpacked
113 files. First, you need to modify the Makefile. The critical line reads:
115   CONST   = -Dconst=
117 Comment out this line, so that it reads:
119   # CONST   = -Dconst=
121 Now you can build the portmapper by issuing:
123 make
127 6.Installing the portmapper
128 ---------------------------
130 Copy the executable to /usr/sbin:
132 cp portmap /usr/sbin
136 7. Creating a start/stop script
137 -------------------------------
139 All, that is left to be done is, to write a start/stop-script (use
140 /etc/init.d/template) and link it to the runlevel directories 3, 4 and 5 for
141 starting and to 0, 1, 2 and 6 for stopping. Make sure, that the portmapper is
142 being started before starting NFS or NIS services and make sure that these
143 services are being stopped before the portmapper gets killed.
144    
146 I guess, that is it. You just installed the portmapper from scratch.
148 8. Contributions
149 -------------------------------
150 brendan@cs.uchicago.edu wrote on 20021206 (YYYYMMDD):
152 > You can simplify the instructions for portmap and tcp_wrappers by
153 > building portmap with the following command:
155 > make WRAP_LIB=/path/to/libwrap.a CONST=
157 > Doing it this way means you don't need the tcp_wrappers source dir
158 > symlink, and you don't need to edit the portmap Makefile by hand