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