python-docutils-vl.spec 8.0 KB

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