thm pushed to pycmd (f21). "Apply updated Python packaging guidelines. (..more)"

notifications at fedoraproject.org notifications at fedoraproject.org
Thu Apr 23 17:42:12 UTC 2015


>From fceddb71b391c741856dd31656dee46caf5df4e8 Mon Sep 17 00:00:00 2001
From: Thomas Moschny <thm at fedoraproject.org>
Date: Mon, 20 Apr 2015 19:27:14 +0200
Subject: Apply updated Python packaging guidelines.

- Mark LICENSE with %license.

diff --git a/pycmd.spec b/pycmd.spec
index 8aa7015..563f7ff 100644
--- a/pycmd.spec
+++ b/pycmd.spec
@@ -1,22 +1,22 @@
+%if 0%{?rhel} && 0%{?rhel} <= 6
+%{!?__python2: %global __python2 /usr/bin/python2}
+%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
+%endif
+
 %if 0%{?fedora}
 %global with_python3 1
-%global python3_version %(%{__python3} -c "import sys; sys.stdout.write(sys.version[:3])")
-%endif
-%if 0%{?rhel} && 0%{?rhel} < 6
-%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
 %endif
 
-
 Name:           pycmd
 Version:        1.1
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Tools for managing/searching Python related files
 Group:          Development/Languages
 License:        MIT
 URL:            http://pypi.python.org/pypi/pycmd
 Source0:        http://pypi.python.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz
 BuildArch:      noarch
-BuildRequires:  python-devel
+BuildRequires:  python2-devel
 BuildRequires:  python-setuptools
 Requires:       python-setuptools
 BuildRequires:  python-py >= 1.4.0
@@ -50,39 +50,46 @@ development.
 
 %prep
 %setup -q
+%setup -qc -n %{name}-%{version}
+mv %{name}-%{version} python2
 
 %if 0%{?with_python3}
-cp -a . %{py3dir}
+cp -a python2 python3
 %endif # with_python3
 
 
 %build
-%{__python} setup.py build
+pushd python2
+%{__python2} setup.py build
+popd
 
 %if 0%{?with_python3}
-pushd %{py3dir}
+pushd python3
 %{__python3} setup.py build
 popd
 %endif # with_python3
 
 
 %install
-%{__python} setup.py install -O1 --skip-build --root %{buildroot}
+pushd python2
+%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
+popd
 
 # remove shebangs
-find %{buildroot}%{python_sitelib} -name '*.py' \
+find %{buildroot}%{python2_sitelib} -name '*.py' \
      -exec sed -i -e '1{/^#!/d}' {} \;
 
 # rename binaries
 pushd %{buildroot}%{_bindir}
 for cmd in py.cleanup py.convert_unittest py.countloc py.lookup py.svnwcrevert py.which; do
-  mv ${cmd} ${cmd}-%{python_version}
+  mv ${cmd} ${cmd}-%{python2_version}
 done
 popd
 
 %if 0%{?with_python3}
-pushd %{py3dir}
+pushd python3
 %{__python3} setup.py install -O1 --skip-build --root %{buildroot}
+popd
 
 # remove shebangs from all scripts
 find %{buildroot}%{python3_sitelib} -name '*.py' \
@@ -94,36 +101,40 @@ for cmd in py.cleanup py.convert_unittest py.countloc py.lookup py.svnwcrevert p
   mv ${cmd} ${cmd}-%{python3_version}
 done
 popd
-
-popd
 %endif # with_python3
 
 # 2.X binaries are called by default for now
 pushd %{buildroot}%{_bindir}
 for cmd in py.cleanup py.convert_unittest py.countloc py.lookup py.svnwcrevert py.which; do
-  ln -s ${cmd}-%{python_version} ${cmd}
+  ln -s ${cmd}-%{python2_version} ${cmd}
 done
+popd
 
 
 %files
-%doc LICENSE README.txt CHANGELOG
+%doc python2/README.txt
+%doc python2/CHANGELOG
+%license python2/LICENSE
 %{_bindir}/py.cleanup
-%{_bindir}/py.cleanup-%{python_version}
+%{_bindir}/py.cleanup-%{python2_version}
 %{_bindir}/py.convert_unittest
-%{_bindir}/py.convert_unittest-%{python_version}
+%{_bindir}/py.convert_unittest-%{python2_version}
 %{_bindir}/py.countloc
-%{_bindir}/py.countloc-%{python_version}
+%{_bindir}/py.countloc-%{python2_version}
 %{_bindir}/py.lookup
-%{_bindir}/py.lookup-%{python_version}
+%{_bindir}/py.lookup-%{python2_version}
 %{_bindir}/py.svnwcrevert
-%{_bindir}/py.svnwcrevert-%{python_version}
+%{_bindir}/py.svnwcrevert-%{python2_version}
 %{_bindir}/py.which
-%{_bindir}/py.which-%{python_version}
-%{python_sitelib}/*
+%{_bindir}/py.which-%{python2_version}
+%{python2_sitelib}/*
+
 
 %if 0%{?with_python3}
 %files -n python3-pycmd
-%doc LICENSE README.txt CHANGELOG
+%doc python3/README.txt
+%doc python3/CHANGELOG
+%license python3/LICENSE
 %{_bindir}/py.cleanup-%{python3_version}
 %{_bindir}/py.convert_unittest-%{python3_version}
 %{_bindir}/py.countloc-%{python3_version}
@@ -135,6 +146,10 @@ done
 
 
 %changelog
+* Mon Apr 20 2015 Thomas Moschny <thomas.moschny at gmx.de> - 1.1-2
+- Apply updated Python packaging guidelines.
+- Mark LICENSE with %%license.
+
 * Fri Jul 18 2014 Thomas Moschny <thomas.moschny at gmx.de> - 1.1-1
 - Update to 1.1.
 
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/pycmd.git/commit/?h=f21&id=fceddb71b391c741856dd31656dee46caf5df4e8


More information about the scm-commits mailing list