diff -urN ppp-2.4.7/chat/Makefile.linux ppp-2.4.7-patched/chat/Makefile.linux --- ppp-2.4.7/chat/Makefile.linux 2014-08-09 23:31:39.000000000 +1100 +++ ppp-2.4.7-patched/chat/Makefile.linux 2014-08-11 16:19:06.400359190 +1100 @@ -10,7 +10,7 @@ CDEF4= -DFNDELAY=O_NDELAY # Old name value CDEFS= $(CDEF1) $(CDEF2) $(CDEF3) $(CDEF4) -COPTS= -O2 -g -pipe +COPTS= $(RPM_OPT_FLAGS) CFLAGS= $(COPTS) $(CDEFS) INSTALL= install diff -urN ppp-2.4.7/pppd/Makefile.linux ppp-2.4.7-patched/pppd/Makefile.linux --- ppp-2.4.7/pppd/Makefile.linux 2014-08-09 23:31:39.000000000 +1100 +++ ppp-2.4.7-patched/pppd/Makefile.linux 2014-08-11 16:19:35.206814899 +1100 @@ -30,10 +30,10 @@ include .depend endif -# CC = gcc +CC = gcc # -COPTS = -O2 -pipe -Wall -g -LIBS = +COPTS = -Wall $(RPM_OPT_FLAGS) +LIBS = -lutil # Uncomment the next 2 lines to include support for Microsoft's # MS-CHAP authentication protocol. Also, edit plugins/radius/Makefile.linux. @@ -61,7 +61,7 @@ USE_TDB=y HAS_SHADOW=y -#USE_PAM=y +USE_PAM=y HAVE_INET6=y # Enable plugins diff -urN ppp-2.4.7/pppd/plugins/Makefile.linux ppp-2.4.7-patched/pppd/plugins/Makefile.linux --- ppp-2.4.7/pppd/plugins/Makefile.linux 2014-08-09 23:31:39.000000000 +1100 +++ ppp-2.4.7-patched/pppd/plugins/Makefile.linux 2014-08-11 16:19:06.400359190 +1100 @@ -1,5 +1,5 @@ #CC = gcc -COPTS = -O2 -g +COPTS = $(RPM_OPT_FLAGS) CFLAGS = $(COPTS) -I.. -I../../include -fPIC LDFLAGS = -shared INSTALL = install diff -urN ppp-2.4.7/pppd/plugins/pppoatm/Makefile.linux ppp-2.4.7-patched/pppd/plugins/pppoatm/Makefile.linux --- ppp-2.4.7/pppd/plugins/pppoatm/Makefile.linux 2014-08-09 23:31:39.000000000 +1100 +++ ppp-2.4.7-patched/pppd/plugins/pppoatm/Makefile.linux 2014-08-11 16:19:06.400359190 +1100 @@ -1,5 +1,5 @@ #CC = gcc -COPTS = -O2 -g +COPTS = $(RPM_OPT_FLAGS) CFLAGS = $(COPTS) -I../.. -I../../../include -fPIC LDFLAGS = -shared INSTALL = install diff -urN ppp-2.4.7/pppd/plugins/pppol2tp/Makefile.linux ppp-2.4.7-patched/pppd/plugins/pppol2tp/Makefile.linux --- ppp-2.4.7/pppd/plugins/pppol2tp/Makefile.linux 2014-08-09 23:31:39.000000000 +1100 +++ ppp-2.4.7-patched/pppd/plugins/pppol2tp/Makefile.linux 2014-08-11 16:19:06.401359205 +1100 @@ -1,5 +1,5 @@ #CC = gcc -COPTS = -O2 -g +COPTS = $(RPM_OPT_FLAGS) CFLAGS = $(COPTS) -I. -I../.. -I../../../include -fPIC LDFLAGS = -shared INSTALL = install diff -urN ppp-2.4.7/pppd/plugins/radius/Makefile.linux ppp-2.4.7-patched/pppd/plugins/radius/Makefile.linux --- ppp-2.4.7/pppd/plugins/radius/Makefile.linux 2014-08-09 23:31:39.000000000 +1100 +++ ppp-2.4.7-patched/pppd/plugins/radius/Makefile.linux 2014-08-11 16:19:06.401359205 +1100 @@ -12,7 +12,7 @@ INSTALL = install PLUGIN=radius.so radattr.so radrealms.so -CFLAGS=-I. -I../.. -I../../../include -O2 -fPIC -DRC_LOG_FACILITY=LOG_DAEMON +CFLAGS=-I. -I../.. -I../../../include $(RPM_OPT_FLAGS) -fPIC -DRC_LOG_FACILITY=LOG_DAEMON # Uncomment the next line to include support for Microsoft's # MS-CHAP authentication protocol. diff -urN ppp-2.4.7/pppd/plugins/rp-pppoe/Makefile.linux ppp-2.4.7-patched/pppd/plugins/rp-pppoe/Makefile.linux --- ppp-2.4.7/pppd/plugins/rp-pppoe/Makefile.linux 2014-08-09 23:31:39.000000000 +1100 +++ ppp-2.4.7-patched/pppd/plugins/rp-pppoe/Makefile.linux 2014-08-11 16:19:06.401359205 +1100 @@ -25,7 +25,7 @@ # Version is set ONLY IN THE MAKEFILE! Don't delete this! RP_VERSION=3.8p -COPTS=-O2 -g +COPTS=$(RPM_OPT_FLAGS) CFLAGS=$(COPTS) -I../../../include '-DRP_VERSION="$(RP_VERSION)"' all: rp-pppoe.so pppoe-discovery diff -urN ppp-2.4.7/pppdump/Makefile.linux ppp-2.4.7-patched/pppdump/Makefile.linux --- ppp-2.4.7/pppdump/Makefile.linux 2014-08-09 23:31:39.000000000 +1100 +++ ppp-2.4.7-patched/pppdump/Makefile.linux 2014-08-11 16:19:06.401359205 +1100 @@ -2,7 +2,7 @@ BINDIR = $(DESTDIR)/sbin MANDIR = $(DESTDIR)/share/man/man8 -CFLAGS= -O -I../include/net +CFLAGS= $(RPM_OPT_FLAGS) -I../include/net OBJS = pppdump.o bsd-comp.o deflate.o zlib.o INSTALL= install diff -urN ppp-2.4.7/pppstats/Makefile.linux ppp-2.4.7-patched/pppstats/Makefile.linux --- ppp-2.4.7/pppstats/Makefile.linux 2014-08-09 23:31:39.000000000 +1100 +++ ppp-2.4.7-patched/pppstats/Makefile.linux 2014-08-11 16:19:06.401359205 +1100 @@ -10,7 +10,7 @@ PPPSTATOBJS = pppstats.o #CC = gcc -COPTS = -O +COPTS = $(RPM_OPT_FLAGS) COMPILE_FLAGS = -I../include LIBS =