Blob Blame History Raw
# needed for building on el6
%{?nodejs_find_provides_and_requires}

%global enable_tests 1
%global srcname jison

Name:           nodejs-%{srcname}
Version:        0.4.17
Release:        3%{?dist}
Summary:        A parser generator with Bison's API
# license text is in README.md
License:        MIT
URL:            https://github.com/zaach/jison
Source0:        https://registry.npmjs.org/%{srcname}/-/%{srcname}-%{version}.tgz
# The example files are not included in the npm tarball.
# Source1 is generated by running Source10, which pulls from the upstream
# version control repository.
Source1:        examples-%{version}.tar.bz2
Source10:       dl-tests.sh


BuildArch:      noarch

%if 0%{?rhel} == 6
ExclusiveArch:  %{ix86} x86_64 %{arm} noarch
%else
ExclusiveArch:  %{nodejs_arches} noarch
%endif

BuildRequires:  nodejs-packaging

%if 0%{?enable_tests}
BuildRequires:  npm(test)
BuildRequires:  npm(jison-lex)
BuildRequires:  npm(ebnf-parser)
BuildRequires:  npm(JSONSelect)
BuildRequires:  npm(escodegen)
%endif

%description
%{summary}.

%prep
%setup -qn package
# copy the example files
%setup -q -T -D -a 1 -n package

chmod -x lib/jison.js
rm -rf node_modules
%nodejs_fixdep cjson '0.3.x'
%nodejs_fixdep nomnom '1.x'
%nodejs_fixdep esprima '2.x'
%nodejs_fixdep escodegen

%build
#nothing to do

%install
mkdir -p %{buildroot}%{nodejs_sitelib}/%{srcname}

cp -pr package.json *.js lib/ \
    %{buildroot}%{nodejs_sitelib}/%{srcname}

mkdir -p %{buildroot}%{_bindir}
ln -s %{nodejs_sitelib}/%{srcname}/lib/cli.js \
    %{buildroot}%{_bindir}/jison

%nodejs_symlink_deps

%check
%nodejs_symlink_deps --check
%{__nodejs} -e 'require("./")'
%if 0%{?enable_tests}
%{__nodejs} tests/all-tests.js
%endif

%files
%{!?_licensedir:%global license %doc}
%doc *.md examples/
%license README.md
%{nodejs_sitelib}/%{srcname}
%{_bindir}/jison

%changelog
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.17-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.17-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Fri Feb 19 2016 Jared Smith <jsmith@fedoraproject.org> - 0.4.17-1
- Update to upstream 0.4.17 release
- Relax dependency on escodegen to allow newer version

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.15-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Wed Jan 06 2016 Piotr Popieluch <piotr1212@gmail.com> - 0.4.15-1
- Initial package