forked from tcler/bkr-client-improved
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
75 lines (66 loc) · 3.49 KB
/
Makefile
File metadata and controls
75 lines (66 loc) · 3.49 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
export PATH:=${PATH}:/usr/local/bin:~/bin
_bin=/usr/local/bin
_lib=/usr/local/lib
_share=/usr/share/bkr-client-improved
_confdir=/etc/bkr-client-improved
completion_path=/usr/share/bash-completion/completions
install install_runtest: _isroot
@rpm -q redhat-lsb >/dev/null || yum install -y redhat-lsb #package that in default RHEL repo
@if [[ $$(lsb_release -si) != Fedora ]]; then \
if ! rpm -q epel-release; then \
[[ $$(uname -r) =~ ^2\.6\. ]] && rpm -i https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm; \
[[ $$(uname -r) =~ ^3\. ]] && rpm -i https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm; :; \
[[ $$(uname -r) =~ ^4\. ]] && rpm -i https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm; :; \
fi; \
fi
@rpm -q beaker-client || utils/beaker-client_install.sh
@rpm -q tcl >/dev/null || yum install -y tcl #package that in default RHEL repo
@yum install -y tcllib #epel
@ rpm -q tcllib || yum install -y rpms/tcllib-1.19-2.el8.noarch.rpm #workaround for missing tcllib on RHEL-8
@if [[ $$(lsb_release -si) != Fedora ]]; then \
libpath=$$(rpm -ql tcllib|egrep 'tcl8../tcllib-[.0-9]+$$'); ln -sf $${libpath} /usr/lib/$${libpath##*/}; \
fi
@rpm -q procmail >/dev/null || yum install -y procmail #package that in default RHEL repo
mkdir -p $(_confdir) && cp -n -r -d conf/* $(_confdir)/.
cp -f conf/*.example $(_confdir)/.
test -f /etc/beaker/default-ks.cfg || cp -f conf/default-ks.cfg /etc/beaker/.
cd lib; for d in *; do rm -fr $(_lib)/$$d; done
cd utils; for f in *; do rm -fr $(_bin)/$$f; done
cd bkr-runtest; for f in *; do rm -fr $(_bin)/$$f; done
cp -rf -d lib/* $(_lib)/.
cp -f -d bkr-runtest/* utils/* $(_bin)/.
mkdir -p $(_share) && cp -f share/* $(_share)/.
@yum install -y bash-completion
cp -fd bash-completion/* ${completion_path}/.||cp -fd bash-completion/* $${completion_path/\/*/}/.
@rm -f /usr/lib/python2.7/site-packages/bkr/client/commands/cmd_recipes_list.py $(_bin)/distro-pkg #remove old file
@rm -f $(_bin)/distro-to-vm.sh #remove old file
install_all: install_robot _install_web
install_robot: _isroot install_runtest _install_require
#install test robot
@yum install -y tclx #epel
cd bkr-test-robot; for f in *; do [ -d $$f ] && continue; cp -fd $$f $(_bin)/$$f; done
_install_web: _isroot _install_tclsh8.6
#install webfront
[ -d /opt/wub2 ] || { \
yum install -y svn &>/dev/null; \
svn export https://github.com/tcler/wub/trunk /opt/wub2 >/dev/null; }
cd bkr-test-robot/www2; for f in *; do rm -fr /opt/wub2/docroot/$$f; done
cp -rf -d bkr-test-robot/www2/* /opt/wub2/docroot/.
cd /opt/wub2; sed -e 's;redirect /wub/;redirect /trms/;' \
-e 's;^/wub/ ;/trms/ ;' \
site.config >site-trms.config
@chmod o+w /opt/wub2/CA
@chmod u+s /usr/local/bin/trms-service.sh
_install_tclsh8.6: _isroot
@which tclsh8.6 || { ./utils/tcl8.6_install.sh; }
_install_require: _isroot
@sed -i '/^Defaults *secure_path/{/.usr.local.bin/! {s; *$$;:$(_bin);}}' /etc/sudoers
@rpm -q tcl-devel >/dev/null || yum install -y tcl-devel #package that in default RHEL repo
@rpm -q sqlite >/dev/null || yum install -y sqlite #package that in default RHEL repo
@rpm -q sqlite-tcl >/dev/null || { yum install -y sqlite-tcl; exit 0; } #package that in default RHEL repo
@-! tclsh <<<"lappend ::auto_path $(_lib) /usr/lib64; package require tdom" 2>&1|grep -q 'can.t find' || \
{ yum install -y tdom || ./utils/tdom_install.sh; }
_isroot:
@test `id -u` = 0 || { echo "[Warn] need root permission" >&2; exit 1; }
rpm: _isroot
./build_rpm.sh