c37475e86725d68e7e06cf14ac88fd6d4fe5b13c
[platform/upstream/git.git] / packaging / git.spec
1 %define gitexecdir %{_libexecdir}/git
2 %define _fwdefdir /etc/sysconfig/SuSEfirewall2.d/services
3
4 Name:           git
5 Version:        1.7.10.4
6 Release:        0
7 License:        GPL-2.0
8 Summary:        Fast, scalable, distributed revision control system
9 Url:            http://git-scm.com
10 Group:          Development/Tools/Version Control
11 Source:         %{name}-%{version}.tar.bz2
12 Source1:        apache2-gitweb.conf
13 Source2:        sysconfig.git-daemon
14 Source3:        git-daemon.init
15 Source4:        git.xinetd
16 Source5:        usr.share.git-web.gitweb.cgi
17 Source6:        susefirewall-git-daemon
18 Patch1:         git-nohardlink.diff
19 Patch2:         git-python-install-fix.diff
20 Patch3:         completion-wordbreaks.diff
21 # CVE-2011-2186, bnc#698456
22 Patch4:         git-prevent_xss-default.diff
23 BuildRequires:  curl
24 BuildRequires:  expat-devel
25 BuildRequires:  fdupes
26 BuildRequires:  gettext-tools
27 BuildRequires:  libcurl-devel
28 BuildRequires:  libopenssl-devel
29 BuildRequires:  perl-Error
30 BuildRequires:  python
31 Requires:       git-core = %{version}
32 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
33
34 %description
35 Git is a fast, scalable, distributed revision control system with an
36 unusually rich command set that provides both high-level operations and
37 full access to internals.
38
39 This package itself only provides the README of git but with the
40 packages it requires, it brings you a complete Git environment
41 including GTK and email interfaces and tools for importing source code
42 repositories from other revision control systems such as subversion,
43 CVS, and GNU arch.
44
45 %package core
46 Summary:        Core git tools
47 Group:          Development/Tools/Version Control
48 Requires:       less
49 Requires:       openssh
50 Requires:       perl-Error
51 Requires:       perl-base = %{perl_version}
52 Requires:       rsync
53
54 %description core
55 Git is a fast, scalable, distributed revision control system with an
56 unusually rich command set that provides both high-level operations and
57 full access to internals.
58
59 These are the core tools with minimal dependencies.
60
61 %package svn
62 Summary:        Git tools for importing Subversion repositories
63 Group:          Development/Tools/Version Control
64 Requires:       git-core = %{version}
65 Requires:       subversion
66 Requires:       subversion-perl
67
68 %description svn
69 Tools for importing Subversion repositories to the Git version control
70 system.
71
72 %package cvs
73 Summary:        Git tools for importing CVS repositories
74 Group:          Development/Tools/Version Control
75 Requires:       cvs
76 Requires:       cvsps
77 Requires:       git-core = %{version}
78 Requires:       perl-DBD-SQLite
79
80 %description cvs
81 Tools for importing CVS repositories to the Git version control system.
82
83 %package arch
84 Summary:        Git tools for importing Arch repositories
85 Group:          Development/Tools/Version Control
86 Requires:       git-core = %{version}
87 # Requires:       tla
88
89 %description arch
90 Tools for importing GNU Arch repositories to the GIT version control
91 system.
92
93 %package email
94 Summary:        Git tools for sending email
95 Group:          Development/Tools/Version Control
96 Requires:       git-core = %{version}
97 # For sending mails over secure SMTP:
98 Recommends:     perl-Authen-SASL
99 Recommends:     perl-Net-SMTP-SSL,
100
101 %description email
102 Email interface for the GIT version control system.
103
104 %package daemon
105 Summary:        Simple Server for Git Repositories
106 Group:          Development/Tools/Version Control
107 Requires(pre):  /usr/sbin/useradd
108 Requires:       git-core = %{version}
109
110 %description daemon
111 A really simple TCP git daemon. In the default configuration it allows
112 read only access to repositories in /srv/git/ that contain the
113 'git-daemon-export-ok' file.
114 %package -n gitk
115 Summary:        Git revision tree visualiser
116 Group:          Development/Tools/Version Control
117 Requires:       git-core = %{version}
118 Requires:       tk >= 8.4
119 Supplements:    packageand(git-core:tk)
120
121 %description -n gitk
122 Grapical tool for visualization of revision trees of projects
123 maintained in the Git version control system. It name gitk indicates
124 that it's written using the Tk Widget set.
125
126 A simple Tk based graphical interface for common Git operations is
127 found in the package git-gui.
128
129 %package gui
130 Summary:        Grapical tool for common git operations
131 Group:          Development/Tools/Version Control
132 Requires:       git-core = %{version}
133 Requires:       tk >= 8.4
134 Supplements:    packageand(git-core:tk)
135
136 %description gui
137 A Tcl/Tk based graphical user interface to Git. git-gui focuses on
138 allowing users to make changes to their repository by making new
139 commits, amending existing ones, creating branches, performing local
140 merges, and fetching/pushing to remote repositories.
141
142 Unlike gitk, git-gui focuses on commit generation and single file
143 annotation, and does not show project history. It does however supply
144 menu actions to start a gitk session from within git-gui.
145
146 %package web
147 Summary:        Git Web Interface
148 Group:          Development/Tools/Version Control
149 Requires:       git-core = %{version}
150 Supplements:    packageand(git-core:apache2)
151
152 %description web
153 CGI script that allows browsing git repositories via web interface.
154
155 The apache2 configuration contained in this package installs a virtual
156 directory /git/ that calls the cgi script.
157
158 %package remote-helpers
159 Summary:        Python package for remote helper scripts
160 Group:          Development/Tools/Version Control
161 Requires:       git-core = %{version}
162 Requires:       python
163
164 %description remote-helpers
165 This package contains the building blocks for remote helpers written in Python.
166
167 %prep
168 %setup -q
169 %patch1 -p1
170 %patch2 -p1
171 %patch3 -p1
172 %patch4 -p1
173
174 %build
175 cat > .make <<'EOF'
176 #!/bin/bash
177 make %{?_smp_mflags} CFLAGS="%{optflags}" \
178        GITWEB_CONFIG="/etc/gitweb.conf" \
179        GITWEB_PROJECTROOT="/srv/git" \
180        WITH_OWN_SUBPROCESS_PY=YesPlease \
181        DESTDIR=%{buildroot} \
182        NO_CROSS_DIRECTORY_HARDLINKS=1 \
183        V=1 \
184        prefix=%{_prefix} mandir=%{_mandir} \
185        gitexecdir=%{gitexecdir} \
186        htmldir=%{_docdir}/git-core \
187        "$@"
188 EOF
189 #
190 chmod 755 .make
191 ./.make all %{?_smp_mflags}
192
193 %check
194 make %{?_smp_mflags} test
195
196 %install
197 ./.make install
198 ###
199 (find %{buildroot}%{_bindir} -type f | grep -vE "archimport|svn|cvs|email|gitk|daemon|gui" | sed -e s@^%{buildroot}@@)                   > bin-man-doc-files
200 (find %{buildroot}%{gitexecdir} -mindepth 1 | grep -vE "archimport|svn|cvs|email|gitk|daemon|gui" | sed -e s@^%{buildroot}@@)               >> bin-man-doc-files
201 (find %{buildroot}%{_mandir} %{buildroot}/Documentation -type f | grep -vE "archimport|svn|git-cvs|email|gitk|daemon|gui" | sed -e s@^%{buildroot}@@ -e 's/$/*/' ) >> bin-man-doc-files
202 ( pushd perl
203   perl Makefile.PL
204   make -f perl.mak DESTDIR=%{buildroot}  install_vendor
205 )
206 rm -rf %{buildroot}/usr/lib/perl5/site_perl
207 %perl_process_packlist
208 find %{buildroot}/%{_mandir} -type f -print0 | xargs -0 chmod 644
209 install -m 644 -D contrib/completion/git-completion.bash %{buildroot}%{_sysconfdir}/bash_completion.d/git.sh
210 %find_lang %{name}
211 cat %{name}.lang >>bin-man-doc-files
212 # use symlinks instead of hardlinks in sub-commands
213
214
215 rm -rf %{buildroot}/%{_datadir}/gitweb
216
217 %fdupes -s %{buildroot}
218
219
220 %files
221 %defattr(-,root,root)
222 %doc README
223
224 %files svn
225 %defattr(-,root,root)
226 %{gitexecdir}/*svn*
227 %doc Documentation/*svn*.txt
228
229 %files cvs
230 %defattr(-,root,root)
231 %doc Documentation/*git-cvs*.txt
232 %{_bindir}/git-cvs*
233 %{gitexecdir}/*cvs*
234
235 %files arch
236 %defattr(-,root,root)
237 %doc Documentation/git-archimport.txt
238 %{gitexecdir}/git-archimport
239
240 %files email
241 %defattr(-,root,root)
242 %doc Documentation/*email*.txt
243 %{gitexecdir}/*email*
244
245 %files daemon
246 %defattr(-,root,root)
247 %doc Documentation/*daemon*.txt
248 %{gitexecdir}/*daemon*
249
250 %files -n gitk
251 %defattr(-,root,root)
252 %doc Documentation/*gitk*.txt
253 %{_bindir}/gitk
254 /usr/share/gitk
255
256 %files gui
257 %defattr(-,root,root)
258 %doc Documentation/*gui*.txt
259 %{gitexecdir}/git-gui*
260 /usr/share/git-gui
261
262 %files remote-helpers
263 %defattr(-,root,root)
264 %python_sitelib/*
265
266 %files core -f bin-man-doc-files
267 %defattr(-,root,root)
268 %{_bindir}/git
269 %{_datadir}/git-core/
270 %dir %{gitexecdir}
271 %doc README COPYING Documentation/*.txt
272 %{perl_vendorlib}/Git.pm
273 %{perl_vendorlib}/Git/
274 %{perl_vendorlib}/Git/*.pm
275 %{perl_vendorarch}/auto/Git/
276 %{_sysconfdir}/bash_completion.d/git.sh
277
278 %changelog