homebrew-core/Formula/minidlna.rb

56 lines
1.5 KiB
Ruby
Raw Normal View History

2014-06-17 06:50:04 +00:00
require "formula"
class Minidlna < Formula
2014-06-17 06:50:04 +00:00
homepage "http://sourceforge.net/projects/minidlna/"
url "https://downloads.sourceforge.net/project/minidlna/minidlna/1.1.3/minidlna-1.1.3.tar.gz"
sha1 "3e5b907fd35b667eb50af98e1f986c7f461a6042"
depends_on "libav"
depends_on "libexif"
depends_on "jpeg"
depends_on "libid3tag"
depends_on "flac"
depends_on "libogg"
depends_on "libvorbis"
depends_on "sqlite"
depends_on "ffmpeg"
2014-03-17 02:35:21 +00:00
patch do
url "http://sourceforge.net/p/minidlna/patches/104/attachment/0001-Remove-check-for-getifaddr-returning-IFF_SLAVE-if-IF.patch"
sha1 "768b119a59c803af4d074138b70b245aa72e426f"
end
def install
2014-06-17 06:50:04 +00:00
ENV.append_to_cflags "-std=gnu89"
system "./configure", "--exec-prefix=#{prefix}"
system "make", "install"
sample_config_path.write sample_config
end
2014-05-03 18:52:11 +00:00
def caveats; <<-EOS.undent
Simple single-user configuration:
mkdir -p ~/.config/minidlna
cp #{sample_config_path} ~/.config/minidlna/minidlna.conf
ln -s YOUR_MEDIA_DIR ~/.config/minidlna/media
minidlnad -f ~/.config/minidlna/minidlna.conf -P ~/.config/minidlna/minidlna.pid
EOS
end
def sample_config_path
share + "minidlna/minidlna.conf"
end
def sample_config; <<-EOS.undent
friendly_name=Mac DLNA Server
media_dir=#{ENV['HOME']}/.config/minidlna/media
db_dir=#{ENV['HOME']}/.config/minidlna/cache
log_dir=#{ENV['HOME']}/.config/minidlna
EOS
end
test do
system "#{sbin}/minidlnad", "-V"
end
end