%{?nodejs_find_provides_and_requires} # The JavaScript code provided by this package is generated with nodejs-jison, # nodejs-jison has a dependency on this package. To overcome this circular # dependency we first ship with pre-generated code from npm sources by setting # '%%global bootstrap 1'. After nodejs-jison is built we rebuild this package # from github sources with '%%global bootstrap 0'. %{!?_with_bootstrap: %global bootstrap 1} %global commit0 f75c7db2e2a176f618ccd354e1897ed73d8fdb40 %global shortcommit0 %(c=%{commit0}; echo ${c:0:7}) %global owner zaach %global srcname lex-parser %global packagename lex-parser %global enable_tests 0 Name: nodejs-lex-parser Version: 0.1.4 Release: 6%{?dist} Summary: A parser for lexical grammars used by jison License: MIT URL: https://github.com/zaach/lex-parser.git # Source0 only contains generated JavaScript, needed for bootstrapping Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz # Source1 only contains sourcecode which is needed to rebuild after bootstrapping jison Source1: https://github.com/%{owner}/%{srcname}/archive/%{commit0}.tar.gz#/%{srcname}-%{shortcommit0}.tar.gz Source2: LICENSE.md # upstream license file requested at https://github.com/zaach/lex-parser/issues/7 BuildArch: noarch %if 0%{?fedora} >= 19 ExclusiveArch: %{nodejs_arches} noarch %else ExclusiveArch: %{ix86} x86_64 %{arm} noarch %endif BuildRequires: nodejs-packaging %if 0%{?enable_tests} BuildRequires: npm(test) %endif %if ! 0%{?bootstrap} BuildRequires: npm(jison) %endif %description A parser for lexical grammars used by jison %prep %if 0%{?bootstrap} %setup -q -n package %else %setup -q -n %{srcname}-%{commit0} %endif cp -p %{SOURCE2} . %build %if ! 0%{?bootstrap} %{__nodejs} ./node_modules/.bin/jison lex.y lex.l mv lex.js lex-parser.js %endif %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename} cp -pr package.json *.js \ %{buildroot}%{nodejs_sitelib}/%{packagename} %nodejs_symlink_deps %if 0%{?enable_tests} %check %nodejs_symlink_deps --check %{__nodejs} tests/all-tests.js %endif %files %{!?_licensedir:%global license %doc} %doc README.md %license LICENSE.md %{nodejs_sitelib}/%{packagename} %changelog * Fri Jul 13 2018 Fedora Release Engineering - 0.1.4-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild * Thu Feb 08 2018 Fedora Release Engineering - 0.1.4-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild * Thu Jul 27 2017 Fedora Release Engineering - 0.1.4-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild * Fri Feb 10 2017 Fedora Release Engineering - 0.1.4-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild * Thu Feb 04 2016 Fedora Release Engineering - 0.1.4-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Tue Nov 24 2015 Jared Smith - 0.1.4-1 - Initial packaging