cd4099e
%{?nodejs_find_provides_and_requires}
cd4099e
886ffd8
%global enable_tests 0
08256ec
08256ec
Name:       marked
a6e87fa
Version:    0.3.2
445942a
Release:    9%{?dist}
08256ec
Summary:    A markdown parser for Node.js built for speed
08256ec
License:    MIT
08256ec
Group:      System Environment/Libraries
08256ec
URL:        https://github.com/chjj/marked
08256ec
Source0:    http://registry.npmjs.org/marked/-/marked-%{version}.tgz
08256ec
# The test files are not included in the npm tarball.
08256ec
# Source1 is generated by running Source10, which pulls from the upstream
08256ec
# version control repository.
08256ec
Source1:    tests-v%{version}.tar.bz2
08256ec
Source10:   dl-tests.sh
510b413
08256ec
BuildArch:  noarch
f0113ba
%if 0%{?fedora} >= 19
510b413
ExclusiveArch: %{nodejs_arches} noarch
f0113ba
%else
f0113ba
ExclusiveArch: %{ix86} x86_64 %{arm} noarch
f0113ba
%endif
08256ec
f0113ba
BuildRequires:  nodejs-packaging
T.C. Hollingsworth de10c87
BuildRequires:  web-assets-devel
T.C. Hollingsworth de10c87
BuildRequires:  uglify-js
08256ec
08256ec
%if 0%{?enable_tests}
08256ec
BuildRequires:  npm(express)
e9d64f6
BuildRequires:  npm(markdown)
e9d64f6
BuildRequires:  npm(showdown)
a6e87fa
# Not yet packaged for Fedora.
a6e87fa
# BuildRequires:  npm(robotskirt)
08256ec
%endif
08256ec
T.C. Hollingsworth de10c87
Requires:       js-marked = %{version}-%{release}
T.C. Hollingsworth de10c87
08256ec
%description
08256ec
marked is a full-featured markdown compiler that can parse huge chunks of
08256ec
markdown without having to worry about caching the compiled output or
08256ec
blocking for an unnecessarily long time.
08256ec
08256ec
marked is extremely fast and frequently outperforms similar markdown parsers.
08256ec
marked is very concise and still implements all markdown features, as well
08256ec
as GitHub Flavored Markdown features.
08256ec
08256ec
marked more or less passes the official markdown test suite in its entirety.
08256ec
This is important because a surprising number of markdown compilers cannot
08256ec
pass more than a few tests.
08256ec
08256ec
T.C. Hollingsworth de10c87
%package -n js-marked
T.C. Hollingsworth de10c87
Summary:    A markdown parser for JavaScript built for speed
T.C. Hollingsworth de10c87
Group:      System Environment/Libraries
T.C. Hollingsworth de10c87
Requires:   web-assets-filesystem
T.C. Hollingsworth de10c87
T.C. Hollingsworth de10c87
%description -n js-marked
T.C. Hollingsworth de10c87
marked is a full-featured markdown compiler that can parse huge chunks of
T.C. Hollingsworth de10c87
markdown without having to worry about caching the compiled output or
T.C. Hollingsworth de10c87
blocking for an unnecessarily long time.
T.C. Hollingsworth de10c87
T.C. Hollingsworth de10c87
marked is extremely fast and frequently outperforms similar markdown parsers.
T.C. Hollingsworth de10c87
marked is very concise and still implements all markdown features, as well
T.C. Hollingsworth de10c87
as GitHub Flavored Markdown features.
T.C. Hollingsworth de10c87
T.C. Hollingsworth de10c87
marked more or less passes the official markdown test suite in its entirety.
T.C. Hollingsworth de10c87
This is important because a surprising number of markdown compilers cannot
T.C. Hollingsworth de10c87
pass more than a few tests.
T.C. Hollingsworth de10c87
T.C. Hollingsworth de10c87
08256ec
%prep
08256ec
%setup -q -n package
08256ec
%setup -q -T -D -a 1 -n package
08256ec
T.C. Hollingsworth de10c87
# remove the bundled minified marked
T.C. Hollingsworth de10c87
rm -f marked.min.js
T.C. Hollingsworth de10c87
08256ec
08256ec
%build
T.C. Hollingsworth de10c87
uglifyjs --comments '/Copyright/' lib/marked.js -o marked.min.js
08256ec
08256ec
08256ec
%install
T.C. Hollingsworth de10c87
mkdir -p %{buildroot}%{_jsdir}/marked
T.C. Hollingsworth de10c87
cp -pr lib/marked.js marked.min.js %{buildroot}%{_jsdir}/marked
T.C. Hollingsworth de10c87
08256ec
mkdir -p %{buildroot}%{nodejs_sitelib}/marked
T.C. Hollingsworth de10c87
cp -pr package.json component.json \
08256ec
    %{buildroot}%{nodejs_sitelib}/marked
