-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathpython-javatools.spec
194 lines (139 loc) · 4.37 KB
/
python-javatools.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
%global srcproj javatools
%global srcname python-%{srcproj}
%global srcver 1.6.0
%global srcrel 1
# There's two distinct eras of RPM packaging for python, with
# different macros and different expectations. Generally speaking the
# new features are available in RHEL 8+ and Fedora 22+
%define old_rhel ( 0%{?rhel} && 0%{?rhel} < 8 )
%define old_fedora ( 0%{?fedora} && 0%{?fedora} < 22 )
%if %{old_rhel} || %{old_fedora}
# old python 2.6 support
%define with_old_python 1
%undefine with_python2
%undefine with_python3
%else
# newer pythons, with cooler macros
%undefine with_old_python
%bcond_with python2
%bcond_without python3
%endif
# we don't generate binaries, let's turn the debuginfo part off
%global debug_package %{nil}
Summary: Tools for inspecting and comparing binary Java class files
Name: %{srcname}
Version: %{srcver}
Release: %{srcrel}%{?dist}
License: LGPLv3
Group: Application/System
URL: https://github.com/obriencj/python-javatools/
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildArch: noarch
Source0: %{srcname}-%{srcver}.tar.gz
%description
Tools for inspecting and comparing binary Java class files, JARs, and
JAR-based distributions
%prep
%setup -q
%build
%if %{with old_python}
%{__python} setup.py build
%endif
%if %{with python2}
%py2_build_wheel
%endif
%if %{with python3}
%py3_build_wheel
%endif
%install
%__rm -rf $RPM_BUILD_ROOT
%if %{with old_python}
%{__python} setup.py install --skip-build --root %{buildroot}
%endif
%if %{with python2}
%py2_install_wheel %{srcproj}-%{version}-py2-none-any.whl
%endif
%if %{with python3}
%py3_install_wheel %{srcproj}-%{version}-py3-none-any.whl
%endif
%clean
rm -rf %{buildroot}
%if %{with old_python}
# package support for older python systems (centos 6, fedora
# 19) with only python 2.6 available.
%package -n python2-%{srcproj}
Summary: %{summary}
BuildRequires: python-devel python-setuptools
BuildRequires: python-cheetah python-six
Requires: python python-argparse python-setuptools
Requires: python-cheetah python-six
%{?python_provide:%python_provide python2-%{srcproj}}
%description -n python2-%{srcproj}
Python Java Tools
%files -n python2-%{srcproj}
%defattr(-,root,root,-)
%{python2_sitelib}/javatools/
%{python2_sitelib}/javatools-%{version}.dist-info
%{_bindir}/*
%doc AUTHORS ChangeLog README.md
%license LICENSE
%endif
%if %{with python2}
%package -n python2-%{srcproj}
Summary: %{summary}
BuildRequires: python2-devel
BuildRequires: python2-pip python2-setuptools python2-wheel
BuildRequires: python2-cheetah python2-six
Requires: python2 python2-setuptools
Requires: python2-cheetah python2-six
%{?python_provide:%python_provide python2-%{srcproj}}
%{?py_provides:%py_provides python2-%{srcproj}}
%description -n python2-%{srcproj}
Python Java Tools
%files -n python2-%{srcproj}
%defattr(-,root,root,-)
%{python2_sitelib}/javatools/
%{python2_sitelib}/javatools-%{version}.dist-info
%{_bindir}/*
%doc AUTHORS ChangeLog README.md
%license LICENSE
%endif
%if %{with python3}
%package -n python3-%{srcproj}
Summary: %{summary}
BuildRequires: python3-devel
BuildRequires: python3-pip python3-setuptools python3-wheel
BuildRequires: python3-cheetah python3-six
Requires: python3 python3-setuptools
Requires: python3-cheetah python3-six
%{?python_provide:%python_provide python3-%{srcproj}}
%{?py_provides:%py_provides python3-%{srcproj}}
%description -n python3-%{srcproj}
Python Java Tools
%files -n python3-%{srcproj}
%defattr(-,root,root,-)
%{python3_sitelib}/javatools/
%{python3_sitelib}/javatools-%{version}.dist-info
%{_bindir}/*
%doc AUTHORS ChangeLog README.md
%license LICENSE
%endif
%changelog
* Thu Jul 27 2023 Christopher O'Brien <[email protected]> - 1.6.0-1
- version 1.6.0
- m2crypto is runtime optional
- python2 and python3 support
* Sun Jun 21 2020 Christopher O'Brien <[email protected]> - 1.5.0-1
- version 1.5.0
* Sun Oct 05 2019 Christopher O'Brien <[email protected]> - 1.4.0-1
- version 1.4.0
- added ChangeLog as its own file
- move to setuptools
* Thu May 23 2013 Christopher O'Brien <[email protected]> - 1.3-1
- bump to 1.3
* Thu Jun 14 2012 Christopher O'Brien <[email protected]> - 1.2-1
- require python 2.6 and later
* Sun May 06 2012 Christopher O'Brien <[email protected]> - 1.1-1
- dependency features, license files
* Fri Apr 27 2012 Christopher O'Brien <[email protected]> - 1.0-1
- Initial build.