File atop-2.4.0-fix_makefile.patch of Package atop

Index: atop-2.4.0/Makefile
===================================================================
--- atop-2.4.0.orig/Makefile
+++ atop-2.4.0/Makefile
@@ -19,7 +19,8 @@ PMPATH1  = /usr/lib/pm-utils/sleep.d
 PMPATH2  = /usr/lib64/pm-utils/sleep.d
 PMPATHD  = /usr/lib/systemd/system-sleep
 
-CFLAGS  += -O2 -I. -Wall  # -DNOPERFEVENT   # -DHTTPSTATS
+OPTFLAGS = -O2
+CFLAGS  += $(OPTFLAGS) -I. -Wall    # -DHTTPSTATS
 OBJMOD0  = version.o
 OBJMOD1  = various.o  deviate.o   procdbase.o
 OBJMOD2  = acctproc.o photoproc.o photosyst.o  rawlog.o ifprop.o parseable.o
@@ -32,8 +33,8 @@ VERS     = $(shell ./atop -V 2>/dev/null
 all: 		atop atopsar atopacctd atopconvert
 
 atop:		atop.o    $(ALLMODS) Makefile
-		$(CC) -c version.c
-		$(CC) atop.o $(ALLMODS) -o atop -lncurses -lz -lm -lrt $(LDFLAGS)
+		$(CC) -I. -Wall $(OPTFLAGS) -c version.c
+		$(CC) atop.o $(ALLMODS) -o atop -lncurses -lz -lm -lrt $(LDFLAGS) $(OPTFLAGS)
 
 atopsar:	atop
 		ln -sf atop atopsar
@@ -45,7 +46,7 @@ atopconvert:	atopconvert.o
 		$(CC) atopconvert.o -o atopconvert -lz $(LDFLAGS)
 
 netlink.o:	netlink.c
-		$(CC) -I. -Wall -c netlink.c
+		$(CC) -I. -Wall $(OPTFLAGS) -c netlink.c
 
 clean:
 		rm -f *.o atop atopacctd atopconvert
@@ -65,14 +66,10 @@ systemdinstall:	genericinstall
 		then	mkdir -p $(DESTDIR)$(PMPATHD); fi
 		#
 		cp atop.service       $(DESTDIR)$(SYSDPATH)
-		chmod 0644            $(DESTDIR)$(SYSDPATH)/atop.service
 		cp atopgpu.service    $(DESTDIR)$(SYSDPATH)
-		chmod 0644            $(DESTDIR)$(SYSDPATH)/atopgpu.service
 		cp atopacct.service   $(DESTDIR)$(SYSDPATH)
-		chmod 0644            $(DESTDIR)$(SYSDPATH)/atopacct.service
 		cp atop.cronsystemd   $(DESTDIR)$(CRNPATH)/atop
 		cp atop-pm.sh         $(DESTDIR)$(PMPATHD)
-		chmod 0711            $(DESTDIR)$(PMPATHD)/atop-pm.sh
 		#
 		# only when making on target system:
 		#
@@ -144,22 +141,13 @@ genericinstall:	atop atopacctd atopconve
 		then	mkdir -p $(DESTDIR)$(ROTPATH);	fi
 		#
 		cp atop   		$(DESTDIR)$(BINPATH)/atop
-		chown root		$(DESTDIR)$(BINPATH)/atop
-		chmod 04711 		$(DESTDIR)$(BINPATH)/atop
 		ln -sf atop             $(DESTDIR)$(BINPATH)/atopsar
 		cp atopacctd  		$(DESTDIR)$(SBINPATH)/atopacctd
-		chown root		$(DESTDIR)$(SBINPATH)/atopacctd
-		chmod 0700 		$(DESTDIR)$(SBINPATH)/atopacctd
 		cp atopgpud  		$(DESTDIR)$(SBINPATH)/atopgpud
-		chown root		$(DESTDIR)$(SBINPATH)/atopgpud
-		chmod 0700 		$(DESTDIR)$(SBINPATH)/atopgpud
 		cp atop   		$(DESTDIR)$(BINPATH)/atop-$(VERS)
 		ln -sf atop-$(VERS)     $(DESTDIR)$(BINPATH)/atopsar-$(VERS)
 		cp atopconvert 		$(DESTDIR)$(BINPATH)/atopconvert
-		chown root		$(DESTDIR)$(BINPATH)/atopconvert
-		chmod 0711 		$(DESTDIR)$(BINPATH)/atopconvert
 		cp atop.daily    	$(DESTDIR)$(SCRPATH)
-		chmod 0711 	 	$(DESTDIR)$(SCRPATH)/atop.daily
 		cp man/atop.1    	$(DESTDIR)$(MAN1PATH)
 		cp man/atopsar.1 	$(DESTDIR)$(MAN1PATH)
 		cp man/atopconvert.1 	$(DESTDIR)$(MAN1PATH)
openSUSE Build Service is sponsored by