homebrew-core/Formula/libspotify.rb
2010-06-07 14:15:45 -07:00

46 lines
1.1 KiB
Ruby

require 'formula'
class Libspotify <Formula
url 'http://developer.spotify.com/download/libspotify/libspotify-0.0.4-darwin.zip'
version '0.0.4'
homepage 'http://developer.spotify.com/en/libspotify/overview/'
md5 'a97552130df26b1aa2228adcf8d4210b'
def inc
include + 'libspotify'
end
def pc
lib+'pkgconfig/libspotify.pc'
end
def install
prefix.install 'share'
inc.install "libspotify.framework/Versions/#{version}/Headers/api.h"
lib.install "libspotify.framework/Versions/#{version}/libspotify" => 'libspotify.0.0.4.dylib'
doc.install Dir['doc/*']
cd lib
ln_s "libspotify.0.0.4.dylib", "libspotify.dylib"
system "install_name_tool",
"-id",
"#{HOMEBREW_PREFIX}/lib/libspotify.#{version}.dylib",
"libspotify.dylib"
pc.write pc_content
end
def pc_content; <<-EOS.undent
prefix=#{HOMEBREW_PREFIX}
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: libspotify
Description: Spotify client library
Version: #{version}
Libs: -L${libdir} -lspotify
Cflags: -I${includedir}
EOS
end
end