[marked/el6: 1/2] build browser version
T.C. Hollingsworth
patches at fedoraproject.org
Fri May 23 01:08:57 UTC 2014
commit de10c87f5e28d9cf307f41d33560fde343167458
Author: T.C. Hollingsworth <tchollingsworth at gmail.com>
Date: Thu May 22 18:03:03 2014 -0700
build browser version
marked.spec | 46 ++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 42 insertions(+), 4 deletions(-)
---
diff --git a/marked.spec b/marked.spec
index 5566cda..e176f64 100644
--- a/marked.spec
+++ b/marked.spec
@@ -4,7 +4,7 @@
Name: marked
Version: 0.3.2
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: A markdown parser for Node.js built for speed
License: MIT
Group: System Environment/Libraries
@@ -24,6 +24,8 @@ ExclusiveArch: %{ix86} x86_64 %{arm} noarch
%endif
BuildRequires: nodejs-packaging
+BuildRequires: web-assets-devel
+BuildRequires: uglify-js
%if 0%{?enable_tests}
BuildRequires: npm(express)
@@ -33,6 +35,8 @@ BuildRequires: npm(showdown)
# BuildRequires: npm(robotskirt)
%endif
+Requires: js-marked = %{version}-%{release}
+
%description
marked is a full-featured markdown compiler that can parse huge chunks of
markdown without having to worry about caching the compiled output or
@@ -47,19 +51,47 @@ This is important because a surprising number of markdown compilers cannot
pass more than a few tests.
+%package -n js-marked
+Summary: A markdown parser for JavaScript built for speed
+Group: System Environment/Libraries
+Requires: web-assets-filesystem
+
+%description -n js-marked
+marked is a full-featured markdown compiler that can parse huge chunks of
+markdown without having to worry about caching the compiled output or
+blocking for an unnecessarily long time.
+
+marked is extremely fast and frequently outperforms similar markdown parsers.
+marked is very concise and still implements all markdown features, as well
+as GitHub Flavored Markdown features.
+
+marked more or less passes the official markdown test suite in its entirety.
+This is important because a surprising number of markdown compilers cannot
+pass more than a few tests.
+
+
%prep
%setup -q -n package
%setup -q -T -D -a 1 -n package
+# remove the bundled minified marked
+rm -f marked.min.js
+
%build
-#nothing to do
+uglifyjs --comments '/Copyright/' lib/marked.js -o marked.min.js
%install
+mkdir -p %{buildroot}%{_jsdir}/marked
+cp -pr lib/marked.js marked.min.js %{buildroot}%{_jsdir}/marked
+
mkdir -p %{buildroot}%{nodejs_sitelib}/marked
-cp -pr package.json component.json lib/ \
+cp -pr package.json component.json \
%{buildroot}%{nodejs_sitelib}/marked
+mkdir -p %{buildroot}%{nodejs_sitelib}/marked/lib
+ln -sf %{_jsdir}/marked/marked.js \
+ %{buildroot}%{nodejs_sitelib}/marked/lib/marked.js
mkdir -p %{buildroot}%{nodejs_sitelib}/marked/bin
install -p -D -m0755 bin/marked \
%{buildroot}%{nodejs_sitelib}/marked/bin/marked
@@ -89,13 +121,19 @@ install -p -D -m0644 man/marked.1 \
%files
-%doc LICENSE README.md doc/
%{nodejs_sitelib}/marked
%{_bindir}/marked
%{_mandir}/man1/marked.1*
+%files -n js-marked
+%doc LICENSE README.md doc/
+%{_jsdir}/marked
+
%changelog
+* Fri May 23 2014 T.C. Hollingsworth <tchollingsworth at gmail.com> - 0.3.2-2
+- build browser version
+
* Sat Apr 19 2014 Jamie Nguyen <jamielinux at fedoraproject.org> - 0.3.2-1
- update to upstream release 0.3.2
More information about the scm-commits
mailing list