%{?nodejs_find_provides_and_requires}
%global enable_tests 1
Name: nodejs-libxmljs
Version: 0.17.0
Release: 1%{?dist}
Summary: Node.js module that provides libxml bindings for the v8 javascript engine
License: MIT
Group: System Environment/Libraries
URL: https://github.com/polotek/libxmljs
Source0: https://registry.npmjs.org/libxmljs/-/libxmljs-%{version}.tgz
# binding.gyp contains a dependency on the bundled libxml2
Patch0: %{name}-0.17.0-remove-bundled-libxml.patch
BuildRequires: nodejs-packaging
BuildRequires: node-gyp
BuildRequires: libxml2-devel
BuildRequires: npm(nan) >= 2.0.4
%if 0%{?fedora} >= 19
ExclusiveArch: %{nodejs_arches}
%else
ExclusiveArch: %{ix86} x86_64 %{arm}
%endif
%if 0%{?enable_tests}
BuildRequires: npm(bindings)
BuildRequires: npm(nodeunit)
%endif
%description
%{summary}.
%prep
%setup -q -n package
%patch0 -p1
%nodejs_fixdep bindings '*'
%nodejs_fixdep -r nan
%nodejs_fixdep --dev nan "^2.0.4"
rm -rf vendor/
%build
%nodejs_symlink_deps --build
export CXXFLAGS="%{optflags}"
export LDFLAGS="%{?__global_ldflags}"
node-gyp configure
node-gyp build
%install
mkdir -p %{buildroot}%{nodejs_sitelib}/libxmljs
cp -pr package.json index.js lib/ \
%{buildroot}%{nodejs_sitelib}/libxmljs
mkdir -p %{buildroot}%{nodejs_sitelib}/libxmljs/build
install -p -D -m0755 build/Release/lib.target/xmljs.node \
%{buildroot}%{nodejs_sitelib}/libxmljs/build/xmljs.node
%nodejs_symlink_deps
%if 0%{?enable_tests}
%check
%nodejs_symlink_deps --check
ln -s Release/lib.target/xmljs.node build/xmljs.node
%__nodejs --expose_gc %{nodejs_sitelib}/nodeunit/bin/nodeunit test
%endif
%files
%doc README.md examples/
%license LICENSE
%{nodejs_sitelib}/libxmljs
%changelog
* Tue Jan 19 2016 Tom Hughes <tom@compton.nu> - 0.17.0-1
- Update to 0.17.0 upstream release
* Thu Dec 3 2015 Tom Hughes <tom@compton.nu> - 0.15.0-2
- Rebuild for nodejs 4.2
* Thu Dec 3 2015 Tom Hughes <tom@compton.nu> - 0.15.0-1
- Update to 0.15.0 upstream release
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 0.9.0-4
- Rebuilt for GCC 5 C++11 ABI change
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Sun Apr 20 2014 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.9.0-1
- update to upstream release 0.9.0
* Fri Feb 14 2014 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.8.1-4
- rebuild for icu-53 (via v8)
* Sat Jul 27 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.8.1-3
- add ExclusiveArch logic
* Sat Jun 22 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.8.1-2
- restrict to compatible arches
* Sat May 25 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.8.1-1
- update to upstream release 0.8.1
* Sun Mar 17 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.7.1-1
- update to upstream release 0.7.1
- make the versioned dependency on npm(bindings) less specific
- remove dependencies on v8 as these are now automatic
* Sun Feb 17 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.7.0-2
- add npm(bindings) to BuildRequires
* Mon Feb 11 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.7.0-1
- initial package