Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Added apt-cacher-ng #18533

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions Library/Formula/apt-cacher-ng.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
require 'formula'

class AptCacherNg < Formula
homepage 'http://www.unix-ag.uni-kl.de/~bloch/acng/'
url 'http://ftp.debian.org/debian/pool/main/a/apt-cacher-ng/apt-cacher-ng_0.7.13.orig.tar.xz'
sha1 'bb6c3cf8e116ed9800543b7864a3a7b406aa4d5a'

depends_on 'xz' => :build
depends_on 'cmake' => :build
depends_on 'fuse4x' => :build

def install
system 'make apt-cacher-ng'

inreplace 'conf/acng.conf' do |s|
s.gsub! /^CacheDir: .*/, "CacheDir: #{var}/spool/apt-cacher-ng"
s.gsub! /^LogDir: .*/, "LogDir: #{var}/log"
end

# copy default config over
etc.install_p 'conf', 'apt-cacher-ng'

# create the cache directory
(var/'spool/apt-cacher-ng').mkpath

sbin.install 'build/apt-cacher-ng'
man8.install 'doc/man/apt-cacher-ng.8'
end

plist_options :startup => true

def plist; <<-EOS.undent
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>OnDemand</key>
<false/>
<key>RunAtLoad</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>#{opt_prefix}/sbin/apt-cacher-ng</string>
<string>-c</string>
<string>#{etc}/apt-cacher-ng</string>
<string>foreground=1</string>
</array>
<key>ServiceIPC</key>
<false/>
</dict>
</plist>
EOS
end
end