rpms/gitolite/devel README, NONE, 1.1 gitolite-0.95-conf.patch, NONE, 1.1 gitolite-0.95-rpm.patch, NONE, 1.1 gitolite.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Lubomir Rintel lkundrak at fedoraproject.org
Wed Jan 20 23:49:46 UTC 2010


Author: lkundrak

Update of /cvs/pkgs/rpms/gitolite/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv12279/devel

Modified Files:
	.cvsignore sources 
Added Files:
	README gitolite-0.95-conf.patch gitolite-0.95-rpm.patch 
	gitolite.spec 
Log Message:
Import gitolite


--- NEW FILE README ---
Care was taken to make the gitolite deployment from RPM as close to the
upstream's way of installing gitolite. Therefore, the documentation shipped
with the package should be useful and gl-install a gl-easy-install scripts
should work.

The "easy" installation should be done as follows:

1.) Create ~gitolite/.ssh/authorized-keys and add your key there
2.) gl-easy-install gitolite localhost $LOGNAME 
3.) gitolite-admin is cloned. Now you can add repositories by modyfing
    configuration there and pushing it back.

The other way to do that would be to su to gitolite user, run "gl-install",
follow the instructions and then manually populate the gitolite-admin.git
repository (and recompile the configuration, as you'd be instructed).

To access the repositories, always use "gitolite" as user name. Gitolite
doesn't use UNIX users/permissions to implement access control, it implements
its own and determines the user name from the key used.

gitolite-0.95-conf.patch:
 example.conf |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- NEW FILE gitolite-0.95-conf.patch ---
>From d96eb124c727d7aafc401aea6279fc4756b386c9 Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak at v3.sk>
Date: Thu, 7 Jan 2010 16:53:49 +0100
Subject: [PATCH 2/2] Make example installation compilable

---
 conf/example.conf |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/conf/example.conf b/conf/example.conf
index 84ccff2..8389839 100644
--- a/conf/example.conf
+++ b/conf/example.conf
@@ -59,6 +59,7 @@
 @interns    =   han
                 # "@interns" now has 3 names in it, but note that this does
                 # not change @staff
+ at others     =   janusz mariusz
 
 # REPO AND BRANCH PERMISSIONS
 # ---------------------------
-- 
1.6.5.2


gitolite-0.95-rpm.patch:
 ga-post-update-hook |    2 -
 gitolite.pm         |    2 -
 gl-auth-command     |    4 +--
 gl-compile-conf     |    6 ++---
 gl-easy-install     |   62 ++++++++++++++++++++++++++--------------------------
 gl-install          |   25 ++++++++++----------
 6 files changed, 51 insertions(+), 50 deletions(-)

--- NEW FILE gitolite-0.95-rpm.patch ---
>From 2818abcfc20a198c6fa56c1dbc3c34c6d03b1610 Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak at v3.sk>
Date: Thu, 7 Jan 2010 16:52:45 +0100
Subject: [PATCH 1/2] Make Gitolite instllation friendly installable system-wide

---
 src/ga-post-update-hook |    2 +-
 src/gitolite.pm         |    2 +-
 src/gl-auth-command     |    4 +-
 src/gl-compile-conf     |    6 ++--
 src/gl-easy-install     |   62 ++++++++++++++++++++++++----------------------
 src/gl-install          |   24 +++++++++---------
 6 files changed, 51 insertions(+), 49 deletions(-)

diff --git a/src/ga-post-update-hook b/src/ga-post-update-hook
index 8090b8a..312560f 100755
--- a/src/ga-post-update-hook
+++ b/src/ga-post-update-hook
@@ -31,4 +31,4 @@ do
 done
 
 cd $GL_ADMINDIR
-src/gl-compile-conf
+gl-compile-conf
diff --git a/src/gitolite.pm b/src/gitolite.pm
index ee0fc77..8878786 100644
--- a/src/gitolite.pm
+++ b/src/gitolite.pm
@@ -116,7 +116,7 @@ sub report_basic
 
     # send back some useful info if no command was given
     print "hello $user, the gitolite version here is ";
-    system("cat", "$GL_ADMINDIR/src/VERSION");
+    system("rpm", "-q", "--qf", '%{version}-%{release}', 'gitolite');
     print "\ryou have the following permissions:\n\r";
     for my $r (sort keys %repos) {
         my $perm .= ( $repos{$r}{R}{'@all'} ? '  @' : ( $repos{$r}{R}{$user} ? '  R' : '' ) );
diff --git a/src/gl-auth-command b/src/gl-auth-command
index 86fec88..f77e493 100755
--- a/src/gl-auth-command
+++ b/src/gl-auth-command
@@ -33,7 +33,7 @@ our %repos;
 # the common setup module is in the same directory as this running program is
 my $bindir = $0;
 $bindir =~ s/\/[^\/]+$//;
-require "$bindir/gitolite.pm";
+require gitolite;
 
 # ask where the rc file is, get it, and "do" it
 &where_is_rc();
@@ -93,7 +93,7 @@ my $repo_base_abs = ( $REPO_BASE =~ m(^/) ? $REPO_BASE : "$ENV{HOME}/$REPO_BASE"
 if ( not -d "$repo_base_abs/$repo.git" ) {
     if ( $repos{$repo}{W}{$user} or $repos{$repo}{W}{'@all'} ) {
         wrap_chdir("$repo_base_abs");
-        new_repo($repo, "$GL_ADMINDIR/src/hooks");
+        new_repo($repo, "/usr/share/gitolite/hooks");
         wrap_chdir($ENV{HOME});
     }
 }
diff --git a/src/gl-compile-conf b/src/gl-compile-conf
index 138249d..fe3ed00 100755
--- a/src/gl-compile-conf
+++ b/src/gl-compile-conf
@@ -59,7 +59,7 @@ our ($REPONAME_PATT, $USERNAME_PATT, $AUTH_COMMAND, $AUTH_OPTIONS, $ABRT, $WARN)
 # the common setup module is in the same directory as this running program is
 my $bindir = $0;
 $bindir =~ s/\/[^\/]+$//;
-require "$bindir/gitolite.pm";
+require gitolite;
 
 # ask where the rc file is, get it, and "do" it
 &where_is_rc();
@@ -73,7 +73,7 @@ $ENV{PATH} .= ":$GIT_PATH" if $GIT_PATH;
 # ----------------------------------------------------------------------------
 
 # command and options for authorized_keys
-$AUTH_COMMAND="$GL_ADMINDIR/src/gl-auth-command";
+$AUTH_COMMAND="/usr/bin/gl-auth-command";
 $AUTH_OPTIONS="no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty";
 
 # groups can now represent user groups or repo groups.
@@ -339,7 +339,7 @@ wrap_chdir("$repo_base_abs");
 
 for my $repo (sort keys %repos) {
     unless (-d "$repo.git") {
-        new_repo($repo, "$GL_ADMINDIR/src/hooks");
+        new_repo($repo, "/usr/share/gitolite/hooks");
         # new_repo would have chdir'd us away; come back
         wrap_chdir("$repo_base_abs");
     }
diff --git a/src/gl-easy-install b/src/gl-easy-install
index db20e2f..3f53f48 100755
--- a/src/gl-easy-install
+++ b/src/gl-easy-install
@@ -48,7 +48,7 @@ main() {
     [[ $upgrade == 0 ]] && initial_conf_key
 
     # MANUAL: cd to $GL_ADMINDIR and run "src/gl-compile-conf"
-    ssh -p $port $user@$host "cd $GL_ADMINDIR; src/gl-compile-conf $quiet"
+    ssh -p $port $user@$host "cd $GL_ADMINDIR; gl-compile-conf $quiet"
 
     setup_pta
 
@@ -60,13 +60,12 @@ main() {
 # ----------------------------------------------------------------------
 
 setup_tempdir() {
-    export tmpgli=tmp-gl-install
     trap cleanup 0
-    mkdir -p $tmpgli
+    export tmpgli=$(mktemp -d)
 }
 
 cleanup() {
-    rm -rf $tmpgli
+    [ -d $tmpgli ] && rm -rf $tmpgli
 }
 
 # ----------------------------------------------------------------------
@@ -169,15 +168,15 @@ basic_sanity() {
     # MANUAL: make sure you're in the gitolite directory, at the top level.
     # The following files should all be visible:
 
-    ls  src/ga-post-update-hook     \
-        src/gitolite.pm             \
-        src/gl-install              \
-        src/gl-auth-command         \
-        src/gl-compile-conf         \
-        src/hooks/update            \
-        conf/example.conf           \
-        conf/example.gitolite.rc    >/dev/null ||
-        die "cant find at least some files in gitolite sources/config; aborting"
+#    ls  src/ga-post-update-hook     \
+#        src/gitolite.pm             \
+#        src/gl-install              \
+#        src/gl-auth-command         \
+#        src/gl-compile-conf         \
+#        src/hooks/update            \
+#        conf/example.conf           \
+#        conf/example.gitolite.rc    >/dev/null ||
+#        die "cant find at least some files in gitolite sources/config; aborting"
 
     # MANUAL: make sure you have password-less (pubkey) auth on the server.
     # That is, running "ssh git at server" should log in straight away, without
@@ -195,13 +194,15 @@ version_info() {
 
     # MANUAL: if needed, make a note of the version you are upgrading from, and to
 
-    # record which version is being sent across; we assume it's HEAD
-    git describe --tags --long HEAD 2>/dev/null > src/VERSION || echo '(unknown)' > src/VERSION
+    LOCAL=$(rpm -qf --qf '%{version}-%{release}' $0 2>/dev/null |
+        awk 'BEGIN {n="(unknown)"} {n=$0} END {print n}')
+    REMOTE=$(rpm -q --qf '%{version}-%{release}' gitolite) || FAIL=1
+
+    [ "$FAIL" ] && die "Could not determine version of gitolite installed on remote: $REMOTE"
 
     # what was the old version there?
     export upgrade_details="you are upgrading from \
-    $(ssh -p $port $user@$host cat gitolite-install/src/VERSION 2>/dev/null || echo '(unknown)' ) \
-    to $(cat src/VERSION)"
+        $REMOTE to $LOCAL"
 
     prompt "$upgrade_details" "$v_upgrade_details"
 }
@@ -281,9 +282,9 @@ copy_gl() {
     # server, to a directory called (for example) "gitolite-install".  You may
     # have to create the directory first.
 
-    ssh -p $port $user@$host mkdir -p gitolite-install
-    scp $quiet -P $port -r src conf doc $user@$host:gitolite-install/
-    rm -f src/VERSION
+    #ssh -p $port $user@$host mkdir -p gitolite-install
+    #scp $quiet -P $port -r src conf doc $user@$host:gitolite-install/
+    #rm -f src/VERSION
 
     # MANUAL: now log on to the server (ssh git at server) and get a command
     # line.  This step is for your convenience; the script does it all from
@@ -297,13 +298,14 @@ copy_gl() {
     prompt "finding/creating gitolite rc..." "$v_edit_glrc"
 
     # lets try and get the file from there first
+    scp -P $port $user@$host:/usr/share/gitolite/conf/example.gitolite.rc $tmpgli &>/dev/null
     if scp -P $port $user@$host:.gitolite.rc $tmpgli &>/dev/null
     then
         prompt "    ...trying to reuse existing rc" \
         "Oh hey... you already had a '.gitolite.rc' file on the server.
 Let's see if we can use that instead of the default one..."
         sort < $tmpgli/.gitolite.rc     | perl -ne 'print "$1\n" if /^\s*(\$\w+) *=/' > $tmpgli/glrc.old
-        sort < conf/example.gitolite.rc | perl -ne 'print "$1\n" if /^\s*(\$\w+) *=/' > $tmpgli/glrc.new
+        sort < $tmpgli/example.gitolite.rc | perl -ne 'print "$1\n" if /^\s*(\$\w+) *=/' > $tmpgli/glrc.new
         if diff -u $tmpgli/glrc.old $tmpgli/glrc.new
         then
             [[ $quiet == -q ]] || ${VISUAL:-${EDITOR:-vi}} $tmpgli/.gitolite.rc
@@ -313,10 +315,10 @@ Let's see if we can use that instead of the default one..."
             # customisations as well as any new variables that the new version of
             # gitolite has introduced
             prompt "" "$v_upgrade_glrc"
-            ${VISUAL:-${EDITOR:-vi}} conf/example.gitolite.rc $tmpgli/.gitolite.rc
+            ${VISUAL:-${EDITOR:-vi}} $tmpgli/example.gitolite.rc $tmpgli/.gitolite.rc
         fi
     else
-        cp conf/example.gitolite.rc $tmpgli/.gitolite.rc
+        cp $tmpgli/example.gitolite.rc $tmpgli/.gitolite.rc
         [[ $quiet == -q ]] || ${VISUAL:-${EDITOR:-vi}} $tmpgli/.gitolite.rc
     fi
 
@@ -347,7 +349,7 @@ run_install() {
     # MANUAL: still in the "gitolite-install" directory?  Good.  Run
     # "src/gl-install"
 
-    ssh -p $port $user@$host "cd gitolite-install; src/gl-install $quiet"
+    ssh -p $port $user@$host "gl-install $quiet"
 
     # MANUAL: if you're upgrading, run "src/gl-compile-conf" and you're done!
     # -- ignore the rest of this file for the purposes of an upgrade
@@ -408,7 +410,7 @@ GIT_WORK_TREE=$GL_ADMINDIR git diff --cached --quiet || GIT_WORK_TREE=$GL_ADMIND
     # properly.  The install program does this.  So cd back to the
     # "gitolite-install" directory and run "src/gl-install"
 
-    ssh -p $port $user@$host "cd gitolite-install; src/gl-install $quiet"
+    ssh -p $port $user@$host "gl-install $quiet"
 
     # MANUAL: you're done!  Log out of the server, come back to your
     # workstation, and clone the admin repo using "git clone
@@ -443,11 +445,11 @@ clone_it()
 v_upgrade_details="
 \$upgrade_details
 
-Note: getting '(unknown)' for the 'from' version should only happen once.
-Getting '(unknown)' for the 'to' version means you are probably installing
-from a tar file dump, not a real clone.  This is not an error but it's nice to
-have those version numbers in case you need support.  Try and install from a
-clone
+Note: You should have same versions of gitolite RPM packages installed both
+on server and locally.
+
+Please report problems with RPM packaged version of gitolite to Bugzilla:
+https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=gitolite
 "
 
 v_setting_up_keypair="
diff --git a/src/gl-install b/src/gl-install
index a4dc729..79c5249 100755
--- a/src/gl-install
+++ b/src/gl-install
@@ -24,14 +24,14 @@ sub wrap_mkdir
 # the common setup module is in the same directory as this running program is
 my $bindir = $0;
 $bindir =~ s/\/[^\/]+$//;
-require "$bindir/gitolite.pm";
+require gitolite;
 
 # ask where the rc file is, get it, and "do" it
 &where_is_rc();
 unless ($ENV{GL_RC}) {
     # doesn't exist.  Copy it across, tell user to edit it and come back
     my $glrc = $ENV{HOME} . "/.gitolite.rc";
-    system("cp conf/example.gitolite.rc $glrc");
+    system("cp /usr/share/gitolite/conf/example.gitolite.rc $glrc");
     print "created $glrc\n";
     print "please edit it, change the paths if you wish to, and RERUN THIS SCRIPT\n";
     exit;
@@ -48,20 +48,20 @@ my $repo_base_abs = ( $REPO_BASE =~ m(^/) ? $REPO_BASE : "$ENV{HOME}/$REPO_BASE"
 wrap_mkdir($repo_base_abs);
 wrap_mkdir($GL_ADMINDIR);
 # mkdir $GL_ADMINDIR's subdirs
-for my $dir qw(conf doc keydir logs src) {
+for my $dir qw(conf keydir logs) {
     wrap_mkdir("$GL_ADMINDIR/$dir");
 }
 
 # "src" and "doc" will be overwritten on each install, but not conf
-system("cp -R src doc $GL_ADMINDIR");
+#system("cp -R src doc $GL_ADMINDIR");
 
 unless (-f $GL_CONF) {
-    system("cp conf/example.conf $GL_CONF");
+    system("cp /usr/share/gitolite/conf/example.conf $GL_CONF");
     print <<EOF;
     created $GL_CONF
     please edit it, then run these two commands:
         cd $GL_ADMINDIR
-        src/gl-compile-conf
+        gl-compile-conf
     (the "admin" document should help here...)
 EOF
 }
@@ -71,21 +71,21 @@ chdir("$repo_base_abs") or die "chdir $repo_base_abs failed: $!\n";
 for my $repo (`find . -type d -name "*.git"`) {
     chomp ($repo);
     # propagate our own, plus any local admin-defined, hooks
-    system("cp $GL_ADMINDIR/src/hooks/* $repo/hooks/");
+    system("cp /usr/share/gitolite/hooks/* $repo/hooks/");
     chmod 0755, "$repo/hooks/update";
 }
 
 # oh and one of those repos is a bit more special and has an extra hook :)
 if ( -d "gitolite-admin.git/hooks" ) {
     print "copying post-update hook to gitolite-admin repo...\n";
-    system("cp $GL_ADMINDIR/src/ga-post-update-hook gitolite-admin.git/hooks/post-update");
+    system("cp /usr/share/gitolite/ga-post-update-hook gitolite-admin.git/hooks/post-update");
     system("perl", "-i", "-p", "-e", "s(GL_ADMINDIR=.*)(GL_ADMINDIR=$GL_ADMINDIR)",
         "gitolite-admin.git/hooks/post-update");
     chmod 0755, "gitolite-admin.git/hooks/post-update";
 }
 
 # fixup program renames
-for my $oldname qw(pta-hook.sh conf-convert.pl 00-easy-install.sh 99-emergency-addkey.sh install.pl update-hook.pl) {
-    unlink "$GL_ADMINDIR/src/$oldname";
-    unlink "$ENV{HOME}/gitolite-install/src/$oldname";
-}
+#for my $oldname qw(pta-hook.sh conf-convert.pl 00-easy-install.sh 99-emergency-addkey.sh install.pl update-hook.pl) {
+#    unlink "$GL_ADMINDIR/src/$oldname";
+#    unlink "$ENV{HOME}/gitolite-install/src/$oldname";
+#}
-- 
1.6.5.2



--- NEW FILE gitolite.spec ---
%global perl_vendorlib %(eval $(perl -V:vendorlib); echo $vendorlib)

Name:           gitolite
Version:        0.95
Release:        3.20091216git%{?dist}
Summary:        Highly flexible server for git directory version tracker

Group:          Applications/System
License:        GPLv2
URL:            http://github.com/sitaramc/gitolite
# The source for this package was pulled from upstream's vcs.  Use the
# following commands to generate the tarball:
# $ git clone git://github.com/sitaramc/gitolite.git gitolite
# $ cd gitolite
# $ git archive ed2bf5 |gzip >gitolite-ed2bf5.tar.gz
Source0:        gitolite-ed2bf5.tar.gz
Source1:        README
# Far from being upstreamable
Patch0:         gitolite-0.95-rpm.patch
Patch1:         gitolite-0.95-conf.patch
BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)

BuildArch:      noarch
BuildRequires:  perl(Text::Markdown)
# We provide the module, but don't create a package/name space
Provides:       perl(%{name}) = %{version}-%{release}
Requires:       git
Requires:       openssh-clients
Requires:       perl(:MODULE_COMPAT_%(eval $(%{__perl} -V:version); echo $version))
Requires(pre):  shadow-utils

%description
Gitolite allows a server to host many git repositories and provide access
to many developers, without having to give them real userids on the server.
The essential magic in doing this is ssh's pubkey access and the authorized
keys file, and the inspiration was an older program called gitosis.

Gitolite can restrict who can read from (clone/fetch) or write to (push) a
repository. It can also restrict who can push to what branch or tag, which
is very important in a corporate environment. Gitolite can be installed
without requiring root permissions, and with no additional software than git
itself and perl. It also has several other neat features described below and
elsewhere in the doc/ directory.


%prep
%setup -q -c
# Don't create backups; would mess with %%install
%patch0 -p1
%patch1 -p1
cp %{SOURCE1} .


%build
# Format documentation
for F in doc/*.mkd
do
        perl -MText::Markdown >$(echo $F |sed s/.mkd/.html/) <$F \
                -e 'print Text::Markdown::markdown (join "", <>)'
done


%install
rm -rf $RPM_BUILD_ROOT

# Directory structure
install -d $RPM_BUILD_ROOT%{_sharedstatedir}/%{name}
install -d $RPM_BUILD_ROOT%{_bindir}
install -d $RPM_BUILD_ROOT%{perl_vendorlib}
install -d $RPM_BUILD_ROOT%{_datadir}/%{name}

# Code
install -p src/gl-* $RPM_BUILD_ROOT%{_bindir}
install -p -m644 src/*.pm $RPM_BUILD_ROOT%{perl_vendorlib}
cp -a conf src/hooks src/ga-* $RPM_BUILD_ROOT%{_datadir}/%{name}

 
%clean
rm -rf $RPM_BUILD_ROOT


%pre
# Add "gitolite" user per http://fedoraproject.org/wiki/Packaging/UsersAndGroups
getent group %{name} >/dev/null || groupadd -r %{name}
getent passwd %{name} >/dev/null || \
useradd -r -g %{name} -d %{_sharedstatedir}/%{name} -s /bin/sh \
        -c "git repository hosting" %{name}


%files
%defattr(-,root,root,-)
%{_bindir}/*
%{perl_vendorlib}/*
%{_datadir}/%{name}
%attr(-,%{name},%{name}) %{_sharedstatedir}/%{name}
%doc doc/COPYING doc/*.html README


%changelog
* Thu Jan 21 2010 Lubomir Rintel (GoodData) <lubo.rintel at gooddata.com> - 0.95-3.20091216git
- Add documentation
- Rename upstream tarball

* Wed Dec 16 2009 Lubomir Rintel (GoodData) <lubo.rintel at gooddata.com> - 0.95-2.20091216git
- Rename patch
- Fix path to post-update hook
- Make example configuration compilable

* Wed Dec 16 2009 Lubomir Rintel (GoodData) <lubo.rintel at gooddata.com> - 0.95-1.20091216git
- Initial packaging


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/gitolite/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- .cvsignore	12 Jan 2010 06:22:11 -0000	1.1
+++ .cvsignore	20 Jan 2010 23:49:45 -0000	1.2
@@ -0,0 +1 @@
+gitolite-ed2bf5.tar.gz


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/gitolite/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- sources	12 Jan 2010 06:22:12 -0000	1.1
+++ sources	20 Jan 2010 23:49:46 -0000	1.2
@@ -0,0 +1 @@
+9e59e060c2a2b0953fe927046bef40d2  gitolite-ed2bf5.tar.gz



More information about the scm-commits mailing list