Blob Blame History Raw
%{?nodejs_find_provides_and_requires}

%global enable_tests 1

Name:       nodejs-libxmljs
Version:    0.9.0
Release:    3%{?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:    http://registry.npmjs.org/libxmljs/-/libxmljs-%{version}.tgz

# binding.gyp contains a dependency on the bundled libxml2
Patch0:     %{name}-0.8.1-remove-bundled-libxml.patch

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

%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
rm -rf vendor/
%nodejs_fixdep bindings '*'


%build
export CXXFLAGS="%{optflags}"
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/xmljs.node \
    %{buildroot}%{nodejs_sitelib}/libxmljs/build/xmljs.node
%nodejs_symlink_deps


%if 0%{?enable_tests}
%check
%nodejs_symlink_deps --check
%__nodejs --expose_gc %{nodejs_sitelib}/nodeunit/bin/nodeunit test
%endif


%files
%doc LICENSE README.md docs/ examples/
%{nodejs_sitelib}/libxmljs


%changelog
* 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