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: 1.6.3
|
---|
6 | Release: 2%{?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 -b .os2~
|
---|
87 |
|
---|
88 | %build
|
---|
89 | make all
|
---|
90 |
|
---|
91 | %install
|
---|
92 | rm -rf $RPM_BUILD_ROOT
|
---|
93 | %{__python} setup.py install -O1 --root $RPM_BUILD_ROOT --prefix %{_prefix} --record=%{name}.files
|
---|
94 | make install-doc 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 | cp hg.exe $RPM_BUILD_ROOT/%{_bindir}
|
---|
139 |
|
---|
140 |
|
---|
141 | %clean
|
---|
142 | rm -rf $RPM_BUILD_ROOT
|
---|
143 |
|
---|
144 | %files
|
---|
145 | # -f %{name}-base.files
|
---|
146 | %defattr(-,root,root,-)
|
---|
147 | %doc CONTRIBUTORS COPYING doc/README doc/hg*.txt doc/hg*.html *.cgi contrib/*.fcgi
|
---|
148 | %doc %attr(644,root,root) %{_mandir}/man?/hg*
|
---|
149 | %doc %attr(644,root,root) contrib/*.svg contrib/sample.hgrc
|
---|
150 | %{_sysconfdir}/bash_completion.d/mercurial.sh
|
---|
151 | %{_datadir}/zsh/site-functions/_mercurial
|
---|
152 | %{_bindir}/hg
|
---|
153 | %{_bindir}/hg.exe
|
---|
154 | %{_bindir}/hg-ssh
|
---|
155 | %{_libdir}/*
|
---|
156 | %dir %{_sysconfdir}/bash_completion.d/
|
---|
157 | %dir %{_datadir}/zsh/site-functions/
|
---|
158 | %dir %{_sysconfdir}/mercurial
|
---|
159 | %dir %{_sysconfdir}/mercurial/hgrc.d
|
---|
160 | %config(noreplace) %{_sysconfdir}/mercurial/hgrc.d/mergetools.rc
|
---|
161 | #%dir %{python_sitearch}/mercurial
|
---|
162 | #%dir %{python_sitearch}/hgext
|
---|
163 |
|
---|
164 | #%files -n emacs-%{pkg}
|
---|
165 | #%{emacs_lispdir}/*.elc
|
---|
166 | #%{emacs_startdir}/*.el
|
---|
167 |
|
---|
168 | #%files -n emacs-%{pkg}-el
|
---|
169 | #%{emacs_lispdir}/*.el
|
---|
170 |
|
---|
171 | #%files hgk -f %{name}-hgk.files
|
---|
172 | #%{_libexecdir}/mercurial/
|
---|
173 | #%{_sysconfdir}/mercurial/hgrc.d/hgk.rc
|
---|
174 |
|
---|
175 | ##%%check
|
---|
176 | ##cd tests && %{__python} run-tests.py
|
---|
177 |
|
---|
178 | %changelog
|
---|