This commit is contained in:
parent
86aaceb23f
commit
2052a56aaf
120
git-daemon.init
Normal file
120
git-daemon.init
Normal file
@ -0,0 +1,120 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# SUSE system startup script for git-daemon
|
||||
# Copyright (C) 1995-2008 SUSE / Novell Inc.
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU Lesser General Public License as published by
|
||||
# the Free Software Foundation; either version 2.1 of the License, or (at
|
||||
# your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,
|
||||
# USA.
|
||||
#
|
||||
# /etc/init.d/git-daemon
|
||||
# and its symbolic link
|
||||
# /usr/sbin/rcgit-daemon
|
||||
#
|
||||
### BEGIN INIT INFO
|
||||
# Provides: git-daemon
|
||||
# Required-Start: $syslog $remote_fs $network
|
||||
# Required-Stop: $syslog $remote_fs
|
||||
# Default-Start: 3 5
|
||||
# Default-Stop: 0 1 2 6
|
||||
# Short-Description: server for git repositories
|
||||
# Description: server for git repositories
|
||||
### END INIT INFO
|
||||
|
||||
git_daemon=/usr/bin/git-daemon
|
||||
test -x $git_daemon || { echo "$git_daemon not installed";
|
||||
if [ "$1" = "stop" ]; then exit 0;
|
||||
else exit 5; fi; }
|
||||
|
||||
# Check for existence of needed config file and read it
|
||||
git_daemon_config=/etc/sysconfig/git-daemon
|
||||
test -r $git_daemon_config || { echo "$git_daemon_config not existing";
|
||||
if [ "$1" = "stop" ]; then exit 0;
|
||||
else exit 6; fi; }
|
||||
|
||||
# Read config
|
||||
. $git_daemon_config
|
||||
|
||||
: ${GIT_DAEMON_BASE_PATH:=/srv/git}
|
||||
|
||||
. /etc/rc.status
|
||||
|
||||
# Reset status of this service
|
||||
rc_reset
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting git-daemon "
|
||||
/sbin/start_daemon "$git_daemon" \
|
||||
--syslog \
|
||||
--detach \
|
||||
--reuseaddr \
|
||||
--user=git-daemon \
|
||||
--group=nogroup \
|
||||
--pid-file=/var/run/git-daemon.pid \
|
||||
--base-path="$GIT_DAEMON_BASE_PATH" \
|
||||
$GIT_DAEMON_ARGS
|
||||
|
||||
rc_status -v
|
||||
;;
|
||||
stop)
|
||||
echo -n "Shutting down git-daemon "
|
||||
/sbin/killproc -TERM $git_daemon
|
||||
rc_status -v
|
||||
;;
|
||||
try-restart|condrestart)
|
||||
if test "$1" = "condrestart"; then
|
||||
echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
|
||||
fi
|
||||
$0 status
|
||||
if test $? = 0; then
|
||||
$0 restart
|
||||
else
|
||||
rc_reset # Not running is not a failure.
|
||||
fi
|
||||
rc_status
|
||||
;;
|
||||
restart)
|
||||
## Stop the service and regardless of whether it was
|
||||
## running or not, start it again.
|
||||
$0 stop
|
||||
$0 start
|
||||
|
||||
# Remember status and be quiet
|
||||
rc_status
|
||||
;;
|
||||
force-reload)
|
||||
$0 try-restart
|
||||
rc_status
|
||||
;;
|
||||
reload)
|
||||
echo -n "Reload service git-daemon "
|
||||
## does not support reload
|
||||
rc_failed 3
|
||||
rc_status -v
|
||||
;;
|
||||
status)
|
||||
echo -n "Checking for service git-daemon "
|
||||
/sbin/checkproc $git_daemon
|
||||
rc_status -v
|
||||
;;
|
||||
probe)
|
||||
test $git_daemon_config -nt /var/run/git-daemon.pid && echo reload
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
rc_exit
|
@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Jun 16 16:43:50 CEST 2008 - lnussel@suse.de
|
||||
|
||||
- use separate package for git-daemon (bnc#382710)
|
||||
- add user and install init script for git-daemon
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue May 20 15:18:40 CEST 2008 - lnussel@suse.de
|
||||
|
||||
|
72
git.spec
72
git.spec
@ -14,13 +14,15 @@
|
||||
Name: git
|
||||
BuildRequires: asciidoc curl-devel libopenssl-devel sgml-skel xmlto
|
||||
Version: 1.5.4.5
|
||||
Release: 21
|
||||
Release: 29
|
||||
Summary: Fast, scalable, distributed revision control system
|
||||
License: GPL v2 or later
|
||||
Group: Development/Tools/Version Control
|
||||
Url: http://git.or.cz
|
||||
Source0: http://kernel.org/pub/software/scm/git/%name-%{version}.tar.bz2
|
||||
Source1: apache2-gitweb.conf
|
||||
Source2: sysconfig.git-daemon
|
||||
Source3: git-daemon.init
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
Requires: git-core = %{version} git-svn = %{version} git-cvs = %{version}
|
||||
Requires: git-arch = %{version} git-email = %{version} gitk = %{version}
|
||||
@ -47,6 +49,7 @@ License: GPL v2 or later
|
||||
Summary: Core git tools
|
||||
Group: Development/Tools/Version Control
|
||||
Requires: rsync, curl, less, openssh
|
||||
Requires: perl-base
|
||||
|
||||
%description core
|
||||
Git is a fast, scalable, distributed revision control system with an
|
||||
@ -129,6 +132,31 @@ Authors:
|
||||
Linus Torvalds <torvalds@osdl.org>
|
||||
Junio C Hamano <junkio@cox.net>
|
||||
|
||||
%package daemon
|
||||
License: GPL v2 or later
|
||||
Summary: Fast, scalable, distributed revision control system
|
||||
Group: Development/Tools/Version Control
|
||||
Requires: git-core = %{version}
|
||||
Provides: git-core:/usr/bin/git-daemon
|
||||
PreReq: /usr/sbin/useradd %fillup_prereq %insserv_prereq
|
||||
|
||||
%description daemon
|
||||
Git is a fast, scalable, distributed revision control system with an
|
||||
unusually rich command set that provides both high-level operations and
|
||||
full access to internals.
|
||||
|
||||
This package itself only provides the README of git but with the
|
||||
packages it requires, it brings you a complete Git environment
|
||||
including GTK and email interfaces and tools for importing source code
|
||||
repositories from other revision control systems such as subversion,
|
||||
CVS, and GNU arch.
|
||||
|
||||
|
||||
|
||||
Authors:
|
||||
--------
|
||||
Linus Torvalds <torvalds@osdl.org>
|
||||
|
||||
%package -n gitk
|
||||
License: GPL v2 or later
|
||||
Summary: Git revision tree visualiser
|
||||
@ -166,7 +194,6 @@ make %{_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" \
|
||||
make %{_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" DESTDIR=$RPM_BUILD_ROOT WITH_OWN_SUBPROCESS_PY=YesPlease NO_EXPAT=1 \
|
||||
prefix=%{_prefix} mandir=%{_mandir} \
|
||||
install %{!?_without_docs: install-doc}
|
||||
install -d ${RPM_BUILD_ROOT}/srv/git
|
||||
### git-web
|
||||
cp gitweb/INSTALL INSTALL.gitweb
|
||||
cp gitweb/README README.gitweb
|
||||
@ -177,9 +204,17 @@ install -m 644 %{SOURCE1} $RPM_BUILD_ROOT/etc/apache2/conf.d/gitweb.conf
|
||||
for i in git-favicon.png git-logo.png gitweb.css; do
|
||||
install -m 644 gitweb/$i $RPM_BUILD_ROOT/usr/share/git-web
|
||||
done
|
||||
### git-daemon
|
||||
install -d -m 755 $RPM_BUILD_ROOT/etc/init.d
|
||||
install -m 755 %{SOURCE3} $RPM_BUILD_ROOT/etc/init.d/git-daemon
|
||||
install -d -m 755 $RPM_BUILD_ROOT%{_sbindir}
|
||||
ln -s ../../etc/init.d/git-daemon $RPM_BUILD_ROOT%{_sbindir}/rcgit-daemon
|
||||
install -d -m 755 $RPM_BUILD_ROOT/var/adm/fillup-templates
|
||||
install -m 644 %{SOURCE2} $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.git-daemon
|
||||
install -d -m 755 $RPM_BUILD_ROOT/srv/git
|
||||
###
|
||||
(find $RPM_BUILD_ROOT%{_bindir} -type f | grep -vE "archimport|svn|cvs|email|gitk" | sed -e s@^$RPM_BUILD_ROOT@@) > bin-man-doc-files
|
||||
(find $RPM_BUILD_ROOT%{_mandir} $RPM_BUILD_ROOT/Documentation -type f | grep -vE "archimport|svn|git-cvs|email|gitk" | sed -e s@^$RPM_BUILD_ROOT@@ -e 's/$/*/' ) >> bin-man-doc-files
|
||||
(find $RPM_BUILD_ROOT%{_bindir} -type f | grep -vE "archimport|svn|cvs|email|gitk|daemon" | sed -e s@^$RPM_BUILD_ROOT@@) > bin-man-doc-files
|
||||
(find $RPM_BUILD_ROOT%{_mandir} $RPM_BUILD_ROOT/Documentation -type f | grep -vE "archimport|svn|git-cvs|email|gitk|daemon" | sed -e s@^$RPM_BUILD_ROOT@@ -e 's/$/*/' ) >> bin-man-doc-files
|
||||
( pushd perl
|
||||
perl Makefile.PL
|
||||
make -f perl.mak DESTDIR=${RPM_BUILD_ROOT} install_vendor
|
||||
@ -192,6 +227,20 @@ install -m 644 -D contrib/completion/git-completion.bash $RPM_BUILD_ROOT/etc/bas
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%pre daemon
|
||||
if ! /usr/bin/getent passwd git-daemon >/dev/null; then
|
||||
/usr/sbin/useradd -r -d /var/lib/empty -s /bin/false -c "git daemon" -g nogroup git-daemon || :
|
||||
fi
|
||||
|
||||
%post daemon
|
||||
%{fillup_and_insserv -n git-daemon}
|
||||
|
||||
%postun daemon
|
||||
%{insserv_cleanup}
|
||||
|
||||
%preun daemon
|
||||
%stop_on_removal
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%doc README
|
||||
@ -224,6 +273,17 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{!?_without_docs: %{_mandir}/man1/*email*.1*}
|
||||
%{!?_without_docs: %doc Documentation/*email*.html }
|
||||
|
||||
%files daemon
|
||||
%defattr(-,root,root)
|
||||
%doc Documentation/*daemon*.txt
|
||||
%{_bindir}/*daemon*
|
||||
/etc/init.d/git-daemon
|
||||
%{_sbindir}/rcgit-daemon
|
||||
%dir /srv/git
|
||||
/var/adm/fillup-templates/sysconfig.git-daemon
|
||||
%{!?_without_docs: %{_mandir}/man1/*daemon*.1*}
|
||||
%{!?_without_docs: %doc Documentation/*daemon*.html }
|
||||
|
||||
%files -n gitk
|
||||
%defattr(-,root,root)
|
||||
%doc Documentation/*gitk*.txt
|
||||
@ -235,7 +295,6 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%files core -f bin-man-doc-files
|
||||
%defattr(-,root,root)
|
||||
%{_datadir}/git-core/
|
||||
/srv/git/
|
||||
%doc README COPYING Documentation/*.txt
|
||||
%{!?_without_docs: %doc Documentation/*.html }
|
||||
/var/adm/perl-modules/%{name}
|
||||
@ -252,6 +311,9 @@ rm -rf $RPM_BUILD_ROOT
|
||||
/usr/share/git-web
|
||||
|
||||
%changelog
|
||||
* Mon Jun 16 2008 lnussel@suse.de
|
||||
- use separate package for git-daemon (bnc#382710)
|
||||
- add user and install init script for git-daemon
|
||||
* Tue May 20 2008 lnussel@suse.de
|
||||
- install gitweb icons, style sheet and README (bnc#359882)
|
||||
- build using V=1 so use of cflags can be verified by brp scripts
|
||||
|
18
sysconfig.git-daemon
Normal file
18
sysconfig.git-daemon
Normal file
@ -0,0 +1,18 @@
|
||||
## Path: Network/git-daemon
|
||||
## Description: git daemon configuration
|
||||
## ServiceRestart: git-daemon
|
||||
|
||||
## Type: string
|
||||
## Default:
|
||||
#
|
||||
# base path for exported directories
|
||||
#
|
||||
# defaults to "/srv/git" if not set
|
||||
#
|
||||
GIT_DAEMON_BASE_PATH=""
|
||||
|
||||
## Type: string
|
||||
## Default:
|
||||
#
|
||||
# additional arguments for git-daemon. See manual page
|
||||
GIT_DAEMON_ARGS=""
|
Loading…
Reference in New Issue
Block a user