diff --git a/.gitignore b/.gitignore index e69de29..12ec02d 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/python-wand-0.4.1.tar.gz diff --git a/python-wand.spec b/python-wand.spec new file mode 100644 index 0000000..64f3cca --- /dev/null +++ b/python-wand.spec @@ -0,0 +1,95 @@ +%{!?__python2: %global __python2 %__python} +%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} + +%if 0%{?fedora} +%bcond_without python3 +%else +%bcond_with python3 +%endif + +Name: python-wand +Version: 0.4.1 +Release: 2%{?dist} +Summary: Ctypes-based simple MagickWand API binding for Python + +License: MIT +URL: http://wand-py.org +Source0: https://github.com/dahlia/wand/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz + +BuildArch: noarch +BuildRequires: python2-devel +BuildRequires: python-setuptools +Requires: ImageMagick + +%description +Wand is a ctypes-based simple ImageMagick binding for Python. It doesn't cover +all functionalities of MagickWand API currently. + + +%if %{with python3} +%package -n python3-wand +Summary: Ctypes-based simple MagickWand API binding for Python +BuildRequires: python3-devel +BuildRequires: python3-setuptools +Requires: ImageMagick + +%description -n python3-wand +Wand is a ctypes-based simple ImageMagick binding for Python. It doesn't cover +all functionalities of MagickWand API currently. +%endif + + +%prep +%setup -qc +mv wand-%{version} python2 + +%if %{with python3} +cp -a python2 python3 +%endif + + +%build +pushd python2 +%{__python2} setup.py build +popd + +%if %{with python3} +pushd python3 +%{__python3} setup.py build +popd +%endif + + +%install +%if %{with python3} +pushd python3 +%{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT +popd +%endif + +pushd python2 +%{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT +popd + +rm $RPM_BUILD_ROOT/usr/README.rst + +%files +%doc python2/README.rst +%license python2/LICENSE +%{python2_sitelib}/* + +%if %{with python3} +%files -n python3-wand +%doc python3/README.rst +%license python3/LICENSE +%{python3_sitelib}/* +%endif + + +%changelog +* Wed Oct 28 2015 Dennis Chen 0.4.1-2 +- Fix python3 runtime dependency +- Fix spec errors +* Tue Oct 27 2015 Dennis Chen 0.4.1-1 +- First Fedora Packaging + diff --git a/sources b/sources index e69de29..a849d2a 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +e2e1b5272be4695ffb5d045fbe9b70d0 python-wand-0.4.1.tar.gz