Skip to content

Commit e215730

Browse files
committed
Bump release to 0.3.0
Change packaging so that it only produces a single package for the default python interpreter on the system.
1 parent 3b4b4a5 commit e215730

File tree

2 files changed

+38
-75
lines changed

2 files changed

+38
-75
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
setup(
55
name="sscg",
6-
version="0.2.1",
6+
version="0.3.0",
77
use_2to3=True,
88

99
entry_points="""\

python-sscg.spec renamed to sscg.spec

Lines changed: 37 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
%if (0%{?fedora} >= 13 || 0%{?rhel} >= 7)
2-
%global with_python3 1
31
%if (0%{?fedora} >= 22 || 0%{?rhel} >= 8)
42
%global use_python3 1
53
%endif
6-
%endif
74

85
%global srcname sscg
96

10-
Name: python-%{srcname}
11-
Version: 0.2.1
7+
Name: %{srcname}
8+
Version: 0.3.0
129
Release: 1%{?dist}
1310
Summary: Self-signed certificate generator
1411

@@ -17,111 +14,77 @@ URL: https://github.com/sgallagher/%{srcname}
1714
Source0: https://github.com/sgallagher/%{srcname}/releases/download/%{srcname}-%{version}/%{srcname}-%{version}.tar.gz
1815

1916
BuildArch: noarch
20-
Requires: pyOpenSSL
21-
Requires: python-pyasn1
22-
BuildRequires: python-devel
23-
BuildRequires: python-setuptools
24-
BuildRequires: pyOpenSSL
25-
BuildRequires: python-pyasn1
2617

27-
%description
28-
A utility to aid in the creation of more secure "self-signed"
29-
certificates. The certificates created by this tool are generated in a
30-
way so as to create a CA certificate that can be safely imported into a
31-
client machine to trust the service certificate without needing to set
32-
up a full PKI environment and without exposing the machine to a risk of
33-
false signatures from the service certificate.
34-
35-
%if 0%{?with_python3}
36-
%package -n python3-%{srcname}
37-
Summary: Self-signed certificate generator
18+
%if 0%{?use_python3}
3819
Requires: python3-pyOpenSSL
3920
Requires: python3-pyasn1
4021
BuildRequires: python3-devel
4122
BuildRequires: python3-setuptools
4223
BuildRequires: python3-pyOpenSSL
4324
BuildRequires: python3-pyasn1
25+
%else
26+
Requires: pyOpenSSL
27+
Requires: python-pyasn1
28+
BuildRequires: python-devel
29+
BuildRequires: python-setuptools
30+
BuildRequires: pyOpenSSL
31+
BuildRequires: python-pyasn1
32+
%endif
4433

45-
%description -n python3-%{srcname}
34+
%description
4635
A utility to aid in the creation of more secure "self-signed"
4736
certificates. The certificates created by this tool are generated in a
4837
way so as to create a CA certificate that can be safely imported into a
4938
client machine to trust the service certificate without needing to set
5039
up a full PKI environment and without exposing the machine to a risk of
5140
false signatures from the service certificate.
52-
%endif #0%{?with_python3}
5341

5442
%prep
55-
%setup -qc -n %{srcname}-%{version}
56-
57-
mv %{srcname}-%{version} python2
58-
find python2 -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|'
43+
%setup -q -n %{srcname}-%{version}
5944

60-
%if 0%{?with_python3}
61-
rm -rf python3
62-
cp -a python2 python3
63-
find python3 -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
64-
%endif #0%{?with_python3}
45+
# Set any script hashbangs to the appropriate python version
46+
%if 0%{?use_python3}
47+
find . -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
48+
%else
49+
find . -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|'
50+
%endif #0%{?use_python3}
6551

6652
%build
6753
# Ensure egg-info is regenerated
6854
rm -rf src/*.egg-info
6955

70-
pushd python2
71-
%{__python2} setup.py build
72-
popd
73-
74-
%if 0%{?with_python3}
75-
pushd python3
56+
%if 0%{?use_python3}
7657
%{__python3} setup.py build
77-
popd
78-
%endif # with_python3
58+
%else
59+
%{__python2} setup.py build
60+
%endif # use_python3
7961

8062
%install
8163
rm -rf $RPM_BUILD_ROOT
8264

83-
pushd python2
84-
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
85-
mv $RPM_BUILD_ROOT/%{_bindir}/%{srcname} \
86-
$RPM_BUILD_ROOT/%{_bindir}/%{srcname}-%{python2_version}
87-
popd
88-
89-
%if 0%{?with_python3}
90-
pushd python3
91-
%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT
92-
mv $RPM_BUILD_ROOT/%{_bindir}/%{srcname} \
93-
$RPM_BUILD_ROOT/%{_bindir}/%{srcname}-%{python3_version}
94-
popd
95-
%endif # with_python3
96-
97-
# On platforms where python3 is preferred, symlink that version
98-
# to /usr/bin/%{srcname}
9965
%if 0%{?use_python3}
100-
ln -s %{srcname}-%{python3_version} $RPM_BUILD_ROOT/%{_bindir}/%{srcname}
66+
%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT
10167
%else
102-
ln -s %{srcname}-%{python2_version} $RPM_BUILD_ROOT/%{_bindir}/%{srcname}
103-
%endif #use_python3
104-
68+
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
69+
%endif # use_python3
70+
10571
%files
106-
%license python2/src/sscg/LICENSE
107-
# For noarch packages: sitelib
108-
%{python2_sitelib}/*
109-
%{_bindir}/%{srcname}-%{python2_version}
110-
%if !0%{?use_python3}
72+
%license src/sscg/LICENSE
11173
%{_bindir}/%{srcname}
112-
%endif
11374

114-
%if 0%{?with_python3}
115-
%files -n python3-%{srcname}
116-
%license python3/src/sscg/LICENSE
117-
%{python3_sitelib}/*
118-
%{_bindir}/%{srcname}-%{python3_version}
11975
%if 0%{?use_python3}
120-
%{_bindir}/%{srcname}
76+
%{python3_sitelib}/%{srcname}/*
77+
%{python3_sitelib}/%{srcname}-%{version}-py%{python3_version}.egg-info/
78+
%else
79+
%{python2_sitelib}/%{srcname}/*
80+
%{python2_sitelib}/%{srcname}-%{version}-py%{python2_version}.egg-info/
12181
%endif #use_python3
122-
%endif #with_python3
12382

12483
%changelog
84+
* Mon Mar 23 2015 Stephen Gallagher <[email protected]> 0.3.0-1
85+
- Rename to sscg
86+
- Only build with default python interpreter
87+
12588
* Tue Mar 17 2015 Stephen Gallagher <[email protected]> 0.2.1-1
12689
- Include the LICENSE file in the tarball
12790

0 commit comments

Comments
 (0)