<commit_before>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 install
    prefix.install 'share'
    (include+'libspotify').install "libspotify.framework/Versions/#{version}/Headers/api.h"
    (include+'libspotify').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"

    (lib+'pkgconfig/libspotify.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<commit_msg>libspotify - install lib correctly [nfo]<commit_after>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 install
    prefix.install 'share'
    (include+'libspotify').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"

    (lib+'pkgconfig/libspotify.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
{'fraction_non_alphanumeric': 0.14691735898557062, 'fraction_numerical': 0.028858766943594228, 'mean_word_length': 3.6315789473684212, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3718080', 'n_tokens_mistral': 879, 'n_tokens_neox': 841, 'n_words': 121}