05e81d
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
05e81d
%global vimdir %{_datadir}/vim/vimfiles
05e81d
05e81d
Summary: Text based document generation
05e81d
Name: asciidoc
05e81d
Version: 8.6.8
56e00f
Release: 5%{?dist}
05e81d
# The python code does not specify a version.
05e81d
# The javascript example code is GPLv2+.
05e81d
License: GPL+ and GPLv2+
05e81d
Group: Applications/System
05e81d
05e81d
URL: http://www.methods.co.nz/asciidoc/
05e81d
Source: http://sourceforge.net/projects/asciidoc/files/%{name}/%{version}/%{name}-%{version}.tar.gz
05e81d
Patch0: asciidoc-8.6.8-music-noship.patch
56e00f
Patch1: asciidoc-8.6.8-explicit-interpreter.patch
05e81d
05e81d
BuildRequires: python2-devel
05e81d
BuildRequires: dblatex
05e81d
BuildRequires: graphviz
05e81d
BuildRequires: libxslt
05e81d
%if 0%{?rhel} == 0
05e81d
BuildRequires: lilypond
05e81d
%endif
05e81d
BuildRequires: source-highlight
05e81d
BuildRequires: texlive-dvipng-bin
05e81d
BuildRequires: vim-filesystem
56e00f
BuildRequires: symlinks
05e81d
05e81d
05e81d
Requires: python >= 2.4
05e81d
Requires: docbook-style-xsl
05e81d
Requires: graphviz
05e81d
Requires: libxslt
05e81d
Requires: libxslt
05e81d
Requires: source-highlight
05e81d
Requires: vim-filesystem
05e81d
05e81d
BuildArch: noarch
05e81d
05e81d
%description
05e81d
AsciiDoc is a text document format for writing short documents,
05e81d
articles, books and UNIX man pages. AsciiDoc files can be translated
05e81d
to HTML and DocBook markups using the asciidoc(1) command.
05e81d
05e81d
%package doc
05e81d
Summary:  Additional documentation and examples for asciidoc
05e81d
Requires: %{name} = %{version}-%{release}
05e81d
05e81d
%description doc
05e81d
%{summary}.
05e81d
05e81d
%package latex
05e81d
Summary:  Support for asciidoc latex output
05e81d
Requires: %{name} = %{version}-%{release}
05e81d
Requires: dblatex
05e81d
Requires: texlive-dvipng-bin
05e81d
05e81d
%description latex
05e81d
%{summary}.
05e81d
05e81d
%if 0%{?rhel} == 0
05e81d
%package music
05e81d
Summary:  Support for asciidoc music output
05e81d
Requires: %{name} = %{version}-%{release}
05e81d
Requires: lilypond
05e81d
05e81d
%description music
05e81d
%{summary}.
05e81d
%endif
05e81d
05e81d
%prep
05e81d
%setup -q
05e81d
%patch0 -p1 -b .music-noship
56e00f
%patch1 -p1 -b .explicit-interpreter
05e81d
05e81d
# Fix line endings on COPYRIGHT file
05e81d
sed -i "s/\r//g" COPYRIGHT
05e81d
05e81d
# Convert CHANGELOG and README to utf-8
05e81d
for file in CHANGELOG README; do
05e81d
    iconv -f ISO-8859-1 -t UTF-8 -o $file.new $file && \
05e81d
    touch -r $file $file.new && \
05e81d
    mv $file.new $file
05e81d
done
05e81d
05e81d
# Remove music-filter doc
05e81d
rm -f doc/music-filter.txt
05e81d
05e81d
%build
05e81d
%configure
05e81d
05e81d
%install
05e81d
make install docs DESTDIR=%{buildroot}
05e81d
05e81d
install -dm 755 %{buildroot}%{_datadir}/asciidoc/
05e81d
# real conf data goes to sysconfdir, rest to datadir; symlinks so asciidoc works
05e81d
for d in dblatex docbook-xsl images javascripts stylesheets; do
05e81d
    mv -v %{buildroot}%{_sysconfdir}/asciidoc/$d \
05e81d
          %{buildroot}%{_datadir}/asciidoc/
56e00f
    # absolute symlink into buildroot is intentional, see below
56e00f
    ln -s %{buildroot}%{_datadir}/%{name}/$d %{buildroot}%{_sysconfdir}/%{name}/
05e81d
05e81d
    # let's symlink stuff for documentation as well so we don't duplicate things
05e81d
    rm -rf %{buildroot}%{_docdir}/%{name}/$d
56e00f
    # absolute symlink into buildroot is intentional, see below
