From 31af97fddaf20141ce48bc40e211d784804cb70e Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Mar 05 2013 14:38:18 +0000 Subject: Initial import of nodejs-xml2js --- diff --git a/.gitignore b/.gitignore index e69de29..236e3dc 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,2 @@ +/xml2js-0.2.6.tgz +/xml2js-tests-0.2.6.tar.bz2 diff --git a/nodejs-xml2js.spec b/nodejs-xml2js.spec new file mode 100644 index 0000000..5451c23 --- /dev/null +++ b/nodejs-xml2js.spec @@ -0,0 +1,66 @@ +%global enable_tests 1 + +Name: nodejs-xml2js +Version: 0.2.6 +Release: 1%{?dist} +Summary: Simple XML to JavaScript object converter + +License: MIT +URL: https://github.com/Leonidas-from-XIV/node-xml2js +Source0: http://registry.npmjs.org/xml2js/-/xml2js-%{version}.tgz +# The test files are not included in the npm tarball. +# Source1 is generated using Source10, which pulls from the upstream +# version control repository. +Source1: xml2js-tests-%{version}.tar.bz2 +Source10: xml2js-dl-tests.sh +BuildArch: noarch + +BuildRequires: nodejs-devel + +%if 0%{?enable_tests} +BuildRequires: npm(zap) +BuildRequires: npm(coffee-script) +BuildRequires: npm(sax) +%endif + +%description +Ever had the urge to parse XML? And wanted to access the data in +some sane, easy way? Don't want to compile a C parser, for whatever +reason? Then xml2js is what you're looking for! + + +%prep +%setup -q -n package +%setup -T -D -a 1 -q -n package +rm -rf node_modules + + +%build + + +%if 0%{?enable_tests} +%check +ln -s %{nodejs_sitelib} . +%{nodejs_sitelib}/zap/bin/zap +%endif + + +%install +mkdir -p %{buildroot}/%{nodejs_sitelib}/xml2js +cp -pr package.json lib %{buildroot}/%{nodejs_sitelib}/xml2js +%nodejs_symlink_deps + + +%files +%doc LICENSE README.md +%{nodejs_sitelib}/xml2js + + +%changelog +* Mon Mar 4 2013 Tom Hughes - 0.2.6-1 +- Update to 0.2.6 release +- Add tests, which are now separate +- BuildRequire coffee-script and sax for tests + +* Sun Feb 10 2013 Tom Hughes - 0.2.4-1 +- Initial build of 0.2.4 diff --git a/sources b/sources index e69de29..84844c5 100644 --- a/sources +++ b/sources @@ -0,0 +1,2 @@ +ab54b27d6f11213663eac861301f1981 xml2js-0.2.6.tgz +1e47b599751d8c9ccef408242786c4e1 xml2js-tests-0.2.6.tar.bz2 diff --git a/xml2js-dl-tests.sh b/xml2js-dl-tests.sh new file mode 100744 index 0000000..ddae841 --- /dev/null +++ b/xml2js-dl-tests.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +tag=0.2.6 + +set -e + +tmp=$(mktemp -d) + +trap cleanup EXIT +cleanup() { + set +e + [ -z "$tmp" -o ! -d "$tmp" ] || rm -rf "$tmp" +} + +unset CDPATH +pwd=$(pwd) + +pushd "$tmp" +git clone git://github.com/Leonidas-from-XIV/node-xml2js.git +cd node-xml2js +git archive --prefix="test/" --format=tar tags/${tag}:test/ \ + | bzip2 > "$pwd"/xml2js-tests-${tag}.tar.bz2 +popd