| 1 | %{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} | 
|---|
| 2 |  | 
|---|
| 3 | Summary: A fast, lightweight distributed source control management system | 
|---|
| 4 | Name: mercurial | 
|---|
| 5 | Version: 2.5.2 | 
|---|
| 6 | Release: 1%{?dist} | 
|---|
| 7 | License: GPLv2+ | 
|---|
| 8 | Group: Development/Tools | 
|---|
| 9 | URL: http://www.selenic.com/mercurial/ | 
|---|
| 10 | Source0: http://www.selenic.com/mercurial/release/%{name}-%{version}.tar.gz | 
|---|
| 11 | Source1: python-wrapper.zip | 
|---|
| 12 |  | 
|---|
| 13 | Patch0: mercurial-os2.diff | 
|---|
| 14 |  | 
|---|
| 15 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root | 
|---|
| 16 | BuildRequires: python python-devel | 
|---|
| 17 | #BuildRequires: emacs emacs-el pkgconfig | 
|---|
| 18 | BuildRequires: pkgconfig | 
|---|
| 19 | Provides: hg = %{version}-%{release} | 
|---|
| 20 |  | 
|---|
| 21 | Requires: python | 
|---|
| 22 | Requires: python(abi) = %{python_version} | 
|---|
| 23 |  | 
|---|
| 24 | %description | 
|---|
| 25 | Mercurial is a fast, lightweight source control management system designed | 
|---|
| 26 | for efficient handling of very large distributed projects. | 
|---|
| 27 |  | 
|---|
| 28 | Quick start: http://www.selenic.com/mercurial/wiki/index.cgi/QuickStart | 
|---|
| 29 | Tutorial: http://www.selenic.com/mercurial/wiki/index.cgi/Tutorial | 
|---|
| 30 | Extensions: http://www.selenic.com/mercurial/wiki/index.cgi/CategoryExtension | 
|---|
| 31 |  | 
|---|
| 32 | %define pkg mercurial | 
|---|
| 33 |  | 
|---|
| 34 | #%package -n emacs-%{pkg} | 
|---|
| 35 | #Summary:       Mercurial version control system support for Emacs | 
|---|
| 36 | #Group:         Applications/Editors | 
|---|
| 37 | #Requires:      hg = %{version}-%{release}, emacs-common | 
|---|
| 38 | #Requires:       emacs(bin) >= %{emacs_version} | 
|---|
| 39 | #Obsoletes:     %{pkg}-emacs | 
|---|
| 40 |  | 
|---|
| 41 | #%description -n emacs-%{pkg} | 
|---|
| 42 | #Contains byte compiled elisp packages for %{pkg}. | 
|---|
| 43 | #To get started: start emacs, load hg-mode with M-x hg-mode, and show | 
|---|
| 44 | #help with C-c h h | 
|---|
| 45 |  | 
|---|
| 46 | #%package -n emacs-%{pkg}-el | 
|---|
| 47 | #Summary:        Elisp source files for %{pkg} under GNU Emacs | 
|---|
| 48 | #Group:          Applications/Editors | 
|---|
| 49 | #Requires:       emacs-%{pkg} = %{version}-%{release} | 
|---|
| 50 |  | 
|---|
| 51 | #%description -n emacs-%{pkg}-el | 
|---|
| 52 | #This package contains the elisp source files for %{pkg} under GNU Emacs. You | 
|---|
| 53 | #do not need to install this package to run %{pkg}. Install the emacs-%{pkg} | 
|---|
| 54 | #package to use %{pkg} with GNU Emacs. | 
|---|
| 55 |  | 
|---|
| 56 | %package hgk | 
|---|
| 57 | Summary:        Hgk interface for mercurial | 
|---|
| 58 | Group:          Development/Tools | 
|---|
| 59 | Requires:       hg = %{version}-%{release}, tk | 
|---|
| 60 |  | 
|---|
| 61 |  | 
|---|
| 62 | %description hgk | 
|---|
| 63 | A Mercurial extension for displaying the change history graphically | 
|---|
| 64 | using Tcl/Tk.  Displays branches and merges in an easily | 
|---|
| 65 | understandable way and shows diffs for each revision.  Based on | 
|---|
| 66 | gitk for the git SCM. | 
|---|
| 67 |  | 
|---|
| 68 | Adds the "hg view" command.  See | 
|---|
| 69 | http://www.selenic.com/mercurial/wiki/index.cgi/UsingHgk for more | 
|---|
| 70 | documentation. | 
|---|
| 71 |  | 
|---|
| 72 | %package debug | 
|---|
| 73 | Summary: HLL debug data for exception handling support. | 
|---|
| 74 |  | 
|---|
| 75 | %description debug | 
|---|
| 76 | HLL debug data for exception handling support. | 
|---|
| 77 |  | 
|---|
| 78 | %prep | 
|---|
| 79 | %setup -q -a 1 | 
|---|
| 80 | %patch0 -p1 | 
|---|
| 81 |  | 
|---|
| 82 | %build | 
|---|
| 83 | export SHELL="/@unixroot/usr/bin/sh.exe" | 
|---|
| 84 | export EMXSHELL="cmd.exe" | 
|---|
| 85 | # Building docs is broken due to missing python-docutils package, skip this step | 
|---|
| 86 | #make SHELL=sh all | 
|---|
| 87 | make build | 
|---|
| 88 |  | 
|---|
| 89 | %install | 
|---|
| 90 | export EMXSHELL="cmd.exe" | 
|---|
| 91 | rm -rf $RPM_BUILD_ROOT | 
|---|
| 92 | %{__python} setup.py install -O1 --root $RPM_BUILD_ROOT --prefix %{_prefix} --record=%{name}.files | 
|---|
| 93 | # As we can't build docs (see above) disable it for now (only affects man) | 
|---|
| 94 | #make install-doc SHELL=sh DESTDIR=$RPM_BUILD_ROOT MANDIR=%{_mandir} | 
|---|
| 95 |  | 
|---|
| 96 | grep -v 'hgk.py*' < %{name}.files > %{name}-base.files | 
|---|
| 97 | grep 'hgk.py*' < %{name}.files > %{name}-hgk.files | 
|---|
| 98 |  | 
|---|
| 99 | #install -D contrib/hgk       $RPM_BUILD_ROOT%{_libexecdir}/mercurial/hgk | 
|---|
| 100 | install contrib/hg-ssh       $RPM_BUILD_ROOT%{_bindir} | 
|---|
| 101 |  | 
|---|
| 102 | bash_completion_dir=$RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d | 
|---|
| 103 | mkdir -p $bash_completion_dir | 
|---|
| 104 | install -m 644 contrib/bash_completion $bash_completion_dir/mercurial.sh | 
|---|
| 105 |  | 
|---|
| 106 | zsh_completion_dir=$RPM_BUILD_ROOT%{_datadir}/zsh/site-functions | 
|---|
| 107 | mkdir -p $zsh_completion_dir | 
|---|
| 108 | install -m 644 contrib/zsh_completion $zsh_completion_dir/_mercurial | 
|---|
| 109 |  | 
|---|
| 110 | #mkdir -p $RPM_BUILD_ROOT%{emacs_lispdir} | 
|---|
| 111 |  | 
|---|
| 112 | #pushd contrib | 
|---|
| 113 | #for file in mercurial.el mq.el; do | 
|---|
| 114 | #  emacs -batch -l mercurial.el --no-site-file -f batch-byte-compile $file | 
|---|
| 115 | #  install -p -m 644 $file ${file}c $RPM_BUILD_ROOT%{emacs_lispdir} | 
|---|
| 116 | #  rm ${file}c | 
|---|
| 117 | #done | 
|---|
| 118 | #popd | 
|---|
| 119 |  | 
|---|
| 120 |  | 
|---|
| 121 |  | 
|---|
| 122 | mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/mercurial/hgrc.d | 
|---|
| 123 |  | 
|---|
| 124 | #mkdir -p $RPM_BUILD_ROOT%{emacs_startdir} && install -m644 %SOURCE1 $RPM_BUILD_ROOT%{emacs_startdir} | 
|---|
| 125 |  | 
|---|
| 126 | #cat >hgk.rc <<EOF | 
|---|
| 127 | #[extensions] | 
|---|
| 128 | ## enable hgk extension ('hg help' shows 'view' as a command) | 
|---|
| 129 | #hgk= | 
|---|
| 130 | # | 
|---|
| 131 | #[hgk] | 
|---|
| 132 | #path=%{_libexecdir}/mercurial/hgk | 
|---|
| 133 | #EOF | 
|---|
| 134 | #install hgk.rc $RPM_BUILD_ROOT/%{_sysconfdir}/mercurial/hgrc.d | 
|---|
| 135 |  | 
|---|
| 136 | install contrib/mergetools.hgrc $RPM_BUILD_ROOT%{_sysconfdir}/mercurial/hgrc.d/mergetools.rc | 
|---|
| 137 |  | 
|---|
| 138 | #build exe wrapper | 
|---|
| 139 | gcc -g -Zomf %optflags -DPYTHON_EXE=\"python%{python_version}.exe\" -o $RPM_BUILD_ROOT/%{_bindir}/hg.exe exec-py.c | 
|---|
| 140 |  | 
|---|
| 141 |  | 
|---|
| 142 | %clean | 
|---|
| 143 | rm -rf $RPM_BUILD_ROOT | 
|---|
| 144 |  | 
|---|
| 145 | %files | 
|---|
| 146 | # -f %{name}-base.files | 
|---|
| 147 | %defattr(-,root,root,-) | 
|---|
| 148 | %doc CONTRIBUTORS COPYING doc/README doc/hg*.txt doc/hg*.html *.cgi contrib/*.fcgi | 
|---|
| 149 | # As we can't build docs (see above) disable it for now (only affects man) | 
|---|
| 150 | #%doc %attr(644,root,root) %{_mandir}/man?/hg* | 
|---|
| 151 | %doc %attr(644,root,root) contrib/*.svg contrib/sample.hgrc | 
|---|
| 152 | %{_sysconfdir}/bash_completion.d/mercurial.sh | 
|---|
| 153 | %{_datadir}/zsh/site-functions/_mercurial | 
|---|
| 154 | %{_bindir}/hg | 
|---|
| 155 | %{_bindir}/hg.exe | 
|---|
| 156 | %{_bindir}/hg-ssh | 
|---|
| 157 | %{_libdir}/* | 
|---|
| 158 | %dir %{_sysconfdir}/bash_completion.d/ | 
|---|
| 159 | %dir %{_datadir}/zsh/site-functions/ | 
|---|
| 160 | %dir %{_sysconfdir}/mercurial | 
|---|
| 161 | %dir %{_sysconfdir}/mercurial/hgrc.d | 
|---|
| 162 | %config(noreplace) %{_sysconfdir}/mercurial/hgrc.d/mergetools.rc | 
|---|
| 163 | #%dir %{python_sitearch}/mercurial | 
|---|
| 164 | #%dir %{python_sitearch}/hgext | 
|---|
| 165 |  | 
|---|
| 166 | #%files -n emacs-%{pkg} | 
|---|
| 167 | #%{emacs_lispdir}/*.elc | 
|---|
| 168 | #%{emacs_startdir}/*.el | 
|---|
| 169 |  | 
|---|
| 170 | #%files -n emacs-%{pkg}-el | 
|---|
| 171 | #%{emacs_lispdir}/*.el | 
|---|
| 172 |  | 
|---|
| 173 | #%files hgk -f %{name}-hgk.files | 
|---|
| 174 | #%{_libexecdir}/mercurial/ | 
|---|
| 175 | #%{_sysconfdir}/mercurial/hgrc.d/hgk.rc | 
|---|
| 176 |  | 
|---|
| 177 | %files debug | 
|---|
| 178 | %defattr(-,root,root) | 
|---|
| 179 | %{_bindir}/*.dbg | 
|---|
| 180 |  | 
|---|
| 181 | ##%%check | 
|---|
| 182 | ##cd tests && %{__python} run-tests.py | 
|---|
| 183 |  | 
|---|
| 184 | %changelog | 
|---|
| 185 | * Wed Apr 09 2014 yd | 
|---|
| 186 | - build for python 2.7. | 
|---|
| 187 | - added debug package with symbolic info for exceptq. | 
|---|
| 188 |  | 
|---|
| 189 | * Sat Mar 30 2013 Dmitriy Kuminov <coding@dmik.org> - 2.5.2-1 | 
|---|
| 190 | - Update to version 2.5.2 from vendor. | 
|---|