/thirdparty/liblastfm2/configure

http://github.com/tomahawk-player/tomahawk · Ruby · 46 lines · 44 code · 1 blank · 1 comment · 3 complexity · 1be679cc1aea11b537c35574486c5487 MD5 · raw file

  1. #!/usr/bin/ruby
  2. cwd = File.dirname( __FILE__ )
  3. require "#{cwd}/admin/utils.rb"
  4. h2 'Determining installation prefix' do
  5. if ARGV.include? '--prefix'
  6. n=ARGV.index '--prefix'
  7. ENV['LFM_PREFIX'] = ARGV[n+1]
  8. end
  9. ENV['LFM_PREFIX'] = '/usr/local' if ENV['LFM_PREFIX'].nil?
  10. if File.exists? ENV['LFM_PREFIX'] and !File.directory? ENV['LFM_PREFIX']
  11. abort "Installation prefix exists but isn't a directory: "+ENV['LFM_PREFIX']
  12. end
  13. puts "Will install to: "+ENV['LFM_PREFIX']
  14. end
  15. h2 "Configuring qmake..." do
  16. args=Array.new
  17. if ARGV.include? '--release'
  18. args << '-config release'
  19. else
  20. args << '-config debug'
  21. end
  22. if ARGV.include? '--no-strip'
  23. args << '"CONFIG += nostrip"'
  24. end
  25. ENV['LFM_QMAKE'] = "#{$qmake} #{args.join(' ')}"
  26. end
  27. h2 "Generating Makefile..." do
  28. hs = Array.new
  29. hs << 'global.h'
  30. hs << 'core/UrlBuilder.h' << 'core/XmlQuery.h' << 'core/misc.h'
  31. hs << 'fingerprint/Fingerprint.h' << 'fingerprint/FingerprintableSource.h'
  32. hs << 'radio/RadioStation.h' << 'radio/RadioTuner.h'
  33. hs << 'scrobble/Audioscrobbler.h' << 'scrobble/ScrobblePoint.h' << 'scrobble/ScrobbleCache.h'
  34. hs << 'types/Tasteometer.h' << 'types/AbstractType.h' << 'types/Track.h' << 'types/Mbid.h' << 'types/Artist.h' << 'types/Album.h' << 'types/FingerprintId.h' << 'types/Playlist.h' << 'types/Tag.h' << 'types/User.h' << 'types/Xspf.h'
  35. hs << 'ws/ws.h' << 'ws/InternetConnectionMonitor.h' << 'ws/NetworkAccessManager.h'
  36. uname = `uname`
  37. ENV['LFM_VERSION']="0.4.0"
  38. File.new("#{cwd}/Makefile", 'w').write `ruby admin/Makefile.rb #{hs.join(' ')}`
  39. end
  40. puts
  41. puts "Good, your configure is finished! Now type: make"