Blob Blame History Raw
%{?nodejs_find_provides_and_requires}

%global enable_tests 0

Name:       nodejs-node-expat
Version:    2.0.0
Release:    6%{?dist}
Summary:    Fast libexpat XML SAX parser binding for Node.js
License:    MIT
Group:      System Environment/Libraries
URL:        http://github.com/astro/node-expat
Source0:    http://registry.npmjs.org/node-expat/-/node-expat-%{version}.tgz

Patch0:     %{name}-2.0.0-use-system-expat.patch

BuildRequires:  expat-devel
BuildRequires:  nodejs-packaging
BuildRequires:  node-gyp

%if 0%{?enable_tests}
BuildRequires:  npm(vows)
%endif

%if 0%{?fedora} >= 19
ExclusiveArch: %{nodejs_arches}
%else
ExclusiveArch: %{ix86} x86_64 %{arm}
%endif

%description
%{summary}.


%prep
%setup -q -n package
%patch0 -p1
rm -rf deps/


%build
export CXXFLAGS="%{optflags}"
node-gyp rebuild


%install
mkdir -p %{buildroot}%{nodejs_sitelib}/node-expat
cp -pr package.json bench.js lib/ \
    %{buildroot}%{nodejs_sitelib}/node-expat
mkdir -p %{buildroot}%{nodejs_sitelib}/node-expat/build
install -p -m0755 build/Release/node_expat.node \
    %{buildroot}%{nodejs_sitelib}/node-expat/build
sed -i -e 's|build/Release|build|g' \
    %{buildroot}%{nodejs_sitelib}/node-expat/lib/node-expat.js

%nodejs_symlink_deps


%if 0%{?enable_tests}
%check
%nodejs_symlink_deps --check
%__nodejs test.js
%endif


%files
%doc LICENSE README.markdown
%{nodejs_sitelib}/node-expat


%changelog
* Sun Jul 28 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 2.0.0-6
- add ExclusiveArch logic

* Wed Jun 19 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 2.0.0-5
- rebuild for missing npm(node-expat) provides on EL6

* Wed Mar 20 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 2.0.0-4
- remove v8 dependencies which are now automatic

* Tue Mar 12 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 2.0.0-3
- bump v8 version for nodejs-0.10.0

* Sun Mar 10 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 2.0.0-2
- fix file permissions
- link against system expat

* Mon Feb 11 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 2.0.0-1
- initial package