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