Drop "-p -o root -g root" from the INSTALL_* Makefile variables and honor
the CONF Makefile variable for accessing the global config file instead of
hardcoding it as /etc.

These changes allow users without root access to install wmcalc in their home
directory.
---
 wmcalc/Makefile   | 6 +++---
 wmcalc/wmcalc_c.h | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/wmcalc/Makefile b/wmcalc/Makefile
index 0559573..4dc8440 100644
--- a/wmcalc/Makefile
+++ b/wmcalc/Makefile
@@ -10,11 +10,11 @@ MANDIR = $(PREFIX)/share/man/man1
 CONF   = /etc
 INSTALL = /usr/bin/install
 INSTALL_DIR    = $(INSTALL) -d
-INSTALL_PROGRAM = $(INSTALL) -p -o root -g root -m 755
-INSTALL_FILE    = $(INSTALL) -p -o root -g root -m 644
+INSTALL_PROGRAM = $(INSTALL)
+INSTALL_FILE    = $(INSTALL) -m 644
 
 .c.o:
-       $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $*.o
+       $(CC) -DCONF=\"$(CONF)\" $(CPPFLAGS) $(CFLAGS) -c $< -o $*.o
 
 $(TARGET): $(OBJECTS)
        $(CC) $(LDFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)
diff --git a/wmcalc/wmcalc_c.h b/wmcalc/wmcalc_c.h
index 9212e6d..af41e24 100644
--- a/wmcalc/wmcalc_c.h
+++ b/wmcalc/wmcalc_c.h
@@ -17,7 +17,7 @@
 #define CALC_CMD_SIZE 128
 #define CONFFILENAME  "/.wmcalc"
 #define CONFTEMPFILE  "/tmp/wmcalc.tmp"
-#define CONFIGGLOBAL  "/etc/wmcalc.conf"
+#define CONFIGGLOBAL  CONF"/wmcalc.conf"
 #define VER           0
 #define REL           3
 
-- 
2.1.0


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to