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