require 'formula' class 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