# HG changeset patch # User Michael Schloh von Bennewitz # Date 1344602403 -7200 # Node ID 827ba617ed8c79fdbab8ddb3975289634925e9f3 # Parent 2f4b17c140a1bb1a68ea7ed9e1d88da74e64d652 Import package vendor original specs for necessary manipulations. diff -r 2f4b17c140a1 -r 827ba617ed8c git/git-notify --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/git/git-notify Fri Aug 10 14:40:03 2012 +0200 @@ -0,0 +1,431 @@ +#!/usr/bin/perl -w +# +# Tool to send git commit notifications +# +# Copyright 2005 Alexandre Julliard +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# +# This script is meant to be called from .git/hooks/post-receive. +# +# Usage: git-notify [options] [--] old-sha1 new-sha1 refname +# +# -c name Send CIA notifications under specified project name +# -m addr Send mail notifications to specified address +# -n max Set max number of individual mails to send +# -r name Set the git repository name +# -s bytes Set the maximum diff size in bytes (-1 for no limit) +# -u url Set the URL to the gitweb browser +# -i branch If at least one -i is given, report only for specified branches +# -x branch Exclude changes to the specified branch from reports +# -X Exclude merge commits +# + +use strict; +use open ':utf8'; +use Encode 'encode'; +use Cwd 'realpath'; + +binmode STDIN, ':utf8'; +binmode STDOUT, ':utf8'; + +sub git_config($); +sub get_repos_name(); + +# some parameters you may want to change + +# CIA notification address +my $cia_address = "cia\@cia.navi.cx"; + +# debug mode +my $debug = 0; + +# configuration parameters + +# base URL of the gitweb repository browser (can be set with the -u option) +my $gitweb_url = git_config( "notify.baseurl" ); + +# default repository name (can be changed with the -r option) +my $repos_name = git_config( "notify.repository" ) || get_repos_name(); + +# max size of diffs in bytes (can be changed with the -s option) +my $max_diff_size = git_config( "notify.maxdiff" ) || 10000; + +# address for mail notices (can be set with -m option) +my $commitlist_address = git_config( "notify.mail" ); + +# project name for CIA notices (can be set with -c option) +my $cia_project_name = git_config( "notify.cia" ); + +# max number of individual notices before falling back to a single global notice (can be set with -n option) +my $max_individual_notices = git_config( "notify.maxnotices" ) || 100; + +# branches to include +my @include_list = split /\s+/, git_config( "notify.include" ) || ""; + +# branches to exclude +my @exclude_list = split /\s+/, git_config( "notify.exclude" ) || ""; + +# set this to something that takes "-s" +my $mailer = git_config( "notify.mailer" ) || "/usr/bin/mail"; + +# Extra options to git rev-list +my @revlist_options; + +sub usage() +{ + print "Usage: $0 [options] [--] old-sha1 new-sha1 refname\n"; + print " -c name Send CIA notifications under specified project name\n"; + print " -m addr Send mail notifications to specified address\n"; + print " -n max Set max number of individual mails to send\n"; + print " -r name Set the git repository name\n"; + print " -s bytes Set the maximum diff size in bytes (-1 for no limit)\n"; + print " -u url Set the URL to the gitweb browser\n"; + print " -i branch If at least one -i is given, report only for specified branches\n"; + print " -x branch Exclude changes to the specified branch from reports\n"; + print " -X Exclude merge commits\n"; + exit 1; +} + +sub xml_escape($) +{ + my $str = shift; + $str =~ s/&/&/g; + $str =~ s//>/g; + my @chars = unpack "U*", $str; + $str = join "", map { ($_ > 127) ? sprintf "&#%u;", $_ : chr($_); } @chars; + return $str; +} + +# format an integer date + timezone as string +# algorithm taken from git's date.c +sub format_date($$) +{ + my ($time,$tz) = @_; + + if ($tz < 0) + { + my $minutes = (-$tz / 100) * 60 + (-$tz % 100); + $time -= $minutes * 60; + } + else + { + my $minutes = ($tz / 100) * 60 + ($tz % 100); + $time += $minutes * 60; + } + return gmtime($time) . sprintf " %+05d", $tz; +} + +# fetch a parameter from the git config file +sub git_config($) +{ + my ($param) = @_; + + open CONFIG, "-|" or exec "git", "config", $param; + my $ret = ; + chomp $ret if $ret; + close CONFIG or $ret = undef; + return $ret; +} + +# parse command line options +sub parse_options() +{ + while (@ARGV && $ARGV[0] =~ /^-/) + { + my $arg = shift @ARGV; + + if ($arg eq '--') { last; } + elsif ($arg eq '-c') { $cia_project_name = shift @ARGV; } + elsif ($arg eq '-m') { $commitlist_address = shift @ARGV; } + elsif ($arg eq '-n') { $max_individual_notices = shift @ARGV; } + elsif ($arg eq '-r') { $repos_name = shift @ARGV; } + elsif ($arg eq '-s') { $max_diff_size = shift @ARGV; } + elsif ($arg eq '-u') { $gitweb_url = shift @ARGV; } + elsif ($arg eq '-i') { push @include_list, shift @ARGV; } + elsif ($arg eq '-x') { push @exclude_list, shift @ARGV; } + elsif ($arg eq '-X') { push @revlist_options, "--no-merges"; } + elsif ($arg eq '-d') { $debug++; } + else { usage(); } + } + if (@ARGV && $#ARGV != 2) { usage(); } + @exclude_list = map { "^$_"; } @exclude_list; +} + +# send an email notification +sub mail_notification($$$@) +{ + my ($name, $subject, $content_type, @text) = @_; + $subject = encode("MIME-Q",$subject); + if ($debug) + { + print "---------------------\n"; + print "To: $name\n"; + print "Subject: $subject\n"; + print "Content-Type: $content_type\n"; + print "\n", join("\n", @text), "\n"; + } + else + { + my $pid = open MAIL, "|-"; + return unless defined $pid; + if (!$pid) + { + exec $mailer, "-s", $subject, "-a", "Content-Type: $content_type", $name or die "Cannot exec $mailer"; + } + print MAIL join("\n", @text), "\n"; + close MAIL; + } +} + +# get the default repository name +sub get_repos_name() +{ + my $dir = `git rev-parse --git-dir`; + chomp $dir; + my $repos = realpath($dir); + $repos =~ s/(.*?)((\.git\/)?\.git)$/$1/; + $repos =~ s/(.*)\/([^\/]+)\/?$/$2/; + return $repos; +} + +# extract the information from a commit or tag object and return a hash containing the various fields +sub get_object_info($) +{ + my $obj = shift; + my %info = (); + my @log = (); + my $do_log = 0; + + open TYPE, "-|" or exec "git", "cat-file", "-t", $obj or die "cannot run git-cat-file"; + my $type = ; + chomp $type; + close TYPE; + + open OBJ, "-|" or exec "git", "cat-file", $type, $obj or die "cannot run git-cat-file"; + while () + { + chomp; + if ($do_log) + { + last if /^-----BEGIN PGP SIGNATURE-----/; + push @log, $_; + } + elsif (/^(author|committer|tagger) ((.*)(<.*>)) (\d+) ([+-]\d+)$/) + { + $info{$1} = $2; + $info{$1 . "_name"} = $3; + $info{$1 . "_email"} = $4; + $info{$1 . "_date"} = $5; + $info{$1 . "_tz"} = $6; + } + elsif (/^tag (.*)$/) + { + $info{"tag"} = $1; + } + elsif (/^$/) { $do_log = 1; } + } + close OBJ; + + $info{"type"} = $type; + $info{"log"} = \@log; + return %info; +} + +# send a commit notice to a mailing list +sub send_commit_notice($$) +{ + my ($ref,$obj) = @_; + my %info = get_object_info($obj); + my @notice = (); + my $subject; + + if ($info{"type"} eq "tag") + { + push @notice, + "Module: $repos_name", + "Branch: $ref", + "Tag: $obj", + $gitweb_url ? "URL: $gitweb_url/?a=tag;h=$obj\n" : "", + "Tagger: " . $info{"tagger"}, + "Date: " . format_date($info{"tagger_date"},$info{"tagger_tz"}), + "", + join "\n", @{$info{"log"}}; + $subject = "Tag " . $info{"tag"} . " : " . $info{"tagger_name"} . ": " . ${$info{"log"}}[0]; + } + else + { + push @notice, + "Module: $repos_name", + "Branch: $ref", + "Commit: $obj", + $gitweb_url ? "URL: $gitweb_url/?a=commit;h=$obj\n" : "", + "Author: " . $info{"author"}, + "Date: " . format_date($info{"author_date"},$info{"author_tz"}), + "", + join "\n", @{$info{"log"}}, + "", + "---", + ""; + + open STAT, "-|" or exec "git", "diff-tree", "--stat", "-M", "--no-commit-id", $obj or die "cannot exec git-diff-tree"; + push @notice, join("", ); + close STAT; + + open DIFF, "-|" or exec "git", "diff-tree", "-p", "-M", "--no-commit-id", $obj or die "cannot exec git-diff-tree"; + my $diff = join( "", ); + close DIFF; + + if (($max_diff_size == -1) || (length($diff) < $max_diff_size)) + { + push @notice, $diff; + } + else + { + push @notice, "Diff: $gitweb_url/?a=commitdiff;h=$obj" if $gitweb_url; + } + + $subject = $info{"author_name"} . ": " . ${$info{"log"}}[0]; + } + + mail_notification($commitlist_address, $subject, "text/plain; charset=UTF-8", @notice); +} + +# send a commit notice to the CIA server +sub send_cia_notice($$) +{ + my ($ref,$commit) = @_; + my %info = get_object_info($commit); + my @cia_text = (); + + return if $info{"type"} ne "commit"; + + push @cia_text, + "", + " ", + " git-notify script for CIA", + " ", + " ", + " " . xml_escape($cia_project_name) . "", + " " . xml_escape($repos_name) . "", + " " . xml_escape($ref). "", + " ", + " ", + " ", + " " . substr($commit,0,10) . "", + " " . xml_escape($info{"author"}) . "", + " " . xml_escape(join "\n", @{$info{"log"}}) . "", + " "; + + open COMMIT, "-|" or exec "git", "diff-tree", "--name-status", "-r", "-M", $commit or die "cannot run git-diff-tree"; + while () + { + chomp; + if (/^([AMD])\t(.*)$/) + { + my ($action, $file) = ($1, $2); + my %actions = ( "A" => "add", "M" => "modify", "D" => "remove" ); + next unless defined $actions{$action}; + push @cia_text, " " . xml_escape($file) . ""; + } + elsif (/^R\d+\t(.*)\t(.*)$/) + { + my ($old, $new) = ($1, $2); + push @cia_text, " " . xml_escape($old) . ""; + } + } + close COMMIT; + + push @cia_text, + " ", + $gitweb_url ? " " . xml_escape("$gitweb_url/?a=commit;h=$commit") . "" : "", + " ", + " ", + " " . $info{"author_date"} . "", + ""; + + mail_notification($cia_address, "DeliverXML", "text/xml", @cia_text); +} + +# send a global commit notice when there are too many commits for individual mails +sub send_global_notice($$$) +{ + my ($ref, $old_sha1, $new_sha1) = @_; + my @notice = (); + + push @revlist_options, "--pretty"; + open LIST, "-|" or exec "git", "rev-list", @revlist_options, "^$old_sha1", "$new_sha1", @exclude_list or die "cannot exec git-rev-list"; + while () + { + chomp; + s/^commit /URL: $gitweb_url\/?a=commit;h=/ if $gitweb_url; + push @notice, $_; + } + close LIST; + + mail_notification($commitlist_address, "New commits on branch $ref", "text/plain; charset=UTF-8", @notice); +} + +# send all the notices +sub send_all_notices($$$) +{ + my ($old_sha1, $new_sha1, $ref) = @_; + + $ref =~ s/^refs\/heads\///; + + return if (@include_list && !grep {$_ eq $ref} @include_list); + + if ($old_sha1 eq '0' x 40) # new ref + { + send_commit_notice( $ref, $new_sha1 ) if $commitlist_address; + return; + } + + my @commits = (); + + open LIST, "-|" or exec "git", "rev-list", @revlist_options, "^$old_sha1", "$new_sha1", @exclude_list or die "cannot exec git-rev-list"; + while () + { + chomp; + die "invalid commit $_" unless /^[0-9a-f]{40}$/; + unshift @commits, $_; + } + close LIST; + + if (@commits > $max_individual_notices) + { + send_global_notice( $ref, $old_sha1, $new_sha1 ) if $commitlist_address; + return; + } + + foreach my $commit (@commits) + { + send_commit_notice( $ref, $commit ) if $commitlist_address; + send_cia_notice( $ref, $commit ) if $cia_project_name; + } +} + +parse_options(); + +# append repository path to URL +$gitweb_url .= "/$repos_name.git" if $gitweb_url; + +if (@ARGV) +{ + send_all_notices( $ARGV[0], $ARGV[1], $ARGV[2] ); +} +else # read them from stdin +{ + while (<>) + { + chomp; + if (/^([0-9a-f]{40}) ([0-9a-f]{40}) (.*)$/) { send_all_notices( $1, $2, $3 ); } + } +} + +exit 0; diff -r 2f4b17c140a1 -r 827ba617ed8c git/git.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/git/git.patch Fri Aug 10 14:40:03 2012 +0200 @@ -0,0 +1,186 @@ +Index: cogito-0.18.2/Makefile +--- cogito-0.18.2/Makefile.orig 2006-11-17 01:37:24.000000000 +0100 ++++ cogito-0.18.2/Makefile 2012-06-18 16:02:16.000000000 +0200 +@@ -2,8 +2,8 @@ + prefix="$(HOME)" + + bindir=$(prefix)/bin +-libdir=$(prefix)/lib/cogito +-sharedir=$(prefix)/share/cogito ++libdir=$(prefix)/lib/git/cogito ++sharedir=$(prefix)/share/git/cogito + + INSTALL?=install + +Index: gc-utils/doc/Makefile +--- gc-utils/doc/Makefile.orig 2008-08-01 17:39:15.000000000 +0200 ++++ gc-utils/doc/Makefile 2012-06-18 16:02:16.000000000 +0200 +@@ -29,17 +29,17 @@ + + .PHONY: gen install clean uninstall + +-gen:: $(manpagesgz) ++gen:: $(manpages) + + $(manpagesgz): + $(QUIET_GEN) cat $(@:../build/%.1.gz=%.1) | sed -e 's,\$$VERSION\$$,$(VERSION_SQ),' | gzip -9 > $@ + +-install: $(manpagesgz) ++install: $(manpages) + @$(MKINSTALLDIRS) $(DESTDIR)$(man1dir) + ifndef V +- @$(foreach f, $(manpagesgz), $(QUIET_INSTALL) $(INSTALL) -m644 $f "$(DESTDIR)$(man1dir)/$(f:../build/%=%)" ;) ++ @$(foreach f, $(manpages), $(QUIET_INSTALL) $(INSTALL) -m644 $f "$(DESTDIR)$(man1dir)/$(f:../build/%=%)" ;) + else +- $(foreach f, $(manpagesgz), $(INSTALL) -m644 $f "$(DESTDIR)$(man1dir)/$(f:../build/%=%)" ;) ++ $(foreach f, $(manpages), $(INSTALL) -m644 $f "$(DESTDIR)$(man1dir)/$(f:../build/%=%)" ;) + endif + + uninstall: +Index: git-1.7.11.4/Documentation/Makefile +--- git-1.7.11.4/Documentation/Makefile.orig 2012-06-18 00:01:30.000000000 +0200 ++++ git-1.7.11.4/Documentation/Makefile 2012-06-18 16:02:16.000000000 +0200 +@@ -56,10 +56,10 @@ + infodir?=$(prefix)/share/info + MAKEINFO=makeinfo + INSTALL_INFO=install-info +-DOCBOOK2X_TEXI=docbook2x-texi ++DOCBOOK2X_TEXI=docbook2texi + DBLATEX=dblatex + ifndef PERL_PATH +- PERL_PATH = /usr/bin/perl ++ PERL_PATH = perl + endif + + -include ../config.mak.autogen +Index: git-1.7.11.4/Makefile +--- git-1.7.11.4/Makefile.orig 2012-06-18 00:01:30.000000000 +0200 ++++ git-1.7.11.4/Makefile 2012-06-18 16:02:16.000000000 +0200 +@@ -339,12 +339,12 @@ + bindir = $(prefix)/$(bindir_relative) + mandir = share/man + infodir = share/info +-gitexecdir = libexec/git-core ++gitexecdir = libexec/git + mergetoolsdir = $(gitexecdir)/mergetools + sharedir = $(prefix)/share + gitwebdir = $(sharedir)/gitweb + localedir = $(sharedir)/locale +-template_dir = share/git-core/templates ++template_dir = share/git/templates + htmldir = share/doc/git-doc + ETC_GITCONFIG = $(sysconfdir)/gitconfig + ETC_GITATTRIBUTES = $(sysconfdir)/gitattributes +@@ -1455,10 +1455,10 @@ + else + ifdef CURLDIR + # Try "-Wl,-rpath=$(CURLDIR)/$(lib)" in such a case. +- BASIC_CFLAGS += -I$(CURLDIR)/include +- CURL_LIBCURL = -L$(CURLDIR)/$(lib) $(CC_LD_DYNPATH)$(CURLDIR)/$(lib) -lcurl ++ BASIC_CFLAGS += `$(CURLDIR)/bin/curl-config --cflags` ++ CURL_LIBCURL = `$(CURLDIR)/bin/curl-config --libs` + else +- CURL_LIBCURL = -lcurl ++ CURL_LIBCURL = -lcurl -lssl -lcrypto + endif + ifdef NEEDS_SSL_WITH_CURL + CURL_LIBCURL += -lssl +@@ -2553,6 +2553,12 @@ + $(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' + $(INSTALL) -m 644 $(SCRIPT_LIB) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' + $(INSTALL) $(install_bindir_programs) '$(DESTDIR_SQ)$(bindir_SQ)' ++ $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(prefix)/lib' ++ $(INSTALL) -m 644 $(LIB_FILE) '$(DESTDIR_SQ)$(prefix)/lib/libgit.a' ++ $(INSTALL) -m 644 $(XDIFF_LIB) '$(DESTDIR_SQ)$(prefix)/lib/libgit-xdiff.a' ++ $(INSTALL) -m 644 $(VCSSVN_LIB) '$(DESTDIR_SQ)$(prefix)/lib/libgit-vcssvn.a' ++ $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(prefix)/include/git' ++ for h in $(LIB_H); do b=`echo $$h | sed -e 's;/*[^/][^/]*$$;;'`; $(INSTALL) -d -m 755 $(DESTDIR_SQ)$(prefix)/include/git/$$b; $(INSTALL) -m 644 $$h $(DESTDIR_SQ)$(prefix)/include/git/$$h; done + $(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install + $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(mergetools_instdir_SQ)' + $(INSTALL) -m 644 mergetools/* '$(DESTDIR_SQ)$(mergetools_instdir_SQ)' +Index: git-1.7.11.4/config.mak.in +--- git-1.7.11.4/config.mak.in.orig 2012-06-18 00:01:30.000000000 +0200 ++++ git-1.7.11.4/config.mak.in 2012-06-18 16:02:16.000000000 +0200 +@@ -15,9 +15,9 @@ + prefix = @prefix@ + exec_prefix = @exec_prefix@ + bindir = @bindir@ +-gitexecdir = @libexecdir@/git-core ++gitexecdir = @libexecdir@/git + datarootdir = @datarootdir@ +-template_dir = @datadir@/git-core/templates ++template_dir = @datadir@/git/templates + sysconfdir = @sysconfdir@ + + mandir=@mandir@ +Index: git-1.7.11.4/perl/Makefile.PL +--- git-1.7.11.4/perl/Makefile.PL.orig 2012-06-18 00:01:30.000000000 +0200 ++++ git-1.7.11.4/perl/Makefile.PL 2012-06-18 16:02:16.000000000 +0200 +@@ -55,5 +55,6 @@ + PM => \%pm, + PM_FILTER => qq[\$(PERL) -pe "s<\\Q++LOCALEDIR++\\E><$localedir>"], + MAKEFILE => 'perl.mak', +- INSTALLSITEMAN3DIR => '$(SITEPREFIX)/share/man/man3' ++ INSTALLDIRS => 'vendor', ++ INSTALLSITEMAN3DIR => '$(SITEPREFIX)/man/man3' + ); +Index: git-1.7.11.4/sha1_file.c +--- git-1.7.11.4/sha1_file.c.orig 2012-06-18 00:01:30.000000000 +0200 ++++ git-1.7.11.4/sha1_file.c 2012-06-18 16:32:16.000000000 +0200 +@@ -20,6 +20,7 @@ + #include "sha1-lookup.h" + #include "bulk-checkin.h" + #include "streaming.h" ++#include + + #ifndef O_NOATIME + #if defined(__linux__) && (defined(__i386__) || defined(__PPC__)) +Index: git-1.7.11.4/templates/Makefile +--- git-1.7.11.4/templates/Makefile.orig 2012-06-18 00:01:30.000000000 +0200 ++++ git-1.7.11.4/templates/Makefile 2012-06-18 16:02:16.000000000 +0200 +@@ -8,7 +8,7 @@ + TAR ?= tar + RM ?= rm -f + prefix ?= $(HOME) +-template_instdir ?= $(prefix)/share/git-core/templates ++template_instdir ?= $(prefix)/share/git/templates + # DESTDIR= + + ifndef SHELL_PATH +Index: stgit-0.14.3/setup.py +--- stgit-0.14.3/setup.py.orig 2008-06-09 00:26:03.000000000 +0200 ++++ stgit-0.14.3/setup.py 2012-06-18 16:02:16.000000000 +0200 +@@ -61,10 +61,10 @@ + long_description = 'Push/pop utility on top of GIT', + scripts = ['stg'], + packages = ['stgit', 'stgit.commands'], +- data_files = [('share/stgit/templates', glob.glob('templates/*.tmpl')), +- ('share/stgit/examples', glob.glob('examples/*.tmpl')), +- ('share/stgit/examples', ['examples/gitconfig']), +- ('share/stgit/contrib', ['contrib/diffcol.sh', ++ data_files = [('share/git/stgit/templates', glob.glob('templates/*.tmpl')), ++ ('share/git/stgit/examples', glob.glob('examples/*.tmpl')), ++ ('share/git/stgit/examples', ['examples/gitconfig']), ++ ('share/git/stgit/contrib', ['contrib/diffcol.sh', + 'contrib/stgbashprompt.sh', + 'contrib/stgit-completion.bash']), + ('share/doc/stgit', glob.glob('doc/*.txt'))] +Index: stgit-0.14.3/stg +--- stgit-0.14.3/stg.orig 2006-04-07 23:38:54.000000000 +0200 ++++ stgit-0.14.3/stg 2012-06-18 16:02:16.000000000 +0200 +@@ -26,12 +26,13 @@ + # It is assumed that the user installed StGIT using the --prefix= option + prefix, bin = os.path.split(sys.path[0]) + +-if bin == 'bin' and prefix != sys.prefix: ++if bin == 'bin': + sys.prefix = prefix + sys.exec_prefix = prefix + + major, minor = sys.version_info[0:2] +- local_path = [os.path.join(prefix, 'lib', 'python'), ++ local_path = [os.path.join(prefix, 'lib', 'git'), ++ os.path.join(prefix, 'lib', 'python'), + os.path.join(prefix, 'lib', 'python%s.%s' % (major, minor)), + os.path.join(prefix, 'lib', 'python%s.%s' % (major, minor), + 'site-packages')] diff -r 2f4b17c140a1 -r 827ba617ed8c git/git.spec --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/git/git.spec Fri Aug 10 14:40:03 2012 +0200 @@ -0,0 +1,359 @@ +## +## git.spec -- OpenPKG RPM Package Specification +## Copyright (c) 2000-2012 OpenPKG Foundation e.V. +## +## 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.7.11.4 +%define V_cogito 0.18.2 +%define V_stgit 0.14.3 +%define V_guilt 0.35 +%define V_tig 1.0 +%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: 20120731 + +# 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 +%option with_svn no + +# list of sources +Source0: http://git-core.googlecode.com/files/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 +Source7: git-notify +Patch0: git.patch + +# build information +BuildPreReq: OpenPKG, openpkg >= 20100101 +PreReq: OpenPKG, openpkg >= 20100101 +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, pcre +PreReq: zlib, openssl, curl, expat, libiconv, pcre +BuildPreReq: python +PreReq: python +%if "%{with_tig}" == "yes" +BuildPreReq: ncurses +PreReq: ncurses +%endif +%if "%{with_gcutils}" == "yes" +BuildPreReq: gzip +%endif +%if "%{with_svn}" == "yes" +PreReq: subversion-perl +%endif + +%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://code.google.com/p/git-core/downloads/list + 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/static/gitweb.css" + echo "GITWEB_JS = /openpkg-cgi/gitweb.d/static/gitweb.js" + echo "GITWEB_LOGO = /openpkg-cgi/gitweb.d/static/git-logo.png" + echo "GITWEB_FAVICON = /openpkg-cgi/gitweb.d/static/git-favicon.png" + echo "GITWEB_PROJECTROOT = %{l_prefix}/var/git" + echo "PYTHON_PATH = %{l_prefix}/bin/python" + echo "NEEDS_CRYPTO_WITH_SSL = YesPlease" + ) >config.mak + ( echo "ac_cv_header_libintl_h=no" + ) >config.cache + CC="%{l_cc}" \ + CFLAGS="%{l_cflags -O}" \ + CPPFLAGS="%{l_cppflags}" \ + LDFLAGS="%{l_ldflags}" \ + LIBS="-lssl -lcrypto -lz" \ + ./configure \ + --cache-file=./config.cache \ + --prefix=%{l_prefix} \ + --mandir=%{l_prefix}/man \ + --with-gitconfig=%{l_prefix}/etc/git/gitconfig \ + --with-gitattributes=%{l_prefix}/etc/git/gitattributes \ + --with-openssl=%{l_prefix} \ + --with-libpcre=%{l_prefix} \ + --with-curl=%{l_prefix} \ + --with-expat=%{l_prefix} \ + --with-iconv=%{l_prefix} \ + --with-zlib=%{l_prefix} \ + --with-shell=%{l_prefix}/bin/bash \ + --with-perl=%{l_prefix}/bin/perl \ + --without-python \ + --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 + # 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 +%if "%{with_svn}" != "yes" + rm -f $RPM_BUILD_ROOT%{l_prefix}/libexec/git/git-svn +%endif + ) || exit $? + + # install git-notify(1) addon utility + %{l_shtool} install -c -m 755 \ + -e 's;/usr/bin/perl;%{l_prefix}/bin/perl;' \ + %{SOURCE git-notify} \ + $RPM_BUILD_ROOT%{l_prefix}/bin/ + + # install GIT web interface + %{l_shtool} mkdir -f -p -m 755 \ + $RPM_BUILD_ROOT%{l_prefix}/cgi/gitweb.d/static \ + $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 644 \ + git-%{V_git}/gitweb/static/* \ + $RPM_BUILD_ROOT%{l_prefix}/cgi/gitweb.d/static/ + ( 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/ + + # provide HTTP backend CGI under canonical path for Apache + ln $RPM_BUILD_ROOT%{l_prefix}/libexec/git/git-http-backend \ + $RPM_BUILD_ROOT%{l_prefix}/cgi/git-http-backend + + # 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 + diff -r 2f4b17c140a1 -r 827ba617ed8c git/rc.git --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/git/rc.git Fri Aug 10 14:40:03 2012 +0200 @@ -0,0 +1,78 @@ +#!@l_prefix@/bin/openpkg rc +## +## rc.git -- Run-Commands +## + +%config + git_enable="$openpkg_rc_def" + git_daemon="no" + git_daemon_flags="" + git_daemon_host="127.0.0.1" + git_daemon_port="9418" + git_daemon_user="@l_rusr@" + git_daemon_group="@l_rgrp@" + git_daemon_basedir="@l_prefix@/var/git/db" + git_log_prolog="true" + git_log_epilog="true" + git_log_numfiles="10" + git_log_minsize="1M" + git_log_complevel="9" + +%common + git_daemon_pidfile="@l_prefix@/var/git/run/git-daemon.pid" + git_daemon_logfile="@l_prefix@/var/git/run/git-daemon.log" + git_daemon_signal () { + [ -f $git_daemon_pidfile ] && kill -$1 `cat $git_daemon_pidfile` + } + +%status -u @l_susr@ -o + git_usable="unknown" + git_active="no" + rcService git enable yes && \ + rcVarIsYes git_daemon && \ + git_daemon_signal 0 && \ + git_active="yes" + echo "git_enable=\"$git_enable\"" + echo "git_usable=\"$git_usable\"" + echo "git_active=\"$git_active\"" + +%start -u @l_susr@ + rcService git enable yes || exit 0 + rcService git active yes && exit 0 + if rcVarIsYes git_daemon; then + ( nohup @l_prefix@/bin/git daemon \ + --reuseaddr \ + --listen="$git_daemon_host" \ + --port="$git_daemon_port" \ + --user="$git_daemon_user" \ + --group="$git_daemon_group" \ + --base-path="$git_daemon_basedir" \ + $git_daemon_flags \ + >$git_daemon_logfile 2>&1 & + echo $! >$git_daemon_pidfile + ) /dev/null 2>&1 + fi + +%stop -u @l_susr@ + rcService git enable yes || exit 0 + rcService git active no && exit 0 + if rcVarIsYes git_daemon; then + git_daemon_signal TERM + sleep 1 + rm -f $git_daemon_pidfile 2>/dev/null || true + fi + +%restart -u @l_susr@ + rcService git enable yes || exit 0 + rcService git active no && exit 0 + rc git stop start + +%daily -u @l_susr@ + rcService git enable yes || exit 0 + shtool rotate -f \ + -n ${git_log_numfiles} -s ${git_log_minsize} -d \ + -z ${git_log_complevel} -m 644 -o @l_rusr@ -g @l_rusr@ \ + -P "${git_log_prolog}" \ + -E "${git_log_epilog}" \ + $git_daemon_logfile +