Browse code

Add python-hyperlink package, and make it a Requires of python-Twisted

Change-Id: I6ae979203bc3ba4b97040b0751a30f96f9a96a40
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/3738
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Sharath George

DheerajSShetty authored on 2017/09/12 07:24:52
Showing 2 changed files
... ...
@@ -4,7 +4,7 @@
4 4
 Summary:        An asynchronous networking framework written in Python
5 5
 Name:           python-Twisted
6 6
 Version:        17.5.0
7
-Release:        1%{?dist}
7
+Release:        2%{?dist}
8 8
 License:        MIT
9 9
 Group:          Development/Languages/Python
10 10
 Vendor:         VMware, Inc.
... ...
@@ -31,6 +31,7 @@ Requires:       python-zope.interface
31 31
 Requires:       python-netaddr
32 32
 Requires:       python-incremental
33 33
 Requires:       python-constantly
34
+Requires:       python-hyperlink
34 35
 
35 36
 BuildArch:      x86_64
36 37
 
... ...
@@ -54,6 +55,7 @@ Requires:       python3-zope.interface
54 54
 Requires:       python3-netaddr
55 55
 Requires:       python3-incremental
56 56
 Requires:       python3-constantly
57
+Requires:       python3-hyperlink
57 58
 
58 59
 %description -n python3-Twisted
59 60
 Python 3 version.
... ...
@@ -128,6 +130,9 @@ popd
128 128
 %{_bindir}/cftp3
129 129
 
130 130
 %changelog
131
+*   Mon Sep 11 2017 Dheeraj Shetty <dheerajs@vmware.com> 17.5.0-2
132
+-   Added python-automat, python-hyperlink and its python3 version to the
133
+-   requires.
131 134
 *   Tue Aug 29 2017 Dheeraj Shetty <dheerajs@vmware.com> 17.5.0-1
132 135
 -   Upgrade version
133 136
 *   Wed Jun 07 2017 Xiaolin Li <xiaolinl@vmware.com> 17.1.0-6
134 137
new file mode 100644
... ...
@@ -0,0 +1,89 @@
0
+%{!?python2_sitelib: %define python2_sitelib %(python2 -c "from distutils.sysconfig import get_python_lib;print(get_python_lib())")}
1
+%{!?python3_sitelib: %define python3_sitelib %(python3 -c "from distutils.sysconfig import get_python_lib;print(get_python_lib())")}
2
+
3
+Summary:        provides a pure-Python implementation of immutable URLs
4
+Name:           python-hyperlink
5
+Version:        17.3.1
6
+Release:        1%{?dist}
7
+License:        MIT
8
+Group:          Development/Languages/Python
9
+Vendor:         VMware, Inc.
10
+Distribution:   Photon
11
+Url:            https://github.com/python-hyper/hyperlink
12
+Source0:        https://github.com/python-hyper/hyperlink/archive/hyperlink-%{version}.tar.gz
13
+%define sha1 hyperlink=a577c1d40a14dfa970c74f3b79ad18a98b18a22f
14
+
15
+BuildRequires:  python2
16
+BuildRequires:  python2-libs
17
+BuildRequires:  python2-devel
18
+BuildRequires:  python-setuptools
19
+%if %{with_check}
20
+BuildRequires:  python-pytest
21
+%endif
22
+
23
+Requires:       python2
24
+Requires:       python2-libs
25
+
26
+BuildArch:      noarch
27
+
28
+%description
29
+Hyperlink provides a pure-Python implementation of immutable URLs. Based on RFC 3986 and 3987, the Hyperlink URL makes working with both URIs and IRIs easy.
30
+
31
+%package -n     python3-hyperlink
32
+Summary:        provides a pure-Python implementation of immutable URLs
33
+BuildRequires:  python3-devel
34
+BuildRequires:  python3-libs
35
+BuildRequires:  python3-setuptools
36
+BuildRequires:  python3-xml
37
+%if %{with_check}
38
+BuildRequires:  python3-pytest
39
+%endif
40
+
41
+Requires:       python3
42
+Requires:       python3-libs
43
+
44
+%description -n python3-hyperlink
45
+Python 3 version.
46
+
47
+%prep
48
+%setup -q -n hyperlink-%{version}
49
+rm -rf ../p3dir
50
+cp -a . ../p3dir
51
+
52
+%build
53
+python2 setup.py build
54
+pushd ../p3dir
55
+python3 setup.py build
56
+popd
57
+
58
+%install
59
+pushd ../p3dir
60
+python3 setup.py install --prefix=%{_prefix} --root=%{buildroot}
61
+popd
62
+python2 setup.py install --prefix=%{_prefix} --root=%{buildroot}
63
+
64
+%check
65
+easy_install_2=$(ls /usr/bin |grep easy_install |grep 2)
66
+$easy_install_2 pip
67
+pip install --upgrade tox
68
+pip install --upgrade pytest-cov
69
+pytest2
70
+pushd ../p3dir
71
+easy_install_3=$(ls /usr/bin |grep easy_install |grep 3)
72
+$easy_install_3 pip
73
+pip install --upgrade tox
74
+pip install --upgrade pytest-cov
75
+pytest3
76
+popd
77
+
78
+%files
79
+%defattr(-,root,root)
80
+%{python2_sitelib}/*
81
+
82
+%files -n python3-hyperlink
83
+%defattr(-,root,root)
84
+%{python3_sitelib}/*
85
+
86
+%changelog
87
+*   Mon Sep 11 2017 Dheeraj Shetty <dheerajs@vmware.com> 17.3.1-1
88
+-   Initial packaging for Photon