You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

342 lines
11 KiB

##
## git.spec -- OpenPKG RPM Package Specification
## Copyright (c) 2000-2010 OpenPKG Foundation e.V. <http://openpkg.net/>
##
## Permission to use, copy, modify, and distribute this software for
## any purpose with or without fee is hereby granted, provided that
## the above copyright notice and this permission notice appear in all
## copies.
##
## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
## SUCH DAMAGE.
##
# package version
%define V_git 1.6.6.1
%define V_cogito 0.18.2
%define V_stgit 0.14.3
%define V_guilt 0.32.2
%define V_tig 0.15
%define V_gcutils 0.2.3
# package information
Name: git
Summary: Distributed Version Control System
URL: http://git-scm.com/
Vendor: Linus Torvalds, Junio C Hamano
Packager: OpenPKG Foundation e.V.
Distribution: OpenPKG Community
Class: EVAL
Group: SCM
License: GPL
Version: %{V_git}
Release: 20100121
# package options
%option with_doc no
%option with_cogito no
%option with_stgit no
%option with_guilt no
%option with_tig no
%option with_gcutils no
# list of sources
Source0: http://www.kernel.org/pub/software/scm/git/git-%{V_git}.tar.gz
Source1: http://www.kernel.org/pub/software/scm/cogito/cogito-%{V_cogito}.tar.gz
Source2: http://homepage.ntlworld.com/cmarinas/stgit/stgit-%{V_stgit}.tar.gz
Source3: http://www.kernel.org/pub/linux/kernel/people/jsipek/guilt/guilt-%{V_guilt}.tar.gz
Source4: http://jonas.nitro.dk/tig/releases/tig-%{V_tig}.tar.gz
Source5: http://switch.dl.sourceforge.net/gcutils/gcutils-v%{V_gcutils}.tar.gz
Source6: rc.git
Patch0: git.patch
# build information
Prefix: %{l_prefix}
BuildRoot: %{l_buildroot}
BuildPreReq: OpenPKG, openpkg >= 20040130
PreReq: OpenPKG, openpkg >= 20040130
BuildPreReq: gcc, make, perl-openpkg
%if "%{with_doc}" == "yes"
BuildPreReq: asciidoc, xmlto
%endif
BuildPreReq: bash, perl, diffutils
PreReq: bash, perl, diffutils
BuildPreReq: zlib, openssl, curl, expat, libiconv
PreReq: zlib, openssl, curl, expat, libiconv
%if "%{with_stgit}" == "yes"
BuildPreReq: python
PreReq: python
%endif
%if "%{with_tig}" == "yes"
BuildPreReq: ncurses
PreReq: ncurses
%endif
%if "%{with_gcutils}" == "yes"
BuildPreReq: gzip
%endif
AutoReq: no
AutoReqProv: no
%description
GIT is a "directory content manager" designed to handle absolutely
massive projects with speed and efficiency. GIT falls in the
category of distributed source code management tools. Every GIT
working directory is a full-fledged repository with full revision
tracking capabilities, not dependent on network access to a central
server.
This package contains both the low-level GIT core components and
optionally the high-level GIT frontends Cogito, StGIT and Guilt.
%track
prog git:git = {
version = %{V_git}
url = http://www.kernel.org/pub/software/scm/git/
regex = git-(\d+(\.\d+)+)\.tar\.gz
}
prog git:cogito = {
version = %{V_cogito}
url = http://www.kernel.org/pub/software/scm/cogito/
regex = cogito-(__VER__)\.tar\.gz
}
prog git:stgit = {
version = %{V_stgit}
url = http://homepage.ntlworld.com/cmarinas/stgit/
regex = stgit-(__VER__)\.tar\.gz
}
prog git:guilt = {
version = %{V_guilt}
url = http://www.kernel.org/pub/linux/kernel/people/jsipek/guilt/
regex = guilt-(__VER__)\.tar\.gz
}
prog git:tig = {
version = %{V_tig}
url = http://jonas.nitro.dk/tig/releases/
regex = tig-(__VER__)\.tar\.gz
}
prog git:gcutils = {
version = %{V_gcutils}
url = http://sourceforge.net/projects/gcutils/files/
regex = gcutils-v(__VER__)\.tar\.gz
}
%prep
%setup -q -c
%setup -q -T -D -a 1
%setup -q -T -D -a 2
%setup -q -T -D -a 3
%setup -q -T -D -a 4
%setup -q -T -D -a 5
%patch -p0
%build
# build GIT core
( cd git-%{V_git}
find . -name "*.[ch]" -print |\
xargs %{l_shtool} subst \
-e 's;struct option;struct git_option;g'
( echo "GITWEB_CONFIG = %{l_prefix}/etc/git/gitweb.config.pl"
echo "GITWEB_BASE_URL = /openpkg-cgi/gitweb.d"
echo "GITWEB_CSS = /openpkg-cgi/gitweb.d/gitweb.css"
echo "GITWEB_LOGO = /openpkg-cgi/gitweb.d/git-logo.png"
echo "GITWEB_FAVICON = /openpkg-cgi/gitweb.d/git-favicon.png"
echo "GITWEB_PROJECTROOT = %{l_prefix}/var/git"
echo "NEEDS_CRYPTO_WITH_SSL = YesPlease"
) >config.mak
CC="%{l_cc}" \
CFLAGS="%{l_cflags -O}" \
CPPFLAGS="%{l_cppflags}" \
LDFLAGS="%{l_ldflags}" \
./configure \
--prefix=%{l_prefix} \
--mandir=%{l_prefix}/man \
--with-openssl=%{l_prefix} \
--with-curl=%{l_prefix} \
--with-expat=%{l_prefix} \
--with-iconv=%{l_prefix} \
--with-zlib=%{l_prefix} \
--with-bash=%{l_prefix}/bin/bash \
--with-perl=%{l_prefix}/bin/perl \
--without-tcltk \
--disable-pthreads
%{l_make} %{l_mflags}
%if "%{with_doc}" == "yes"
( cd Documentation
%{l_make} %{l_mflags} man
) || exit $?
%endif
) || exit $?
# build Cogito frontend
%if "%{with_cogito}" == "yes"
( cd cogito-%{V_cogito}
%{l_make} %{l_mflags} \
prefix=%{l_prefix}
) || exit $?
%endif
# build Guilt add-on
%if "%{with_guilt}" == "yes"
( cd guilt-%{V_guilt}
%{l_shtool} subst \
-e 's;/bin/sh;%{l_prefix}/bin/bash;g' \
guilt*
) || exit $?
%endif
# build Tig add-on
%if "%{with_tig}" == "yes"
( cd tig-%{V_tig}
CC="%{l_cc}" \
CFLAGS="%{l_cflags -O}" \
CPPFLAGS="%{l_cppflags ncurses .}" \
LDFLAGS="%{l_ldflags}" \
./configure \
--prefix=%{l_prefix} \
--mandir=%{l_prefix}/man \
--with-libiconv=%{l_prefix}
%{l_make} %{l_mflags}
) || exit $?
%endif
# build GC-Utils add-on
%if "%{with_gcutils}" == "yes"
( cd gc-utils
%{l_make} %{l_mflags} \
prefix=%{l_prefix} \
mandir=%{l_prefix}/man
) || exit $?
%endif
%install
rm -rf $RPM_BUILD_ROOT
# install GIT core
( cd git-%{V_git}
%{l_make} %{l_mflags} install \
DESTDIR=$RPM_BUILD_ROOT
%if "%{with_doc}" == "yes"
( cd Documentation
%{l_shtool} mkdir -f -p -m 755 \
$RPM_BUILD_ROOT%{l_prefix}/man/man1 \
$RPM_BUILD_ROOT%{l_prefix}/man/man5 \
$RPM_BUILD_ROOT%{l_prefix}/man/man7
%{l_shtool} install -c -m 644 \
*.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/
%{l_shtool} install -c -m 644 \
*.5 $RPM_BUILD_ROOT%{l_prefix}/man/man5/
%{l_shtool} install -c -m 644 \
*.7 $RPM_BUILD_ROOT%{l_prefix}/man/man7/
) || exit $?
%endif
) || exit $?
# install GIT web interface
%{l_shtool} mkdir -f -p -m 755 \
$RPM_BUILD_ROOT%{l_prefix}/cgi/gitweb.d \
$RPM_BUILD_ROOT%{l_prefix}/etc/git
%{l_shtool} install -c -m 755 \
git-%{V_git}/gitweb/gitweb.cgi $RPM_BUILD_ROOT%{l_prefix}/cgi/
%{l_shtool} install -c -m 755 \
git-%{V_git}/gitweb/gitweb.css \
git-%{V_git}/gitweb/git-favicon.png \
git-%{V_git}/gitweb/git-logo.png \
$RPM_BUILD_ROOT%{l_prefix}/cgi/gitweb.d/
( echo "##"
echo "## gitweb.config.pl -- gitweb Perl configuration "
echo "##"
echo ""
echo "1;"
) >gitweb.config.pl
%{l_shtool} install -c -m 755 \
gitweb.config.pl $RPM_BUILD_ROOT%{l_prefix}/etc/git/
# install GIT bash programmable completion
%{l_shtool} install -c -m 644 \
git-%{V_git}/contrib/completion/git-completion.bash \
$RPM_BUILD_ROOT%{l_prefix}/etc/git/git.bashrc
# install Cogito frontend
%if "%{with_cogito}" == "yes"
( cd cogito-%{V_cogito}
%{l_make} %{l_mflags} install \
INSTALL="%{l_shtool} install" \
DESTDIR=$RPM_BUILD_ROOT \
prefix=%{l_prefix}
) || exit $?
%endif
# install StGIT add-on
%if "%{with_stgit}" == "yes"
( cd stgit-%{V_stgit}
PATH="`pwd`/../git-%{V_git}:$PATH"
%{l_prefix}/bin/python setup.py install \
--root=$RPM_BUILD_ROOT \
--prefix=%{l_prefix} \
--install-lib=%{l_prefix}/lib/git
) || exit $?
%endif
# install Guilt add-on
%if "%{with_guilt}" == "yes"
( cd guilt-%{V_guilt}
%{l_make} %{l_mflags} install \
PREFIX=$RPM_BUILD_ROOT%{l_prefix}
) || exit $?
%endif
# install Tig add-on
%if "%{with_tig}" == "yes"
( cd tig-%{V_tig}
%{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
) || exit $?
%endif
# install GC-Utils add-on
%if "%{with_gcutils}" == "yes"
( cd gc-utils
%{l_make} %{l_mflags} \
prefix=$RPM_BUILD_ROOT%{l_prefix} \
mandir=$RPM_BUILD_ROOT%{l_prefix}/man \
install
) || exit $?
%endif
# install run-command script
%{l_shtool} mkdir -f -p -m 755 \
$RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
%{l_shtool} install -c -m 755 %{l_value -s -a} \
%{SOURCE rc.git} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
# strip down installation
strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
strip $RPM_BUILD_ROOT%{l_prefix}/libexec/git-core/* >/dev/null 2>&1 || true
rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc
# create additional directories
%{l_shtool} mkdir -f -p -m 755 \
$RPM_BUILD_ROOT%{l_prefix}/var/git/run \
$RPM_BUILD_ROOT%{l_prefix}/var/git/db
# determine installation files
%{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
%{l_files_std} `cat perl-openpkg-files` \
'%config %{l_prefix}/etc/git/*' \
'%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/git/*'
%files -f files
%clean
rm -rf $RPM_BUILD_ROOT