Summary:	JavaScript interpreter and libraries
Summary(ja):	JavaScript インタプリタ及びライブラリ
Name:		mozjs24
Version:	24.2.0
Release:	3%{?_dist_release}
License:	MPLv2.0
Group:		Development/Languages
URL:		http://www.mozilla.org/js/
Source0:	http://ftp.mozilla.org/pub/mozilla.org/js/mozjs-%{version}.tar.bz2	

Patch0:		js17-build-fixes.patch
Patch1:		mozjs24-0001-Add-AArch64-support.patch

BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root

Buildrequires:	nspr-devel >= 4.7
Buildrequires:	readline-devel
Buildrequires:	zlib-devel
BuildRequires:	python
BuildRequires:	zip

Vendor: 	Project Vine
Distribution: 	Vine Linux
Packager: 	Takemikaduchi

%description
JavaScript is the Netscape-developed object scripting language used in millions
of web pages and server applications worldwide. Netscape's JavaScript is a
superset of the ECMA-262 Edition 3 (ECMAScript) standard scripting language,
with only mild differences from the published standard.

%package devel
Summary: 	Header files, libraries and development documentation for %{name}
Summary(ja): 	%{name} のヘッダファイル、ライブラリ及び開発用ドキュメント
Group: 		Development/Libraries
Requires: 	%{name} = %{version}-%{release}
Requires: 	pkgconfig
Provides: 	libjs-devel = %{version}-%{release}

%description devel
This package contains the header files, static libraries and development
documentation for %{name}. If you like to develop programs using %{name},
you will need to install %{name}-devel.


%prep
%setup -q -n mozjs-%{version}
# Delete bundled sources
rm js/src/editline -rf
rm js/src/ctypes/libffi -rf
%patch0 -p1
%patch1 -p1
chmod a+x configure

%build
%configure \
  --disable-static \
  --with-system-nspr \
  --enable-threadsafe \
  --enable-readline \
  --enable-xterm-updates

make %{?_smp_mflags}

%install
%{__rm} -rf %{buildroot}
make install DESTDIR=%{buildroot}
# For some reason the headers and pkg-config file are executable
find %{buildroot}%{_includedir} -type f -exec chmod a-x {} \;
chmod a-x  %{buildroot}%{_libdir}/pkgconfig/*.pc

%{__rm} -rf %{buildroot}%{_libdir}/*.a
%{__rm} -rf %{buildroot}%{_libdir}/*.la


%clean
%{__rm} -rf %{buildroot}


%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%files
%defattr(-,root,root,-)
%doc LICENSE README
%{_bindir}/js24
%{_libdir}/libmozjs-24.so

%files devel
%defattr(-,root,root,-)
%{_bindir}/js24-config
%{_includedir}/mozjs-24
%{_libdir}/pkgconfig/mozjs-24.pc

%changelog
* Thu Jun 30 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 24.2.0-3
- rebuild with gcc-5.4.0
- add Buildrequires: zlib-devel

* Tue Mar 24 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 24.2.0-2
- rebuilt with readline 6.3
- fixed License
- added Japanese summary

* Sat Mar 29 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 24.2.0-1
- initial build

