source: spec/trunk/SPECS/mercurial.spec@ 1010

Last change on this file since 1010 was 411, checked in by Yuri Dario, 11 years ago

spec: updates to python macros.

  • Property svn:eol-style set to native
File size: 5.7 KB
Line 
1%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
2
3Summary: A fast, lightweight distributed source control management system
4Name: mercurial
5Version: 2.5.2
6Release: 1%{?dist}
7License: GPLv2+
8Group: Development/Tools
9URL: http://www.selenic.com/mercurial/
10Source0: http://www.selenic.com/mercurial/release/%{name}-%{version}.tar.gz
11Source1: python-wrapper.zip
12
13Patch0: mercurial-os2.diff
14
15BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
16BuildRequires: python python-devel
17#BuildRequires: emacs emacs-el pkgconfig
18BuildRequires: pkgconfig
19Provides: hg = %{version}-%{release}
20
21Requires: python
22Requires: python(abi) = %{python_version}
23
24%description
25Mercurial is a fast, lightweight source control management system designed
26for efficient handling of very large distributed projects.
27
28Quick start: http://www.selenic.com/mercurial/wiki/index.cgi/QuickStart
29Tutorial: http://www.selenic.com/mercurial/wiki/index.cgi/Tutorial
30Extensions: 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
57Summary: Hgk interface for mercurial
58Group: Development/Tools
59Requires: hg = %{version}-%{release}, tk
60
61
62%description hgk
63A Mercurial extension for displaying the change history graphically
64using Tcl/Tk. Displays branches and merges in an easily
65understandable way and shows diffs for each revision. Based on
66gitk for the git SCM.
67
68Adds the "hg view" command. See
69http://www.selenic.com/mercurial/wiki/index.cgi/UsingHgk for more
70documentation.
71
72%package debug
73Summary: HLL debug data for exception handling support.
74
75%description debug
76HLL debug data for exception handling support.
77
78%prep
79%setup -q -a 1
80%patch0 -p1
81
82%build
83export SHELL="/@unixroot/usr/bin/sh.exe"
84export EMXSHELL="cmd.exe"
85# Building docs is broken due to missing python-docutils package, skip this step
86#make SHELL=sh all
87make build
88
89%install
90export EMXSHELL="cmd.exe"
91rm -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
96grep -v 'hgk.py*' < %{name}.files > %{name}-base.files
97grep 'hgk.py*' < %{name}.files > %{name}-hgk.files
98
99#install -D contrib/hgk $RPM_BUILD_ROOT%{_libexecdir}/mercurial/hgk
100install contrib/hg-ssh $RPM_BUILD_ROOT%{_bindir}
101
102bash_completion_dir=$RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d
103mkdir -p $bash_completion_dir
104install -m 644 contrib/bash_completion $bash_completion_dir/mercurial.sh
105
106zsh_completion_dir=$RPM_BUILD_ROOT%{_datadir}/zsh/site-functions
107mkdir -p $zsh_completion_dir
108install -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
122mkdir -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
136install contrib/mergetools.hgrc $RPM_BUILD_ROOT%{_sysconfdir}/mercurial/hgrc.d/mergetools.rc
137
138#build exe wrapper
139gcc -g -Zomf %optflags -DPYTHON_EXE=\"python%{python_version}.exe\" -o $RPM_BUILD_ROOT/%{_bindir}/hg.exe exec-py.c
140
141
142%clean
143rm -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.
Note: See TracBrowser for help on using the repository browser.