T.C. Hollingsworth de10c87
mkdir -p %{buildroot}%{nodejs_sitelib}/marked/lib
T.C. Hollingsworth de10c87
ln -sf %{_jsdir}/marked/marked.js \
T.C. Hollingsworth de10c87
    %{buildroot}%{nodejs_sitelib}/marked/lib/marked.js
08256ec
mkdir -p %{buildroot}%{nodejs_sitelib}/marked/bin
08256ec
install -p -D -m0755 bin/marked \
08256ec
    %{buildroot}%{nodejs_sitelib}/marked/bin/marked
08256ec
mkdir -p %{buildroot}/%{_bindir}
08256ec
ln -sf %{nodejs_sitelib}/marked/bin/marked \
08256ec
    %{buildroot}%{_bindir}/marked
08256ec
08256ec
mkdir -p %{buildroot}%{_mandir}/man1
08256ec
install -p -D -m0644 man/marked.1 \
08256ec
    %{buildroot}%{_mandir}/man1/marked.1
08256ec
08256ec
%nodejs_symlink_deps
08256ec
08256ec
08256ec
%if 0%{?enable_tests}
08256ec
%check
08256ec
# gfm_code_hr_list test is known to fail but the author has not yet arrived
08256ec
# at a satisfactory solution: https://github.com/chjj/marked/pull/118
08256ec
99e6ad8
# def_blocks and double_link are also known to fail:
99e6ad8
# https://github.com/chjj/marked/issues/136#issuecomment-15016714
08256ec
f0113ba
%nodejs_symlink_deps --check
a6e87fa
# /usr/bin/npm install robotskirt
08256ec
%__nodejs ./test/
08256ec
%endif
08256ec
08256ec
08256ec
%files
08256ec
%{nodejs_sitelib}/marked
08256ec
%{_bindir}/marked
08256ec
%{_mandir}/man1/marked.1*
08256ec
08256ec
T.C. Hollingsworth de10c87
%files -n js-marked
T.C. Hollingsworth de10c87
%doc LICENSE README.md doc/
T.C. Hollingsworth de10c87
%{_jsdir}/marked
T.C. Hollingsworth de10c87
08256ec
%changelog
445942a
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.2-9
445942a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
445942a
3d853dc
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.2-8
3d853dc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
3d853dc
6a3bde1
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.2-7
6a3bde1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
6a3bde1
b5dd675
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.2-6
b5dd675
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
b5dd675
6649da3
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.2-5
6649da3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
6649da3
3f48384
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.2-4
3f48384
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
3f48384
5e14003
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.2-3
5e14003
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
5e14003
T.C. Hollingsworth de10c87
* Fri May 23 2014 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.3.2-2
T.C. Hollingsworth de10c87
- build browser version
T.C. Hollingsworth de10c87
a6e87fa
* Sat Apr 19 2014 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.3.2-1
a6e87fa
- update to upstream release 0.3.2
a6e87fa
45bf07f
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.9-3
45bf07f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
45bf07f
510b413
* Thu Jun 27 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.2.9-2
510b413
- restrict to compatible arches
510b413
e9d64f6
* Fri May 31 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.2.9-1
e9d64f6
- update to upstream release 0.2.9
e9d64f6
99e6ad8
* Sun Mar 17 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.2.8-3
99e6ad8
- add further information about test failures (all known to fail)
99e6ad8
08256ec
* Tue Mar 12 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.2.8-2
08256ec
- add information about test failures
08256ec
08256ec
* Thu Feb 14 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.2.8-1
08256ec
- initial package