%{?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 1 Name: nodejs-lex-parser Version: 0.1.4 Release: %mkrel 6 Group: Development/Java 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 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 * Wed Mar 23 2022 umeabot <umeabot> 0.1.4-6.mga9 + Revision: 1821366 - Mageia 9 Mass Rebuild * Sun Jul 05 2020 joequant <joequant> 0.1.4-5.mga8 + Revision: 1602136 - redo deps * Wed Feb 12 2020 umeabot <umeabot> 0.1.4-4.mga8 + Revision: 1492601 - Mageia 8 Mass Rebuild + pterjan <pterjan> - Drop ExclusiveArch preventing building this noarch package on aarch64 machines * Wed Sep 19 2018 umeabot <umeabot> 0.1.4-3.mga7 + Revision: 1265017 - Mageia 7 Mass Rebuild * Wed Sep 28 2016 neoclust <neoclust> 0.1.4-2.mga6 + Revision: 1057386 - imported package nodejs-lex-parser