Show More
@@ -1,20 +1,17 b'' | |||||
1 | FROM centos:centos7 |
|
1 | FROM centos:centos7 | |
2 |
|
2 | |||
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 epel-release | |
7 | RUN yum install -y \ |
|
7 | RUN yum install -y \ | |
8 | gcc \ |
|
8 | gcc \ | |
9 | gettext \ |
|
9 | gettext \ | |
10 | make \ |
|
10 | make \ | |
11 | python3-devel \ |
|
11 | python3-devel \ | |
12 | python36-docutils \ |
|
12 | python36-docutils \ | |
13 | rpm-build \ |
|
13 | rpm-build \ | |
14 | tar |
|
14 | tar | |
15 |
|
15 | |||
16 | # For creating repo meta data |
|
16 | # For creating repo meta data | |
17 | RUN yum install -y createrepo |
|
17 | RUN yum install -y createrepo | |
18 |
|
||||
19 | # For rust extensions |
|
|||
20 | RUN yum install -y cargo |
|
@@ -1,18 +1,15 b'' | |||||
1 | FROM centos:centos8 |
|
1 | FROM centos:centos8 | |
2 |
|
2 | |||
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 \ |
|
6 | RUN yum install -y \ | |
7 | gcc \ |
|
7 | gcc \ | |
8 | gettext \ |
|
8 | gettext \ | |
9 | make \ |
|
9 | make \ | |
10 | python3-devel \ |
|
10 | python3-devel \ | |
11 | python3-docutils \ |
|
11 | python3-docutils \ | |
12 | rpm-build |
|
12 | rpm-build | |
13 |
|
13 | |||
14 | # For creating repo meta data |
|
14 | # For creating repo meta data | |
15 | RUN yum install -y createrepo |
|
15 | RUN yum install -y createrepo | |
16 |
|
||||
17 | # For rust extensions |
|
|||
18 | RUN yum install -y cargo |
|
@@ -1,173 +1,173 b'' | |||||
1 | %global emacs_lispdir %{_datadir}/emacs/site-lisp |
|
1 | %global emacs_lispdir %{_datadir}/emacs/site-lisp | |
2 |
|
2 | |||
3 | %define withpython %{nil} |
|
3 | %define withpython %{nil} | |
4 |
|
4 | |||
5 | %global pythonexe python3 |
|
5 | %global pythonexe python3 | |
6 | %global pythondocutils python3-docutils |
|
6 | %global pythondocutils python3-docutils | |
7 |
|
7 | |||
8 | %if "%{?withpython}" |
|
8 | %if "%{?withpython}" | |
9 |
|
9 | |||
10 | %global pythonver %{withpython} |
|
10 | %global pythonver %{withpython} | |
11 | %global pythonname Python-%{withpython} |
|
11 | %global pythonname Python-%{withpython} | |
12 | %global docutilsname docutils-0.14 |
|
12 | %global docutilsname docutils-0.14 | |
13 | %global docutilsmd5 c53768d63db3873b7d452833553469de |
|
13 | %global docutilsmd5 c53768d63db3873b7d452833553469de | |
14 | %global pythonhg python-hg |
|
14 | %global pythonhg python-hg | |
15 | %global hgpyprefix /opt/%{pythonhg} |
|
15 | %global hgpyprefix /opt/%{pythonhg} | |
16 | # byte compilation will fail on some some Python /test/ files |
|
16 | # byte compilation will fail on some some Python /test/ files | |
17 | %global _python_bytecompile_errors_terminate_build 0 |
|
17 | %global _python_bytecompile_errors_terminate_build 0 | |
18 |
|
18 | |||
19 | %else |
|
19 | %else | |
20 |
|
20 | |||
21 | %global pythonver %(%{pythonexe} -c 'import sys;print(".".join(map(str, sys.version_info[:2])))') |
|
21 | %global pythonver %(%{pythonexe} -c 'import sys;print(".".join(map(str, sys.version_info[:2])))') | |
22 |
|
22 | |||
23 | %endif |
|
23 | %endif | |
24 |
|
24 | |||
25 | Summary: A fast, lightweight Source Control Management system |
|
25 | Summary: A fast, lightweight Source Control Management system | |
26 | Name: mercurial |
|
26 | Name: mercurial | |
27 | Version: snapshot |
|
27 | Version: snapshot | |
28 | Release: 0 |
|
28 | Release: 0 | |
29 | License: GPLv2+ |
|
29 | License: GPLv2+ | |
30 | Group: Development/Tools |
|
30 | Group: Development/Tools | |
31 | URL: https://mercurial-scm.org/ |
|
31 | URL: https://mercurial-scm.org/ | |
32 | Source0: %{name}-%{version}-%{release}.tar.gz |
|
32 | Source0: %{name}-%{version}-%{release}.tar.gz | |
33 | %if "%{?withpython}" |
|
33 | %if "%{?withpython}" | |
34 | Source1: %{pythonname}.tgz |
|
34 | Source1: %{pythonname}.tgz | |
35 | Source2: %{docutilsname}.tar.gz |
|
35 | Source2: %{docutilsname}.tar.gz | |
36 | %endif |
|
36 | %endif | |
37 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root |
|
37 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root | |
38 |
|
38 | |||
39 | BuildRequires: make, gcc, gettext |
|
39 | BuildRequires: make, gcc, gettext | |
40 | %if "%{?withpython}" |
|
40 | %if "%{?withpython}" | |
41 | BuildRequires: readline-devel, openssl-devel, ncurses-devel, zlib-devel, bzip2-devel |
|
41 | BuildRequires: readline-devel, openssl-devel, ncurses-devel, zlib-devel, bzip2-devel | |
42 | %else |
|
42 | %else | |
43 | BuildRequires: %{pythonexe} >= %{pythonver}, %{pythonexe}-devel, %{pythondocutils} |
|
43 | BuildRequires: %{pythonexe} >= %{pythonver}, %{pythonexe}-devel, %{pythondocutils} | |
44 | Requires: %{pythonexe} >= %{pythonver} |
|
44 | Requires: %{pythonexe} >= %{pythonver} | |
45 | %endif |
|
45 | %endif | |
46 | # 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 | |
47 | #Requires: tk |
|
47 | #Requires: tk | |
48 |
|
48 | |||
49 | %description |
|
49 | %description | |
50 | Mercurial is a fast, lightweight source control management system designed |
|
50 | Mercurial is a fast, lightweight source control management system designed | |
51 | for efficient handling of very large distributed projects. |
|
51 | for efficient handling of very large distributed projects. | |
52 |
|
52 | |||
53 | %prep |
|
53 | %prep | |
54 |
|
54 | |||
55 | %if "%{?withpython}" |
|
55 | %if "%{?withpython}" | |
56 | %setup -q -n mercurial-%{version}-%{release} -a1 -a2 |
|
56 | %setup -q -n mercurial-%{version}-%{release} -a1 -a2 | |
57 | # despite the comments in cgi.py, we do this to prevent rpmdeps from picking /usr/local/bin/python up |
|
57 | # despite the comments in cgi.py, we do this to prevent rpmdeps from picking /usr/local/bin/python up | |
58 | sed -i '1c#! /usr/bin/env %{pythonexe}' %{pythonname}/Lib/cgi.py |
|
58 | sed -i '1c#! /usr/bin/env %{pythonexe}' %{pythonname}/Lib/cgi.py | |
59 | %else |
|
59 | %else | |
60 | %setup -q -n mercurial-%{version}-%{release} |
|
60 | %setup -q -n mercurial-%{version}-%{release} | |
61 | %endif |
|
61 | %endif | |
62 |
|
62 | |||
63 | %build |
|
63 | %build | |
64 |
|
64 | |||
65 | export HGPYTHON3=1 |
|
65 | export HGPYTHON3=1 | |
66 |
|
66 | |||
67 | %if "%{?withpython}" |
|
67 | %if "%{?withpython}" | |
68 |
|
68 | |||
69 | PYPATH=$PWD/%{pythonname} |
|
69 | PYPATH=$PWD/%{pythonname} | |
70 | cd $PYPATH |
|
70 | cd $PYPATH | |
71 | ./configure --prefix=%{hgpyprefix} |
|
71 | ./configure --prefix=%{hgpyprefix} | |
72 | make all %{?_smp_mflags} |
|
72 | make all %{?_smp_mflags} | |
73 | cd - |
|
73 | cd - | |
74 |
|
74 | |||
75 | cd %{docutilsname} |
|
75 | cd %{docutilsname} | |
76 | LD_LIBRARY_PATH=$PYPATH $PYPATH/python setup.py build |
|
76 | LD_LIBRARY_PATH=$PYPATH $PYPATH/python setup.py build | |
77 | cd - |
|
77 | cd - | |
78 |
|
78 | |||
79 | # verify Python environment |
|
79 | # verify Python environment | |
80 | LD_LIBRARY_PATH=$PYPATH PYTHONPATH=$PWD/%{docutilsname} $PYPATH/python -c 'import sys, zlib, bz2, ssl, curses, readline' |
|
80 | LD_LIBRARY_PATH=$PYPATH PYTHONPATH=$PWD/%{docutilsname} $PYPATH/python -c 'import sys, zlib, bz2, ssl, curses, readline' | |
81 |
|
81 | |||
82 | # set environment for make |
|
82 | # set environment for make | |
83 | export PATH=$PYPATH:$PATH |
|
83 | export PATH=$PYPATH:$PATH | |
84 | export LD_LIBRARY_PATH=$PYPATH |
|
84 | export LD_LIBRARY_PATH=$PYPATH | |
85 | export CFLAGS="-L $PYPATH" |
|
85 | export CFLAGS="-L $PYPATH" | |
86 | export PYTHONPATH=$PWD/%{docutilsname} |
|
86 | export PYTHONPATH=$PWD/%{docutilsname} | |
87 |
|
87 | |||
88 | %endif |
|
88 | %endif | |
89 |
|
89 | |||
90 | make all PYTHON=%{pythonexe} |
|
90 | make all PYTHON=%{pythonexe} | |
91 | make -C contrib/chg |
|
91 | make -C contrib/chg | |
92 |
|
92 | |||
93 | sed -i -e '1s|#!/usr/bin/env python$|#!/usr/bin/env %{pythonexe}|' contrib/hg-ssh |
|
93 | sed -i -e '1s|#!/usr/bin/env python$|#!/usr/bin/env %{pythonexe}|' contrib/hg-ssh | |
94 |
|
94 | |||
95 | %install |
|
95 | %install | |
96 | rm -rf $RPM_BUILD_ROOT |
|
96 | rm -rf $RPM_BUILD_ROOT | |
97 |
|
97 | |||
98 | export HGPYTHON3=1 |
|
98 | export HGPYTHON3=1 | |
99 |
|
99 | |||
100 | %if "%{?withpython}" |
|
100 | %if "%{?withpython}" | |
101 |
|
101 | |||
102 | PYPATH=$PWD/%{pythonname} |
|
102 | PYPATH=$PWD/%{pythonname} | |
103 | cd $PYPATH |
|
103 | cd $PYPATH | |
104 | make install DESTDIR=$RPM_BUILD_ROOT |
|
104 | make install DESTDIR=$RPM_BUILD_ROOT | |
105 | # these .a are not necessary and they are readonly and strip fails - kill them! |
|
105 | # these .a are not necessary and they are readonly and strip fails - kill them! | |
106 | rm -f %{buildroot}%{hgpyprefix}/lib/{,python2.*/config}/libpython2.*.a |
|
106 | rm -f %{buildroot}%{hgpyprefix}/lib/{,python2.*/config}/libpython2.*.a | |
107 | cd - |
|
107 | cd - | |
108 |
|
108 | |||
109 | cd %{docutilsname} |
|
109 | cd %{docutilsname} | |
110 | LD_LIBRARY_PATH=$PYPATH $PYPATH/python setup.py install --root="$RPM_BUILD_ROOT" |
|
110 | LD_LIBRARY_PATH=$PYPATH $PYPATH/python setup.py install --root="$RPM_BUILD_ROOT" | |
111 | cd - |
|
111 | cd - | |
112 |
|
112 | |||
113 |
PATH=$PYPATH:$PATH LD_LIBRARY_PATH=$PYPATH make install PYTHON=%{pythonexe} DESTDIR=$RPM_BUILD_ROOT PREFIX=%{hgpyprefix} MANDIR=%{_mandir} |
|
113 | PATH=$PYPATH:$PATH LD_LIBRARY_PATH=$PYPATH make install PYTHON=%{pythonexe} DESTDIR=$RPM_BUILD_ROOT PREFIX=%{hgpyprefix} MANDIR=%{_mandir} | |
114 | mkdir -p $RPM_BUILD_ROOT%{_bindir} |
|
114 | mkdir -p $RPM_BUILD_ROOT%{_bindir} | |
115 | ( cd $RPM_BUILD_ROOT%{_bindir}/ && ln -s ../..%{hgpyprefix}/bin/hg . ) |
|
115 | ( cd $RPM_BUILD_ROOT%{_bindir}/ && ln -s ../..%{hgpyprefix}/bin/hg . ) | |
116 | ( cd $RPM_BUILD_ROOT%{_bindir}/ && ln -s ../..%{hgpyprefix}/bin/python2.? %{pythonhg} ) |
|
116 | ( cd $RPM_BUILD_ROOT%{_bindir}/ && ln -s ../..%{hgpyprefix}/bin/python2.? %{pythonhg} ) | |
117 |
|
117 | |||
118 | %else |
|
118 | %else | |
119 |
|
119 | |||
120 |
make install PYTHON=%{pythonexe} DESTDIR=$RPM_BUILD_ROOT PREFIX=%{_prefix} MANDIR=%{_mandir} |
|
120 | make install PYTHON=%{pythonexe} DESTDIR=$RPM_BUILD_ROOT PREFIX=%{_prefix} MANDIR=%{_mandir} | |
121 |
|
121 | |||
122 | %endif |
|
122 | %endif | |
123 |
|
123 | |||
124 | install -m 755 contrib/chg/chg $RPM_BUILD_ROOT%{_bindir}/ |
|
124 | install -m 755 contrib/chg/chg $RPM_BUILD_ROOT%{_bindir}/ | |
125 | install -m 755 contrib/hgk $RPM_BUILD_ROOT%{_bindir}/ |
|
125 | install -m 755 contrib/hgk $RPM_BUILD_ROOT%{_bindir}/ | |
126 | install -m 755 contrib/hg-ssh $RPM_BUILD_ROOT%{_bindir}/ |
|
126 | install -m 755 contrib/hg-ssh $RPM_BUILD_ROOT%{_bindir}/ | |
127 |
|
127 | |||
128 | bash_completion_dir=$RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d |
|
128 | bash_completion_dir=$RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d | |
129 | mkdir -p $bash_completion_dir |
|
129 | mkdir -p $bash_completion_dir | |
130 | install -m 644 contrib/bash_completion $bash_completion_dir/mercurial.sh |
|
130 | install -m 644 contrib/bash_completion $bash_completion_dir/mercurial.sh | |
131 |
|
131 | |||
132 | zsh_completion_dir=$RPM_BUILD_ROOT%{_datadir}/zsh/site-functions |
|
132 | zsh_completion_dir=$RPM_BUILD_ROOT%{_datadir}/zsh/site-functions | |
133 | mkdir -p $zsh_completion_dir |
|
133 | mkdir -p $zsh_completion_dir | |
134 | install -m 644 contrib/zsh_completion $zsh_completion_dir/_mercurial |
|
134 | install -m 644 contrib/zsh_completion $zsh_completion_dir/_mercurial | |
135 |
|
135 | |||
136 | mkdir -p $RPM_BUILD_ROOT%{emacs_lispdir} |
|
136 | mkdir -p $RPM_BUILD_ROOT%{emacs_lispdir} | |
137 | install -m 644 contrib/mercurial.el $RPM_BUILD_ROOT%{emacs_lispdir}/ |
|
137 | install -m 644 contrib/mercurial.el $RPM_BUILD_ROOT%{emacs_lispdir}/ | |
138 | install -m 644 contrib/mq.el $RPM_BUILD_ROOT%{emacs_lispdir}/ |
|
138 | install -m 644 contrib/mq.el $RPM_BUILD_ROOT%{emacs_lispdir}/ | |
139 |
|
139 | |||
140 | mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/mercurial/hgrc.d |
|
140 | mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/mercurial/hgrc.d | |
141 |
|
141 | |||
142 | %clean |
|
142 | %clean | |
143 | rm -rf $RPM_BUILD_ROOT |
|
143 | rm -rf $RPM_BUILD_ROOT | |
144 |
|
144 | |||
145 | %files |
|
145 | %files | |
146 | %defattr(-,root,root,-) |
|
146 | %defattr(-,root,root,-) | |
147 | %doc CONTRIBUTORS COPYING doc/README doc/hg*.txt doc/hg*.html *.cgi contrib/*.fcgi contrib/*.wsgi |
|
147 | %doc CONTRIBUTORS COPYING doc/README doc/hg*.txt doc/hg*.html *.cgi contrib/*.fcgi contrib/*.wsgi | |
148 | %doc %attr(644,root,root) %{_mandir}/man?/hg* |
|
148 | %doc %attr(644,root,root) %{_mandir}/man?/hg* | |
149 | %doc %attr(644,root,root) contrib/*.svg |
|
149 | %doc %attr(644,root,root) contrib/*.svg | |
150 | %dir %{_datadir}/zsh/ |
|
150 | %dir %{_datadir}/zsh/ | |
151 | %dir %{_datadir}/zsh/site-functions/ |
|
151 | %dir %{_datadir}/zsh/site-functions/ | |
152 | %{_datadir}/zsh/site-functions/_mercurial |
|
152 | %{_datadir}/zsh/site-functions/_mercurial | |
153 | %dir %{_datadir}/emacs/site-lisp/ |
|
153 | %dir %{_datadir}/emacs/site-lisp/ | |
154 | %{_datadir}/emacs/site-lisp/mercurial.el |
|
154 | %{_datadir}/emacs/site-lisp/mercurial.el | |
155 | %{_datadir}/emacs/site-lisp/mq.el |
|
155 | %{_datadir}/emacs/site-lisp/mq.el | |
156 | %{_bindir}/hg |
|
156 | %{_bindir}/hg | |
157 | %{_bindir}/chg |
|
157 | %{_bindir}/chg | |
158 | %{_bindir}/hgk |
|
158 | %{_bindir}/hgk | |
159 | %{_bindir}/hg-ssh |
|
159 | %{_bindir}/hg-ssh | |
160 | %dir %{_sysconfdir}/bash_completion.d/ |
|
160 | %dir %{_sysconfdir}/bash_completion.d/ | |
161 | %config(noreplace) %{_sysconfdir}/bash_completion.d/mercurial.sh |
|
161 | %config(noreplace) %{_sysconfdir}/bash_completion.d/mercurial.sh | |
162 | %dir %{_sysconfdir}/mercurial |
|
162 | %dir %{_sysconfdir}/mercurial | |
163 | %dir %{_sysconfdir}/mercurial/hgrc.d |
|
163 | %dir %{_sysconfdir}/mercurial/hgrc.d | |
164 | %if "%{?withpython}" |
|
164 | %if "%{?withpython}" | |
165 | %{_bindir}/%{pythonhg} |
|
165 | %{_bindir}/%{pythonhg} | |
166 | %{hgpyprefix} |
|
166 | %{hgpyprefix} | |
167 | %else |
|
167 | %else | |
168 | %{_libdir}/python%{pythonver}/site-packages/%{name}-*-py%{pythonver}.egg-info |
|
168 | %{_libdir}/python%{pythonver}/site-packages/%{name}-*-py%{pythonver}.egg-info | |
169 | %{_libdir}/python%{pythonver}/site-packages/%{name} |
|
169 | %{_libdir}/python%{pythonver}/site-packages/%{name} | |
170 | %{_libdir}/python%{pythonver}/site-packages/hgext |
|
170 | %{_libdir}/python%{pythonver}/site-packages/hgext | |
171 | %{_libdir}/python%{pythonver}/site-packages/hgext3rd |
|
171 | %{_libdir}/python%{pythonver}/site-packages/hgext3rd | |
172 | %{_libdir}/python%{pythonver}/site-packages/hgdemandimport |
|
172 | %{_libdir}/python%{pythonver}/site-packages/hgdemandimport | |
173 | %endif |
|
173 | %endif |
General Comments 0
You need to be logged in to leave comments.
Login now