Browse code

Add polkit and js

Change-Id: I447e5c0a2ae5a3aa2d38ef311a96a98ec8304b14
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/4268
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Dheeraj S Shetty <dheerajs@vmware.com>

Vinay Kulkarni authored on 2017/11/11 10:02:22
Showing 2 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,80 @@
0
+Summary:       Mozilla's JavaScript engine.
1
+Name:          js
2
+Version:       1.8.5
3
+Release:       1%{?dist}
4
+Group:         Applications/System
5
+Vendor:        VMware, Inc.
6
+License:       GPLv2+ or LGPLv2+ or MPLv1.1
7
+URL:           https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Releases/1.8.5
8
+Source0:       https://archive.mozilla.org/pub/js/js185-1.0.0.tar.gz
9
+Distribution:  Photon
10
+BuildRequires: autoconf
11
+BuildRequires: readline-devel
12
+BuildRequires: ncurses-devel
13
+BuildRequires: nspr >= 4.7
14
+BuildRequires: zip
15
+Requires:      ncurses
16
+Requires:      nspr >= 4.7
17
+%define sha1 js185=52a01449c48d7a117b35f213d3e4263578d846d6
18
+
19
+%description
20
+Mozilla's JavaScript engine includes a just-in-time compiler (JIT) that compiles
21
+JavaScript to machine code, for a significant speed increase.
22
+
23
+%package devel
24
+Summary:        js devel
25
+Group:          Development/Tools
26
+Requires:       %{name} = %{version}
27
+%description devel
28
+This contains development tools and libraries for SpiderMonkey.
29
+
30
+%prep
31
+%setup -q
32
+
33
+%build
34
+cd js/src
35
+./configure \
36
+    --prefix=%{_prefix} \
37
+    --bindir=%{_bindir} \
38
+    --sbindir=%{_sbindir} \
39
+    --includedir=%{_includedir} \
40
+    --libdir=%{_libdir} \
41
+    --mandir=%{_mandir} \
42
+    --infodir=%{_infodir} \
43
+    --datadir=%{_datarootdir} \
44
+    --sysconfdir=/etc \
45
+    --with-system-nspr \
46
+    --enable-threadsafe \
47
+    --enable-readline
48
+make CXX=g++ CXXFLAGS='-std=gnu++98 -DXP_UNIX=1 -DJS_THREADSAFE=1 -DENABLE_ASSEMBLER=1 -DENABLE_JIT=1'
49
+
50
+%install
51
+cd js/src
52
+make DESTDIR=%{buildroot} install
53
+pushd %{buildroot}/%{_libdir}
54
+ln -fs libmozjs185.so.1.0.0 libmozjs185.so.1.0
55
+ln -fs libmozjs185.so.1.0 libmozjs185.so
56
+popd
57
+find %{buildroot} -name '*.la' -delete
58
+
59
+%post
60
+/sbin/ldconfig
61
+
62
+%postun
63
+/sbin/ldconfig
64
+
65
+%files
66
+%defattr(-,root,root)
67
+%{_bindir}/js-config
68
+%{_libdir}/libmozjs185.so.*
69
+
70
+%files devel
71
+%defattr(-,root,root)
72
+%{_includedir}/%{name}/*
73
+%{_libdir}/libmozjs185-1.0.a
74
+%{_libdir}/libmozjs185.so
75
+%{_libdir}/pkgconfig/mozjs185.pc
76
+
77
+%changelog
78
+*   Fri Nov 10 2017 Vinay Kulkarni <kulkarniv@vmware.com> 1.8.5-1
79
+-   mozjs v1.8.5 for PhotonOS.
0 80
new file mode 100644
... ...
@@ -0,0 +1,119 @@
0
+Summary:       A toolkit for defining and handling authorizations.
1
+Name:          polkit
2
+Version:       0.113
3
+Release:       1%{?dist}
4
+Group:         Applications/System
5
+Vendor:        VMware, Inc.
6
+License:       LGPLv2+
7
+URL:           https://www.freedesktop.org/software/polkit/docs/latest/polkit.8.html
8
+Source0:       https://www.freedesktop.org/software/polkit/releases/%{name}-%{version}.tar.gz
9
+Distribution:  Photon
10
+BuildRequires: autoconf
11
+BuildRequires: expat
12
+BuildRequires: glib-devel
13
+BuildRequires: gobject-introspection
14
+BuildRequires: intltool >= 0.40.0
15
+BuildRequires: js-devel
16
+BuildRequires: Linux-PAM
17
+BuildRequires: systemd
18
+Requires:      expat
19
+Requires:      glib
20
+Requires:      js
21
+Requires:      Linux-PAM
22
+Requires:      systemd
23
+%define sha1 polkit=ef855c2d04184dceb38e0940dc7bec9cc3da415c
24
+
25
+%description
26
+polkit provides an authorization API intended to be used by privileged programs
27
+(“MECHANISMS”) offering service to unprivileged programs (“SUBJECTS”) often
28
+through some form of inter-process communication mechanism
29
+
30
+%package devel
31
+Summary: polkit development headers and libraries
32
+Group: Development/Libraries
33
+Requires: polkit = %{version}-%{release}
34
+
35
+%description devel
36
+header files and libraries for polkit
37
+
38
+%prep
39
+%setup -q
40
+
41
+%build
42
+./configure \
43
+    --prefix=%{_prefix} \
44
+    --bindir=%{_bindir} \
45
+    --sbindir=%{_sbindir} \
46
+    --includedir=%{_includedir} \
47
+    --libdir=%{_libdir} \
48
+    --mandir=%{_mandir} \
49
+    --infodir=%{_infodir} \
50
+    --datadir=%{_datarootdir} \
51
+    --sysconfdir=%{_sysconfdir} \
52
+    --enable-libsystemd-login=yes \
53
+    --with-systemdsystemunitdir=%{_libdir}/systemd/system
54
+make %{?_smp_mflags}
55
+
56
+%install
57
+make DESTDIR=%{buildroot} install
58
+find %{buildroot} -name '*.la' -delete
59
+install -vdm 755 %{buildroot}/etc/pam.d
60
+cat > %{buildroot}/etc/pam.d/polkit-1 << "EOF"
61
+# Begin /etc/pam.d/polkit-1
62
+
63
+auth     include        system-auth
64
+account  include        system-account
65
+password include        system-password
66
+session  include        system-session
67
+
68
+# End /etc/pam.d/polkit-1
69
+EOF
70
+
71
+%check
72
+# Disable check. It requires dbus - not available in chroot/container.
73
+
74
+%pre
75
+getent group polkitd > /dev/null || groupadd -fg 27 polkitd &&
76
+getent passwd polkitd > /dev/null || \
77
+    useradd -c "PolicyKit Daemon Owner" -d /etc/polkit-1 -u 27 \
78
+        -g polkitd -s /bin/false polkitd
79
+
80
+%post
81
+/sbin/ldconfig
82
+
83
+%postun
84
+/sbin/ldconfig
85
+if [ $1 -eq 0 ] ; then
86
+    systemctl stop polkit
87
+    if getent passwd polkitd >/dev/null; then
88
+        userdel polkitd
89
+    fi
90
+    if getent group polkitd >/dev/null; then
91
+        groupdel polkitd
92
+    fi
93
+fi
94
+
95
+%files
96
+%defattr(-,root,root)
97
+%{_bindir}/pk*
98
+%{_libdir}/lib%{name}-*.so.*
99
+%{_libdir}/polkit-1/polkit-agent-helper-1
100
+%{_libdir}/polkit-1/polkitd
101
+%{_libdir}/systemd/system/polkit.service
102
+%{_datarootdir}/dbus-1/system-services/org.freedesktop.PolicyKit1.service
103
+%{_datarootdir}/locale/*
104
+%{_datarootdir}/polkit-1/actions/*.policy
105
+%{_sysconfdir}/dbus-1/system.d/org.freedesktop.PolicyKit1.conf
106
+%{_sysconfdir}/pam.d/polkit-1
107
+%{_sysconfdir}/polkit-1/rules.d/50-default.rules
108
+
109
+%files devel
110
+%defattr(-,root,root)
111
+%{_includedir}/%{name}-1/
112
+%{_libdir}/lib%{name}-*.a
113
+%{_libdir}/lib%{name}-*.so
114
+%{_libdir}/pkgconfig/*.pc
115
+
116
+%changelog
117
+*   Fri Nov 10 2017 Vinay Kulkarni <kulkarniv@vmware.com> 0.113-1
118
+-   polkit for PhotonOS.