Ticket #21691: patch-Makefile.diff

File patch-Makefile.diff, 960 bytes (added by jim@…, 15 years ago)

Patch to install as proper user/group and deal with strangeness in the install command

  • Makefile

    old new  
    11PACKAGE=grok
    22PREFIX=/usr/local
     3INSTALL_USER=root
     4INSTALL_GROUP=root
    35
    46CFLAGS+=-pipe -fPIC
    57#CFLAGS+=-pg -g
    68CFLAGS+=-O2
     
    115117.c.o:
    116118        $(CC) -c $(CFLAGS) $< -o $@
    117119
    118120install: libgrok.so grok
    119         install -m 755 -o root -g root grok $(PREFIX)/bin
    120         install -m 644 -o root -g root libgrok.so $(PREFIX)/lib
     121        for dirname in bin lib include; do \
     122                mkdir -p $(PREFIX)/$$dirname; \
     123        done
     124        install -m 755 -o $(INSTALL_USER) -g $(INSTALL_GROUP) grok $(PREFIX)/bin/.
     125        install -m 644 -o $(INSTALL_USER) -g $(INSTALL_GROUP) libgrok.so $(PREFIX)/lib/.
    121126        for header in grok.h grokre.h grok_pattern.h grok_capture.h grok_capture_xdr.h grok_match.h grok_logging.h; do \
    122                 install -m 644 -o root -g root $$header $(PREFIX)/include; \
     127                install -m 644 -o $(INSTALL_USER) -g $(INSTALL_GROUP) $$header $(PREFIX)/include/.; \
    123128        done
    124129