fd20b1
%global vimdir %{_datadir}/vim/vimfiles
fd20b1
%global commit f7c2274b84394bcf6607284fe4f48ab606c988d5
fd20b1
%global shortcommit %(c=%{commit}; echo ${c:0:7})
fd20b1
fd20b1
Summary: Text based document generation
fd20b1
Name: asciidoc
fd20b1
Version: 8.6.10
fd20b1
Release: 0.5.20180627git%{shortcommit}%{?dist}
fd20b1
# The python code does not specify a version.
fd20b1
# The javascript example code is GPLv2+.
fd20b1
License: GPL+ and GPLv2+
fd20b1
fd20b1
URL: http://asciidoc.org
fd20b1
# Tarball name has to be modified, due github repo 
fd20b1
# is called asciidoc-py3 instead of asciidoc
fd20b1
# This solution is temporary, due upstream 
fd20b1
# haven't released 8.6.10 version yet.
fd20b1
# https://github.com/%%{name}/%%{name}-py3/archive/%%{version}.tar.gz
fd20b1
Source0: %{name}-py3-%{commit}.tar.gz
fd20b1
fd20b1
Patch1: asciidoc-music-noship.patch
fd20b1
Patch2: asciidoc-remove-music.patch
fd20b1
fd20b1
BuildRequires: python3-devel
fd20b1
BuildRequires: dblatex
fd20b1
BuildRequires: docbook-style-xsl
fd20b1
BuildRequires: graphviz
fd20b1
BuildRequires: libxslt
fd20b1
BuildRequires: source-highlight
fd20b1
BuildRequires: texlive-dvipng-bin
fd20b1
BuildRequires: texlive-dvisvgm-bin
fd20b1
BuildRequires: vim-filesystem
fd20b1
BuildRequires: symlinks
fd20b1
BuildRequires: automake
fd20b1
BuildRequires: autoconf
fd20b1
fd20b1
Requires: %{__python3}
fd20b1
Requires: docbook-style-xsl
fd20b1
Requires: graphviz
fd20b1
Requires: libxslt
fd20b1
Requires: source-highlight
fd20b1
Requires: vim-filesystem
fd20b1
fd20b1
BuildArch: noarch
fd20b1
fd20b1
%description
fd20b1
AsciiDoc is a text document format for writing short documents,
fd20b1
articles, books and UNIX man pages. AsciiDoc files can be translated
fd20b1
to HTML and DocBook markups using the asciidoc(1) command.
fd20b1
fd20b1
%package doc
fd20b1
Summary:  Additional documentation and examples for asciidoc
fd20b1
Requires: %{name} = %{version}-%{release}
fd20b1
fd20b1
%description doc
fd20b1
%{summary}.
fd20b1
fd20b1
%package latex
fd20b1
Summary:  Support for asciidoc latex output
fd20b1
Requires: %{name} = %{version}-%{release}
fd20b1
Requires: dblatex
fd20b1
Requires: texlive-dvipng-bin
fd20b1
fd20b1
%description latex
fd20b1
%{summary}.
fd20b1
fd20b1
%prep
fd20b1
%autosetup -p1 -n %{name}-py3-%{commit}
fd20b1
rm -rf filters/music
fd20b1
# Fix line endings on COPYRIGHT file
fd20b1
sed -i "s/\r//g" COPYRIGHT
fd20b1
fd20b1
# Convert README and dict files to utf-8
fd20b1
for file in README.asciidoc doc/*.dict examples/website/*.dict; do
fd20b1
    iconv -f ISO-8859-1 -t UTF-8 -o $file.new $file && \
fd20b1
    touch -r $file $file.new && \
fd20b1
    mv $file.new $file
fd20b1
done
fd20b1
fd20b1
# Fix python shebang
fd20b1
grep -rl '#!/usr/bin/env python' | xargs -r \
fd20b1
    sed -i -e '1s@#!/usr/bin/env python3\?$@#!%{__python3}@'
fd20b1
fd20b1
%build
fd20b1
autoreconf -v
fd20b1
%configure
fd20b1
fd20b1
%install
fd20b1
make install docs DESTDIR=%{buildroot}
fd20b1
fd20b1
install -dm 755 %{buildroot}%{_datadir}/asciidoc/
fd20b1
# real conf data goes to sysconfdir, rest to datadir; symlinks so asciidoc works
fd20b1
for d in dblatex docbook-xsl images javascripts stylesheets; do
fd20b1
    mv -v %{buildroot}%{_sysconfdir}/asciidoc/$d \
fd20b1
          %{buildroot}%{_datadir}/asciidoc/
fd20b1
    # absolute symlink into buildroot is intentional, see below
fd20b1
    ln -s %{buildroot}%{_datadir}/%{name}/$d %{buildroot}%{_sysconfdir}/%{name}/
fd20b1
fd20b1
    # let's symlink stuff for documentation as well so we don't duplicate things
fd20b1
    rm -rf %{buildroot}%{_docdir}/%{name}/$d
fd20b1
    # absolute symlink into buildroot is intentional, see below
fd20b1
    ln -s %{buildroot}%{_datadir}/%{name}/$d %{buildroot}%{_docdir}/%{name}/
fd20b1
done
fd20b1
fd20b1
# Python API
fd20b1
mkdir -p %{buildroot}%{python3_sitelib}/
fd20b1
sed '1d' asciidocapi.py > %{buildroot}%{python3_sitelib}/asciidocapi.py
fd20b1
chmod -x %{buildroot}%{python3_sitelib}/asciidocapi.py
fd20b1
touch -r asciidocapi.py %{buildroot}%{python3_sitelib}/asciidocapi.py
fd20b1
fd20b1
# Make it easier to %%exclude these with both rpm < and >= 4.7
fd20b1
for file in %{buildroot}{%{_bindir},%{_sysconfdir}/asciidoc/filters/*}/*.py ; do
fd20b1
    touch ${file}{c,o}
fd20b1
done
fd20b1
fd20b1
mkdir -p %{buildroot}%{vimdir}/{ftdetect,syntax}
fd20b1
for file in $(cd vim; find * -type f); do
fd20b1
    install -m 0644 vim/$file %{buildroot}%{vimdir}/$file
fd20b1
done
fd20b1
fd20b1
# Absolute symlinks were used above to be able to detect dangling ones. Make
fd20b1
# them relative now (sane for being installed) and remove dangling symlinks.
fd20b1
symlinks -cdr %{buildroot}
fd20b1
fd20b1
# Clean up no needed doc files
fd20b1
for file in BUGS.txt CHANGELOG.txt INSTALL INSTALL.txt README.txt; do
fd20b1
    rm -f %{buildroot}/%{_pkgdocdir}/$file
fd20b1
done
fd20b1
fd20b1
%check
fd20b1
export PATH="../:$PATH"
fd20b1
cd tests
fd20b1
%{__python3} testasciidoc.py update
fd20b1
%{__python3} testasciidoc.py run
fd20b1
fd20b1
%files
fd20b1
%doc COPYING COPYRIGHT README.asciidoc
fd20b1
%doc %{_mandir}/man1/a2x.1*
fd20b1
%doc %{_mandir}/man1/asciidoc.1*
fd20b1
%config(noreplace) %{_sysconfdir}/asciidoc/
fd20b1
%{_bindir}/a2x
fd20b1
%{_bindir}/a2x.py
fd20b1
%{_bindir}/asciidoc
fd20b1
%{_bindir}/asciidoc.py
fd20b1
%{_datadir}/asciidoc/
fd20b1
%{python3_sitelib}/asciidocapi.py*
fd20b1
%{python3_sitelib}/__pycache__/asciidocapi*
fd20b1
%{vimdir}/syntax/asciidoc.vim
fd20b1
%exclude %{_bindir}/*.py[co]
fd20b1
%exclude %{_sysconfdir}/asciidoc/filters/*/*.py[co]
fd20b1
%exclude %{_sysconfdir}/asciidoc/filters/latex
fd20b1
%exclude %{_pkgdocdir}/examples
fd20b1
%exclude %{_pkgdocdir}/doc
fd20b1
%exclude %{_pkgdocdir}/{dblatex,docbook-xsl,images,javascripts,stylesheets}
fd20b1
fd20b1
%files doc
fd20b1
%{_pkgdocdir}/examples
fd20b1
%{_pkgdocdir}/doc
fd20b1
%{_pkgdocdir}/{dblatex,docbook-xsl,images,javascripts,stylesheets}
fd20b1
%exclude %{_docdir}/%{name}/{COPYING,COPYRIGHT,README.asciidoc}
fd20b1
fd20b1
%files latex
fd20b1
%dir %{_sysconfdir}/asciidoc/filters/latex
fd20b1
%{_sysconfdir}/asciidoc/filters/latex/*.py
fd20b1
%config(noreplace) %{_sysconfdir}/asciidoc/filters/latex/*.conf
fd20b1
fd20b1
%changelog
fd20b1
* Wed Sep 19 2018 Tomas Orsava <torsava@redhat.com> - 8.6.10-0.5.20180627gitf7c2274
fd20b1
- Require the Python interpreter directly instead of using the package name
fd20b1
- Related: rhbz#1619153
fd20b1
fd20b1
* Tue Aug 14 2018 Josef Ridky <jridky@redhat.com> - 8.6.10-0.4.20180627gitf7c2274
fd20b1
- Remove ImageMagic requirement
fd20b1
fd20b1
* Wed Jun 27 2018 Josef Ridky <jridky@redhat.com> - 8.6.10-0.3.20180627gitf7c2274
fd20b1
- Update to master branch version from 27/06/2018
fd20b1
fd20b1
* Thu Jun 14 2018 Josef Ridky <jridky@redhat.com> - 8.6.10-0.2.20180605git986f99d
fd20b1
- Various rpmlint fixes
fd20b1
- Remove musicfilter from package (#1571138)
fd20b1
fd20b1
* Wed Jun 06 2018 Josef Ridky <jridky@redhat.com> - 8.6.10-0.1.20180605git986f99d
fd20b1
- New upstream version with Python3 support - asciidoc-py3 (commit 986f99d)
fd20b1
- Update versioning, Source and Url label information
fd20b1
fd20b1
* Wed Feb 14 2018 Josef Ridky <jridky@redhat.com> - 8.6.8-15
fd20b1
- spec file cleanup (remove Group tag, use autosetup)
fd20b1
- add python2 build support for RHEL
fd20b1
fd20b1
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 8.6.8-14
fd20b1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
fd20b1
fd20b1
* Wed Dec 06 2017 Todd Zullinger <tmz@pobox.com> - 8.6.8-13
fd20b1
- Explicitly use python2, in preparation for python3 becoming the default
fd20b1
  python
fd20b1
fd20b1
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 8.6.8-12
fd20b1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
fd20b1
fd20b1
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 8.6.8-11
fd20b1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
fd20b1
fd20b1
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 8.6.8-10
fd20b1
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
fd20b1
fd20b1
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 8.6.8-9
fd20b1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
fd20b1
fd20b1
* Fri Oct 30 2015 Stanislav Ochotnicky <sochotnicky@redhat.com> - 8.6.8-8
fd20b1
- Fix build due to doc files (rhbz#1266596)
fd20b1
fd20b1
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 8.6.8-7
fd20b1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
fd20b1
fd20b1
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 8.6.8-6
fd20b1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
fd20b1
fd20b1
* Mon Feb 10 2014 Nils Philippsen <nils@redhat.com> - 8.6.8-5
fd20b1
- explicitly use system copy of Python 2.x
fd20b1
- fix broken and remove dangling symlinks
fd20b1
fd20b1
* Tue Dec 03 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 8.6.8-3
fd20b1
- Fix duplicate documentation files (#1001234)
fd20b1
- Fix encoding of manifests being written (#968308)
fd20b1
fd20b1
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 8.6.8-2
fd20b1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
fd20b1
fd20b1
* Thu Mar  7 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 8.6.8-1
fd20b1
- Update to latest upstream version
fd20b1
- Move things around make docs dir actually working
fd20b1
- Add proper requires on vim-filesystem
fd20b1
- Run testsuite
fd20b1
- Split music and latex support to subpackages
fd20b1
fd20b1
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 8.4.5-9
fd20b1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
fd20b1
fd20b1
* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 8.4.5-8
fd20b1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
fd20b1
fd20b1
* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 8.4.5-7
fd20b1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
fd20b1
fd20b1
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 8.4.5-6
fd20b1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
fd20b1
fd20b1
* Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 8.4.5-5
fd20b1
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
fd20b1
fd20b1
* Tue Sep  8 2009 Ville Skyttä <ville.skytta@iki.fi> - 8.4.5-4
fd20b1
- Remaining improvements from #480288:
fd20b1
- Add dependencies on libxslt and docbook-style-xsl.
fd20b1
- Install dblatex style sheets.
fd20b1
- Exclude unneeded *.py[co].
fd20b1
- Install python API.
fd20b1
- Specfile cleanups.
fd20b1
fd20b1
* Thu Aug 13 2009 Todd Zullinger <tmz@pobox.com> - 8.4.5-3
fd20b1
- Use 'unsafe' mode by default (bug 506953)
fd20b1
- Install filter scripts in %%{_datadir}/asciidoc
fd20b1
- Convert spec file, CHANGELOG, and README to utf-8
fd20b1
- Preserve timestamps on installed files, where feasible
fd20b1
- s/$RPM_BUILD_ROOT/%%{buildroot} and drop duplicated /'s
fd20b1
- Fix rpmlint mixed-use-of-spaces-and-tabs and end-of-line-encoding warnings
fd20b1
fd20b1
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 8.4.5-2
fd20b1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
fd20b1
fd20b1
* Fri Jun 19 2009 Dave Airlie <airlied@redhat.com> 8.4.5-1
fd20b1
- new upstream version 8.4.5 - required by X.org libXi to build
fd20b1
fd20b1
* Mon Feb 23 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 8.2.5-4
fd20b1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
fd20b1
fd20b1
* Thu May 22 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 8.2.5-3
fd20b1
- fix license tag
fd20b1
fd20b1
* Wed Dec 05 2007 Florian La Roche <laroche@redhat.com> - 8.2.5-2
fd20b1
- remove doc/examples from filelist due to dangling symlinks
fd20b1
fd20b1
* Tue Nov 20 2007 Florian La Roche <laroche@redhat.com> - 8.2.5-1
fd20b1
- new upstream version 8.2.5
fd20b1
fd20b1
* Mon Oct 22 2007 Florian La Roche <laroche@redhat.com> - 8.2.3-1
fd20b1
- new upstream version 8.2.3
fd20b1
fd20b1
* Sat Sep 01 2007 Florian La Roche <laroche@redhat.com> - 8.2.2-1
fd20b1
- new upstream version 8.2.2
fd20b1
fd20b1
* Mon Mar 19 2007 Chris Wright <chrisw@redhat.com> - 8.1.0-1
fd20b1
- update to asciidoc 8.1.0
fd20b1
fd20b1
* Thu Sep 14 2006 Chris Wright <chrisw@redhat.com> - 7.0.2-3
fd20b1
- rebuild for Fedora Extras 6
fd20b1
fd20b1
* Tue Feb 28 2006 Chris Wright <chrisw@redhat.com> - 7.0.2-2
fd20b1
- rebuild for Fedora Extras 5
fd20b1
fd20b1
* Mon Aug 29 2005 Chris Wright <chrisw@osdl.org> - 7.0.2-1
fd20b1
- convert spec file to UTF-8
fd20b1
- Source should be URL
fd20b1
- update to 7.0.2
fd20b1
fd20b1
* Fri Aug 19 2005 Chris Wright <chrisw@osdl.org> - 7.0.1-3
fd20b1
- consistent use of RPM_BUILD_ROOT
fd20b1
fd20b1
* Thu Aug 18 2005 Chris Wright <chrisw@osdl.org> - 7.0.1-2
fd20b1
- Update BuildRoot
fd20b1
- use _datadir
fd20b1
- use config and _sysconfdir
fd20b1
fd20b1
* Wed Jun 29 2005 Terje Røsten <terje.rosten@ntnu.no> - 7.0.1-1
fd20b1
- 7.0.1
fd20b1
- Drop patch now upstream
fd20b1
- Build as noarch (Petr Klíma)
fd20b1
fd20b1
* Sat Jun 11 2005 Terje Røsten <terje.rosten@ntnu.no> - 7.0.0-0.3
fd20b1
- Add include patch
fd20b1
fd20b1
* Fri Jun 10 2005 Terje Røsten <terje.rosten@ntnu.no> - 7.0.0-0.2
fd20b1
- Fix stylesheets according to Stuart
fd20b1
fd20b1
* Fri Jun 10 2005 Terje Røsten <terje.rosten@ntnu.no> - 7.0.0-0.1
fd20b1
- Initial package
fd20b1
- Based on Debian package, thx!