Browse code

Add python3 to full install

Vinay Kulkarni authored on 2015/07/17 05:45:48
Showing 3 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,17 @@
0
+--- a/Lib/cgi.py	2014-06-29 19:05:24.000000000 -0700
1
+@@ -1,13 +1,5 @@
2
+-#! /usr/local/bin/python
3
++#! /usr/bin/python
4
+ 
5
+-# NOTE: the above "/usr/local/bin/python" is NOT a mistake.  It is
6
+-# intentionally NOT "/usr/bin/env python".  On many systems
7
+-# (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI
8
+-# scripts, and /usr/local/bin is the default directory where Python is
9
+-# installed, so /usr/bin/env would be unable to find python.  Granted,
10
+-# binary installations by Linux vendors often install Python in
11
+-# /usr/bin.  So let those vendors patch cgi.py to match their choice
12
+-# of installation.
13
+ 
14
+ """Support module for CGI (Common Gateway Interface) scripts.
15
+ 
0 16
new file mode 100644
... ...
@@ -0,0 +1,188 @@
0
+Summary:	A high-level scripting language
1
+Name:		python3
2
+Version:	3.4.3
3
+Release:	1%{?dist}
4
+License:	PSF
5
+URL:		http://www.python.org/
6
+Group:		System Environment/Programming
7
+Vendor:		VMware, Inc.
8
+Distribution:	Photon
9
+Source0:	https://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz
10
+%define sha1 Python=7ca5cd664598bea96eec105aa6453223bb6b4456
11
+Patch:          cgi3.patch
12
+BuildRequires:	pkg-config >= 0.28
13
+BuildRequires:	bzip2-devel
14
+BuildRequires:	ncurses-devel
15
+BuildRequires:  openssl-devel
16
+BuildRequires:  readline-devel
17
+BuildRequires:  xz-devel
18
+Requires:	bzip2
19
+Requires:	ncurses
20
+Requires:  	openssl
21
+Requires:  	readline
22
+Requires:  	xz
23
+Provides: 	python-sqlite
24
+Provides: 	python(abi)
25
+Provides: 	/usr/bin/python
26
+Provides: 	/bin/python
27
+
28
+%description
29
+The Python 3 package contains a new version of Python development environment.
30
+Python 3 brings more efficient ways of handling dictionaries, better unicode
31
+strings support, easier and more intuitive syntax, and removes the deprecated
32
+code. It is incompatible with Python 2.x releases.
33
+
34
+%package libs
35
+Summary: The libraries for python runtime
36
+Group: Applications/System
37
+Requires: python3 = %{version}-%{release}
38
+BuildRequires:	expat >= 2.1.0
39
+BuildRequires:	libffi >= 3.0.13
40
+BuildRequires:	ncurses-devel
41
+BuildRequires:	sqlite-autoconf
42
+Requires:	coreutils
43
+Requires:	expat >= 2.1.0
44
+Requires:	libffi >= 3.0.13
45
+Requires:	ncurses
46
+Requires:	sqlite-autoconf
47
+
48
+
49
+%description libs
50
+The python interpreter can be embedded into applications wanting to
51
+use python as an embedded scripting language.  The python-libs package
52
+provides the libraries needed for python 3 applications.
53
+
54
+%package devel
55
+Summary: The libraries and header files needed for Python development.
56
+Group: Development/Libraries
57
+Requires: python3 = %{version}-%{release}
58
+# Needed here because of the migration of Makefile from -devel to the main
59
+# package
60
+Conflicts: python3 < %{version}-%{release}
61
+
62
+%description devel
63
+The Python programming language's interpreter can be extended with
64
+dynamically loaded extensions and can be embedded in other programs.
65
+This package contains the header files and libraries needed to do
66
+these types of tasks.
67
+
68
+Install python-devel if you want to develop Python extensions.  The
69
+python package will also need to be installed.  You'll probably also
70
+want to install the python-docs package, which contains Python
71
+documentation.
72
+
73
+%package tools
74
+Summary: A collection of development tools included with Python.
75
+Group: Development/Tools
76
+Requires: python3 = %{version}-%{release}
77
+
78
+%description tools
79
+The Python package includes several development tools that are used
80
+to build python programs.
81
+
82
+
83
+%prep
84
+%setup -q -n Python-%{version}
85
+%patch -p1
86
+
87
+%build
88
+export OPT="${CFLAGS}"
89
+./configure \
90
+	CFLAGS="%{optflags}" \
91
+	CXXFLAGS="%{optflags}" \
92
+	--prefix=%{_prefix} \
93
+	--bindir=%{_bindir} \
94
+	--libdir=%{_libdir} \
95
+	--enable-shared \
96
+	--with-system-expat \
97
+	--with-system-ffi \
98
+	--with-dbmliborder=gdbm:ndbm
99
+make %{?_smp_mflags}
100
+
101
+%install
102
+[ %{buildroot} != "/"] && rm -rf %{buildroot}/*
103
+make DESTDIR=%{buildroot} altinstall
104
+chmod -v 755 %{buildroot}%{_libdir}/libpython3.4m.so.1.0
105
+%{_fixperms} %{buildroot}/*
106
+
107
+# Remove unused stuff
108
+find %{buildroot}%{_libdir} -name '*.pyc' -delete
109
+find %{buildroot}%{_libdir} -name '*.pyo' -delete
110
+
111
+%check
112
+make -k check |& tee %{_specdir}/%{name}-check-log || %{nocheck}
113
+
114
+%post
115
+-p /sbin/ldconfig
116
+# Enable below if using 'make install' instead of 'make altinstall'
117
+#ln -s %{_bindir}/python3 %{_bindir}/python
118
+#ln -s %{_bindir}/python3-config %{_bindir}/python-config
119
+#ln -s %{_libdir}/libpython3.4m.so %{_libdir}/libpython3.4.so
120
+
121
+%postun
122
+-p /sbin/ldconfig
123
+
124
+%clean
125
+rm -rf %{buildroot}/*
126
+
127
+%files
128
+%defattr(-, root, root)
129
+%doc LICENSE README
130
+%{_bindir}/pydoc*
131
+%{_bindir}/pyvenv*
132
+%{_bindir}/python*
133
+%{_bindir}/pip*
134
+%{_bindir}/easy_install-3.4
135
+%{_mandir}/*/*
136
+
137
+%dir %{_libdir}/python3.4
138
+%dir %{_libdir}/python3.4/site-packages
139
+
140
+%{_libdir}/libpython3.so
141
+%{_libdir}/libpython3.4m.so
142
+%{_libdir}/libpython3.4m.so.1.0
143
+%{_libdir}/pkgconfig/python-3.4.pc
144
+# Enable below if using 'make install' instead of 'make altinstall'
145
+#%{_libdir}/pkgconfig/python-3.4m.pc
146
+#%{_libdir}/pkgconfig/python3.pc
147
+
148
+%exclude %{_libdir}/python3.4/ctypes/test
149
+%exclude %{_libdir}/python3.4/distutils/tests
150
+%exclude %{_libdir}/python3.4/sqlite3/test
151
+%exclude %{_libdir}/python3.4/idlelib/idle_test
152
+%exclude %{_libdir}/python3.4/test
153
+#%exclude %{_libdir}/python3.4/unittest
154
+%exclude %{_libdir}/python3.4/lib-dynload/_ctypes_test.*.so
155
+
156
+%files libs
157
+%defattr(-,root,root)
158
+%doc LICENSE README
159
+%{_libdir}/python3.4
160
+%exclude %{_libdir}/python3.4/ctypes/test
161
+%exclude %{_libdir}/python3.4/distutils/tests
162
+%exclude %{_libdir}/python3.4/sqlite3/test
163
+%exclude %{_libdir}/python3.4/idlelib/idle_test
164
+%exclude %{_libdir}/python3.4/test
165
+#%exclude %{_libdir}/python3.4/unittest
166
+%exclude %{_libdir}/python3.4/lib-dynload/_ctypes_test.*.so
167
+
168
+%files devel
169
+%defattr(-,root,root)
170
+/usr/include/*
171
+%doc Misc/README.valgrind Misc/valgrind-python.supp Misc/gdbinit
172
+%{_libdir}/python3.4/config-3.4m/*
173
+%exclude %{_libdir}/python3.4/config-3.4m/python.o
174
+%{_libdir}/libpython3.so
175
+%exclude %{_bindir}/2to3*
176
+%exclude %{_bindir}/idle*
177
+
178
+%files tools
179
+%defattr(-,root,root,755)
180
+%doc Tools/README
181
+%{_libdir}/python3.4/lib2to3
182
+%{_bindir}/2to3*
183
+%{_bindir}/idle*
184
+
185
+%changelog
186
+*	Wed Jul 1 2015 Vinay Kulkarni <kulkarniv@vmware.com> 3.4.3
187
+-	Add Python3 package to Photon.
... ...
@@ -24,7 +24,7 @@
24 24
                 "rpm-devel","pycurl","urlgrabber","yum-metadata-parser","yum", "rocket", "strace", "cracklib-python",
25 25
                 "haveged", "haveged-devel", "vim-extra",
26 26
                 "postgresql", "openjdk", "apr", "apr-util", "httpd", "openvswitch", "eventlog", "syslog-ng", "zookeeper", "fuse", "fleet",
27
-                "nss-altfiles", "apache-maven", "subversion", "mesos"]
27
+                "nss-altfiles", "apache-maven", "subversion", "mesos", "python3", "python3-libs", "python3-devel", "python3-tools"]
28 28
 }
29 29
 
30 30