patch-Makefile 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. --- logrotate-3.7.8.orig/Makefile 2008-05-19 12:25:54.000000000 +0200
  2. +++ logrotate-3.7.8/Makefile 2011-01-15 23:45:59.000000000 +0100
  3. @@ -1,10 +1,10 @@
  4. VERSION = $(shell awk '/Version:/ { print $$2 }' logrotate.spec)
  5. -OS_NAME = $(shell uname -s)
  6. +OS_NAME = Linux
  7. LFS = $(shell echo `getconf LFS_CFLAGS 2>/dev/null`)
  8. -CFLAGS = -Wall -D_GNU_SOURCE -D$(OS_NAME) -DVERSION=\"$(VERSION)\" $(RPM_OPT_FLAGS) $(LFS)
  9. +CFLAGS ?= -Wall -D_GNU_SOURCE -D$(OS_NAME) -DVERSION=\"$(VERSION)\" $(RPM_OPT_FLAGS) $(LFS)
  10. PROG = logrotate
  11. MAN = logrotate.8
  12. -LOADLIBES = -lpopt
  13. +LIBS = -lpopt
  14. SVNURL= svn+ssh://svn.fedorahosted.org/svn/logrotate
  15. SVNPUBURL = http://svn.fedorahosted.org/svn/logrotate
  16. SVNTAG = r$(subst .,-,$(VERSION))
  17. @@ -68,10 +68,7 @@ MANDIR = $(BASEDIR)/man
  18. OBJS = logrotate.o log.o config.o basenames.o
  19. SOURCES = $(subst .o,.c,$(OBJS) $(LIBOBJS))
  20. -ifeq ($(RPM_OPT_FLAGS),)
  21. -CFLAGS += -g
  22. -LDFLAGS = -g
  23. -endif
  24. +LDFLAGS ?=
  25. ifeq (.depend,$(wildcard .depend))
  26. TARGET=$(PROG)
  27. @@ -84,6 +81,7 @@ RCSVERSION = $(subst .,-,$(VERSION))
  28. all: $(TARGET)
  29. $(PROG): $(OBJS)
  30. + $(CC) $(LDFLAGS) -o $(PROG) $^ $(LIBS)
  31. clean:
  32. rm -f $(OBJS) $(PROG) core* .depend
  33. @@ -96,16 +94,16 @@ test: $(TARGET)
  34. (cd test; ./test)
  35. install:
  36. - [ -d $(PREFIX)/$(BINDIR) ] || mkdir -p $(PREFIX)/$(BINDIR)
  37. - [ -d $(PREFIX)/$(MANDIR) ] || mkdir -p $(PREFIX)/$(MANDIR)
  38. - [ -d $(PREFIX)/$(MANDIR)/man8 ] || mkdir -p $(PREFIX)/$(MANDIR)/man8
  39. + [ -d $(DESTDIR)/$(BINDIR) ] || mkdir -p $(DESTDIR)/$(BINDIR)
  40. + [ -d $(DESTDIR)/$(MANDIR) ] || mkdir -p $(DESTDIR)/$(MANDIR)
  41. + [ -d $(DESTDIR)/$(MANDIR)/man8 ] || mkdir -p $(DESTDIR)/$(MANDIR)/man8
  42. if [ "$(OS_NAME)" = HP-UX ]; then \
  43. - $(INSTALL) $(PROG) $(PREFIX)/$(BINDIR) 0755 bin bin; \
  44. - $(INSTALL) $(MAN) $(PREFIX)/$(MANDIR)/man`echo $(MAN) | sed "s/.*\.//"` 0644 bin bin; \
  45. + $(INSTALL) $(PROG) $(DESTDIR)/$(BINDIR) 0755 bin bin; \
  46. + $(INSTALL) $(MAN) $(DESTDIR)/$(MANDIR)/man`echo $(MAN) | sed "s/.*\.//"` 0644 bin bin; \
  47. else \
  48. - $(INSTALL) -m 755 $(PROG) $(PREFIX)/$(BINDIR); \
  49. - $(INSTALL) -m 644 $(MAN) $(PREFIX)/$(MANDIR)/man`echo $(MAN) | sed "s/.*\.//"`/$(MAN); \
  50. + $(INSTALL) -m 755 $(PROG) $(DESTDIR)/$(BINDIR); \
  51. + $(INSTALL) -m 644 $(MAN) $(DESTDIR)/$(MANDIR)/man`echo $(MAN) | sed "s/.*\.//"`/$(MAN); \
  52. fi
  53. co: