patch file cleanup... ick.. kaloz you owe me some love
[packages.git] / net / rp-l2tp / patches / 001-cross.patch
1 diff -ruN rp-l2tp-0.4-orig/Makefile.in rp-l2tp-0.4-4/Makefile.in
2 --- rp-l2tp-0.4-orig/Makefile.in        2004-07-01 17:17:11.000000000 +0200
3 +++ rp-l2tp-0.4-4/Makefile.in   2005-03-09 16:26:49.000000000 +0100
4 @@ -27,10 +27,10 @@
5  sbindir=@sbindir@
6  
7  OBJS=auth.o debug.o dgram.o main.o md5.o network.o options.o peer.o session.o tunnel.o utils.o
8 -EXTRA_LIBS=@LIBEVENT@/*.o -ldl
9 +EXTRA_LIBS=@LIBEVENT@/*.o -lc -ldl
10  
11  SRCS=$(OBJS:.o=.c)
12 -CFLAGS=-g -I.. -I@LIBEVENT@ -Wall -Wstrict-prototypes -ansi -pedantic -D_GNU_SOURCE -DVERSION=\"$(VERSION)\" -DPREFIX=\"$(prefix)\"
13 +CFLAGS=@CFLAGS@ -I@LIBEVENT@ -Wall -Wstrict-prototypes -ansi -pedantic -D_GNU_SOURCE -DVERSION=\"$(VERSION)\" -DPREFIX=\"$(prefix)\"
14  
15  TARGETS=l2tpd libl2tp.a handlers
16  
17 @@ -38,12 +38,12 @@
18  
19  libl2tp.a: $(OBJS)
20         rm -f $@
21 -       ar -rc $@ $^
22 -       ranlib $@ || true
23 +       $(AR) -rc $@ $^
24 +       @RANLIB@ $@ || true
25  
26  l2tpd: libl2tp.a libevent/libevent.a
27         $(MAKE) -C handlers
28 -       @CC@ -o l2tpd -rdynamic $(OBJS) $(EXTRA_LIBS)
29 +       @CC@ $(CFLAGS) -o l2tpd -rdynamic $(OBJS) $(EXTRA_LIBS)
30  
31  libevent/libevent.a:
32         test -d libevent || ln -s ../libevent .
33 @@ -72,18 +72,20 @@
34         rm -f *.o *.a *~
35         rm -f l2tpd
36         $(MAKE) -C handlers clean
37 +       $(MAKE) -C libevent clean
38  
39  distclean: clean
40 -       rm -f Makefile config.cache
41 +       rm -f Makefile config.cache config.log config.status .depend
42         $(MAKE) -C handlers distclean
43 +       $(MAKE) -C libevent distclean
44  
45  -include .depend
46  
47  install: all
48         -mkdir -p $(RPM_INSTALL_ROOT)$(DESTDIR)$(sbindir)
49 -       $(install) -m 755 -s l2tpd $(RPM_INSTALL_ROOT)$(DESTDIR)$(sbindir)
50 +       $(install) -m 755 l2tpd $(RPM_INSTALL_ROOT)$(DESTDIR)$(sbindir)
51         -mkdir -p $(RPM_INSTALL_ROOT)$(DESTDIR)/etc/l2tp
52 -       $(install) -m 644 l2tp.conf $(RPM_INSTALL_ROOT)$(DESTDIR)/etc/l2tp/l2tp.conf.example
53 +       $(install) -m 644 l2tp.conf $(RPM_INSTALL_ROOT)$(DESTDIR)/etc/l2tp.conf.example
54         -mkdir -p $(RPM_INSTALL_ROOT)$(DESTDIR)$(mandir)/man8
55         -mkdir -p $(RPM_INSTALL_ROOT)$(DESTDIR)$(mandir)/man5
56         $(install) -m 644 man/l2tpd.8 $(RPM_INSTALL_ROOT)$(DESTDIR)$(mandir)/man8
57 diff -ruN rp-l2tp-0.4-orig/handlers/Makefile.in rp-l2tp-0.4-4/handlers/Makefile.in
58 --- rp-l2tp-0.4-orig/handlers/Makefile.in       2002-09-30 21:45:00.000000000 +0200
59 +++ rp-l2tp-0.4-4/handlers/Makefile.in  2005-03-09 16:26:49.000000000 +0100
60 @@ -14,32 +14,34 @@
61  
62  OBJS=pty.o sync-pppd.o dstring.o
63  SRCS=$(OBJS:.o=.c)
64 -CFLAGS=-g -O2 -I.. -I../libevent -I../../libevent -Wall
65 +CFLAGS=@CFLAGS@ -I.. -I../libevent -I../../libevent -Wall
66  
67  all: $(HANDLERS) l2tp-control
68  
69  l2tp-control: cmd-control.o
70 -       gcc -o l2tp-control cmd-control.o
71 +       $(CC) $(CFLAGS) -o l2tp-control cmd-control.o
72  
73  cmd-control.o: cmd-control.c
74 -       gcc -c -o $@ $^
75 +       $(CC) $(CFLAGS) -c -o $@ $^
76  
77  %.o: %.c
78 -       gcc $(CFLAGS) -fPIC -c -o $@ $<
79 +       $(CC) $(CFLAGS) -fPIC -c -o $@ $<
80  
81  sync-pppd.so: pty.o sync-pppd.o
82 -       gcc -shared -o $@ $^
83 +       $(CC) $(CFLAGS) -shared -o $@ $^
84  
85  cmd.so: cmd.o dstring.o
86 -       gcc -shared -o $@ $^
87 +       $(CC) $(CFLAGS) -shared -o $@ $^
88  
89  clean:
90         rm -f *.so *.o *~
91         rm -f l2tp-control
92  
93  install: all
94 -       -mkdir -p $(RPM_INSTALL_ROOT)$(sbindir)
95 -       -mkdir -p $(RPM_INSTALL_ROOT)$(prefix)/lib/l2tp/plugins
96 -       $(install) -m 755 -s l2tp-control $(RPM_INSTALL_ROOT)$(sbindir)
97 -       $(install) -m 755 $(HANDLERS) $(RPM_INSTALL_ROOT)$(prefix)/lib/l2tp/plugins
98 +       -mkdir -p $(RPM_INSTALL_ROOT)$(DESTDIR)$(sbindir)
99 +       -mkdir -p $(RPM_INSTALL_ROOT)$(DESTDIR)$(prefix)/lib/l2tp
100 +       $(install) -m 755 l2tp-control $(RPM_INSTALL_ROOT)$(DESTDIR)$(sbindir)
101 +       $(install) -m 755 $(HANDLERS) $(RPM_INSTALL_ROOT)$(DESTDIR)$(prefix)/lib/l2tp
102 +
103  distclean: clean
104 +       rm -f Makefile
105 diff -ruN rp-l2tp-0.4-orig/handlers/cmd-control.c rp-l2tp-0.4-4/handlers/cmd-control.c
106 --- rp-l2tp-0.4-orig/handlers/cmd-control.c     2002-09-30 21:45:00.000000000 +0200
107 +++ rp-l2tp-0.4-4/handlers/cmd-control.c        2005-03-09 16:26:49.000000000 +0100
108 @@ -52,7 +52,7 @@
109  
110      memset(&addr, 0, sizeof(addr));
111      addr.sun_family = AF_LOCAL;
112 -    strncpy(addr.sun_path, "/var/run/l2tpctrl", sizeof(addr.sun_path) - 1);
113 +    strncpy(addr.sun_path, "/var/run/l2tp.sock", sizeof(addr.sun_path) - 1);
114  
115      fd = socket(AF_LOCAL, SOCK_STREAM, 0);
116      if (fd < 0) {
117 diff -ruN rp-l2tp-0.4-orig/handlers/cmd.c rp-l2tp-0.4-4/handlers/cmd.c
118 --- rp-l2tp-0.4-orig/handlers/cmd.c     2004-07-01 16:58:56.000000000 +0200
119 +++ rp-l2tp-0.4-4/handlers/cmd.c        2005-03-09 16:26:49.000000000 +0100
120 @@ -162,7 +162,7 @@
121  
122      /* We have hit the end of our options.  Open command socket */
123      if (!sockname) {
124 -       sockname = "/var/run/l2tpctrl";
125 +       sockname = "/var/run/l2tp.sock";
126      }
127  
128      (void) remove(sockname);
129 diff -ruN rp-l2tp-0.4-orig/libevent/Makefile.in rp-l2tp-0.4-4/libevent/Makefile.in
130 --- rp-l2tp-0.4-orig/libevent/Makefile.in       2002-09-30 21:45:00.000000000 +0200
131 +++ rp-l2tp-0.4-4/libevent/Makefile.in  2005-03-09 16:26:49.000000000 +0100
132 @@ -18,24 +18,27 @@
133  
134  libevent.a: $(OBJS)
135         rm -f libevent.a
136 -       ar -cq libevent.a $(OBJS)
137 +       $(AR) r libevent.a $(OBJS)
138         @RANLIB@ libevent.a
139  
140  event.o: event.c $(HDRS)
141 -       gcc $(CFLAGS) -c -o event.o event.c
142 +       $(CC) $(CFLAGS) -c -o event.o event.c
143  
144  hash.o: hash.c $(HDRS)
145 -       gcc $(CFLAGS) -c -o hash.o hash.c
146 +       $(CC) $(CFLAGS) -c -o hash.o hash.c
147  
148  event_sig.o: event_sig.c $(HDRS)
149 -       gcc $(CFLAGS) -c -o event_sig.o event_sig.c
150 +       $(CC) $(CFLAGS) -c -o event_sig.o event_sig.c
151  
152  event_tcp.o: event_tcp.c $(HDRS)
153 -       gcc $(CFLAGS) -c -o event_tcp.o event_tcp.c
154 +       $(CC) $(CFLAGS) -c -o event_tcp.o event_tcp.c
155  
156  clean: FORCE
157         rm -f *.a *.o *~
158  
159 +distclean: clean
160 +       rm -f Makefile
161 +
162  FORCE:
163  
164 -.phony: FORCE
165 \ No newline at end of file
166 +.phony: FORCE
167 diff -ruN rp-l2tp-0.4-orig/main.c rp-l2tp-0.4-4/main.c
168 --- rp-l2tp-0.4-orig/main.c     2002-09-30 21:45:00.000000000 +0200
169 +++ rp-l2tp-0.4-4/main.c        2005-03-09 16:26:49.000000000 +0100
170 @@ -68,7 +68,7 @@
171      l2tp_peer_init();
172      l2tp_debug_set_bitmask(debugmask);
173  
174 -    if (l2tp_parse_config_file(es, "/etc/l2tp/l2tp.conf") < 0) {
175 +    if (l2tp_parse_config_file(es, "/etc/l2tp.conf") < 0) {
176         l2tp_die();
177      }
178  
179 diff -ruN rp-l2tp-0.4-orig/man/l2tp.conf.5 rp-l2tp-0.4-4/man/l2tp.conf.5
180 --- rp-l2tp-0.4-orig/man/l2tp.conf.5    2004-07-01 16:58:56.000000000 +0200
181 +++ rp-l2tp-0.4-4/man/l2tp.conf.5       2005-03-09 16:26:49.000000000 +0100
182 @@ -155,7 +155,7 @@
183  in the global section.  The only option available is:
184  .IP "\fBsocket-path\fP \fIpathname\fR"
185  Specifies the path name of the UNIX-domain socket for controlling the
186 -daemon.  Defaults to \fI/var/run/l2tpctrl\fR.
187 +daemon.  Defaults to \fI/var/run/l2tp.sock\fR.
188  .PP
189  Even if you do not supply any options to cmd, you \fImust\fR have
190  a \fBsection cmd\fR line to activate the handler.
191 diff -ruN rp-l2tp-0.4-orig/man/l2tpd.8 rp-l2tp-0.4-4/man/l2tpd.8
192 --- rp-l2tp-0.4-orig/man/l2tpd.8        2002-09-30 21:45:00.000000000 +0200
193 +++ rp-l2tp-0.4-4/man/l2tpd.8   2005-03-09 16:26:49.000000000 +0100
194 @@ -47,17 +47,17 @@
195  fairly lightweight and efficient.
196  
197  .SH L2TPD CONFIGURATION
198 -On startup, \fBl2tpd\fR reads the configuration file \fB/etc/l2tp/l2tp.conf\fR.
199 +On startup, \fBl2tpd\fR reads the configuration file \fB/etc/l2tp.conf\fR.
200  This configuration file sets operating parameters, describes peers and loads
201  and configures handlers.  See \fBl2tp.conf\fR(5) for configuration
202  file details.
203  
204  .SH FILES
205  .TP
206 -.B /etc/l2tp/l2tp.conf
207 +.B /etc/l2tp.conf
208  Main configuration file.
209  .TP
210 -.B /var/run/l2tpctrl
211 +.B /var/run/l2tp.sock
212  Control socket for \fBcmd.so\fR handler.
213  
214  .SH AUTHORS
215 diff -ruN rp-l2tp-0.4-orig/utils.c rp-l2tp-0.4-4/utils.c
216 --- rp-l2tp-0.4-orig/utils.c    2002-09-30 21:45:00.000000000 +0200
217 +++ rp-l2tp-0.4-4/utils.c       2005-03-09 16:26:49.000000000 +0100
218 @@ -182,7 +182,7 @@
219  *  -1 on error, 0 if OK
220  * %DESCRIPTION:
221  *  Dynamically-loads a handler and initializes it.  If fname is not
222 -*  an absolute path name, we load the handler from /usr/lib/l2tp/plugins
223 +*  an absolute path name, we load the handler from /usr/lib/l2tp
224  ***********************************************************************/
225  int
226  l2tp_load_handler(EventSelector *es,
227 @@ -196,7 +196,7 @@
228      if (*fname == '/') {
229         handle = dlopen(fname, RTLD_NOW);
230      } else {
231 -       snprintf(buf, sizeof(buf), "%s/lib/l2tp/plugins/%s", PREFIX, fname);
232 +       snprintf(buf, sizeof(buf), "%s/lib/l2tp/%s", PREFIX, fname);
233         buf[sizeof(buf)-1] = 0;
234         handle = dlopen(buf, RTLD_NOW);
235      }