2014-10-29 08:12:55 +00:00
|
|
|
|
|
|
|
NAME="qasim"
|
|
|
|
DESTDIR=""
|
|
|
|
DEV_DESTDIR="tmp"
|
|
|
|
CONFDIR="#{DESTDIR}/etc"
|
|
|
|
BINDIR="#{DESTDIR}/usr/bin"
|
|
|
|
MANDIR="#{DESTDIR}/usr/share/man"
|
|
|
|
DOCDIR="#{DESTDIR}/usr/share/doc"
|
|
|
|
SHAREDIR="#{DESTDIR}/usr/share"
|
|
|
|
|
|
|
|
RUBYVERSION="2.0"
|
|
|
|
RDOC="rdoc#{RUBYVERSION}"
|
|
|
|
|
2014-10-29 21:35:43 +00:00
|
|
|
QRC_FILES=Dir.glob("lib/#{NAME}/*.qrc")
|
|
|
|
RBQRC_FILES=QRC_FILES.map{ |f| f.sub(/\.qrc$/,'_qrc.rb') }
|
2014-10-29 08:12:55 +00:00
|
|
|
|
2014-10-29 21:35:43 +00:00
|
|
|
UI_FILES=Dir.glob("lib/#{NAME}/ui/*.ui")
|
|
|
|
RBUI_FILES=UI_FILES.map{ |f| f.sub(/\.ui$/,'_ui.rb') }
|
|
|
|
|
|
|
|
|
|
|
|
desc "Do everything"
|
2014-10-29 08:12:55 +00:00
|
|
|
task :all => [:build, :install]
|
|
|
|
|
2014-10-29 21:35:43 +00:00
|
|
|
desc "Clean everything"
|
2014-10-29 08:12:55 +00:00
|
|
|
task :clean => [
|
|
|
|
:clean_ui,
|
|
|
|
:clean_qrc,
|
|
|
|
:clean_bin,
|
|
|
|
:clean_lib,
|
2014-10-29 21:35:43 +00:00
|
|
|
:clean_data,
|
|
|
|
:"gem:clean"
|
2014-10-29 08:12:55 +00:00
|
|
|
]
|
|
|
|
|
2014-10-29 21:35:43 +00:00
|
|
|
desc "Build everything"
|
2014-10-29 08:12:55 +00:00
|
|
|
task :build => [
|
|
|
|
:build_ui,
|
|
|
|
:build_qrc,
|
|
|
|
:build_bin,
|
|
|
|
:build_lib,
|
2014-10-29 21:35:43 +00:00
|
|
|
:build_data,
|
|
|
|
:"gem:build"
|
2014-10-29 08:12:55 +00:00
|
|
|
]
|
|
|
|
|
2014-10-29 21:35:43 +00:00
|
|
|
desc "Install everything"
|
2014-10-29 08:12:55 +00:00
|
|
|
task :install => [
|
|
|
|
:install_ui,
|
|
|
|
:install_qrc,
|
|
|
|
:install_bin,
|
|
|
|
:install_lib,
|
|
|
|
:install_data
|
|
|
|
]
|
|
|
|
|
2014-10-29 21:35:43 +00:00
|
|
|
desc "Build documentation"
|
|
|
|
task :doc => [:build_doc]
|
|
|
|
|
2014-10-29 08:12:55 +00:00
|
|
|
task :clean_doc do
|
|
|
|
rm_rf doc
|
|
|
|
end
|
|
|
|
|
|
|
|
task :build_doc => :clean_doc do
|
2014-10-29 21:35:43 +00:00
|
|
|
sh %Q{#{RDOC}
|
2014-10-29 08:12:55 +00:00
|
|
|
--promiscuous
|
|
|
|
--inline-source
|
|
|
|
--line-numbers
|
|
|
|
-o doc lib/$(NAME)/
|
|
|
|
bin/
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
task :clean_qrc do
|
2014-10-29 21:35:43 +00:00
|
|
|
rm_fr RBQRC_FILES
|
2014-10-29 08:12:55 +00:00
|
|
|
end
|
|
|
|
|
2014-10-29 21:35:43 +00:00
|
|
|
task :build_qrc => RBQRC_FILES do
|
|
|
|
puts RBQRC_FILES
|
2014-10-29 08:12:55 +00:00
|
|
|
end
|
|
|
|
|
2014-10-29 21:35:43 +00:00
|
|
|
rule "_qrc.rb" => ".qrc" do |t|
|
|
|
|
sh %Q{rbrcc #{t.source} -o #{t.name}}
|
2014-10-29 08:12:55 +00:00
|
|
|
end
|
|
|
|
|
2014-10-29 21:35:43 +00:00
|
|
|
namespace :gem do
|
|
|
|
require "bundler/gem_tasks"
|
|
|
|
|
|
|
|
desc "Clean stalling gem files from the pkg directory"
|
|
|
|
task :clean do
|
|
|
|
rm_rf Dir.glob('pkg/*.gem')
|
|
|
|
end
|
|
|
|
end
|
2014-10-29 22:31:11 +00:00
|
|
|
|
|
|
|
require 'rake'
|
|
|
|
require "bundler/gem_tasks"
|
|
|
|
require 'rake/testtask'
|
|
|
|
|
|
|
|
Rake::TestTask.new do |t|
|
|
|
|
#t.warning = true
|
|
|
|
#t.verbose = true
|
|
|
|
t.libs << "spec"
|
|
|
|
t.test_files = FileList['spec/**/*_spec.rb']
|
|
|
|
end
|
|
|
|
|