inital packaging commit
[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.8.5
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 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
11 BuildRequires:  autoconf213
12 BuildRequires:  gcc-c++
13 BuildRequires:  nspr-devel
14 BuildRequires:  pkg-config
15 BuildRequires:  python
16 BuildRequires:  zip
17 Provides:       mozjs185
18
19 %description
20 JavaScript is the Netscape-developed object scripting language used in millions
21 of web pages and server applications worldwide. Netscape's JavaScript is a
22 superset of the ECMA-262 Edition 3 (ECMAScript) standard scripting language,
23 with only mild differences from the published standard.
24
25 %package -n libmozjs185
26 Summary:        JavaScript library
27 Group:          System/Libraries
28
29 %description -n libmozjs185
30 JavaScript is the Netscape-developed object scripting language used in millions
31 of web pages and server applications worldwide. Netscape's JavaScript is a
32 superset of the ECMA-262 Edition 3 (ECMAScript) standard scripting language,
33 with only mild differences from the published standard.
34
35
36 %package devel
37 Summary:        Header files, libraries and development documentation for %{name}
38 Group:          Development/Libraries/Other
39 Requires:       libmozjs185 = %{version}-%{release}
40 Requires:       pkg-config
41 Provides:       libjs-devel = %{version}-%{release}
42 Provides:       mozjs185-devel
43
44 %description devel
45 This package contains the header files, static libraries and development
46 documentation for %{name}. If you like to develop programs using %{name},
47 you will need to install %{name}-devel.
48
49 %prep
50 %setup -q -n %{name}-%{version}
51
52 %build
53 export MOZILLA_VERSION=%{version}
54 cd js
55 pushd src
56 %configure --with-system-nspr --enable-threadsafe
57 popd
58 export BUILD_OPT=1
59 %{__make} %{?_smp_mflags} -C src \
60         JS_THREADSAFE="1" \
61         XCFLAGS="%{optflags} -fPIC " \
62         BUILD_OPT="1" \
63
64 %install
65 cd js/src
66 %make_install
67 %{__rm} -rf %{buildroot}%{_libdir}/libmozjs185-1.0.a
68 # SO links are created wrong, fixing them
69 %{__rm} -rf %{buildroot}%{_libdir}/libmozjs185.so.1.0
70 %{__rm} -rf %{buildroot}%{_libdir}/libmozjs185.so
71 %{__ln_s} libmozjs185.so.1.0.0 %{buildroot}%{_libdir}/libmozjs185.so.1.0
72 %{__ln_s} libmozjs185.so.1.0.0 %{buildroot}%{_libdir}/libmozjs185.so
73 # JS shell
74 %{__install} -m 0755 shell/js %{buildroot}%{_bindir}/
75 # headers are installed with executable permissions
76 chmod 644 %{buildroot}%{_includedir}/js/*
77
78 %clean
79 %{__rm} -rf %{buildroot}
80
81 %post -n libmozjs185 -p /sbin/ldconfig
82
83 %postun -n libmozjs185 -p /sbin/ldconfig
84
85 %files
86 %defattr(-,root,root,-)
87 %doc js/src/README.html
88 %{_bindir}/js
89
90 %files -n libmozjs185
91 %defattr(-,root,root,-)
92 %{_libdir}/*.so.*
93
94 %files devel
95 %defattr(-,root,root,-)
96 #%{_bindir}/jscpucfg
97 %{_bindir}/js-config
98 %{_libdir}/pkgconfig/*.pc
99 %{_libdir}/*.so
100 %{_includedir}/js/