1
- %if (0%{?fedora } >= 13 || 0%{?rhel } >= 7)
2
- %global with_python3 1
3
1
%if (0%{?fedora } >= 22 || 0%{?rhel } >= 8)
4
2
%global use_python3 1
5
3
%endif
6
- %endif
7
4
8
5
%global srcname sscg
9
6
10
- Name: python- %{srcname }
11
- Version: 0.2.1
7
+ Name: %{srcname }
8
+ Version: 0.3.0
12
9
Release: 1%{?dist }
13
10
Summary: Self-signed certificate generator
14
11
@@ -17,111 +14,77 @@ URL: https://github.com/sgallagher/%{srcname}
17
14
Source0: https://github.com/sgallagher/%{srcname }/releases/download/%{srcname }-%{version }/%{srcname }-%{version }.tar.gz
18
15
19
16
BuildArch: noarch
20
- Requires: pyOpenSSL
21
- Requires: python-pyasn1
22
- BuildRequires: python-devel
23
- BuildRequires: python-setuptools
24
- BuildRequires: pyOpenSSL
25
- BuildRequires: python-pyasn1
26
17
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 }
38
19
Requires: python3-pyOpenSSL
39
20
Requires: python3-pyasn1
40
21
BuildRequires: python3-devel
41
22
BuildRequires: python3-setuptools
42
23
BuildRequires: python3-pyOpenSSL
43
24
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
44
33
45
- %description -n python3-%{ srcname }
34
+ %description
46
35
A utility to aid in the creation of more secure "self-signed"
47
36
certificates. The certificates created by this tool are generated in a
48
37
way so as to create a CA certificate that can be safely imported into a
49
38
client machine to trust the service certificate without needing to set
50
39
up a full PKI environment and without exposing the machine to a risk of
51
40
false signatures from the service certificate.
52
- %endif #0%{?with_python3}
53
41
54
42
%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 }
59
44
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}
65
51
66
52
%build
67
53
# Ensure egg-info is regenerated
68
54
rm -rf src/* .egg-info
69
55
70
- pushd python2
71
- %{__python2} setup.py build
72
- popd
73
-
74
- %if 0%{?with_python3 }
75
- pushd python3
56
+ %if 0%{?use_python3 }
76
57
%{__python3} setup.py build
77
- popd
78
- %endif # with_python3
58
+ %else
59
+ %{__python2} setup.py build
60
+ %endif # use_python3
79
61
80
62
%install
81
63
rm -rf $RPM_BUILD_ROOT
82
64
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}
99
65
%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
101
67
%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
+
105
71
%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
111
73
%{_bindir }/%{srcname }
112
- %endif
113
74
114
- %if 0%{?with_python3 }
115
- %files -n python3-%{srcname }
116
- %license python3/src/sscg/LICENSE
117
- %{python3_sitelib }/*
118
- %{_bindir }/%{srcname }-%{python3_version }
119
75
%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/
121
81
%endif #use_python3
122
- %endif #with_python3
123
82
124
83
%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
+
125
88
*
Tue Mar 17 2015 Stephen Gallagher <[email protected] > 0.2.1-1
126
89
- Include the LICENSE file in the tarball
127
90
0 commit comments