Browse code

nodejs, kibana, yarn: Package Updates

nodejs - Upgrade to 8.11.4 to fix the CVE-2018-7161 and CVE-2018-7167
kibana - New package 6.4.0 version
yarn - New package

Change-Id: Idb03c60569b6b86b97968a31260190976a2916d5
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/5648
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Anish Swaminathan <anishs@vmware.com>

Keerthana K authored on 2018/09/12 02:04:24
Showing 3 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,118 @@
0
+Name:            kibana
1
+Summary:         Browser-based analytics and search dashboard for Elasticsearch.
2
+Version:         6.4.0
3
+Release:         1%{?dist}
4
+License:         Apache License Version 2.0
5
+URL:             https://www.elastic.co/products/kibana
6
+Source0:         https://github.com/elastic/kibana/archive/%{name}-%{version}.tar.gz
7
+Vendor:          VMware, Inc.
8
+Distribution:    Photon
9
+Group:           System Environment/Daemons
10
+%define sha1     kibana=41879947d7de83d4d1c00bd91182574c0034b6f3
11
+BuildRequires:   git
12
+BuildRequires:   yarn
13
+BuildRequires:   nodejs
14
+BuildRequires:   zip
15
+BuildRequires:   photon-release
16
+BuildRequires:   systemd
17
+Requires:        systemd
18
+Requires:        nodejs
19
+Requires:        elasticsearch
20
+
21
+%global debug_package %{nil}
22
+
23
+%description
24
+Kibana is a window into the Elastic Stack.
25
+It enables visual exploration and real-time analysis of your data in Elasticsearch.
26
+
27
+%prep
28
+%setup -q -n %{name}-%{version}
29
+yarn kbn bootstrap
30
+
31
+%build
32
+export PATH=${PATH}:/usr/bin
33
+yarn build --skip-os-packages
34
+
35
+%install
36
+mkdir -p %{buildroot}%{_datadir}/%{name}
37
+cp -r build/kibana-oss/LICENSE.txt %{buildroot}%{_datadir}/%{name}
38
+cp -r build/kibana-oss/README.txt %{buildroot}%{_datadir}/%{name}
39
+cp -r build/kibana-oss/NOTICE.txt %{buildroot}%{_datadir}/%{name}
40
+cp -r build/kibana-oss/package.json %{buildroot}%{_datadir}/%{name}
41
+cp -r build/kibana-oss/plugins %{buildroot}%{_datadir}/%{name}
42
+cp -r build/kibana-oss/bin %{buildroot}%{_datadir}/%{name}
43
+cp -r build/kibana-oss/src %{buildroot}%{_datadir}/%{name}
44
+cp -r build/kibana-oss/node_modules %{buildroot}%{_datadir}/%{name}
45
+cp -r build/kibana-oss/webpackShims %{buildroot}%{_datadir}/%{name}
46
+cp -r build/kibana-oss/yarn.lock %{buildroot}%{_datadir}/%{name}
47
+cp -r build/kibana-oss/optimize %{buildroot}%{_datadir}/%{name}
48
+
49
+chmod -R 755 %{buildroot}%{_datadir}/%{name}
50
+
51
+install -vdm 755 %{buildroot}%{_sharedstatedir}/%{name}
52
+
53
+mkdir -p %{buildroot}%{_sysconfdir}/default
54
+install -D -m 644 src/dev/build/tasks/os_packages/service_templates/sysv/etc/default/kibana %{buildroot}%{_sysconfdir}/default
55
+
56
+mkdir -p %{buildroot}%{_sysconfdir}/systemd/system
57
+install -D -m 644 src/dev/build/tasks/os_packages/service_templates/systemd/etc/systemd/system/kibana.service %{buildroot}%{_sysconfdir}/systemd/system
58
+
59
+mkdir -p %{buildroot}%{_sysconfdir}/%{name}
60
+install -D -m 644 config/%{name}.yml %{buildroot}%{_sysconfdir}/%{name}
61
+
62
+mkdir -p %{buildroot}%{_sysconfdir}/init.d
63
+install -D -m 644 src/dev/build/tasks/os_packages/service_templates/sysv/etc/init.d/%{name} %{buildroot}%{_sysconfdir}/init.d
64
+
65
+rm -rf %{buildroot}%{_datadir}/%{name}/node_modules/clipboardy
66
+
67
+%pre -p /bin/sh
68
+if ! getent group %{name} >/dev/null; then
69
+    groupadd -r %{name}
70
+fi
71
+if ! getent passwd %{name} >/dev/null; then
72
+    useradd -r -g %{name} -d /var/lib/%{name} -s /sbin/nologin  -c "Kibana User" %{name}
73
+fi
74
+exit 0
75
+
76
+
77
+%post
78
+/sbin/ldconfig
79
+chown -R kibana:kibana /var/lib/kibana
80
+chown -R kibana:kibana /usr/share/kibana
81
+%systemd_post  %{name}.service
82
+
83
+%preun
84
+/sbin/ldconfig
85
+%systemd_preun %{name}.service
86
+
87
+%postun -p /bin/sh
88
+%systemd_postun_with_restart %{name}.service
89
+if [ $1 -eq 0 ] ; then
90
+   getent passwd kibana > /dev/null
91
+   if [ "$?" == "0" ] ; then
92
+      userdel %{name}
93
+   fi
94
+   getent group kibana >/dev/null
95
+   if [ "$?" == "0" ] ; then
96
+      groupdel %{name}
97
+   fi
98
+fi
99
+exit
100
+
101
+%files
102
+%defattr(-,root,root,-)
103
+%dir %{_sharedstatedir}/%{name}
104
+%doc %{_datadir}/%{name}/LICENSE.txt
105
+%doc %{_datadir}/%{name}/README.txt
106
+%{_sysconfdir}/systemd/system/%{name}.service
107
+%{_sysconfdir}/default/%{name}
108
+%{_sysconfdir}/init.d/%{name}
109
+%{_sysconfdir}/%{name}/%{name}.yml
110
+%{_datadir}/%{name}/yarn.lock
111
+%{_datadir}/%{name}/package.json
112
+%dir %{_datadir}/%{name}
113
+%{_datadir}/%{name}
114
+
115
+%changelog
116
+*   Tue Sep 11 2018 Keerthana K <keerthanak@vmware.com> 6.4.0-1
117
+-   Initial kibana package for PhotonOS.
... ...
@@ -1,6 +1,6 @@
1 1
 Summary:        A JavaScript runtime built on Chrome's V8 JavaScript engine.
