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