56e00f
    ln -s %{buildroot}%{_datadir}/%{name}/$d %{buildroot}%{_docdir}/%{name}/
05e81d
done
05e81d
05e81d
# Python API
05e81d
install -Dpm 644 asciidocapi.py %{buildroot}%{python_sitelib}/asciidocapi.py
05e81d
05e81d
# Make it easier to %exclude these with both rpm < and >= 4.7
05e81d
for file in %{buildroot}{%{_bindir},%{_sysconfdir}/asciidoc/filters/*}/*.py ; do
05e81d
    touch ${file}{c,o}
05e81d
done
05e81d
05e81d
mkdir -p %{buildroot}%{vimdir}/{ftdetect,syntax}
05e81d
for file in $(cd vim; find * -type f); do
05e81d
    install -m 0644 vim/$file %{buildroot}%{vimdir}/$file
05e81d
done
05e81d
05e81d
# Remove music files for RHEL
05e81d
%if 0%{?rhel} >= 0
05e81d
rm -rf %{buildroot}{%{_sysconfdir}/asciidoc/filters/music,%{_sysconfdir}/asciidoc/filters/music/*.conf,%{_sysconfdir}/asciidoc/filters/music/*.py}
05e81d
%endif
05e81d
56e00f
# Absolute symlinks were used above to be able to detect dangling ones. Make
56e00f
# them relative now (sane for being installed) and remove dangling symlinks.
56e00f
symlinks -cdr %{buildroot}
56e00f
05e81d
%check
05e81d
export PATH="../:$PATH"
05e81d
cd tests
05e81d
python testasciidoc.py update
05e81d
python testasciidoc.py run
05e81d
05e81d
%files
05e81d
%doc COPYING COPYRIGHT BUGS CHANGELOG README
05e81d
%doc %{_mandir}/man1/a2x.1*
05e81d
%doc %{_mandir}/man1/asciidoc.1*
05e81d
%config(noreplace) %{_sysconfdir}/asciidoc/
05e81d
%{_bindir}/a2x
05e81d
%{_bindir}/a2x.py
05e81d
%{_bindir}/asciidoc
05e81d
%{_bindir}/asciidoc.py
05e81d
%{_datadir}/asciidoc/
05e81d
%{python_sitelib}/asciidocapi.py*
05e81d
%{vimdir}/ftdetect/asciidoc_filetype.vim
05e81d
%{vimdir}/syntax/asciidoc.vim
05e81d
%exclude %{_bindir}/*.py[co]
05e81d
%exclude %{_sysconfdir}/asciidoc/filters/*/*.py[co]
05e81d
%exclude %{_sysconfdir}/asciidoc/filters/latex
05e81d
%exclude %{_sysconfdir}/asciidoc/filters/music
05e81d
05e81d
%files doc
05e81d
%{_docdir}/%{name}
05e81d
%exclude %{_docdir}/%{name}/{BUGS,CHANGELOG,COPYING,COPYRIGHT,README}
05e81d
05e81d
%files latex
05e81d
%dir %{_sysconfdir}/asciidoc/filters/latex
05e81d
%{_sysconfdir}/asciidoc/filters/latex/*.py
05e81d
%{_sysconfdir}/asciidoc/filters/latex/*.conf
05e81d
05e81d
%if 0%{?rhel} == 0
05e81d
%files music
05e81d
%dir %{_sysconfdir}/asciidoc/filters/music
05e81d
%{_sysconfdir}/asciidoc/filters/music/*.conf
05e81d
%{_sysconfdir}/asciidoc/filters/music/*.py
05e81d
%endif
05e81d
05e81d
05e81d
%changelog
56e00f
* Mon Feb 10 2014 Nils Philippsen <nils@redhat.com> - 8.6.8-5
56e00f
- explicitly use system copy of Python 2.x (#987011)
56e00f
- fix broken and remove dangling symlinks
56e00f
56e00f
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 8.6.8-3
56e00f
- Mass rebuild 2013-12-27
56e00f
05e81d
* Thu Oct  3 2013 Paul W. Frields <pfrields@redhat.com> - 8.6.8-2
05e81d
- Do not build or test musicfilter
05e81d
05e81d
* Thu Mar  7 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 8.6.8-1
05e81d
- Update to latest upstream version
05e81d
- Move things around make docs dir actually working
05e81d
- Add proper requires on vim-filesystem
05e81d
- Run testsuite
05e81d
- Split music and latex support to subpackages
05e81d
05e81d
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 8.4.5-9
05e81d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
05e81d
05e81d
* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 8.4.5-8
05e81d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
05e81d
05e81d
* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 8.4.5-7
05e81d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
05e81d
05e81d
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 8.4.5-6
05e81d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
05e81d
05e81d
* Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 8.4.5-5
05e81d
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
05e81d
05e81d
* Tue Sep  8 2009 Ville Skyttä <ville.skytta@iki.fi> - 8.4.5-4
05e81d
- Remaining improvements from #480288:
05e81d
- Add dependencies on libxslt and docbook-style-xsl.
05e81d
- Install dblatex style sheets.
05e81d
- Exclude unneeded *.py[co].
05e81d
- Install python API.
05e81d
- Specfile cleanups.
05e81d
05e81d
* Thu Aug 13 2009 Todd Zullinger <tmz@pobox.com> - 8.4.5-3
05e81d
- Use 'unsafe' mode by default (bug 506953)
05e81d
- Install filter scripts in %%{_datadir}/asciidoc
05e81d
- Convert spec file, CHANGELOG, and README to utf-8
05e81d
- Preserve timestamps on installed files, where feasible
05e81d
- s/$RPM_BUILD_ROOT/%%{buildroot} and drop duplicated /'s
05e81d
- Fix rpmlint mixed-use-of-spaces-and-tabs and end-of-line-encoding warnings
05e81d
05e81d
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 8.4.5-2
05e81d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
05e81d
05e81d
* Fri Jun 19 2009 Dave Airlie <airlied@redhat.com> 8.4.5-1
05e81d
- new upstream version 8.4.5 - required by X.org libXi to build
05e81d
05e81d
* Mon Feb 23 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 8.2.5-4
05e81d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
05e81d
05e81d
* Thu May 22 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 8.2.5-3
05e81d
- fix license tag
05e81d
05e81d
* Wed Dec 05 2007 Florian La Roche <laroche@redhat.com> - 8.2.5-2
05e81d
- remove doc/examples from filelist due to dangling symlinks
05e81d
05e81d
* Tue Nov 20 2007 Florian La Roche <laroche@redhat.com> - 8.2.5-1
05e81d
- new upstream version 8.2.5
05e81d
05e81d
* Mon Oct 22 2007 Florian La Roche <laroche@redhat.com> - 8.2.3-1
05e81d
- new upstream version 8.2.3
05e81d
05e81d
* Sat Sep 01 2007 Florian La Roche <laroche@redhat.com> - 8.2.2-1
05e81d
- new upstream version 8.2.2
05e81d
05e81d
* Mon Mar 19 2007 Chris Wright <chrisw@redhat.com> - 8.1.0-1
05e81d
- update to asciidoc 8.1.0
05e81d
05e81d
* Thu Sep 14 2006 Chris Wright <chrisw@redhat.com> - 7.0.2-3
05e81d
- rebuild for Fedora Extras 6
05e81d
05e81d
* Tue Feb 28 2006 Chris Wright <chrisw@redhat.com> - 7.0.2-2
05e81d
- rebuild for Fedora Extras 5
05e81d
05e81d
* Mon Aug 29 2005 Chris Wright <chrisw@osdl.org> - 7.0.2-1
05e81d
- convert spec file to UTF-8
05e81d
- Source should be URL
05e81d
- update to 7.0.2
05e81d
05e81d
* Fri Aug 19 2005 Chris Wright <chrisw@osdl.org> - 7.0.1-3
05e81d
- consistent use of RPM_BUILD_ROOT
05e81d
05e81d
* Thu Aug 18 2005 Chris Wright <chrisw@osdl.org> - 7.0.1-2
05e81d
- Update BuildRoot
05e81d
- use _datadir
05e81d
- use config and _sysconfdir
05e81d
05e81d
* Wed Jun 29 2005 Terje Røsten <terje.rosten@ntnu.no> - 7.0.1-1
05e81d
- 7.0.1
05e81d
- Drop patch now upstream
05e81d
- Build as noarch (Petr Klíma)
05e81d
05e81d
* Sat Jun 11 2005 Terje Røsten <terje.rosten@ntnu.no> - 7.0.0-0.3
05e81d
- Add include patch
05e81d
05e81d
* Fri Jun 10 2005 Terje Røsten <terje.rosten@ntnu.no> - 7.0.0-0.2
05e81d
- Fix stylesheets according to Stuart
05e81d
05e81d
* Fri Jun 10 2005 Terje Røsten <terje.rosten@ntnu.no> - 7.0.0-0.1
05e81d
- Initial package
05e81d
- Based on Debian package, thx!