PageRenderTime 142ms CodeModel.GetById 80ms app.highlight 1ms RepoModel.GetById 60ms app.codeStats 0ms

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