2 changed files with 173 additions and 0 deletions
@ -0,0 +1,140 @@
|
||||
## |
||||
## perforce.spec -- OpenPKG RPM Specification |
||||
## Copyright (c) 2000-2002 Cable & Wireless Deutschland GmbH |
||||
## Copyright (c) 2000-2002 The OpenPKG Project <http://www.openpkg.org/> |
||||
## Copyright (c) 2000-2002 Ralf S. Engelschall <rse@engelschall.com> |
||||
## |
||||
## 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 information |
||||
Name: perforce |
||||
Summary: The Perforce SCM System |
||||
URL: http://www.perforce.com/ |
||||
Vendor: Perforce Software |
||||
Packager: The OpenPKG Project |
||||
Distribution: OpenPKG [EXP] |
||||
Group: SCM |
||||
License: Commercial |
||||
Version: 2002.1 |
||||
Release: 20020719 |
||||
|
||||
# list of sources |
||||
Source0: perforce-%{version}.tar.bz2 |
||||
Source1: ftp://ftp.perforce.com/perforce/utils/c4/c4.tar.gz |
||||
Source2: http://www.perforce.com/perforce/doc.021/man/p4.1 |
||||
Source3: http://www.perforce.com/perforce/doc.021/man/p4d.1 |
||||
Source4: http://www.perforce.com/perforce/doc.021/manuals/p4guide/p4guide.pdf |
||||
Source5: http://www.perforce.com/perforce/doc.021/manuals/p4sag/p4sag.pdf |
||||
Source6: http://www.perforce.com/perforce/doc.021/manuals/cmdref/cmdref.pdf |
||||
Source7: http://www.perforce.com/perforce/doc.021/manuals/p4ftp/p4ftp.pdf |
||||
|
||||
# build information |
||||
Prefix: %{l_prefix} |
||||
BuildRoot: %{l_buildroot} |
||||
BuildPreReq: OpenPKG, openpkg >= 20020206 |
||||
PreReq: OpenPKG, openpkg >= 20020206 |
||||
AutoReq: no |
||||
AutoReqProv: no |
||||
|
||||
%description |
||||
Perforce (P4) is a commercial (but freely available and useable |
||||
for Open Source projects) Software Configuration Management (SCM) |
||||
system. It is superior to Concurrent Versions System (CVS) and |
||||
even (with the help of an existing CVS to P4 repository conversion |
||||
tool) can operate on the RCS files of CVS. This is the unlicensed |
||||
demo version. It has full time-unlimited functionality, but is |
||||
restricted to 2 users. For a real license one has to contact |
||||
<opensource@perforce.com>. |
||||
|
||||
%prep |
||||
%setup0 -q -c |
||||
%setup1 -q -T -D -a 1 |
||||
|
||||
%build |
||||
( cd c4-1.6 |
||||
%{l_make} %{l_mflags} \ |
||||
CC="%{l_cc}" CFLAGS="%{l_cflags -O}" |
||||
) |
||||
|
||||
%install |
||||
rm -rf $RPM_BUILD_ROOT |
||||
%{l_shtool} mkdir -f -p -m 755 \ |
||||
$RPM_BUILD_ROOT%{l_prefix}/bin \ |
||||
$RPM_BUILD_ROOT%{l_prefix}/sbin \ |
||||
$RPM_BUILD_ROOT%{l_prefix}/man/man1 \ |
||||
$RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \ |
||||
$RPM_BUILD_ROOT%{l_prefix}/libexec/perforce \ |
||||
$RPM_BUILD_ROOT%{l_prefix}/share/perforce \ |
||||
$RPM_BUILD_ROOT%{l_prefix}/var/perforce/p4d.depot |
||||
subdir="perforce-2002.1/bin" |
||||
case "%{l_target}" in |
||||
*-freebsd* ) subdir="$subdir.freebsd4" ;; |
||||
*-linux* ) subdir="$subdir.linux22x86" ;; |
||||
*-solaris* ) subdir="$subdir.solaris26" ;; |
||||
* ) echo "platform %{l_target} not supported" 1>&2; exit 1 ;; |
||||
esac |
||||
( cd $subdir |
||||
%{l_shtool} install -c -m 755 \ |
||||
p4 $RPM_BUILD_ROOT%{l_prefix}/bin/ |
||||
%{l_shtool} install -c -m 755 \ |
||||
p4d p4web p4ftpd $RPM_BUILD_ROOT%{l_prefix}/sbin/ |
||||
%{l_shtool} install -c -m 644 \ |
||||
%{SOURCE p4.1} %{SOURCE p4d.1} $RPM_BUILD_ROOT%{l_prefix}/man/man1/ |
||||
%{l_shtool} install -c -m 644 \ |
||||
%{SOURCE p4guide.pdf} %{SOURCE p4sag.pdf} \ |
||||
%{SOURCE cmdref.pdf} %{SOURCE p4ftp.pdf} \ |
||||
$RPM_BUILD_ROOT%{l_prefix}/share/perforce/ |
||||
) |
||||
( cd c4-1.6 |
||||
%{l_shtool} install -c -m 755 \ |
||||
c4 $RPM_BUILD_ROOT%{l_prefix}/bin/ |
||||
%{l_shtool} install -c -m 644 \ |
||||
c4-1.6/c4.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/ |
||||
) |
||||
%{l_shtool} install -c -m 755 \ |
||||
-e 's;@l_prefix@;%{l_prefix};g' \ |
||||
-e 's;@l_rusr@;%{l_rusr};g' \ |
||||
-e 's;@l_rgrp@;%{l_rgrp};g' \ |
||||
%{SOURCE rc.perforce} \ |
||||
$RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ |
||||
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
||||
%{l_files_std} \ |
||||
'%dir %attr(700,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/perforce' \ |
||||
'%dir %attr(700,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/perforce/p4d.depot' |
||||
|
||||
%files -f files |
||||
|
||||
%clean |
||||
rm -rf $RPM_BUILD_ROOT |
||||
|
||||
%post |
||||
if [ ".$1" = .1 ]; then |
||||
$RPM_INSTALL_PREFIX/etc/rc perforce start |
||||
sleep 1 |
||||
P4PORT=`$RPM_INSTALL_PREFIX/etc/rc -q perforce_port` |
||||
export P4PORT |
||||
( echo "Protections:" |
||||
echo " read user * * //..." |
||||
echo " write user * * //..." |
||||
echo " super user %{l_rusr} * //..." |
||||
) | su %{l_rusr} -c "$RPM_INSTALL_PREFIX/bin/p4 protect -i" >/dev/null 2>&1 |
||||
$RPM_INSTALL_PREFIX/etc/rc perforce stop |
||||
fi |
||||
|
@ -0,0 +1,33 @@
|
||||
#!@l_prefix@/lib/openpkg/bash @l_prefix@/etc/rc |
||||
## |
||||
## rc.perforce -- Run-Commands for P4 Daemon |
||||
## |
||||
|
||||
%config |
||||
perforce_enable="yes" |
||||
perforce_port="localhost:1666" |
||||
perforce_rootdir="@l_prefix@/var/perforce/p4d.depot" |
||||
perforce_journal="@l_prefix@/var/perforce/p4d.journal" |
||||
perforce_logfile="@l_prefix@/var/perforce/p4d.log" |
||||
|
||||
%start -p 100 -u root |
||||
if opServiceEnabled perforce; then |
||||
cmd="@l_prefix@/sbin/p4d" |
||||
cmd="$cmd -q -d -z" |
||||
cmd="$cmd -p ${perforce_port}" |
||||
cmd="$cmd -r ${perforce_rootdir}" |
||||
cmd="$cmd -J ${perforce_journal}" |
||||
cmd="$cmd -L ${perforce_logfile}" |
||||
umask 077 |
||||
su @l_rusr@ -c "nohup $cmd </dev/null >/dev/null 2>&1 &" |
||||
fi |
||||
|
||||
%stop -p 200 -u root |
||||
if opServiceEnabled perforce; then |
||||
cmd="@l_prefix@/bin/p4" |
||||
cmd="$cmd -p ${perforce_port}" |
||||
cmd="$cmd admin stop" |
||||
umask 077 |
||||
su @l_rusr@ -c "$cmd" |
||||
fi |
||||
|
Loading…
Reference in new issue