forked from containerbuildsystem/dockerfile-parse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
python-dockerfile-parse.spec
151 lines (114 loc) · 4.02 KB
/
python-dockerfile-parse.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
%if 0%{?rhel} && 0%{?rhel} <= 6
%{!?__python2: %global __python2 /usr/bin/python2}
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%{!?python2_version: %global python2_version %(%{__python2} -c "import sys; sys.stdout.write(sys.version[:3])")}
%endif
%if 0%{?rhel} && 0%{?rhel} <= 7
%{!?py2_build: %global py2_build %{__python2} setup.py build}
%{!?py2_install: %global py2_install %{__python2} setup.py install --skip-build --root %{buildroot}}
%endif
%if (0%{?fedora} >= 21 || 0%{?rhel} >= 8)
%global with_python3 1
%endif
%global with_check 1
%global owner DBuildService
%global project dockerfile-parse
%global commit 9d2da5f60f020647651fbc3030c8337ac854438d
%global shortcommit %(c=%{commit}; echo ${c:0:7})
Name: python-dockerfile-parse
Version: 0.0.6
Release: 1%{?dist}
Summary: Python library for Dockerfile manipulation
Group: Development/Tools
License: BSD
URL: https://github.com/%{owner}/%{project}
Source0: https://github.com/%{owner}/%{project}/archive/%{commit}/%{project}-%{commit}.tar.gz
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-setuptools
%if 0%{?with_check}
BuildRequires: pytest, python-six
%endif # with_check
Requires: python-setuptools
# defined in /usr/lib/rpm/macros.d/macros.python
# if python_provide() is defined, call python_provide(python-%%{project})
# which may eventually add Provides: ... (see the function definition)
%{?python_provide:%python_provide python-%{project}}
%if 0%{?with_python3}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
%if 0%{?with_check}
BuildRequires: python3-pytest
%endif # with_check
%endif # with_python3
%description
Python library for Dockerfile manipulation
%if 0%{?with_python3}
%package -n python3-%{project}
Summary: Python 3 library for Dockerfile manipulation
Group: Development/Tools
License: BSD
%{?python_provide:%python_provide python3-%{project}}
Requires: python3-setuptools
%description -n python3-%{project}
Python 3 library for Dockerfile manipulation
%endif # with_python3
%prep
%setup -n %{project}-%{commit}
%build
%py2_build
%if 0%{?with_python3}
%py3_build
%endif # with_python3
%install
%py2_install
%if 0%{?with_python3}
%py3_install
%endif # with_python3
%if 0%{?with_check}
%check
LANG=en_US.utf8 py.test-%{python2_version} -vv tests
%if 0%{?with_python3}
LANG=en_US.utf8 py.test-%{python3_version} -vv tests
%endif # with_python3
%endif # with_check
%files
%doc README.md
%{!?_licensedir:%global license %doc}
%license LICENSE
%dir %{python2_sitelib}/dockerfile_parse
%{python2_sitelib}/dockerfile_parse/*.*
%{python2_sitelib}/dockerfile_parse-%{version}-py2.*.egg-info
%if 0%{?with_python3}
%files -n python3-%{project}
%doc README.md
%{!?_licensedir:%global license %doc}
%license LICENSE
%dir %{python3_sitelib}/dockerfile_parse
%dir %{python3_sitelib}/dockerfile_parse/__pycache__
%{python3_sitelib}/dockerfile_parse/*.*
%{python3_sitelib}/dockerfile_parse/__pycache__/*.py*
%{python3_sitelib}/dockerfile_parse-%{version}-py3.*.egg-info
%endif # with_python3
%changelog
* Tue Dec 20 2016 Tim Waugh <[email protected]> - 0.0.6-1
- 0.0.6
* Fri Nov 20 2015 Jiri Popelka <[email protected]> - 0.0.5-3
- don't use py3dir
- new python macros
- use python_provide macro
* Fri Nov 06 2015 Jiri Popelka <[email protected]> - 0.0.5-2
- %%check section
* Mon Sep 21 2015 Jiri Popelka <[email protected]> - 0.0.5-1
- 0.0.5
* Thu Aug 27 2015 Jiri Popelka <[email protected]> - 0.0.4-1
- 0.0.4
* Tue Jun 30 2015 Jiri Popelka <[email protected]> - 0.0.3-2
- define macros for RHEL-6
* Fri Jun 26 2015 Jiri Popelka <[email protected]> - 0.0.3-1
- 0.0.3
* Fri Jun 26 2015 Jiri Popelka <[email protected]> - 0.0.2-1
- 0.0.2
* Thu Jun 18 2015 Jiri Popelka <[email protected]> - 0.0.1-1
- initial release