asciidoc-vl.spec 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. Summary: Text based document generation
  2. Summary(ja): テキストベースのドキュメント生成
  3. Name: asciidoc
  4. Version: 9.1.0
  5. Release: 2%{?_dist_release}
  6. Group: office
  7. Vendor: Project Vine
  8. Distribution: Vine Linux
  9. Packager: daisuke, kenta
  10. License: GPLv2+
  11. URL: https://asciidoc.org/
  12. Source0: https://github.com/asciidoc-py/asciidoc-py/releases/download/%{version}/%{name}-%{version}.tar.gz
  13. BuildArch: noarch
  14. BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
  15. BuildRequires: python3
  16. BuildRequires: symlinks
  17. Requires: python3
  18. Requires: docbook-style-xsl
  19. Requires: libxslt
  20. Requires: graphviz
  21. Requires: source-highlight
  22. %description
  23. AsciiDoc is a text document format for writing short documents,
  24. articles, books and UNIX man pages. AsciiDoc files can be translated
  25. to HTML and DocBook markups using the asciidoc(1) command.
  26. %package doc
  27. Summary: Additional documentation and examples for asciidoc
  28. Group: documentation
  29. Requires: %{name} = %{version}-%{release}
  30. %description doc
  31. %{summary}.
  32. %package latex
  33. Summary: Support for asciidoc latex output
  34. Group: publishing
  35. Requires: %{name} = %{version}-%{release}
  36. Requires: dblatex
  37. %description latex
  38. %{summary}.
  39. %prep
  40. %setup -q
  41. # Convert files to utf-8
  42. for file in README.asciidoc doc/*.dict website/*.dict; do
  43. iconv -f ISO-8859-1 -t UTF-8 -o $file.new $file && \
  44. touch -r $file $file.new && \
  45. mv $file.new $file
  46. done
  47. # Remove music files
  48. rm -rf %{buildroot}{%{_sysconfdir}/asciidoc/filters/music,%{_sysconfdir}/asciidoc/filters/music/*.conf,%{_sysconfdir}/asciidoc/filters/music/*.py}
  49. # Fix python shebang
  50. grep -rl '#!/usr/bin/env python' | xargs -r \
  51. sed -i -e '1s@#!/usr/bin/env python3\?$@#!%{__python3}@'
  52. %build
  53. autoreconf -v
  54. %configure
  55. %make_build
  56. %install
  57. make install docs DESTDIR=%{buildroot}
  58. install -dm 755 %{buildroot}%{_datadir}/asciidoc/
  59. # Real conf data goes to sysconfdir, rest to datadir; symlinks so asciidoc works
  60. for d in dblatex docbook-xsl images javascripts stylesheets; do
  61. mv -v %{buildroot}%{_sysconfdir}/asciidoc/$d \
  62. %{buildroot}%{_datadir}/asciidoc/
  63. # Absolute symlink into buildroot is intentional, see below
  64. ln -s %{buildroot}%{_datadir}/%{name}/$d %{buildroot}%{_sysconfdir}/%{name}/
  65. # Let's symlink stuff for documentation as well so we don't duplicate things
  66. rm -rf %{buildroot}%{_docdir}/%{name}/$d
  67. # Absolute symlink into buildroot is intentional, see below
  68. ln -s %{buildroot}%{_datadir}/%{name}/$d %{buildroot}%{_docdir}/%{name}/
  69. done
  70. # Python API
  71. mkdir -p %{buildroot}%{python3_sitelib}/
  72. sed '1d' asciidocapi.py > %{buildroot}%{python3_sitelib}/asciidocapi.py
  73. chmod -x %{buildroot}%{python3_sitelib}/asciidocapi.py
  74. touch -r asciidocapi.py %{buildroot}%{python3_sitelib}/asciidocapi.py
  75. # Make it easier to %%exclude these with both rpm < and >= 4.7
  76. for file in %{buildroot}{%{_bindir},%{_sysconfdir}/asciidoc/filters/*}/*.py ; do
  77. touch ${file}{c,o}
  78. done
  79. # Clean up no needed doc files
  80. rm -f %{buildroot}%{_pkgdocdir}/INSTALL.txt
  81. rm -f %{buildroot}%{_mandir}/man1/testasciidoc.1*
  82. rm -f %{buildroot}%{_bindir}/*.py[co]
  83. rm -f %{buildroot}%{_sysconfdir}/asciidoc/filters/*/*.py[co]
  84. # Absolute symlinks were used above to be able to detect dangling ones. Make
  85. # them relative now (sane for being installed) and remove dangling symlinks.
  86. for l in $(find %{buildroot} -type l); do symlinks -cdov $l; done
  87. %pre
  88. # fix conflict with asciidoc < 9.1.0
  89. if [ ! -L %{_sysconfdir}/asciidoc/dblatex ]; then
  90. rm -rf %{_sysconfdir}/asciidoc/dblatex
  91. fi
  92. %files
  93. %defattr(-,root,root,0755)
  94. %license COPYRIGHT
  95. %doc BUGS.txt CHANGELOG.txt README*
  96. %dir %{_sysconfdir}/asciidoc
  97. %config(noreplace) %{_sysconfdir}/asciidoc/*
  98. %{_bindir}/*
  99. %{_mandir}/man1/*
  100. %{python3_sitelib}/asciidocapi.py*
  101. %{_datadir}/asciidoc/
  102. %exclude %{_sysconfdir}/asciidoc/dblatex
  103. %exclude %{_sysconfdir}/asciidoc/filters/latex
  104. %exclude %{_sysconfdir}/asciidoc/filters/music
  105. %exclude %{_pkgdocdir}/website
  106. %exclude %{_pkgdocdir}/doc
  107. %exclude %{_pkgdocdir}/{dblatex,docbook-xsl,images,javascripts,stylesheets}
  108. %files doc
  109. %{_pkgdocdir}/website
  110. %{_pkgdocdir}/doc
  111. %{_pkgdocdir}/{dblatex,docbook-xsl,images,javascripts,stylesheets}
  112. %exclude %{_docdir}/%{name}/{COPYRIGHT,README.asciidoc}
  113. %files latex
  114. %dir %{_sysconfdir}/asciidoc
  115. %{_sysconfdir}/asciidoc/dblatex
  116. %dir %{_sysconfdir}/asciidoc/filters/latex
  117. %{_sysconfdir}/asciidoc/filters/latex/*.py
  118. %config(noreplace) %{_sysconfdir}/asciidoc/filters/latex/*.conf
  119. %changelog
  120. * Tue Mar 23 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 9.1.0-2
  121. - fixed conflict with asciidoc < 9.1.0.
  122. * Mon Mar 22 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 9.1.0-1
  123. - new upstream release.
  124. * Tue Jan 6 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 8.6.9-1
  125. - new upstream version
  126. - moved to Applications/Text Group
  127. * Sun Feb 26 2012 Munehiro Yamamoto <munepi@vinelinux.org> 8.6.6-1
  128. - new upstream version
  129. * Sun Feb 19 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 8.6.4-2
  130. - rebuild with python-2.7.2
  131. * Tue Apr 26 2011 NAKAMURA Kenta <kenta@vinelinux.org> 8.6.4-1
  132. - new upstream version 8.6.4
  133. * Wed Aug 20 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 8.2.5-1
  134. - initial build for Vine Linux
  135. * Wed Dec 05 2007 Florian La Roche <laroche@redhat.com> - 8.2.5-2
  136. - remove doc/examples from filelist due to dangling symlinks
  137. * Tue Nov 20 2007 Florian La Roche <laroche@redhat.com> - 8.2.5-1
  138. - new upstream version 8.2.5
  139. * Mon Oct 22 2007 Florian La Roche <laroche@redhat.com> - 8.2.3-1
  140. - new upstream version 8.2.3
  141. * Sat Sep 01 2007 Florian La Roche <laroche@redhat.com> - 8.2.2-1
  142. - new upstream version 8.2.2
  143. * Mon Mar 19 2007 Chris Wright <chrisw@redhat.com> - 8.1.0-1
  144. - update to asciidoc 8.1.0
  145. * Thu Sep 14 2006 Chris Wright <chrisw@redhat.com> - 7.0.2-3
  146. - rebuild for Fedora Extras 6
  147. * Tue Feb 28 2006 Chris Wright <chrisw@redhat.com> - 7.0.2-2
  148. - rebuild for Fedora Extras 5
  149. * Mon Aug 29 2005 Chris Wright <chrisw@osdl.org> - 7.0.2-1
  150. - convert spec file to UTF-8
  151. - Source should be URL
  152. - update to 7.0.2
  153. * Fri Aug 19 2005 Chris Wright <chrisw@osdl.org> - 7.0.1-3
  154. - consistent use of RPM_BUILD_ROOT
  155. * Thu Aug 18 2005 Chris Wright <chrisw@osdl.org> - 7.0.1-2
  156. - Update BuildRoot
  157. - use _datadir
  158. - use config and _sysconfdir
  159. * Wed Jun 29 2005 Terje Røsten <terje.rosten@ntnu.no> - 7.0.1-1
  160. - 7.0.1
  161. - Drop patch now upstream
  162. - Build as noarch (Petr Klíma)
  163. * Sat Jun 11 2005 Terje Røsten <terje.rosten@ntnu.no> - 7.0.0-0.3
  164. - Add include patch
  165. * Fri Jun 10 2005 Terje Røsten <terje.rosten@ntnu.no> - 7.0.0-0.2
  166. - Fix stylesheets according to Stuart
  167. * Fri Jun 10 2005 Terje Røsten <terje.rosten@ntnu.no> - 7.0.0-0.1
  168. - Initial package
  169. - Based on Debian package, thx!