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

Last change on this file since 41 was 41, checked in by Yuri Dario, 15 years ago

spec: mercurial build updates.

  • Property svn:eol-style set to native
File size: 5.4 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: 1.6.3
6Release: 1
7License: GPLv2+
8Group: Development/Tools
9URL: http://www.selenic.com/mercurial/
10Source0: http://www.selenic.com/mercurial/release/%{name}-%{version}.tar.gz
11Source1: mercurial-os2.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) = 2.6
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# 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
69Summary: Hgk interface for mercurial
70Group: Development/Tools
71Requires: hg = %{version}-%{release}, tk
72
73
74%description hgk
75A Mercurial extension for displaying the change history graphically
76using Tcl/Tk. Displays branches and merges in an easily
77understandable way and shows diffs for each revision. Based on
78gitk for the git SCM.
79
80Adds the "hg view" command. See
81http://www.selenic.com/mercurial/wiki/index.cgi/UsingHgk for more
82documentation.
83
84%prep
85%setup -q -a 1
86%patch0 -p1 -b .os2~
87
88%build
89make all
90
91%install
92rm -rf $RPM_BUILD_ROOT
93%{__python} setup.py install -O1 --root $RPM_BUILD_ROOT --prefix %{_prefix} --record=%{name}.files
94make install-doc 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
138cp hg.exe $RPM_BUILD_ROOT/%{_bindir}
139
140
141%clean
142rm -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
Note: See TracBrowser for help on using the repository browser.