Blob Blame Raw
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}

%if 0%{?fedora} >= 15
%global _with_xulrunner 1
%ifarch %{ix86} x86_64 %{arm}
%global _with_v8 1
%endif
%endif

Name:           natus
Version:        0.1.4
Release:        2%{?dist}
Summary:        A robust JavaScript shell built on the Natus meta-engine

Group:          Development/Languages
License:        MIT
URL:            https://www.github.com/npmccallum/natus
Source0:        https://www.github.com/downloads/npmccallum/natus/natus-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  readline-devel
BuildRequires:  python-devel
BuildRequires:  webkitgtk-devel
%{?_with_xulrunner:
BuildRequires:  xulrunner-devel >= 2.0
}
%{?_with_v8:
BuildRequires:  v8-devel
}

Requires: lib%{name} = %{version}-%{release}

%description
A robust JavaScript shell built on the Natus meta-engine

%package -n lib%{name}
Summary: Libraries for embedding the Natus meta-engine
Group: Development/Languages
Requires: lib%{name}-engine = %{version}-%{release}
Provides: %{name}-libs = %{version}-%{release}
Obsoletes: %{name}-libs < 0.1.3-4

%description -n lib%{name}
Libraries for embedding the Natus meta-engine

%package -n lib%{name}-devel
Summary: Development files for embedding the Natus meta-engine
Group: Development/Languages
Requires: lib%{name} = %{version}-%{release}
Requires: pkgconfig
Provides: %{name}-libs-devel = %{version}-%{release}
Obsoletes: %{name}-libs-devel < 0.1.3-4

%description -n lib%{name}-devel
Development files for embedding the Natus meta-engine

%package -n lib%{name}-JavaScriptCore
Summary: JavaScriptCore engine for Natus
Group: Development/Languages
Requires: lib%{name} = %{version}-%{release}
Provides: lib%{name}-engine = %{version}-%{release}

Provides: %{name}-engine = %{version}-%{release}
Obsoletes: %{name}-engine-JavaScriptCore < 0.1.3-5

%description -n lib%{name}-JavaScriptCore
JavaScriptCore engine for Natus

%{?_with_xulrunner:
%package -n lib%{name}-SpiderMonkey
Summary: SpiderMonkey engine for Natus
Group: Development/Languages
Requires: lib%{name} = %{version}-%{release}
Provides: lib%{name}-engine = %{version}-%{release}

Provides: %{name}-engine = %{version}-%{release}
Obsoletes: %{name}-engine-SpiderMonkey < 0.1.3-5

%description -n lib%{name}-SpiderMonkey
SpiderMonkey engine for Natus
}

%{?_with_v8:
%package -n lib%{name}-V8
Summary: V8 engine for Natus
Group: Development/Languages
Requires: lib%{name} = %{version}-%{release}
Provides: lib%{name}-engine = %{version}-%{release}

Provides: %{name}-engine = %{version}-%{release}
Obsoletes: %{name}-engine-V8 < 0.1.3-5

%description -n lib%{name}-V8
V8 engine for Natus
}

%package python
Summary: Python module for Natus
Group: Development/Languages
Requires: lib%{name} = %{version}-%{release}

%description python
Python module for Natus

%package -n python-natus
Summary: Natus JavaScript module for Python
Group: Development/Languages
Requires: lib%{name} = %{version}-%{release}

%description -n python-natus
Natus JavaScript module for Python

%prep
%setup -q

%build
%configure
make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
find $RPM_BUILD_ROOT/%{_libdir} -name '*.la' -delete

%clean
rm -rf $RPM_BUILD_ROOT

%post -n lib%{name} -p /sbin/ldconfig

%postun -n lib%{name} -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%{_bindir}/natus

%files -n lib%{name}
%defattr(-,root,root,-)
%doc ChangeLog COPYING AUTHORS README
%{_libdir}/lib%{name}.so*
%{_libdir}/%{name}
%exclude %{_libdir}/lib%{name}.so
%exclude %{_libdir}/%{name}/%{version}/modules/python.so
%exclude %{_libdir}/%{name}/%{version}/engines/*

%files -n lib%{name}-devel
%defattr(-,root,root,-)
%{_includedir}/%{name}
%{_libdir}/lib%{name}.so
%{_libdir}/pkgconfig/%{name}.pc

%files -n lib%{name}-JavaScriptCore
%defattr(-,root,root,-)
%{_libdir}/%{name}/%{version}/engines/JavaScriptCore.so

%{?_with_xulrunner:
%files -n lib%{name}-SpiderMonkey
%defattr(-,root,root,-)
%{_libdir}/%{name}/%{version}/engines/SpiderMonkey.so
}

%{?_with_v8:
%files -n lib%{name}-V8
%defattr(-,root,root,-)
%{_libdir}/%{name}/%{version}/engines/V8.so
}

%files python
%defattr(-,root,root,-)
%{_libdir}/%{name}/%{version}/modules/python.so

%files -n python-natus
%defattr(-,root,root,-)
%{python_sitearch}/%{name}.so

%changelog
* Sun Feb 06 2011 Nathaniel McCallum <nathaniel@natemccallum.com> - 0.1.4-2
- Remove *.la files

* Sun Feb 06 2011 Nathaniel McCallum - 0.1.4-1
- Update to 0.1.4
- Remove upstreamed fixes
- Re-enable smp build

* Fri Dec 24 2010 Dan HorĂ¡k <dan[at]danny.cz> - 0.1.3-7
- v8 is available on selected architectures

* Thu Dec 23 2010 Nathaniel McCallum <nathaniel@natemccallum.com> - 0.1.3-6
- Rename engines

* Thu Dec 23 2010 Nathaniel McCallum <nathaniel@natemccallum.com> - 0.1.3-5
- Really fix SpiderMonkey this time

* Thu Dec 23 2010 Nathaniel McCallum <nathaniel@natemccallum.com> - 0.1.3-4
- Rename natus-libs -> libnatus, natus-libs-devel -> libnatus-devel
- Apply upstream fix for deprecated symbol in SpiderMonkey

* Thu Dec 23 2010 Nathaniel McCallum <nathaniel@natemccallum.com> - 0.1.3-3
- Enable the V8 engine on Fedora >=15

* Sun Dec 12 2010 Nathaniel McCallum <nathaniel@natemccallum.com> - 0.1.3-2
- Added pkgconfig requires to -devel

* Sat Dec 11 2010 Nathaniel McCallum <nathaniel@natemccallum.com> - 0.1.3-1
- First package