diff --git a/character-parser-1.2.0.tgz b/character-parser-1.2.0.tgz new file mode 100644 index 0000000..247a53a Binary files /dev/null and b/character-parser-1.2.0.tgz differ diff --git a/dl-tests.sh b/dl-tests.sh new file mode 100644 index 0000000..a8d96bd --- /dev/null +++ b/dl-tests.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +tag=1.2.0 + +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/ForbesLindesay/character-parser.git +cd character-parser +git archive --prefix="test/" --format=tar tags/${tag}:test/ \ + | bzip2 > "$pwd"/tests-${tag}.tar.bz2 +popd diff --git a/nodejs-character-parser.spec b/nodejs-character-parser.spec new file mode 100644 index 0000000..bbe39df --- /dev/null +++ b/nodejs-character-parser.spec @@ -0,0 +1,55 @@ +%{?nodejs_find_provides_and_requires} +%global enable_tests 1 +Name: nodejs-character-parser +Version: 1.2.0 +Release: 1 +Summary: Parse JavaScript one character at a time to look for snippets in templates +License: MIT +URL: https://github.com/ForbesLindesay/character-parser +Source0: http://registry.npmjs.org/character-parser/-/character-parser-%{version}.tgz +# The test files are not included in the npm tarball. +# Source1 is generated by running Source10, which pulls from the upstream +# version control repository. +Source1: tests-%{version}.tar.bz2 +Source10: dl-tests.sh +BuildArch: noarch +ExclusiveArch: %{nodejs_arches} noarch +BuildRequires: nodejs-packaging + +%if 0%{?enable_tests} +BuildRequires: mocha npm(better-assert) +%endif + +%description +Parse JavaScript one character at a time to look for snippets in templates. +This is not a validator, it's just designed to allow you to have sections +of JavaScript delimited by brackets robustly. + +%prep +%setup -q -n package +%setup -q -T -D -a 1 -n package +for i in LICENSE README.md; do + sed -i -e 's/\r$//' "${i}" +done + +%build + +%install +mkdir -p %{buildroot}%{nodejs_sitelib}/character-parser +cp -pr package.json index.js \ + %{buildroot}%{nodejs_sitelib}/character-parser +%nodejs_symlink_deps +%if 0%{?enable_tests} + +%check +%nodejs_symlink_deps --check +/usr/bin/mocha -R spec +%endif + +%files +%doc LICENSE README.md +%{nodejs_sitelib}/character-parser + +%changelog +* Fri Aug 21 2020 leiju - 1.2.0-1 +- Package init diff --git a/nodejs-character-parser.yaml b/nodejs-character-parser.yaml new file mode 100644 index 0000000..f6bd482 --- /dev/null +++ b/nodejs-character-parser.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: ForbesLindesay/character-parser +tag_prefix: "^" +seperator: "." diff --git a/tests-1.2.0.tar.bz2 b/tests-1.2.0.tar.bz2 new file mode 100644 index 0000000..399dad6 Binary files /dev/null and b/tests-1.2.0.tar.bz2 differ