aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/logrotate.rb
blob: 09713e22ba0d0f94da45bd649117f9012f7dacb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
require 'formula'

class Logrotate < Formula
  homepage 'http://packages.debian.org/testing/admin/logrotate'
  url 'https://fedorahosted.org/releases/l/o/logrotate/logrotate-3.8.3.tar.gz'
  sha1 '19d70e2cfb97c1cee32e0d709da990856311022a'

  depends_on 'popt'

  # Per MacPorts, let these variables be overridden by ENV vars.
  def patches
    DATA
  end

  def install
    # Otherwise defaults to /bin/gz
    ENV["COMPRESS_COMMAND"] = "/usr/bin/gzip"
    ENV["COMPRESS_EXT"] = ".gz"
    ENV["UNCOMPRESS_COMMAND"] = "/usr/bin/gunzip"

    system "make"
    sbin.install 'logrotate'
    man8.install 'logrotate.8'
    man5.install 'logrotate.conf.5'
    (prefix+'etc/logrotate/examples').install Dir['examples/*']
  end
end

__END__
diff --git a/Makefile b/Makefile
index d65a3f3..14d1f3f 100644
--- a/Makefile
+++ b/Makefile
@@ -76,6 +76,22 @@ ifneq ($(POPT_DIR),)
     LOADLIBES += -L$(POPT_DIR)
 endif
 
+ifneq ($(COMPRESS_COMMAND),)
+    CFLAGS += -DCOMPRESS_COMMAND=\"$(COMPRESS_COMMAND)\"
+endif
+
+ifneq ($(COMPRESS_EXT),)
+    CFLAGS += -DCOMPRESS_EXT=\"$(COMPRESS_EXT)\"
+endif
+
+ifneq ($(UNCOMPRESS_COMMAND),)
+    CFLAGS += -DUNCOMPRESS_COMMAND=\"$(UNCOMPRESS_COMMAND)\"
+endif
+
+ifneq ($(DEFAULT_MAIL_COMMAND),)
+    CFLAGS += -DDEFAULT_MAIL_COMMAND=\"$(DEFAULT_MAIL_COMMAND)\"
+endif
+
 ifneq ($(STATEFILE),)
     CFLAGS += -DSTATEFILE=\"$(STATEFILE)\"
 endif