5
5
%endif
6
6
%endif
7
7
8
- Name: python-sscg
8
+ %global srcname sscg
9
+
10
+ Name: python-%{srcname }
9
11
Version: 0.2
10
12
Release: 1%{?dist }
11
13
Summary: Self-signed certificate generator
12
14
13
- License: PSF
14
- URL: https://github.com/sgallagher/sscg
15
- Source0: https://github.com/sgallagher/sscg /releases/download/sscg -%{version }/sscg -%{version }.tar.gz
15
+ License: BSD
16
+ URL: https://github.com/sgallagher/%{ srcname }
17
+ Source0: https://github.com/sgallagher/%{ srcname } /releases/download/%{ srcname } -%{version }/%{ srcname } -%{version }.tar.gz
16
18
17
19
BuildArch: noarch
18
20
Requires: pyOpenSSL
@@ -31,7 +33,7 @@ up a full PKI environment and without exposing the machine to a risk of
31
33
false signatures from the service certificate.
32
34
33
35
%if 0%{?with_python3 }
34
- %package -n python3-sscg
36
+ %package -n python3-%{ srcname }
35
37
Summary: Self-signed certificate generator
36
38
Requires: python3-pyOpenSSL
37
39
Requires: python3-pyasn1
@@ -40,7 +42,7 @@ BuildRequires: python3-setuptools
40
42
BuildRequires: python3-pyOpenSSL
41
43
BuildRequires: python3-pyasn1
42
44
43
- %description -n python3-sscg
45
+ %description -n python3-%{ srcname }
44
46
A utility to aid in the creation of more secure "self-signed"
45
47
certificates. The certificates created by this tool are generated in a
46
48
way so as to create a CA certificate that can be safely imported into a
@@ -50,63 +52,80 @@ false signatures from the service certificate.
50
52
%endif #0%{?with_python3}
51
53
52
54
%prep
53
- %setup -q -n sscg-%{version }
55
+ %setup -qc -n %{srcname }-%{version }
56
+
57
+ mv %{srcname }-%{version } python2
58
+ find python2 -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|'
54
59
55
60
%if 0%{?with_python3 }
56
- rm -rf %{py3dir }
57
- cp -a . %{py3dir }
61
+ rm -rf python3
62
+ cp -a python2 python3
63
+ find python3 -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
58
64
%endif #0%{?with_python3}
59
65
60
66
%build
61
- # Remove CFLAGS=... for noarch packages (unneeded)
62
- CFLAGS=" $RPM_OPT_FLAGS " %{__python2} setup.py build
67
+ # Ensure egg-info is regenerated
68
+ rm -rf src/* .egg-info
69
+
70
+ pushd python2
71
+ %{__python2} setup.py build
72
+ popd
63
73
64
74
%if 0%{?with_python3 }
65
- pushd %{ py3dir }
66
- CFLAGS = "$RPM_OPT_FLAGS" %{__python3} setup.py build
75
+ pushd python3
76
+ %{__python3} setup.py build
67
77
popd
68
78
%endif # with_python3
69
79
70
80
%install
71
81
rm -rf $RPM_BUILD_ROOT
82
+
83
+ pushd python2
72
84
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
73
- mv $RPM_BUILD_ROOT /%{_bindir }/sscg \
74
- $RPM_BUILD_ROOT /%{_bindir }/sscg-%{python2_version }
85
+ mv $RPM_BUILD_ROOT/%{_bindir }/%{srcname } \
86
+ $RPM_BUILD_ROOT/%{_bindir }/%{srcname }-%{python2_version }
87
+ popd
75
88
76
89
%if 0%{?with_python3 }
77
- pushd %{ py3dir }
90
+ pushd python3
78
91
%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT
79
- mv $RPM_BUILD_ROOT/%{_bindir }/sscg \
80
- $RPM_BUILD_ROOT/%{_bindir }/sscg-%{python3_version }
92
+ mv $RPM_BUILD_ROOT/%{_bindir }/%{srcname } \
93
+ $RPM_BUILD_ROOT/%{_bindir }/%{srcname }-%{python3_version }
94
+ popd
81
95
%endif # with_python3
82
96
83
97
# On platforms where python3 is preferred, symlink that version
84
- # to /usr/bin/sscg
98
+ # to /usr/bin/%{srcname}
85
99
%if 0%{?use_python3 }
86
- ln -s sscg -%{python3_version } $RPM_BUILD_ROOT/%{_bindir }/sscg
100
+ ln -s %{ srcname } -%{python3_version } $RPM_BUILD_ROOT/%{_bindir }/%{ srcname }
87
101
%else
88
- ln -s sscg -%{python2_version } $RPM_BUILD_ROOT/%{_bindir }/sscg
102
+ ln -s %{ srcname } -%{python2_version } $RPM_BUILD_ROOT/%{_bindir }/%{ srcname }
89
103
%endif #use_python3
90
104
91
105
%files
92
106
%doc
93
107
# For noarch packages: sitelib
94
108
%{python2_sitelib }/*
95
- %{_bindir }/sscg -%{python2_version }
109
+ %{_bindir }/%{ srcname } -%{python2_version }
96
110
%if ! 0%{?use_python3 }
97
- %{_bindir }/sscg
111
+ %{_bindir }/%{ srcname }
98
112
%endif
99
113
100
114
%if 0%{?with_python3 }
101
- %files -n python3-sscg
115
+ %files -n python3-%{ srcname }
102
116
%{python3_sitelib }/*
103
- %{_bindir }/sscg -%{python3_version }
117
+ %{_bindir }/%{ srcname } -%{python3_version }
104
118
%if 0%{?use_python3 }
105
- %{_bindir }/sscg
119
+ %{_bindir }/%{ srcname }
106
120
%endif #use_python3
107
121
%endif #with_python3
108
122
109
123
%changelog
124
+ *
Tue Mar 17 2015 Stephen Gallagher <[email protected] > 0.2-1
125
+ - Add support for namedConstraints
126
+ - Add support for subjectAltNames
127
+ - Fix packaging issues from Fedora package review
128
+
110
129
*
Mon Mar 16 2015 Stephen Gallagher <[email protected] > 0.1-2
111
130
- Update BuildRequires
112
131
0 commit comments