--- ppp-2.4.7.orig/pppd/plugins/Makefile.linux	2014-08-09 14:31:39.000000000 +0200
+++ ppp-2.4.7/pppd/plugins/Makefile.linux	2015-06-09 11:14:41.000000000 +0200
@@ -1,13 +1,13 @@
-#CC	= gcc
-COPTS	= -O2 -g
-CFLAGS	= $(COPTS) -I.. -I../../include -fPIC
-LDFLAGS	= -shared
-INSTALL	= install
+#
+# makefile for pppd/plugins
+#
+VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../patchlevel.h)
 
-DESTDIR = $(INSTROOT)@DESTDIR@
-BINDIR = $(DESTDIR)/sbin
-MANDIR = $(DESTDIR)/share/man/man8
-LIBDIR = $(DESTDIR)/lib/pppd/$(VERSION)
+include ../../Makedefs.com
+
+CPPFLAGS += -I.. -I../../include
+CFLAGS	+= -fPIC
+LDFLAGS	+= -shared
 
 SUBDIRS := rp-pppoe pppoatm pppol2tp
 # Uncomment the next line to include the radius authentication plugin
@@ -30,12 +30,10 @@ all:	$(PLUGINS)
 	for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d all; done
 
 %.so: %.c
-	$(CC) -o $@ $(LDFLAGS) $(CFLAGS) $^
-
-VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../patchlevel.h)
+	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $^
 
 install: $(PLUGINS)
-	$(INSTALL) -d $(LIBDIR)
+	$(INSTALL) -d -m 755 $(LIBDIR)
 	$(INSTALL) $? $(LIBDIR)
 	for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d install; done
 
@@ -44,5 +42,4 @@ clean:
 	for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d clean; done
 
 depend:
-	$(CPP) -M $(CFLAGS) *.c >.depend
-	for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d depend; done
+	$(CPP) -M $(CPPFLAGS) *.c >.depend
