Merge "fix: the incorrect version of tarball generated by gbs export" into tizen
[platform/upstream/js.git] / packaging / js.spec
1 Name:           js
2 Summary:        JavaScript interpreter
3 License:        MPL-1.1 or GPL-2.0+ or LGPL-2.1+
4 Group:          Development/Languages/Other
5 Version:        1.0.0
6 Release:        0
7 Url:            http://www.mozilla.org/js/
8 Source0:        http://ftp.mozilla.org/pub/mozilla.org/%{name}/%{name}-%{version}.tar.bz2
9 Source98:       baselibs.conf
10 BuildRequires:  autoconf213
11 BuildRequires:  gcc-c++
12 BuildRequires:  nspr-devel
13 BuildRequires:  pkg-config
14 BuildRequires:  python
15 BuildRequires:  zip
16 Provides:       mozjs185
17
18 %description
19 JavaScript is the Netscape-developed object scripting language used in millions
20 of web pages and server applications worldwide. Netscape's JavaScript is a
21 superset of the ECMA-262 Edition 3 (ECMAScript) standard scripting language,
22 with only mild differences from the published standard.
23
24 %package -n libmozjs185
25 Summary:        JavaScript library
26 Group:          System/Libraries
27
28 %description -n libmozjs185
29 JavaScript is the Netscape-developed object scripting language used in millions
30 of web pages and server applications worldwide. Netscape's JavaScript is a
31 superset of the ECMA-262 Edition 3 (ECMAScript) standard scripting language,
32 with only mild differences from the published standard.
33
34
35 %package devel
36 Summary:        Header files, libraries and development documentation for %{name}
37 Group:          Development/Libraries/Other
38 Requires:       libmozjs185 = %{version}-%{release}
39 Requires:       pkg-config
40 Provides:       libjs-devel = %{version}-%{release}
41 Provides:       mozjs185-devel
42
43 %description devel
44 This package contains the header files, static libraries and development
45 documentation for %{name}. If you like to develop programs using %{name},
46 you will need to install %{name}-devel.
47
48 %prep
49 %setup -q -n %{name}-%{version}
50
51 %build
52 export MOZILLA_VERSION=%{version}
53 cd js
54 pushd src
55 %ifarch aarch64
56 export CPPFLAGS+=" -DENABLE_JIT=0 "
57 export JIT_CONFIG_OPT="--disable-tracejit --disable-methodjit"
58 %endif
59 %configure --with-system-nspr --enable-threadsafe $JIT_CONFIG_OPT
60
61 popd
62 export BUILD_OPT=1
63 %{__make} %{?_smp_mflags} -C src \
64         JS_THREADSAFE="1" \
65         XCFLAGS="%{optflags} -fPIC " \
66         BUILD_OPT="1" \
67
68 %install
69 cd js/src
70 %make_install
71 %{__rm} -rf %{buildroot}%{_libdir}/libmozjs185-1.0.a
72 # SO links are created wrong, fixing them
73 %{__rm} -rf %{buildroot}%{_libdir}/libmozjs185.so.1.0
74 %{__rm} -rf %{buildroot}%{_libdir}/libmozjs185.so
75 %{__ln_s} libmozjs185.so.1.0.0 %{buildroot}%{_libdir}/libmozjs185.so.1.0
76 %{__ln_s} libmozjs185.so.1.0.0 %{buildroot}%{_libdir}/libmozjs185.so
77 # JS shell
78 %{__install} -m 0755 shell/js %{buildroot}%{_bindir}/
79 # headers are installed with executable permissions
80 chmod 644 %{buildroot}%{_includedir}/js/*
81
82 %clean
83 %{__rm} -rf %{buildroot}
84
85 %post -n libmozjs185 -p /sbin/ldconfig
86
87 %postun -n libmozjs185 -p /sbin/ldconfig
88
89 %files
90 %defattr(-,root,root,-)
91 %doc js/src/README.html
92 %{_bindir}/js
93
94 %files -n libmozjs185
95 %defattr(-,root,root,-)
96 %{_libdir}/*.so.*
97
98 %files devel
99 %defattr(-,root,root,-)
100 #%{_bindir}/jscpucfg
101 %{_bindir}/js-config
102 %{_libdir}/pkgconfig/*.pc
103 %{_libdir}/*.so
104 %{_includedir}/js/