forked from libyui/libyui-old
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
61 lines (53 loc) · 1.84 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# -*- coding: utf-8 -*-
# make continuous integration using rubygem-packaging_rake_tasks
# Copyright © 2014 SUSE
# MIT license
require "packaging/tasks"
require "packaging/configuration"
# skip 'tarball' task, it's redefined here
Packaging::Tasks.load_tasks(:exclude => ["tarball.rake"])
BUILDDIR = "build"
Packaging.configuration do |conf|
spec_template = Dir.glob("*.spec.{in,cmake}").first
conf.obs_project = "devel:libraries:libyui"
conf.obs_sr_project = "openSUSE:Factory"
conf.package_name = spec_template[/(.*)\.spec\..*/, 1]
conf.package_dir = "#{BUILDDIR}/package"
conf.skip_license_check << /.*/ if conf.package_name =~ /gtk|bindings/
conf.skip_license_check << /bootstrap.sh|ChangeLog|Makefile.cvs/
conf.skip_license_check << /^buildtools\/.*/
conf.skip_license_check << /\.(cmake|gv|ui|xpm)$/
conf.skip_license_check << /^src\/lang_fonts$/
conf.skip_license_check << /\.mng$/ # binary
end
desc 'Pretend to run the test suite'
task :test do
puts 'No tests yet' if verbose
end
LIBYUI_PREFIX = ENV["HOME"] + "/libyui-prefix"
LIBYUI_BASE = ENV.fetch("LIBYUI_BASE", "../libyui")
# build the gem package
desc 'Build a tarball for OBS'
task :tarball do
rm_rf BUILDDIR
unless File.file? "CMakeLists.txt"
ln_sf "#{LIBYUI_BASE}/buildtools/CMakeLists.common", "CMakeLists.txt"
end
lib_dir = `rpm --eval '%{_lib}'`.chomp
mkdir_p BUILDDIR
chdir BUILDDIR do
# unfortunately buildtools are set up in such a way that
# for making a package, all dependencies need to be present and installed :-/
sh("cmake",
"-DCMAKE_BUILD_TYPE=RELEASE",
"-DLIB_DIR=#{lib_dir}",
"-DPREFIX=#{LIBYUI_PREFIX}",
"-DCMAKE_PREFIX_PATH=#{LIBYUI_PREFIX}",
"-DENABLE_WERROR=OFF", # gtk needs this
"..")
sh "make clean"
sh "make -j$(nproc) VERBOSE=1"
sh "make install"
sh "make srcpackage"
end
end