Blob Blame History Raw
%{?nodejs_find_provides_and_requires}

%global docs %{_docdir}/%{name}-%{version}

%if 0%{?fedora} >= 20
%global docs %{_docdir}/%{name}
%endif

Name:       docco
Version:    0.6.2
Release:    6%{?dist}
Summary:    The Quick and Dirty Literate Programming Documentation Generator
License:    MIT
Group:      System Environment/Libraries
URL:        http://jashkenas.github.com/docco/
Source0:    http://registry.npmjs.org/docco/-/docco-%{version}.tgz

BuildArch:  noarch
%if 0%{?fedora} >= 19
ExclusiveArch: %{nodejs_arches} noarch
%else
ExclusiveArch: %{ix86} x86_64 %{arm} noarch
%endif

BuildRequires:  nodejs-packaging
BuildRequires:  coffee-script

# Required for running docco to build the docs.
BuildRequires:  npm(commander)
BuildRequires:  npm(highlight.js)
BuildRequires:  npm(marked)
BuildRequires:  npm(underscore)
BuildRequires:  python-pygments

Requires:       python-pygments

%description
Docco is a quick-and-dirty documentation generator, written in Literate
CoffeeScript. It produces an HTML document that displays your comments
intermingled with your code. All prose is passed through Markdown, and
code is passed through Pygments syntax highlighting.


%prep
%setup -q -n package
%nodejs_fixdep commander '~2.1'
%nodejs_fixdep marked '~0.2'
%nodejs_fixdep underscore '~1.6'


%build
%nodejs_symlink_deps --check
# Build docco.js
/usr/bin/cake build
# Build the documentation.
./bin/docco --layout linear docco.litcoffee
# Remove bundled web fonts.
find . -type f -iname '*.eot' -delete
find . -type f -iname '*.ttf' -delete
find . -type f -iname '*.woff' -delete


%install
mkdir -p %{buildroot}%{nodejs_sitelib}/docco
cp -pr package.json docco.js \
    %{buildroot}%{nodejs_sitelib}/docco
mkdir -p %{buildroot}%{nodejs_sitelib}/docco/bin
install -p -D -m0755 bin/docco \
    %{buildroot}%{nodejs_sitelib}/docco/bin/docco
mkdir -p %{buildroot}%{_bindir}
ln -sf %{nodejs_sitelib}/docco/bin/docco \
    %{buildroot}%{_bindir}/docco

mkdir -p %{buildroot}%{_datadir}/docco
cp -pr resources/ %{buildroot}%{_datadir}/docco
ln -sf %{_datadir}/docco/resources \
    %{buildroot}%{nodejs_sitelib}/docco/resources

# The docs expect the resources/ directory to be present.
mkdir -p %{buildroot}%{docs}
ln -sf %{_datadir}/docco/resources \
    %{buildroot}%{docs}/resources

%nodejs_symlink_deps


%files
%doc LICENSE README index.html docs/*
%{?el6:%doc resources}
%{nodejs_sitelib}/docco
%{_bindir}/docco
%{_datadir}/docco


%changelog
* Fri Apr 18 2014 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.6.2-6
- fix versioned dependencies

* Sun Aug 04 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.6.2-5
- add conditional for new unversioned docdir introduced in f20

* Sat Aug 03 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.6.2-4
- add resources symlink to %%files
- add ExclusiveArch logic

* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Thu Jun 27 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.6.2-2
- restrict to compatible arches

* Tue Apr 16 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.6.2-1
- update to upstream release 0.6.2

* Sat Mar 23 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.6.1-3
- add missing docco.js (#924952)

* Sat Mar 16 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.6.1-2
- rename from nodejs-docco to just docco

* Fri Mar 15 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.6.1-1
- update to upstream release 0.6.1
- use LICENSE file that has now been included in the tarball
- move docs to %%docs
- remove bundled web fonts
- include /usr/share/docco/resources
- add python-pygments to BuildRequires
- add npm(highlight-js) to BuildRequires

* Tue Mar 12 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.6.0-1
- update to upstream release 0.6.0
- remove comments about bundled showdown.js as project has switched to marked
- add a man page
- improve %%description
- remove /usr/share/docco/resources as we are including the compiled version
- test suite removed by upstream so remove coffee-script, npm(console.log)
  and python-pygments from BuildRequires
- add npm(marked) and npm(underscore) to BuildRequires

* Sat Mar 09 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.4.0-4
- add copies of the MIT and BSD licenses to comply with license requirements

* Sun Feb 17 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.4.0-3
- add BSD to License

* Sun Feb 17 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.4.0-2
- include vendor/ directory

* Sun Feb 17 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.4.0-1
- initial package