updated/fixed stage3 packages with priority <= 2 (beside ipsec-tools & rarpd)
[hdw-linux/hdw-linux.git] / packages / net / portmap / makefile.patch
1 --- ./Makefile.orig     2005-08-03 22:38:49.000000000 +0200
2 +++ ./Makefile  2005-08-03 22:43:49.000000000 +0200
3 @@ -8,7 +8,7 @@
4  # if you disagree. See `man 3 syslog' for examples. Some syslog versions
5  # do not provide this flexibility.
6  #
7 -FACILITY=LOG_MAIL
8 +FACILITY=LOG_AUTH
9  
10  # To disable tcp-wrapper style access control, comment out the following
11  # macro definitions.  Access control can also be turned off by providing
12 @@ -16,7 +16,8 @@
13  # daemon, is always treated as an authorized host.
14  
15  HOSTS_ACCESS= -DHOSTS_ACCESS
16 -WRAP_LIB = $(WRAP_DIR)/libwrap.a
17 +#WRAP_LIB = $(WRAP_DIR)/libwrap.a
18 +WRAP_LIB = -lwrap
19  
20  # Comment out if your RPC library does not allocate privileged ports for
21  # requests from processes with root privilege, or the new portmap will
22 @@ -71,7 +72,7 @@
23  # With verbose logging on, HP-UX 9.x and AIX 4.1 leave zombies behind when
24  # SIGCHLD is not ignored. Enable next macro for a fix.
25  #
26 -# ZOMBIES = -DIGNORE_SIGCHLD   # AIX 4.x, HP-UX 9.x
27 +ZOMBIES = -DIGNORE_SIGCHLD     # AIX 4.x, HP-UX 9.x
28  
29  # Uncomment the following macro if your system does not have u_long.
30  #
31 @@ -81,7 +82,7 @@
32  # libwrap.a object library. WRAP_DIR should specify the directory with
33  # that library.
34  
35 -WRAP_DIR= ../tcp_wrappers
36 +WRAP_DIR= $(TCPD_DIR)
37  
38  # Auxiliary object files that may be missing from your C library.
39  #
40 @@ -99,22 +100,30 @@
41  
42  # Comment out if your compiler talks ANSI and understands const
43  #
44 -CONST   = -Dconst=
45 +#CONST   = -Dconst=
46  
47  ### End of configurable stuff.
48  ##############################
49  
50 +GLIBC=$(shell grep -s -c __GLIBC__ /usr/include/features.h)
51 +
52 +ifeq ($(GLIBC),0)
53 +LIBS   += # -lbsd
54 +else
55 +LIBS   += -lnsl
56 +endif
57 +
58  SHELL  = /bin/sh
59  
60 -COPT   = $(CONST) -Dperror=xperror $(HOSTS_ACCESS) $(CHECK_PORT) \
61 +COPT   = $(CONST) $(HOSTS_ACCESS) $(CHECK_PORT) \
62         $(SYS) -DFACILITY=$(FACILITY) $(ULONG) $(ZOMBIES) $(SA_LEN) \
63         $(LOOPBACK) $(SETPGRP)
64 -CFLAGS = $(COPT) -O $(NSARCHS)
65 +CFLAGS = -Wall $(COPT) -O2 $(NSARCHS)
66  OBJECTS        = portmap.o pmap_check.o from_local.o $(AUX)
67  
68  all:   portmap pmap_dump pmap_set
69  
70 -portmap: $(OBJECTS) $(WRAP_DIR)/libwrap.a
71 +portmap: $(OBJECTS) # $(WRAP_DIR)/libwrap.a
72         $(CC) $(CFLAGS) -o $@ $(OBJECTS) $(WRAP_LIB) $(LIBS)
73  
74  pmap_dump: pmap_dump.c
75 @@ -129,6 +139,13 @@
76  get_myaddress: get_myaddress.c
77         cc $(CFLAGS) -DTEST -o $@ get_myaddress.c $(LIBS)
78  
79 +install: all
80 +       install -o root -g root -m 0755 -s portmap ${BASEDIR}/sbin
81 +       install -o root -g root -m 0755 -s pmap_dump ${BASEDIR}/usr/sbin
82 +       install -o root -g root -m 0755 -s pmap_set ${BASEDIR}/usr/sbin
83 +       mkdir -p ${BASEDIR}/usr/share/doc/portmap
84 +       cp README ${BASEDIR}/usr/share/doc/portmap/portmapper.txt
85 +
86  lint:  
87         lint $(COPT) $(OBJECTS:%.o=%.c)
88