python-docutils-vl.spec 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. %define srcname docutils
  2. %define elisppkgname rst-el
  3. %define prereq_ge() %(LC_ALL="C" rpm -q --queryformat 'Requires(post,preun):%%{NAME} >= %%{VERSION}' %1| grep -v "is not")
  4. Summary: an open-source text processing system written in Python
  5. Summary(ja): Pythonで書かれたテキスト処理システム
  6. Name: python-%{srcname}
  7. Version: 0.16
  8. Release: 2%{?_dist_release}
  9. Group: programming
  10. Vendor: Project Vine
  11. Distribution: Vine Linux
  12. Packager: shaolin, munepi, owa
  13. License: Public Domain and MIT and Python and GPLv3+
  14. URL: https://docutils.sourceforge.net/
  15. Source0: https://prdownloads.sourceforge.net/%{srcname}/%{srcname}-%{version}.tar.gz
  16. ## for rst-mode
  17. Source1: %{elisppkgname}-install.sh
  18. Source2: %{elisppkgname}-remove.sh
  19. Source3: vine-default-%{elisppkgname}.el
  20. Source4: %{elisppkgname}-init.el
  21. BuildArch: noarch
  22. BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
  23. BuildRequires: python-rpm-macros
  24. BuildRequires: python-devel
  25. BuildRequires: python2-rpm-macros
  26. BuildRequires: python-setuptools
  27. Requires: python
  28. %{?python_provide:%python_provide python2-%{srcname}}
  29. Provides: docutils = %{version}-%{release}
  30. Obsoletes: docutils <= 0.5
  31. %description
  32. Docutils is an open-source text processing system for processing
  33. plaintext documentation into useful formats, such as HTML or LaTeX.
  34. It includes reStructuredText, the easy to read, easy to use,
  35. what-you-see-is-what-you-get plaintext markup language.
  36. %description -l ja
  37. Docutilsはオープンソースのテキスト処理システムで、プレーンテキストの
  38. 文書をHTMLやLaTeXなどの使いやすいフォーマットに変換するものです。
  39. 読みやすく使いやすくWYSIWYGなプレーンテキストのマークアップ言語である
  40. reStructuresTextを含んでいます。
  41. %package -n python3-%{srcname}
  42. Summary: an open-source text processing system written in Python
  43. Summary(ja): Pythonで書かれたテキスト処理システム
  44. Group: programming
  45. BuildRequires: python3-devel
  46. BuildRequires: python3-rpm-macros
  47. BuildRequires: python3-setuptools
  48. Requires: python3
  49. %{?python_provide:%python_provide python3-%{srcname}}
  50. %description -n python3-%{srcname}
  51. Docutils is an open-source text processing system for processing
  52. plaintext documentation into useful formats, such as HTML or LaTeX.
  53. It includes reStructuredText, the easy to read, easy to use,
  54. what-you-see-is-what-you-get plaintext markup language.
  55. %description -n python3-%{srcname} -l ja
  56. Docutilsはオープンソースのテキスト処理システムで、プレーンテキストの
  57. 文書をHTMLやLaTeXなどの使いやすいフォーマットに変換するものです。
  58. 読みやすく使いやすくWYSIWYGなプレーンテキストのマークアップ言語である
  59. reStructuresTextを含んでいます。
  60. %package -n %{elisppkgname}
  61. Summary: Emacs support for reStructuredText
  62. Summary(ja): reStructuredText の Emacs サポート
  63. Group: publishing
  64. Requires: emacsen
  65. Requires(post,preun): emacsen
  66. %prereq_ge emacsen-common
  67. %description -n %{elisppkgname}
  68. Emacs support for reStructuredText.
  69. %description -l ja -n %{elisppkgname}
  70. reStructuredText の Emacs サポート
  71. %prep
  72. %setup -q -n %{srcname}-%{version}
  73. # Remove shebang from library files
  74. sed -i -e '/#! *\/usr\/bin\/.*/{1D}' $(grep -Erl '^#!.+python' %{srcname})
  75. iconv -f ISO88592 -t UTF8 tools/editors/emacs/IDEAS.rst > tmp
  76. mv tmp tools/editors/emacs/IDEAS.rst
  77. # We want the licenses but don't need this build file
  78. rm -f licenses/docutils.conf
  79. # https://bugzilla.redhat.com/show_bug.cgi?id=1687377
  80. rm test/test_writers/test_odt.py
  81. %build
  82. %py2_build
  83. %py3_build
  84. %install
  85. %__rm -rf $RPM_BUILD_ROOT
  86. %py2_install
  87. %py3_install
  88. # Flash file is used for testing docutils but shouldn't be in the installed package.
  89. mv docs/user/rst/images/biohazard.swf ./biohazard.swf
  90. # docutils setup.py runs 2to3 on a copy of the tests and puts it in sitelib.
  91. rm -rf %{buildroot}%{python3_sitelib}/test
  92. for file in %{buildroot}/%{_bindir}/*.py; do
  93. mv $file `dirname $file`/`basename $file .py`
  94. done
  95. ## for Emacs package
  96. mkdir -p %{buildroot}%{_datadir}/emacs/site-lisp/%{elisppkgname}/packages
  97. mkdir -p %{buildroot}%{emacsen_pkgdir}/install
  98. mkdir -p %{buildroot}%{emacsen_pkgdir}/remove
  99. #
  100. # install el files
  101. #
  102. mv tools/editors/emacs/rst.el %{buildroot}%{_datadir}/emacs/site-lisp/%{elisppkgname}
  103. cp -p %{SOURCE3} %{SOURCE4} %{buildroot}%{_datadir}/emacs/site-lisp/%{elisppkgname}
  104. #
  105. # install script (bytecompile el and install elc , remove)
  106. #
  107. %_installemacsenscript %{elisppkgname} %{SOURCE1}
  108. %_removeemacsenscript %{elisppkgname} %{SOURCE2}
  109. %check
  110. mv biohazard.swf docs/user/rst/images/biohazard.swf
  111. python test/alltests.py
  112. python3 test/alltests.py
  113. rm docs/user/rst/images/biohazard.swf
  114. %clean
  115. rm -rf $RPM_BUILD_ROOT
  116. %post -n %{elisppkgname}
  117. #
  118. # bytecompile and install
  119. #
  120. if [ "$1" = 2 ]; then
  121. %_emacsenPackageRemove %{elisppkgname}
  122. fi
  123. %_addemacsenlist %{elisppkgname}
  124. %_emacsenPackageInstall %{elisppkgname}
  125. %preun -n %{elisppkgname}
  126. if [ "$1" = 0 ]; then
  127. %_emacsenPackageRemove %{elisppkgname}
  128. %_removeemacsenlist %{elisppkgname}
  129. fi
  130. %files
  131. %defattr(-,root,root)
  132. %license COPYING.txt licenses/*
  133. %doc BUGS.txt FAQ.txt HISTORY.txt README.txt RELEASE-NOTES.txt
  134. %doc THANKS.txt docs tools/editors
  135. %{python_sitelib}/%{srcname}/
  136. %{python_sitelib}/docutils-*.egg-info
  137. %files -n python3-%{srcname}
  138. %defattr(-,root,root)
  139. %license COPYING.txt licenses/*
  140. %doc BUGS.txt FAQ.txt HISTORY.txt README.txt RELEASE-NOTES.txt
  141. %doc THANKS.txt docs tools/editors
  142. %{_bindir}/*
  143. %{python3_sitelib}/%{srcname}/
  144. %{python3_sitelib}/docutils-*.egg-info
  145. %files -n %{elisppkgname}
  146. %defattr(-,root,root)
  147. %license COPYING.txt licenses/*
  148. %doc BUGS.txt FAQ.txt HISTORY.txt README.txt RELEASE-NOTES.txt
  149. %doc THANKS.txt docs tools/editors
  150. %{_datadir}/emacs/site-lisp/%{elisppkgname}
  151. %{emacsen_pkgdir}/install/%{elisppkgname}
  152. %{emacsen_pkgdir}/remove/%{elisppkgname}
  153. %changelog
  154. * Wed Aug 19 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.16-2
  155. - fixed dependency.
  156. * Sun Aug 16 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.16-1
  157. - new upstream release.
  158. * Tue Nov 27 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.14-1
  159. - new upstream release.
  160. - added python3 support.
  161. * Sun Jan 12 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.11-2
  162. - rebuild with VineSeed environment
  163. * Fri Sep 06 2013 Toshiharu Kudoh <toshi.kd2@gmail.com> 0.11-1
  164. - new upstream release
  165. * Sun Jun 16 2013 Toshiharu Kudoh <toshi.kd2@gmail.com> 0.10-1
  166. - new upstream release
  167. * Sun Feb 19 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.6-4
  168. - rebuild with python-2.7.2
  169. * Sat Jan 29 2011 IWAI, Masaharu <iwai@alib.jp> 0.6-3
  170. - new package: rst-el (Emacs Lisp)
  171. - add Source1-4
  172. * Thu Sep 02 2010 Shu KONNO <owa@bg.wakwak.com> 0.6-2
  173. - changed package-name to python-docutils from docutils
  174. - added Provides: docutils = %%{version}-%%{release}
  175. - added Obsoletes: docutils <= 0.5
  176. - added BR: python-setuptools
  177. - added RQ: python-imaging
  178. (merged from '* Mon Aug 23 2010 Munehiro Yamamoto <munepi@vinelinux.org> python-docutils-0.6-1')
  179. * Wed Feb 03 2010 Shu KONNO <owa@bg.wakwak.com> 0.5-3
  180. - rebuilt with python-2.6.4
  181. * Thu Aug 6 2009 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 0.5-2
  182. - rename /usr/bin/*.py to /usr/bin/*
  183. (keep symlinking to *.py for compatibility - should be removed in the future)
  184. * Wed Jul 01 2009 Shu KONNO <owa@bg.wakwak.com> 0.5-1
  185. - updated docutils to 0.5
  186. - added BuildArch: noarch
  187. * Sun Jul 20 2008 Shu KONNO <owa@bg.wakwak.com> 0.4-1vl5
  188. - rebuilt with python-2.5.2
  189. - applied new versioning policy and spec in utf-8
  190. * Thu Jan 31 2008 Shu KONNO <owa@bg.wakwak.com> 0.4-0vl4
  191. - defined python_sitelib by using distutils.sysconfig.get_python_lib()
  192. - updated module directory with platform-independent path
  193. - added script to install extras/roman.py (missing if it's already on the system)
  194. * Sun Sep 9 2007 KANEKO Seiji <giraffe@m2.pbc.ne.jp> 0.4-0vl2
  195. - initial build for Vine Linux