##// END OF EJS Templates
packaging: switch centos 7 packaging to python 3...
Mathias De Mare -
r46440:de1f4c43 default
parent child Browse files
Show More
@@ -20,6 +20,7 b' CENTOS_RELEASES := \\'
20 # Build a Python for these CentOS releases.
20 # Build a Python for these CentOS releases.
21 CENTOS_WITH_PYTHON_RELEASES :=
21 CENTOS_WITH_PYTHON_RELEASES :=
22 CENTOS_WITH_NONVERSIONED_PYTHON :=
22 CENTOS_WITH_NONVERSIONED_PYTHON :=
23 CENTOS_WITH_36_DOCUTILS := 7
23
24
24 help:
25 help:
25 @echo 'Packaging Make Targets'
26 @echo 'Packaging Make Targets'
@@ -110,13 +111,13 b' define centos_targets'
110 .PHONY: centos$(1)
111 .PHONY: centos$(1)
111 centos$(1):
112 centos$(1):
112 mkdir -p $$(HGROOT)/packages/centos$(1)
113 mkdir -p $$(HGROOT)/packages/centos$(1)
113 ./buildrpm $$(if $$(filter $(1),$$(CENTOS_WITH_PYTHON_RELEASES)),--withpython,$$(if $$(filter $(1),$$(CENTOS_WITH_NONVERSIONED_PYTHON)),--python python,))
114 ./buildrpm $$(if $$(filter $(1),$$(CENTOS_WITH_PYTHON_RELEASES)),--withpython,$$(if $$(filter $(1),$$(CENTOS_WITH_NONVERSIONED_PYTHON)),--python python,))$$(if $$(filter $(1),$$(CENTOS_WITH_36_DOCUTILS)), --docutilspackage python36-docutils,)
114 cp $$(HGROOT)/contrib/packaging/rpmbuild/RPMS/*/* $$(HGROOT)/packages/centos$(1)
115 cp $$(HGROOT)/contrib/packaging/rpmbuild/RPMS/*/* $$(HGROOT)/packages/centos$(1)
115 cp $$(HGROOT)/contrib/packaging/rpmbuild/SRPMS/* $$(HGROOT)/packages/centos$(1)
116 cp $$(HGROOT)/contrib/packaging/rpmbuild/SRPMS/* $$(HGROOT)/packages/centos$(1)
116
117
117 .PHONY: docker-centos$(1)
118 .PHONY: docker-centos$(1)
118 docker-centos$(1):
119 docker-centos$(1):
119 ./dockerrpm centos$(1) $$(if $$(filter $(1),$$(CENTOS_WITH_PYTHON_RELEASES)),--withpython,$$(if $$(filter $(1),$$(CENTOS_WITH_NONVERSIONED_PYTHON)),--python python,))
120 ./dockerrpm centos$(1) $$(if $$(filter $(1),$$(CENTOS_WITH_PYTHON_RELEASES)),--withpython,$$(if $$(filter $(1),$$(CENTOS_WITH_NONVERSIONED_PYTHON)),--python python,))$$(if $$(filter $(1),$$(CENTOS_WITH_36_DOCUTILS)), --docutilspackage python36-docutils,)
120
121
121 endef
122 endef
122
123
@@ -7,6 +7,7 b''
7 BUILD=1
7 BUILD=1
8 RPMBUILDDIR="$PWD/rpmbuild"
8 RPMBUILDDIR="$PWD/rpmbuild"
9 PYTHONEXE=python3
9 PYTHONEXE=python3
10 DOCUTILSPACKAGE=python3-docutils
10
11
11 while [ "$1" ]; do
12 while [ "$1" ]; do
12 case "$1" in
13 case "$1" in
@@ -25,6 +26,11 b' while [ "$1" ]; do'
25 PYTHONMD5=f1a2ace631068444831d01485466ece0
26 PYTHONMD5=f1a2ace631068444831d01485466ece0
26 PYTHONEXE=python
27 PYTHONEXE=python
27 ;;
28 ;;
29 --docutilspackage)
30 shift
31 DOCUTILSPACKAGE="$1"
32 shift
33 ;;
28 --rpmbuilddir )
34 --rpmbuilddir )
29 shift
35 shift
30 RPMBUILDDIR="$1"
36 RPMBUILDDIR="$1"
@@ -149,6 +155,9 b' fi'
149 sed -i \
155 sed -i \
150 -e "s/^%define withpython.*$/%define withpython $RPMPYTHONVER/" \
156 -e "s/^%define withpython.*$/%define withpython $RPMPYTHONVER/" \
151 $rpmspec
157 $rpmspec
158 sed -i \
159 -e "s/^%global pythondocutils.*$/%global pythondocutils $DOCUTILSPACKAGE/" \
160 $rpmspec
152
161
153 if [ "$BUILD" ]; then
162 if [ "$BUILD" ]; then
154 rpmbuild --define "_topdir $RPMBUILDDIR" -ba $rpmspec --clean
163 rpmbuild --define "_topdir $RPMBUILDDIR" -ba $rpmspec --clean
@@ -3,12 +3,13 b' FROM centos:centos7'
3 RUN groupadd -g %GID% build && \
3 RUN groupadd -g %GID% build && \
4 useradd -u %UID% -g %GID% -s /bin/bash -d /build -m build
4 useradd -u %UID% -g %GID% -s /bin/bash -d /build -m build
5
5
6 RUN yum install -y epel-release
6 RUN yum install -y \
7 RUN yum install -y \
7 gcc \
8 gcc \
8 gettext \
9 gettext \
9 make \
10 make \
10 python-devel \
11 python3-devel \
11 python-docutils \
12 python36-docutils \
12 rpm-build \
13 rpm-build \
13 tar
14 tar
14
15
@@ -3,6 +3,7 b''
3 %define withpython %{nil}
3 %define withpython %{nil}
4
4
5 %global pythonexe python3
5 %global pythonexe python3
6 %global pythondocutils python3-docutils
6
7
7 %if "%{?withpython}"
8 %if "%{?withpython}"
8
9
@@ -39,7 +40,7 b' BuildRequires: make, gcc, gettext'
39 %if "%{?withpython}"
40 %if "%{?withpython}"
40 BuildRequires: readline-devel, openssl-devel, ncurses-devel, zlib-devel, bzip2-devel
41 BuildRequires: readline-devel, openssl-devel, ncurses-devel, zlib-devel, bzip2-devel
41 %else
42 %else
42 BuildRequires: %{pythonexe} >= %{pythonver}, %{pythonexe}-devel, %{pythonexe}-docutils >= 0.5
43 BuildRequires: %{pythonexe} >= %{pythonver}, %{pythonexe}-devel, %{pythondocutils}
43 Requires: %{pythonexe} >= %{pythonver}
44 Requires: %{pythonexe} >= %{pythonver}
44 %endif
45 %endif
45 # The hgk extension uses the wish tcl interpreter, but we don't enforce it
46 # The hgk extension uses the wish tcl interpreter, but we don't enforce it
General Comments 0
You need to be logged in to leave comments. Login now