python-cssutils-vl.spec 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
  2. %{!?python3:%global __python3 /usr/bin/python3}
  3. %{!?python3_inc:%global python3_inc %(%{__python3} -c "from distutils.sysconfig import get_python_inc; print(get_python_inc(1))")}
  4. %{!?python3_sitearch: %global python3_sitearch %(python3 -c "from distutils.sysconfig import get_python_lib; import sys; sys.stdout.write(get_python_lib(1))")}
  5. %{!?python3_sitelib: %global python3_sitelib %(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
  6. %{!?python3_version: %global python3_version %(python3 -c "import sys; sys.stdout.write(sys.version[:3])")}
  7. %global srcname cssutils
  8. Summary: CSS Cascading Style Sheets library for Python
  9. Summary(ja): Python 用 CSS カスケーディング・スタイル・シート ライブラリ
  10. Name: python-cssutils
  11. Version: 1.0.1
  12. Release: 1%{?_dist_release}
  13. License: LGPLv3+
  14. Group: Development/Libraries
  15. URL: http://cthedot.de/cssutils/
  16. Source0: https://pypi.python.org/packages/source/c/cssutils/cssutils-1.0.1.tar.gz
  17. Provides: python3-%{srcname} = %{version}
  18. BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
  19. # Required at runtime for the css* executables
  20. Requires: python-setuptools
  21. BuildRequires: python-devel
  22. BuildRequires: python-setuptools
  23. BuildRequires: python3-devel
  24. BuildRequires: python3-setuptools
  25. BuildRequires: dos2unix
  26. BuildArch: noarch
  27. Vendor: Project Vine
  28. Distribution: Vine Linux
  29. %description
  30. A Python package to parse and build CSS Cascading Style Sheets. DOM only, not
  31. any rendering facilities.
  32. %description -l ja
  33. CSS カスケーディング・スタイル・シートの作成と構文解析用の Pythonパッケージ
  34. です。ただし DOM にのみ対応しており、レンダリングには対応していません。
  35. %package doc
  36. Summary: Documentation for the CSS Cascading Style Sheets library for Python
  37. Summary(ja): Python 用 CSS カスケーディング・スタイル・シート ライブラリのドキュメント
  38. Group: Applications/Documentation
  39. %description doc
  40. This is the documentation for python-cssutils, a Python package to parse and
  41. build CSS Cascading Style Sheets.
  42. %description doc -l ja
  43. CSS カスケーディング・スタイル・シートの作成と構文解析用の Pythonパッケージ
  44. である、python-cssutils のドキュメントです。
  45. %package -n python3-%{srcname}
  46. Summary: %{sum}
  47. Summary(ja): Python3 用 CSS カスケーディング・スタイル・シート ライブラリ
  48. %{?python_provide:%python_provide python3-%{srcname}}
  49. %description -n python3-%{srcname}
  50. A Python package to parse and build CSS Cascading Style Sheets. DOM only, not
  51. any rendering facilities.
  52. %description -n python3-%{srcname} -l ja
  53. CSS カスケーディング・スタイル・シートの作成と構文解析用の Python3パッケージ
  54. です。ただし DOM にのみ対応しており、レンダリングには対応していません。
  55. %prep
  56. %setup -qc
  57. # Convert all CRLF files, keeping original timestamps
  58. find . -type f -exec dos2unix -k {} \;
  59. cp -pr %{srcname}-%{version}/examples .
  60. cp -pr %{srcname}-%{version}/README.txt .
  61. cp -pr %{srcname}-%{version}/COPYING .
  62. mv %{srcname}-%{version} python2
  63. cp -a python2 python3
  64. find python3 -name '*.py' | xargs sed -i '1s|^#!.*|#!%{__python3}|'
  65. find python2 -name '*.py' | xargs sed -i '1s|^#!.*|#!%{__python}|'
  66. %build
  67. pushd python2
  68. %{__python} setup.py build
  69. popd
  70. pushd python3
  71. %{__python3} setup.py build
  72. popd
  73. %install
  74. %{__rm} -rf ${RPM_BUILD_ROOT}
  75. pushd python2
  76. %{__python} setup.py install \
  77. --single-version-externally-managed \
  78. -O1 \
  79. --skip-build \
  80. --root ${RPM_BUILD_ROOT}
  81. popd
  82. pushd python3
  83. %{__python3} setup.py install \
  84. --single-version-externally-managed \
  85. -O1 \
  86. --skip-build \
  87. --root ${RPM_BUILD_ROOT}
  88. popd
  89. %clean
  90. %{__rm} -rf ${RPM_BUILD_ROOT}
  91. %files
  92. %license COPYING
  93. %doc README.txt
  94. %{python_sitelib}/*
  95. %files -n python3-%{srcname}
  96. %license COPYING
  97. %doc README.txt
  98. %{python3_sitelib}/*
  99. %{_bindir}/csscapture
  100. %{_bindir}/csscombine
  101. %{_bindir}/cssparse
  102. %files doc
  103. %defattr(-,root,root,-)
  104. %doc docs/* examples/
  105. %changelog
  106. * Tue Jul 12 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.0.1-1
  107. - new upstream release.
  108. * Sun Jan 12 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.9.7-3.b3
  109. - rebuild with VineSeed environment
  110. * Sun Feb 19 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.9.7-2.b3
  111. - rebuild with python-2.7.2
  112. * Thu Aug 26 2010 Munehiro Yamamoto <munepi@vinelinux.org> 0.9.7-1.b3
  113. - new upstream release
  114. * Tue Aug 24 2010 Munehiro Yamamoto <munepi@vinelinux.org> 0.9.6-1
  115. - new upstream release
  116. * Tue Feb 02 2010 Shu KONNO <owa@bg.wakwak.com> 0.9.5.1-2
  117. - rebuild with python-2.6
  118. * Sun Dec 14 2008 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.9.5.1-1
  119. - initial build for Vine Linux based on fedora package
  120. * Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 0.9.5.1-4
  121. - Rebuild for Python 2.6
  122. * Fri Oct 10 2008 Matthias Saou <http://freshrpms.net/> 0.9.5.1-3
  123. - Add missing python-setuptools BR, split off doc sub-package (mschwendt).
  124. * Thu Oct 9 2008 Matthias Saou <http://freshrpms.net/> 0.9.5.1-2
  125. - Update license, group, add python-setuptools requirement (mschwendt).
  126. * Tue Aug 19 2008 Matthias Saou <http://freshrpms.net/> 0.9.5.1-1
  127. - Update to 0.9.5.1.
  128. * Fri Aug 8 2008 Matthias Saou <http://freshrpms.net/> 0.9.5-1
  129. - Update to 0.9.5 final.
  130. * Tue Jul 15 2008 Matthias Saou <http://freshrpms.net/> 0.9.5b2-0.2.rc2
  131. - Convert CRLF end of lines.
  132. - Patch out #!/... magic from python files meant to be included and not run.
  133. * Tue Jul 15 2008 Matthias Saou <http://freshrpms.net/> 0.9.5b2-0.1.rc2
  134. - Initial RPM release.