-
Notifications
You must be signed in to change notification settings - Fork 0
/
python-lit.spec
94 lines (75 loc) · 2.22 KB
/
python-lit.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
%global srcname lit
%if 0%{?fedora}
%global with_python3 1
%endif
# FIXME: Work around for rhel not having py2_build/py2_install macro.
%{!?py2_build: %global py2_build %{expand: CFLAGS="%{optflags}" %{__python2} setup.py %{?py_setup_args} build --executable="%{__python2} -s"}}
%{!?py2_install: %global py2_install %{expand: CFLAGS="%{optflags}" %{__python2} setup.py %{?py_setup_args} install -O1 --skip-build --root %{buildroot}}}
Name: python-%{srcname}
Version: 0.5.0
Release: 1%{?dist}
BuildArch: noarch
License: NCSA
Group: Development/Languages
Summary: Tool for executing llvm test suites
URL: https://pypi.python.org/pypi/lit
Source0: https://pypi.python.org/packages/5b/a0/dbed2c8dfb220eb9a5a893257223cd0ff791c0fbc34ce2f1a957fa4b6c6f/lit-0.5.0.tar.gz
BuildRequires: python2-devel
BuildRequires: python-setuptools
%if 0%{?with_python3}
BuildRequires: python3-devel
%endif
%description
lit is a tool used by the LLVM project for executing its test suites.
%package -n python2-lit
Summary: LLVM lit test runner for Python 2
Group: Development/Languages
%if 0%{?with_python3}
%package -n python3-lit
Summary: LLVM lit test runner for Python 3
Group: Development/Languages
%endif
%description -n python2-lit
lit is a tool used by the LLVM project for executing its test suites.
%if 0%{?with_python3}
%description -n python3-lit
lit is a tool used by the LLVM project for executing its test suites.
%endif
%prep
%autosetup -n %{srcname}-%{version}
%build
%py2_build
%if 0%{?with_python3}
%py3_build
%endif
%install
%py2_install
%if 0%{?with_python3}
%py3_install
%endif
# Strip out #!/usr/bin/env python
sed -i -e '1{\@^#!/usr/bin/env python@d}' %{buildroot}%{python2_sitelib}/%{srcname}/*.py
sed -i -e '1{\@^#!/usr/bin/env python@d}' %{buildroot}%{python3_sitelib}/%{srcname}/*.py
%check
%{__python2} setup.py test
%if 0%{?with_python3}
# FIXME: Tests fail with python3
#{__python3} setup.py test
%endif
%clean
rm -rf %{buildroot}
%files -n python2-%{srcname}
%doc README.txt
%{python2_sitelib}/*
%if %{undefined with_python3}
%{_bindir}/lit
%endif
%if 0%{?with_python3}
%files -n python3-%{srcname}
%doc README.txt
%{python3_sitelib}/*
%{_bindir}/lit
%endif
%changelog
* Thu Mar 09 2017 Tom Stellard <[email protected]> - 0.5.0-1
- Initial version