| 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: mercurial-os2.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) = 2.6 | 
|---|
| 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 | # If the emacs-el package has installed a pkgconfig file, use that to determine | 
|---|
| 35 | # install locations and Emacs version at build time, otherwise set defaults. | 
|---|
| 36 | #if ($(pkgconfig emacs) ; echo $?) | 
|---|
| 37 | #define emacs_version 22.1 | 
|---|
| 38 | #define emacs_lispdir %{_datadir}/emacs/site-lisp | 
|---|
| 39 | #define emacs_startdir %{_datadir}/emacs/site-lisp/site-start.d | 
|---|
| 40 | #else | 
|---|
| 41 | #define emacs_version %{expand:%(pkg-config emacs --modversion)} | 
|---|
| 42 | #define emacs_lispdir %{expand:%(pkg-config emacs --variable sitepkglispdir)} | 
|---|
| 43 | #define emacs_startdir %{expand:%(pkg-config emacs --variable sitestartdir)} | 
|---|
| 44 | #endif | 
|---|
| 45 |  | 
|---|
| 46 | #%package -n emacs-%{pkg} | 
|---|
| 47 | #Summary:       Mercurial version control system support for Emacs | 
|---|
| 48 | #Group:         Applications/Editors | 
|---|
| 49 | #Requires:      hg = %{version}-%{release}, emacs-common | 
|---|
| 50 | #Requires:       emacs(bin) >= %{emacs_version} | 
|---|
| 51 | #Obsoletes:     %{pkg}-emacs | 
|---|
| 52 |  | 
|---|
| 53 | #%description -n emacs-%{pkg} | 
|---|
| 54 | #Contains byte compiled elisp packages for %{pkg}. | 
|---|
| 55 | #To get started: start emacs, load hg-mode with M-x hg-mode, and show | 
|---|
| 56 | #help with C-c h h | 
|---|
| 57 |  | 
|---|
| 58 | #%package -n emacs-%{pkg}-el | 
|---|
| 59 | #Summary:        Elisp source files for %{pkg} under GNU Emacs | 
|---|
| 60 | #Group:          Applications/Editors | 
|---|
| 61 | #Requires:       emacs-%{pkg} = %{version}-%{release} | 
|---|
| 62 |  | 
|---|
| 63 | #%description -n emacs-%{pkg}-el | 
|---|
| 64 | #This package contains the elisp source files for %{pkg} under GNU Emacs. You | 
|---|
| 65 | #do not need to install this package to run %{pkg}. Install the emacs-%{pkg} | 
|---|
| 66 | #package to use %{pkg} with GNU Emacs. | 
|---|
| 67 |  | 
|---|
| 68 | %package hgk | 
|---|
| 69 | Summary:        Hgk interface for mercurial | 
|---|
| 70 | Group:          Development/Tools | 
|---|
| 71 | Requires:       hg = %{version}-%{release}, tk | 
|---|
| 72 |  | 
|---|
| 73 |  | 
|---|
| 74 | %description hgk | 
|---|
| 75 | A Mercurial extension for displaying the change history graphically | 
|---|
| 76 | using Tcl/Tk.  Displays branches and merges in an easily | 
|---|
| 77 | understandable way and shows diffs for each revision.  Based on | 
|---|
| 78 | gitk for the git SCM. | 
|---|
| 79 |  | 
|---|
| 80 | Adds the "hg view" command.  See | 
|---|
| 81 | http://www.selenic.com/mercurial/wiki/index.cgi/UsingHgk for more | 
|---|
| 82 | documentation. | 
|---|
| 83 |  | 
|---|
| 84 | %prep | 
|---|
| 85 | %setup -q -a 1 | 
|---|
| 86 | %patch0 -p1 | 
|---|
| 87 |  | 
|---|
| 88 | %build | 
|---|
| 89 | # Building docs is broken due to missing python-docutils package, skip this step | 
|---|
| 90 | #make SHELL=sh all | 
|---|
| 91 | make SHELL=sh build | 
|---|
| 92 |  | 
|---|
| 93 | %install | 
|---|
| 94 | rm -rf $RPM_BUILD_ROOT | 
|---|
| 95 | %{__python} setup.py install -O1 --root $RPM_BUILD_ROOT --prefix %{_prefix} --record=%{name}.files | 
|---|
| 96 | # As we can't build docs (see above) disable it for now (only affects man) | 
|---|
| 97 | #make install-doc SHELL=sh DESTDIR=$RPM_BUILD_ROOT MANDIR=%{_mandir} | 
|---|
| 98 |  | 
|---|
| 99 | grep -v 'hgk.py*' < %{name}.files > %{name}-base.files | 
|---|
| 100 | grep 'hgk.py*' < %{name}.files > %{name}-hgk.files | 
|---|
| 101 |  | 
|---|
| 102 | #install -D contrib/hgk       $RPM_BUILD_ROOT%{_libexecdir}/mercurial/hgk | 
|---|
| 103 | install contrib/hg-ssh       $RPM_BUILD_ROOT%{_bindir} | 
|---|
| 104 |  | 
|---|
| 105 | bash_completion_dir=$RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d | 
|---|
| 106 | mkdir -p $bash_completion_dir | 
|---|
| 107 | install -m 644 contrib/bash_completion $bash_completion_dir/mercurial.sh | 
|---|
| 108 |  | 
|---|
| 109 | zsh_completion_dir=$RPM_BUILD_ROOT%{_datadir}/zsh/site-functions | 
|---|
| 110 | mkdir -p $zsh_completion_dir | 
|---|
| 111 | install -m 644 contrib/zsh_completion $zsh_completion_dir/_mercurial | 
|---|
| 112 |  | 
|---|
| 113 | #mkdir -p $RPM_BUILD_ROOT%{emacs_lispdir} | 
|---|
| 114 |  | 
|---|
| 115 | #pushd contrib | 
|---|
| 116 | #for file in mercurial.el mq.el; do | 
|---|
| 117 | #  emacs -batch -l mercurial.el --no-site-file -f batch-byte-compile $file | 
|---|
| 118 | #  install -p -m 644 $file ${file}c $RPM_BUILD_ROOT%{emacs_lispdir} | 
|---|
| 119 | #  rm ${file}c | 
|---|
| 120 | #done | 
|---|
| 121 | #popd | 
|---|
| 122 |  | 
|---|
| 123 |  | 
|---|
| 124 |  | 
|---|
| 125 | mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/mercurial/hgrc.d | 
|---|
| 126 |  | 
|---|
| 127 | #mkdir -p $RPM_BUILD_ROOT%{emacs_startdir} && install -m644 %SOURCE1 $RPM_BUILD_ROOT%{emacs_startdir} | 
|---|
| 128 |  | 
|---|
| 129 | #cat >hgk.rc <<EOF | 
|---|
| 130 | #[extensions] | 
|---|
| 131 | ## enable hgk extension ('hg help' shows 'view' as a command) | 
|---|
| 132 | #hgk= | 
|---|
| 133 | # | 
|---|
| 134 | #[hgk] | 
|---|
| 135 | #path=%{_libexecdir}/mercurial/hgk | 
|---|
| 136 | #EOF | 
|---|
| 137 | #install hgk.rc $RPM_BUILD_ROOT/%{_sysconfdir}/mercurial/hgrc.d | 
|---|
| 138 |  | 
|---|
| 139 | install contrib/mergetools.hgrc $RPM_BUILD_ROOT%{_sysconfdir}/mercurial/hgrc.d/mergetools.rc | 
|---|
| 140 |  | 
|---|
| 141 | cp hg.exe $RPM_BUILD_ROOT/%{_bindir} | 
|---|
| 142 |  | 
|---|
| 143 |  | 
|---|
| 144 | %clean | 
|---|
| 145 | rm -rf $RPM_BUILD_ROOT | 
|---|
| 146 |  | 
|---|
| 147 | %files | 
|---|
| 148 | # -f %{name}-base.files | 
|---|
| 149 | %defattr(-,root,root,-) | 
|---|
| 150 | %doc CONTRIBUTORS COPYING doc/README doc/hg*.txt doc/hg*.html *.cgi contrib/*.fcgi | 
|---|
| 151 | # As we can't build docs (see above) disable it for now (only affects man) | 
|---|
| 152 | #%doc %attr(644,root,root) %{_mandir}/man?/hg* | 
|---|
| 153 | %doc %attr(644,root,root) contrib/*.svg contrib/sample.hgrc | 
|---|
| 154 | %{_sysconfdir}/bash_completion.d/mercurial.sh | 
|---|
| 155 | %{_datadir}/zsh/site-functions/_mercurial | 
|---|
| 156 | %{_bindir}/hg | 
|---|
| 157 | %{_bindir}/hg.exe | 
|---|
| 158 | %{_bindir}/hg-ssh | 
|---|
| 159 | %{_libdir}/* | 
|---|
| 160 | %dir %{_sysconfdir}/bash_completion.d/ | 
|---|
| 161 | %dir %{_datadir}/zsh/site-functions/ | 
|---|
| 162 | %dir %{_sysconfdir}/mercurial | 
|---|
| 163 | %dir %{_sysconfdir}/mercurial/hgrc.d | 
|---|
| 164 | %config(noreplace) %{_sysconfdir}/mercurial/hgrc.d/mergetools.rc | 
|---|
| 165 | #%dir %{python_sitearch}/mercurial | 
|---|
| 166 | #%dir %{python_sitearch}/hgext | 
|---|
| 167 |  | 
|---|
| 168 | #%files -n emacs-%{pkg} | 
|---|
| 169 | #%{emacs_lispdir}/*.elc | 
|---|
| 170 | #%{emacs_startdir}/*.el | 
|---|
| 171 |  | 
|---|
| 172 | #%files -n emacs-%{pkg}-el | 
|---|
| 173 | #%{emacs_lispdir}/*.el | 
|---|
| 174 |  | 
|---|
| 175 | #%files hgk -f %{name}-hgk.files | 
|---|
| 176 | #%{_libexecdir}/mercurial/ | 
|---|
| 177 | #%{_sysconfdir}/mercurial/hgrc.d/hgk.rc | 
|---|
| 178 |  | 
|---|
| 179 | ##%%check | 
|---|
| 180 | ##cd tests && %{__python} run-tests.py | 
|---|
| 181 |  | 
|---|
| 182 | %changelog | 
|---|
| 183 |  | 
|---|
| 184 | * Sat Mar 30 2013 Dmitriy Kuminov <coding@dmik.org> - 2.5.2-1 | 
|---|
| 185 | - Update to version 2.5.2 from vendor. | 
|---|