2 2
 Name:           nodejs
3
-Version:        8.3.0
3
+Version:        8.11.4
4 4
 Release:        1%{?dist}
5 5
 License:        MIT
6 6
 Group:          Applications/System
... ...
@@ -8,7 +8,7 @@ Vendor:         VMware, Inc.
8 8
 Distribution:   Photon
9 9
 URL:            https://github.com/nodejs/node
10 10
 Source0:        https://nodejs.org/download/release/v8.3.0/node-v%{version}.tar.xz
11
-%define         sha1 node=62969b076013b20370fd42b7441b3c7ab7ac924f
11
+%define         sha1 node=195b6e6b53d04659cd6ee6afa203ad486d6eb758
12 12
 
13 13
 BuildRequires:  coreutils >= 8.22, openssl-devel >= 1.0.1
14 14
 Requires:       (coreutils >= 8.22 or toybox)
... ...
@@ -70,6 +70,8 @@ make cctest
70 70
 %{_datadir}/systemtap/tapset/node.stp
71 71
 
72 72
 %changelog
73
+*   Tue Sep 11 2018 Keerthana K <keerthanak@vmware.com> 8.11.4-1
74
+-   Updated to version 8.11.4 to fix CVE-2018-7161 and CVE-2018-7167.
73 75
 *   Wed Feb 14 2018 Xiaolin Li <xiaolinl@vmware.com> 8.3.0-1
74 76
 -   Updated to version 8.3.0
75 77
 *   Fri Oct 13 2017 Alexey Makhalov <amakhalov@vmware.com> 7.7.4-4
76 78
new file mode 100644
... ...
@@ -0,0 +1,47 @@
0
+Summary:        Fast, reliable, and secure dependency management.
1
+Name:           yarn
2
+Version:        1.6.0
3
+Release:        1%{?dist}
4
+License:        BSD 2-Clause
5
+URL:            https://yarnpkg.com
6
+Source0:        https://github.com/yarnpkg/yarn/archive/%{name}-%{version}.tar.gz
7
+%define sha1    yarn=dca4344aa4aa9b31aebe95636985b6fabc4d0542
8
+Vendor:         VMware, Inc.
9
+Distribution:   Photon
10
+Group:          Developement/Languages/NodeJs
11
+BuildRequires:  nodejs
12
+
13
+%global debug_package %{nil}
14
+
15
+%description
16
+Yarn caches every package it has downloaded, so it never needs to download the same package again. It also does
17
+almost everything concurrently to maximize resource utilization. This means even faster installs.
18
+Using a detailed but concise lockfile format and a deterministic algorithm for install operations, Yarn is able to
19
+guarantee that any installation that works on one system will work exactly the same on another system.
20
+Yarn uses checksums to verify the integrity of every installed package before its code is executed.
21
+
22
+%prep
23
+%setup -q -n %{name}-%{version}
24
+npm install
25
+
26
+%build
27
+npm run build
28
+
29
+%install
30
+mkdir -p %{buildroot}%{_libdir}/node_modules/%{name}
31
+mkdir -p %{buildroot}%{_bindir}
32
+cp -r src bin package.json node_modules lib %{buildroot}%{_libdir}/node_modules/%{name}
33
+ln -sf %{_libdir}/node_modules/%{name}/bin/yarn.js %{buildroot}%{_bindir}/yarn
34
+ln -sf %{_libdir}/node_modules/%{name}/bin/yarn.js %{buildroot}%{_bindir}/yarnpkg
35
+
36
+%files
37
+%defattr(-,root,root,-)
38
+%doc LICENSE README.md
39
+%{_bindir}/yarn
40
+%{_bindir}/yarnpkg
41
+%dir %{_libdir}/node_modules/
42
+%{_libdir}/node_modules/%{name}
43
+
44
+%changelog
45
+*   Tue Sep 11 2018 Keerthana K <keerthanak@vmware.com> 1.6.0-1
46
+-   Initial yarn package for PhotonOS.