From e21573022386872523d96b38da8db7fe35f282f7 Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Mon, 23 Mar 2015 17:10:51 -0400 Subject: [PATCH] Bump release to 0.3.0 Change packaging so that it only produces a single package for the default python interpreter on the system. --- setup.py | 2 +- python-sscg.spec => sscg.spec | 111 ++++++++++++---------------------- 2 files changed, 38 insertions(+), 75 deletions(-) rename python-sscg.spec => sscg.spec (52%) diff --git a/setup.py b/setup.py index d697873..21d69ba 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( name="sscg", - version="0.2.1", + version="0.3.0", use_2to3=True, entry_points="""\ diff --git a/python-sscg.spec b/sscg.spec similarity index 52% rename from python-sscg.spec rename to sscg.spec index 80936a0..f3fff83 100644 --- a/python-sscg.spec +++ b/sscg.spec @@ -1,14 +1,11 @@ -%if (0%{?fedora} >= 13 || 0%{?rhel} >= 7) -%global with_python3 1 %if (0%{?fedora} >= 22 || 0%{?rhel} >= 8) %global use_python3 1 %endif -%endif %global srcname sscg -Name: python-%{srcname} -Version: 0.2.1 +Name: %{srcname} +Version: 0.3.0 Release: 1%{?dist} Summary: Self-signed certificate generator @@ -17,111 +14,77 @@ URL: https://github.com/sgallagher/%{srcname} Source0: https://github.com/sgallagher/%{srcname}/releases/download/%{srcname}-%{version}/%{srcname}-%{version}.tar.gz BuildArch: noarch -Requires: pyOpenSSL -Requires: python-pyasn1 -BuildRequires: python-devel -BuildRequires: python-setuptools -BuildRequires: pyOpenSSL -BuildRequires: python-pyasn1 -%description -A utility to aid in the creation of more secure "self-signed" -certificates. The certificates created by this tool are generated in a -way so as to create a CA certificate that can be safely imported into a -client machine to trust the service certificate without needing to set -up a full PKI environment and without exposing the machine to a risk of -false signatures from the service certificate. - -%if 0%{?with_python3} -%package -n python3-%{srcname} -Summary: Self-signed certificate generator +%if 0%{?use_python3} Requires: python3-pyOpenSSL Requires: python3-pyasn1 BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pyOpenSSL BuildRequires: python3-pyasn1 +%else +Requires: pyOpenSSL +Requires: python-pyasn1 +BuildRequires: python-devel +BuildRequires: python-setuptools +BuildRequires: pyOpenSSL +BuildRequires: python-pyasn1 +%endif -%description -n python3-%{srcname} +%description A utility to aid in the creation of more secure "self-signed" certificates. The certificates created by this tool are generated in a way so as to create a CA certificate that can be safely imported into a client machine to trust the service certificate without needing to set up a full PKI environment and without exposing the machine to a risk of false signatures from the service certificate. -%endif #0%{?with_python3} %prep -%setup -qc -n %{srcname}-%{version} - -mv %{srcname}-%{version} python2 -find python2 -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|' +%setup -q -n %{srcname}-%{version} -%if 0%{?with_python3} -rm -rf python3 -cp -a python2 python3 -find python3 -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' -%endif #0%{?with_python3} +# Set any script hashbangs to the appropriate python version +%if 0%{?use_python3} +find . -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' +%else +find . -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|' +%endif #0%{?use_python3} %build # Ensure egg-info is regenerated rm -rf src/*.egg-info -pushd python2 -%{__python2} setup.py build -popd - -%if 0%{?with_python3} -pushd python3 +%if 0%{?use_python3} %{__python3} setup.py build -popd -%endif # with_python3 +%else +%{__python2} setup.py build +%endif # use_python3 %install rm -rf $RPM_BUILD_ROOT -pushd python2 -%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT -mv $RPM_BUILD_ROOT/%{_bindir}/%{srcname} \ - $RPM_BUILD_ROOT/%{_bindir}/%{srcname}-%{python2_version} -popd - -%if 0%{?with_python3} -pushd python3 -%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT -mv $RPM_BUILD_ROOT/%{_bindir}/%{srcname} \ - $RPM_BUILD_ROOT/%{_bindir}/%{srcname}-%{python3_version} -popd -%endif # with_python3 - -# On platforms where python3 is preferred, symlink that version -# to /usr/bin/%{srcname} %if 0%{?use_python3} -ln -s %{srcname}-%{python3_version} $RPM_BUILD_ROOT/%{_bindir}/%{srcname} +%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT %else -ln -s %{srcname}-%{python2_version} $RPM_BUILD_ROOT/%{_bindir}/%{srcname} -%endif #use_python3 - +%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT +%endif # use_python3 + %files -%license python2/src/sscg/LICENSE -# For noarch packages: sitelib -%{python2_sitelib}/* -%{_bindir}/%{srcname}-%{python2_version} -%if !0%{?use_python3} +%license src/sscg/LICENSE %{_bindir}/%{srcname} -%endif -%if 0%{?with_python3} -%files -n python3-%{srcname} -%license python3/src/sscg/LICENSE -%{python3_sitelib}/* -%{_bindir}/%{srcname}-%{python3_version} %if 0%{?use_python3} -%{_bindir}/%{srcname} +%{python3_sitelib}/%{srcname}/* +%{python3_sitelib}/%{srcname}-%{version}-py%{python3_version}.egg-info/ +%else +%{python2_sitelib}/%{srcname}/* +%{python2_sitelib}/%{srcname}-%{version}-py%{python2_version}.egg-info/ %endif #use_python3 -%endif #with_python3 %changelog +* Mon Mar 23 2015 Stephen Gallagher 0.3.0-1 +- Rename to sscg +- Only build with default python interpreter + * Tue Mar 17 2015 Stephen Gallagher 0.2.1-1 - Include the LICENSE file in the tarball