Blob Blame History Raw
%{?nodejs_find_provides_and_requires}

Name:       docco
Version:    0.6.1
Release:    3%{?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
# Include our own man page.
Source20:   docco.1
BuildArch:  noarch

BuildRequires:  nodejs-devel
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


%build
cp -pr %{nodejs_sitelib} .
# Build docco.js
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}%{_docdir}/%{name}-%{version}
ln -sf %{_datadir}/docco/resources \
    %{buildroot}%{_docdir}/%{name}-%{version}/resources

mkdir -p %{buildroot}%{_mandir}/man1
install -p -D -m0644 %{SOURCE20} %{buildroot}%{_mandir}/man1/docco.1

%nodejs_symlink_deps


%files
%doc LICENSE README index.html docs/*
%{nodejs_sitelib}/docco
%{_bindir}/docco
%{_datadir}/docco
%{_mandir}/man1/docco.1*


%changelog
* 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