-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathRakefile
42 lines (36 loc) · 1.26 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
require "yast/rake"
Yast::Tasks.configuration do |conf|
#lets ignore license check for now
conf.skip_license_check << /.*/
end
desc "Generate the QSS and CSS files"
task :generate do
unless system("which npm >/dev/null 2>&1")
abort "Error: The npm package is not installed, install it with command " \
"\"zypper install npm-default\""
end
Dir.chdir("src") do
system("npm ci") unless File.exist?("node_modules")
system("npx gulp")
end
end
# support for the "yupdate" tool when running in the inst-sys
if File.exist?("/.packages.initrd")
# redefine the "install" task
Rake::Task["install"].clear
task :install do
# prepare the target directories
destdir = ENV["DESTDIR"] || "/"
icewm_dir = File.join(destdir, "/etc/icewm/")
theme_dir = File.join(destdir, "/usr/share/YaST2/theme/current/")
FileUtils.mkdir_p(icewm_dir)
FileUtils.mkdir_p(theme_dir)
# SLE or openSUSE installation?
sle = File.read("/etc/os-release").match?(/SUSE Linux Enterprise/i)
theme = sle ? "SLE" : "openSUSE"
# copy the theme files, the "/." at the end of the source directory
# means copy all files from that directory
FileUtils.cp_r("theme/#{theme}/wmconfig/.", icewm_dir)
FileUtils.cp_r("theme/#{theme}/.", theme_dir)
end
end