python-docutils-vl.spec 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  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.6
  8. Release: 3%{?_dist_release}
  9. Group: Development/Languages
  10. License: Public Domain and MIT and Python and GPLv2
  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-setuptools
  22. Requires: python
  23. Requires: python-imaging
  24. Vendor: Project Vine
  25. Distribution: Vine Linux
  26. Packager: shaolin, munepi, owa
  27. Provides: docutils = %{version}-%{release}
  28. Obsoletes: docutils <= 0.5
  29. %description
  30. Docutils is an open-source text processing system for processing
  31. plaintext documentation into useful formats, such as HTML or LaTeX.
  32. It includes reStructuredText, the easy to read, easy to use,
  33. what-you-see-is-what-you-get plaintext markup language.
  34. %description -l ja
  35. Docutilsはオープンソースのテキスト処理システムで、プレーンテキストの
  36. 文書をHTMLやLaTeXなどの使いやすいフォーマットに変換するものです。
  37. 読みやすく使いやすくWYSIWYGなプレーンテキストのマークアップ言語である
  38. reStructuresTextを含んでいます。
  39. %package -n %{elisppkgname}
  40. Summary: Emacs support for reStructuredText
  41. Summary(ja): reStructuredText の Emacs サポート
  42. Group: Applications/Editors/Emacs
  43. Requires: emacsen
  44. Requires(post,preun): emacsen
  45. %prereq_ge emacsen-common
  46. %description -n %{elisppkgname}
  47. Emacs support for reStructuredText.
  48. %description -l ja -n %{elisppkgname}
  49. reStructuredText の Emacs サポート
  50. %prep
  51. %setup -q -n %{srcname}-%{version}
  52. # Remove a shebang from one of the library files
  53. %__sed -i -e '/#! *\/usr\/bin\/.*python.*/{1D}' docutils/readers/python/pynodes.py
  54. %build
  55. CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
  56. %install
  57. %__rm -rf $RPM_BUILD_ROOT
  58. %{__python} setup.py install --skip-build --root=$RPM_BUILD_ROOT
  59. for file in %{buildroot}/%{_bindir}/*.py; do
  60. mv $file `dirname $file`/`basename $file .py`
  61. ln -sf `basename $file .py` `dirname $file`/`basename $file`
  62. done
  63. # We want the licenses but don't need this build file
  64. %__rm -f licenses/docutils.conf
  65. # docutils only installs this if its not already on the system. Due to the
  66. # possibility that a previous version of docutils may be installed, we install
  67. # it manually here.
  68. install -D -m644 extras/roman.py ${RPM_BUILD_ROOT}/%{python_sitelib}/roman.py
  69. ## for Emacs package
  70. mkdir -p %{buildroot}%{_datadir}/emacs/site-lisp/%{elisppkgname}/packages
  71. mkdir -p %{buildroot}%{emacsen_pkgdir}/install
  72. mkdir -p %{buildroot}%{emacsen_pkgdir}/remove
  73. #
  74. # install el files
  75. #
  76. mv tools/editors/emacs/rst.el %{buildroot}%{_datadir}/emacs/site-lisp/%{elisppkgname}
  77. cp -p %{SOURCE3} %{SOURCE4} %{buildroot}%{_datadir}/emacs/site-lisp/%{elisppkgname}
  78. #
  79. # install script (bytecompile el and install elc , remove)
  80. #
  81. %_installemacsenscript %{elisppkgname} %{SOURCE1}
  82. %_removeemacsenscript %{elisppkgname} %{SOURCE2}
  83. %clean
  84. rm -rf $RPM_BUILD_ROOT
  85. %post -n %{elisppkgname}
  86. #
  87. # bytecompile and install
  88. #
  89. if [ "$1" = 2 ]; then
  90. %_emacsenPackageRemove %{elisppkgname}
  91. fi
  92. %_addemacsenlist %{elisppkgname}
  93. %_emacsenPackageInstall %{elisppkgname}
  94. %preun -n %{elisppkgname}
  95. if [ "$1" = 0 ]; then
  96. %_emacsenPackageRemove %{elisppkgname}
  97. %_removeemacsenlist %{elisppkgname}
  98. fi
  99. %files
  100. %defattr(-,root,root)
  101. %doc BUGS.txt HISTORY.txt RELEASE-NOTES.txt docs COPYING.txt THANKS.txt FAQ.txt README.txt
  102. %doc licenses docs
  103. %{_bindir}/*
  104. %{python_sitelib}/%{srcname}/
  105. %{python_sitelib}/roman.*
  106. %{python_sitelib}/docutils-*.egg-info
  107. %files -n %{elisppkgname}
  108. %defattr(-,root,root)
  109. %doc BUGS.txt HISTORY.txt RELEASE-NOTES.txt COPYING.txt THANKS.txt FAQ.txt README.txt
  110. %doc licenses tools/editors
  111. %{_datadir}/emacs/site-lisp/%{elisppkgname}
  112. %{emacsen_pkgdir}/install/%{elisppkgname}
  113. %{emacsen_pkgdir}/remove/%{elisppkgname}
  114. %changelog
  115. * Sat Jan 29 2011 IWAI, Masaharu <iwai@alib.jp> 0.6-3
  116. - new package: rst-el (Emacs Lisp)
  117. - add Source1-4
  118. * Thu Sep 02 2010 Shu KONNO <owa@bg.wakwak.com> 0.6-2
  119. - changed package-name to python-docutils from docutils
  120. - added Provides: docutils = %%{version}-%%{release}
  121. - added Obsoletes: docutils <= 0.5
  122. - added BR: python-setuptools
  123. - added RQ: python-imaging
  124. (merged from '* Mon Aug 23 2010 Munehiro Yamamoto <munepi@vinelinux.org> python-docutils-0.6-1')
  125. * Wed Feb 03 2010 Shu KONNO <owa@bg.wakwak.com> 0.5-3
  126. - rebuilt with python-2.6.4
  127. * Thu Aug 6 2009 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 0.5-2
  128. - rename /usr/bin/*.py to /usr/bin/*
  129. (keep symlinking to *.py for compatibility - should be removed in the future)
  130. * Wed Jul 01 2009 Shu KONNO <owa@bg.wakwak.com> 0.5-1
  131. - updated docutils to 0.5
  132. - added BuildArch: noarch
  133. * Sun Jul 20 2008 Shu KONNO <owa@bg.wakwak.com> 0.4-1vl5
  134. - rebuilt with python-2.5.2
  135. - applied new versioning policy and spec in utf-8
  136. * Thu Jan 31 2008 Shu KONNO <owa@bg.wakwak.com> 0.4-0vl4
  137. - defined python_sitelib by using distutils.sysconfig.get_python_lib()
  138. - updated module directory with platform-independent path
  139. - added script to install extras/roman.py (missing if it's already on the system)
  140. * Sun Sep 9 2007 KANEKO Seiji <giraffe@m2.pbc.ne.jp> 0.4-0vl2
  141. - initial build for Vine Linux