Browse Source

python-cssutils-1.0.1-1

git-svn-id: http://trac.vinelinux.org/repos/projects/specs@10601 ec354946-7b23-47d6-9f5a-488ba84defc7
tomop 7 years ago
parent
commit
e0ff0e0ed0
1 changed files with 65 additions and 21 deletions
  1. 65 21
      p/python-cssutils/python-cssutils-vl.spec

+ 65 - 21
p/python-cssutils/python-cssutils-vl.spec

@@ -1,21 +1,32 @@
 %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
 
-%define betaversion b3
+%{!?python3:%global __python3 /usr/bin/python3}
+%{!?python3_inc:%global python3_inc %(%{__python3} -c "from distutils.sysconfig import get_python_inc; print(get_python_inc(1))")}
+%{!?python3_sitearch: %global python3_sitearch %(python3 -c "from distutils.sysconfig import get_python_lib; import sys; sys.stdout.write(get_python_lib(1))")}
+%{!?python3_sitelib: %global python3_sitelib %(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
+%{!?python3_version: %global python3_version %(python3 -c "import sys; sys.stdout.write(sys.version[:3])")}
+
+
+%global srcname cssutils
 
 Summary: CSS Cascading Style Sheets library for Python
 Summary(ja): Python 用 CSS カスケーディング・スタイル・シート ライブラリ
 Name: python-cssutils
-Version: 0.9.7
-Release: 3%{?betaversion:.%betaversion}%{?_dist_release}
+Version: 1.0.1
+Release: 1%{?_dist_release}
 License: LGPLv3+
 Group: Development/Libraries
 URL: http://cthedot.de/cssutils/
-Source: http://cssutils.googlecode.com/files/cssutils-%{version}%{?betaversion:%betaversion}.zip
+Source0: https://pypi.python.org/packages/source/c/cssutils/cssutils-1.0.1.tar.gz
+Provides: python3-%{srcname} = %{version}
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
 # Required at runtime for the css* executables
 Requires: python-setuptools
 BuildRequires: python-devel
 BuildRequires: python-setuptools
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: dos2unix
 BuildArch: noarch
 
 Vendor: Project Vine
@@ -44,47 +55,77 @@ CSS カスケーディング・スタイル・シートの作成と構文解析
 である、python-cssutils のドキュメントです。
 
 
+%package -n python3-%{srcname}
+Summary:        %{sum}
+Summary(ja):    Python3 用 CSS カスケーディング・スタイル・シート ライブラリ
+%{?python_provide:%python_provide python3-%{srcname}}
+
+%description -n python3-%{srcname}
+A Python package to parse and build CSS Cascading Style Sheets. DOM only, not
+any rendering facilities.
+
+%description -n python3-%{srcname} -l ja
+CSS カスケーディング・スタイル・シートの作成と構文解析用の Python3パッケージ
+です。ただし DOM にのみ対応しており、レンダリングには対応していません。
+
+
 %prep
-%setup -q -n cssutils-%{version}%{?betaversion:%betaversion}
+%setup -qc
 # Convert all CRLF files, keeping original timestamps
-for FILE in `find . -type f -exec grep -Gl '\r\n' {} \;`; do
-    tr -d '\r' < ${FILE} > ${FILE}.tmp
-    touch -r ${FILE} ${FILE}.timestamp
-    cat ${FILE}.tmp > ${FILE}
-    touch -r ${FILE}.timestamp ${FILE}
-    %__rm -f ${FILE}.timestamp ${FILE}.tmp
-done
+find . -type f -exec dos2unix -k {} \;
+cp -pr %{srcname}-%{version}/examples .
+cp -pr %{srcname}-%{version}/README.txt .
+cp -pr %{srcname}-%{version}/COPYING .
+mv %{srcname}-%{version} python2
+cp -a python2 python3
+find python3 -name '*.py' | xargs sed -i '1s|^#!.*|#!%{__python3}|'
+find python2 -name '*.py' | xargs sed -i '1s|^#!.*|#!%{__python}|'
 
 
 %build
+pushd python2
 %{__python} setup.py build
+popd
+pushd python3
+%{__python3} setup.py build
+popd
 
 
 %install
 %{__rm} -rf ${RPM_BUILD_ROOT}
+
+pushd python2
 %{__python} setup.py install \
     --single-version-externally-managed \
     -O1 \
     --skip-build \
     --root ${RPM_BUILD_ROOT}
+popd
+
+pushd python3
+%{__python3} setup.py install \
+    --single-version-externally-managed \
+    -O1 \
+    --skip-build \
+    --root ${RPM_BUILD_ROOT}
+popd
 
 
 %clean
 %{__rm} -rf ${RPM_BUILD_ROOT}
 
-
 %files
-# The sources have some 2755 mode directories (as of 0.9.5.1), fix here
-%defattr(-,root,root,0755)
-%doc CHANGELOG.txt COPYING* docs/ README.txt
+%license COPYING
+%doc README.txt
+%{python_sitelib}/*
+
+%files -n python3-%{srcname}
+%license COPYING
+%doc README.txt
+%{python3_sitelib}/*
 %{_bindir}/csscapture
 %{_bindir}/csscombine
 %{_bindir}/cssparse
-%{python_sitelib}/cssutils-*.egg-info/
-%{python_sitelib}/cssutils/
-%{python_sitelib}/encutils/
-# # This is a way too generic name!
-# %exclude %{python_sitelib}/tests/
 
 %files doc
 %defattr(-,root,root,-)
@@ -92,6 +133,9 @@ done
 
 
 %changelog
+* Tue Jul 12 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.0.1-1
+- new upstream release.
+
 * Sun Jan 12 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.9.7-3.b3
 - rebuild with VineSeed environment