mercurial.spec
161 lines
| 4.5 KiB
| text/x-rpm-spec
|
RPMSpecLexer
/ contrib / mercurial.spec
Mads Kiilerich
|
r21639 | %global emacs_lispdir %{_datadir}/emacs/site-lisp | ||
Mads Kiilerich
|
r22436 | |||
%define withpython %{nil} | ||||
%if "%{?withpython}" | ||||
%global pythonver %{withpython} | ||||
%global pythonname Python-%{withpython} | ||||
Mads Kiilerich
|
r23140 | %global docutilsname docutils-0.12 | ||
Mads Kiilerich
|
r23141 | %global docutilsmd5 4622263b62c5c771c03502afa3157768 | ||
Mads Kiilerich
|
r22436 | %global pythonhg python-hg | ||
Mads Kiilerich
|
r24729 | %global hgpyprefix /opt/%{pythonhg} | ||
Mads Kiilerich
|
r22436 | # byte compilation will fail on some some Python /test/ files | ||
%global _python_bytecompile_errors_terminate_build 0 | ||||
%else | ||||
Mads Kiilerich
|
r21639 | %global pythonver %(python -c 'import sys;print ".".join(map(str, sys.version_info[:2]))') | ||
Mads Kiilerich
|
r22436 | %endif | ||
Mads Kiilerich
|
r12056 | Summary: A fast, lightweight Source Control Management system | ||
mpm@selenic.com
|
r459 | Name: mercurial | ||
Matt Mackall
|
r3863 | Version: snapshot | ||
Thomas Arendsen Hein
|
r1891 | Release: 0 | ||
Matt Mackall
|
r10263 | License: GPLv2+ | ||
mpm@selenic.com
|
r459 | Group: Development/Tools | ||
Mads Kiilerich
|
r8942 | URL: http://mercurial.selenic.com/ | ||
Mads Kiilerich
|
r21641 | Source0: %{name}-%{version}-%{release}.tar.gz | ||
Mads Kiilerich
|
r22436 | %if "%{?withpython}" | ||
Source1: %{pythonname}.tgz | ||||
Source2: %{docutilsname}.tar.gz | ||||
%endif | ||||
Mads Kiilerich
|
r7424 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root | ||
mpm@selenic.com
|
r459 | |||
Mads Kiilerich
|
r22436 | BuildRequires: make, gcc, gettext | ||
%if "%{?withpython}" | ||||
BuildRequires: readline-devel, openssl-devel, ncurses-devel, zlib-devel, bzip2-devel | ||||
%else | ||||
Pierre-Yves David
|
r25008 | BuildRequires: python >= 2.6, python-devel, python-docutils >= 0.5 | ||
Requires: python >= 2.6 | ||||
Mads Kiilerich
|
r22436 | %endif | ||
Mads Kiilerich
|
r10255 | # The hgk extension uses the wish tcl interpreter, but we don't enforce it | ||
#Requires: tk | ||||
julian@lava.net
|
r4751 | |||
mpm@selenic.com
|
r459 | %description | ||
Mercurial is a fast, lightweight source control management system designed | ||||
for efficient handling of very large distributed projects. | ||||
%prep | ||||
Mads Kiilerich
|
r22436 | |||
%if "%{?withpython}" | ||||
%setup -q -n mercurial-%{version}-%{release} -a1 -a2 | ||||
# despite the comments in cgi.py, we do this to prevent rpmdeps from picking /usr/local/bin/python up | ||||
sed -i '1c#! /usr/bin/env python' %{pythonname}/Lib/cgi.py | ||||
%else | ||||
Mads Kiilerich
|
r21641 | %setup -q -n mercurial-%{version}-%{release} | ||
Mads Kiilerich
|
r22436 | %endif | ||
mpm@selenic.com
|
r459 | |||
%build | ||||
Mads Kiilerich
|
r22436 | |||
%if "%{?withpython}" | ||||
PYPATH=$PWD/%{pythonname} | ||||
cd $PYPATH | ||||
./configure --prefix=%{hgpyprefix} | ||||
make all %{?_smp_mflags} | ||||
cd - | ||||
cd %{docutilsname} | ||||
LD_LIBRARY_PATH=$PYPATH $PYPATH/python setup.py build | ||||
cd - | ||||
# verify Python environment | ||||
LD_LIBRARY_PATH=$PYPATH PYTHONPATH=$PWD/%{docutilsname} $PYPATH/python -c 'import sys, zlib, bz2, ssl, curses, readline' | ||||
# set environment for make | ||||
export PATH=$PYPATH:$PATH | ||||
export LD_LIBRARY_PATH=$PYPATH | ||||
export CFLAGS="-L $PYPATH" | ||||
export PYTHONPATH=$PWD/%{docutilsname} | ||||
%endif | ||||
Adam Spiers
|
r4753 | make all | ||
mpm@selenic.com
|
r459 | |||
%install | ||||
Mads Kiilerich
|
r7424 | rm -rf $RPM_BUILD_ROOT | ||
Mads Kiilerich
|
r22436 | |||
%if "%{?withpython}" | ||||
PYPATH=$PWD/%{pythonname} | ||||
cd $PYPATH | ||||
make install DESTDIR=$RPM_BUILD_ROOT | ||||
# these .a are not necessary and they are readonly and strip fails - kill them! | ||||
rm -f %{buildroot}%{hgpyprefix}/lib/{,python2.*/config}/libpython2.*.a | ||||
cd - | ||||
cd %{docutilsname} | ||||
LD_LIBRARY_PATH=$PYPATH $PYPATH/python setup.py install --root="$RPM_BUILD_ROOT" | ||||
cd - | ||||
PATH=$PYPATH:$PATH LD_LIBRARY_PATH=$PYPATH make install DESTDIR=$RPM_BUILD_ROOT PREFIX=%{hgpyprefix} MANDIR=%{_mandir} | ||||
mkdir -p $RPM_BUILD_ROOT%{_bindir} | ||||
( cd $RPM_BUILD_ROOT%{_bindir}/ && ln -s ../..%{hgpyprefix}/bin/hg . ) | ||||
( cd $RPM_BUILD_ROOT%{_bindir}/ && ln -s ../..%{hgpyprefix}/bin/python2.? %{pythonhg} ) | ||||
%else | ||||
Mads Kiilerich
|
r11062 | make install DESTDIR=$RPM_BUILD_ROOT PREFIX=%{_prefix} MANDIR=%{_mandir} | ||
Adam Spiers
|
r4753 | |||
Mads Kiilerich
|
r22436 | %endif | ||
Mads Kiilerich
|
r21638 | install -m 755 contrib/hgk $RPM_BUILD_ROOT%{_bindir}/ | ||
install -m 755 contrib/hg-ssh $RPM_BUILD_ROOT%{_bindir}/ | ||||
Adam Spiers
|
r4752 | |||
bash_completion_dir=$RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d | ||||
mkdir -p $bash_completion_dir | ||||
Mads Kiilerich
|
r8942 | install -m 644 contrib/bash_completion $bash_completion_dir/mercurial.sh | ||
Adam Spiers
|
r4752 | |||
zsh_completion_dir=$RPM_BUILD_ROOT%{_datadir}/zsh/site-functions | ||||
mkdir -p $zsh_completion_dir | ||||
Mads Kiilerich
|
r8942 | install -m 644 contrib/zsh_completion $zsh_completion_dir/_mercurial | ||
Adam Spiers
|
r4752 | |||
Mads Kiilerich
|
r8942 | mkdir -p $RPM_BUILD_ROOT%{emacs_lispdir} | ||
Mads Kiilerich
|
r21638 | install -m 644 contrib/mercurial.el $RPM_BUILD_ROOT%{emacs_lispdir}/ | ||
install -m 644 contrib/mq.el $RPM_BUILD_ROOT%{emacs_lispdir}/ | ||||
Mads Kiilerich
|
r8942 | |||
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/mercurial/hgrc.d | ||||
mpm@selenic.com
|
r459 | |||
mpm@selenic.com
|
r563 | %clean | ||
rm -rf $RPM_BUILD_ROOT | ||||
mpm@selenic.com
|
r459 | |||
mpm@selenic.com
|
r563 | %files | ||
%defattr(-,root,root,-) | ||||
Greg Lindahl
|
r10664 | %doc CONTRIBUTORS COPYING doc/README doc/hg*.txt doc/hg*.html *.cgi contrib/*.fcgi | ||
Mads Kiilerich
|
r10255 | %doc %attr(644,root,root) %{_mandir}/man?/hg* | ||
Siddharth Agarwal
|
r22385 | %doc %attr(644,root,root) contrib/*.svg | ||
Mads Kiilerich
|
r12056 | %dir %{_datadir}/zsh/ | ||
%dir %{_datadir}/zsh/site-functions/ | ||||
Adam Spiers
|
r4752 | %{_datadir}/zsh/site-functions/_mercurial | ||
Mads Kiilerich
|
r12056 | %dir %{_datadir}/emacs/site-lisp/ | ||
Adam Spiers
|
r4752 | %{_datadir}/emacs/site-lisp/mercurial.el | ||
Mads Kiilerich
|
r10255 | %{_datadir}/emacs/site-lisp/mq.el | ||
Adam Spiers
|
r4752 | %{_bindir}/hg | ||
%{_bindir}/hgk | ||||
%{_bindir}/hg-ssh | ||||
Mads Kiilerich
|
r8942 | %dir %{_sysconfdir}/bash_completion.d/ | ||
Mads Kiilerich
|
r12056 | %config(noreplace) %{_sysconfdir}/bash_completion.d/mercurial.sh | ||
Mads Kiilerich
|
r8942 | %dir %{_sysconfdir}/mercurial | ||
%dir %{_sysconfdir}/mercurial/hgrc.d | ||||
Mads Kiilerich
|
r22436 | %if "%{?withpython}" | ||
%{_bindir}/%{pythonhg} | ||||
%{hgpyprefix} | ||||
%else | ||||
Mads Kiilerich
|
r8867 | %if "%{?pythonver}" != "2.4" | ||
%{_libdir}/python%{pythonver}/site-packages/%{name}-*-py%{pythonver}.egg-info | ||||
%endif | ||||
Mads Kiilerich
|
r8942 | %{_libdir}/python%{pythonver}/site-packages/%{name} | ||
%{_libdir}/python%{pythonver}/site-packages/hgext | ||||
Mads Kiilerich
|
r22436 | %endif | ||