c9083dfcc489036565ec3e108303cae12475d33c
[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/js/js185-1.0.0.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 %configure --with-system-nspr --enable-threadsafe
56 popd
57 export BUILD_OPT=1
58 %{__make} %{?_smp_mflags} -C src \
59         JS_THREADSAFE="1" \
60         XCFLAGS="%{optflags} -fPIC " \
61         BUILD_OPT="1" \
62
63 %install
64 cd js/src
65 %make_install
66 %{__rm} -rf %{buildroot}%{_libdir}/libmozjs185-1.0.a
67 # SO links are created wrong, fixing them
68 %{__rm} -rf %{buildroot}%{_libdir}/libmozjs185.so.1.0
69 %{__rm} -rf %{buildroot}%{_libdir}/libmozjs185.so
70 %{__ln_s} libmozjs185.so.1.0.0 %{buildroot}%{_libdir}/libmozjs185.so.1.0
71 %{__ln_s} libmozjs185.so.1.0.0 %{buildroot}%{_libdir}/libmozjs185.so
72 # JS shell
73 %{__install} -m 0755 shell/js %{buildroot}%{_bindir}/
74 # headers are installed with executable permissions
75 chmod 644 %{buildroot}%{_includedir}/js/*
76
77 %clean
78 %{__rm} -rf %{buildroot}
79
80 %post -n libmozjs185 -p /sbin/ldconfig
81
82 %postun -n libmozjs185 -p /sbin/ldconfig
83
84 %files
85 %defattr(-,root,root,-)
86 %doc js/src/README.html
87 %{_bindir}/js
88
89 %files -n libmozjs185
90 %defattr(-,root,root,-)
91 %{_libdir}/*.so.*
92
93 %files devel
94 %defattr(-,root,root,-)
95 #%{_bindir}/jscpucfg
96 %{_bindir}/js-config
97 %{_libdir}/pkgconfig/*.pc
98 %{_libdir}/*.so
99 %{_includedir}/js/