]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Ported r180 from branches/v2_2_6_1 (DESTDIR support in Makefile)
authorFrédéric Marchal <fmarchal@users.sourceforge.net>
Thu, 31 Dec 2009 08:02:34 +0000 (08:02 +0000)
committerFrédéric Marchal <fmarchal@users.sourceforge.net>
Thu, 31 Dec 2009 08:02:34 +0000 (08:02 +0000)
ChangeLog
Makefile.in

index 00fdc2bd8bda3181644b8bd9894acd85c1c7964c..1cc87aab1e975bf144284ae9b115ed9ab30829f5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -17,7 +17,7 @@ Dec-31-2009 Version 2.2.7
                - Only copy the files when creating the directory with the images to link the reports to.
                - Directories deleted without using the rm system command.
 
-Dec-17-2009 Version 2.2.6.1
+Dec-31-2009 Version 2.2.6.1
                - Remove unnecessary dependency on off_t.
                - Configuration doesn't fail if rlim_t is not available.
                - Test for the availability of -Werror=implicit-function-declaration and -Werror=format flags in gcc (thanks to Murilo Moreira de Oliveira and pjetko).
@@ -29,6 +29,7 @@ Dec-17-2009 Version 2.2.6.1
                - The date stored in sarg-date is now stored in a more machine readable form (thanks to rcastanheira for pointing this out).
                - The date read from sarg-date was not properly parsed and would produce a wrongly sorted index across a year change (thanks to rcastanheira for pointing this out).
                - my_mkdir changed to avoid the use of getword, be simpler and, maybe, work reliably on windows.
+               - Makefile supports DESTDIR for easy package creation (thanks to Erjo).
 
 Oct-14-2009 Version 2.2.6
                - Protection against buffer overflows in getword and friends and report the origin of the error instead of always blaming access.log.
index b549f3d85eec473048e6c3e17d82b7450b464f30..b8e48a9af08e7dbe487cbc4bfc3bd729d75b88b7 100644 (file)
@@ -57,54 +57,54 @@ sarg: $(OBJS)
        $(CC) $(LDFLAGS) $(OBJS) -o $@ $(LIBS) $(LIBCRYPT)
 
 install: all
-       -@if test ! -d $(BINDIR); then \
-               echo "creating $(BINDIR)"; \
-               mkdir -p $(BINDIR); \
+       -@if test ! -d $(DESTDIR)$(BINDIR); then \
+               echo "creating $(DESTDIR)$(BINDIR)"; \
+               mkdir -p $(DESTDIR)$(BINDIR); \
        fi
-       -@if test ! -d $(MANDIR); then \
-               echo "creating $(MANDIR)"; \
-               mkdir -p $(MANDIR); \
+       -@if test ! -d $(DESTDIR)$(MANDIR); then \
+               echo "creating $(DESTDIR)$(MANDIR)"; \
+               mkdir -p $(DESTDIR)$(MANDIR); \
        fi
-       -@if test ! -d $(SYSCONFDIR); then \
-               echo "creating $(SYSCONFDIR)"; \
-               mkdir -p $(SYSCONFDIR); \
+       -@if test ! -d $(DESTDIR)$(SYSCONFDIR); then \
+               echo "creating $(DESTDIR)$(SYSCONFDIR)"; \
+               mkdir -p $(DESTDIR)$(SYSCONFDIR); \
        fi
-       -@if test ! -d $(LANGDIR); then \
-               echo "Creating $(LANGDIR)"; \
-               mkdir -p $(LANGDIR); \
+       -@if test ! -d $(DESTDIR)$(LANGDIR); then \
+               echo "Creating $(DESTDIR)$(LANGDIR)"; \
+               mkdir -p $(DESTDIR)$(LANGDIR); \
        fi
-       -@if test ! -d $(FONTDIR); then \
-               echo "Creating $(FONTDIR)"; \
-               mkdir -p $(FONTDIR); \
+       -@if test ! -d $(DESTDIR)$(FONTDIR); then \
+               echo "Creating $(DESTDIR)$(FONTDIR)"; \
+               mkdir -p $(DESTDIR)$(FONTDIR); \
        fi
-       -@if test ! -d $(IMAGEDIR); then \
-               echo "Creating $(IMAGEDIR)"; \
-               mkdir -p $(IMAGEDIR); \
+       -@if test ! -d $(DESTDIR)$(IMAGEDIR); then \
+               echo "Creating $(DESTDIR)$(IMAGEDIR)"; \
+               mkdir -p $(DESTDIR)$(IMAGEDIR); \
        fi
-       $(INSTALL_PROGRAM) sarg $(BINDIR)/sarg
-       chmod 755 $(BINDIR)/sarg
-       $(INSTALL_PROGRAM) sarg.1 $(MANDIR)/sarg.1
-       chmod 755 $(MANDIR)/sarg.1
-       @if test ! -f $(SYSCONFDIR)/sarg.conf; then \
-               echo "cp $(SYSCONFDIR)/sarg.conf"; \
-               cp sarg.conf $(SYSCONFDIR)/sarg.conf; \
+       $(INSTALL_PROGRAM) sarg $(DESTDIR)$(BINDIR)/sarg
+       chmod 755 $(DESTDIR)$(BINDIR)/sarg
+       $(INSTALL_PROGRAM) sarg.1 $(DESTDIR)$(MANDIR)/sarg.1
+       chmod 755 $(DESTDIR)$(MANDIR)/sarg.1
+       @if test ! -f $(DESTDIR)$(SYSCONFDIR)/sarg.conf; then \
+               echo "cp $(DESTDIR)$(SYSCONFDIR)/sarg.conf"; \
+               cp sarg.conf $(DESTDIR)$(SYSCONFDIR)/sarg.conf; \
        else \
-               cp sarg.conf $(SYSCONFDIR)/sarg.conf.default; \
+               cp sarg.conf $(DESTDIR)$(SYSCONFDIR)/sarg.conf.default; \
        fi
-       cp -r ./languages/* $(LANGDIR);
-       cp ./exclude_codes $(SYSCONFDIR);
-       cp ./user_limit_block $(SYSCONFDIR);
-       cp -r ./images/* $(IMAGEDIR);
-       cp -r ./sarg-php $(SYSCONFDIR);
-       cp -r ./fonts/* $(FONTDIR);
-       cp -r ./css.tpl $(SYSCONFDIR);
-       -@if test -d $(HTMLDIR); then \
-               cp -r ./sarg-php $(HTMLDIR);    \
+       cp -r ./languages/* $(DESTDIR)$(LANGDIR);
+       cp ./exclude_codes $(DESTDIR)$(SYSCONFDIR);
+       cp ./user_limit_block $(DESTDIR)$(SYSCONFDIR);
+       cp -r ./images/* $(DESTDIR)$(IMAGEDIR);
+       cp -r ./sarg-php $(DESTDIR)$(SYSCONFDIR);
+       cp -r ./fonts/* $(DESTDIR)$(FONTDIR);
+       cp -r ./css.tpl $(DESTDIR)$(SYSCONFDIR);
+       -@if test -d $(DESTDIR)$(HTMLDIR); then \
+               cp -r ./sarg-php $(DESTDIR)$(HTMLDIR);  \
        fi
 
 uninstall:
-       rm -f $(BINDIR)/sarg
-       rm -f $(MANDIR)/sarg.1
+       rm -f $(DESTDIR)$(BINDIR)/sarg
+       rm -f $(DESTDIR)$(MANDIR)/sarg.1
 
 TAGS: $(SRCS)
        etags $(SRCS)