Skip to content

Commit

Permalink
mpd: add test & install example conf file
Browse files Browse the repository at this point in the history
Follow up to Homebrew/legacy-homebrew#39353. The test should ensure we catch the need to
bump in future.

Closes Homebrew/legacy-homebrew#39360.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
  • Loading branch information
DomT4 authored and MikeMcQuaid committed May 15, 2015
1 parent 5977b3d commit 03189fc
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions Formula/mpd.rb
Expand Up @@ -4,7 +4,7 @@ class Mpd < Formula

stable do
url "http://www.musicpd.org/download/mpd/0.19/mpd-0.19.9.tar.xz"
sha1 "6683bee5f132eda318c5a61ec14b2df8d9164d60"
sha256 "47851423053cd38cfad65be5985b41b7cd5bdbe8d0d13378e11748a28b19f26f"
end

bottle do
Expand Down Expand Up @@ -70,6 +70,7 @@ def install
--disable-debug
--disable-dependency-tracking
--prefix=#{prefix}
--sysconfdir=#{etc}
--enable-bzip2
--enable-ffmpeg
--enable-fluidsynth
Expand All @@ -89,7 +90,9 @@ def install
system "./configure", *args
system "make"
ENV.j1 # Directories are created in parallel, so let's not do that
system "make install"
system "make", "install"

(etc+"mpd").install "doc/mpdconf.example" => "mpd.conf"
end

plist_options :manual => "mpd"
Expand All @@ -116,4 +119,18 @@ def plist; <<-EOS.undent
</plist>
EOS
end

test do
pid = fork do
exec "#{bin}/mpd --stdout --no-daemon --no-config"
end
sleep 2

begin
assert_match /OK MPD/, shell_output("curl localhost:6600")
ensure
Process.kill("SIGINT", pid)
Process.wait(pid)
end
end
end

0 comments on commit 03189fc

Please sign in to comment.