# packaging/linux/p4dti.spec -- spec. for building a Linux RPM for P4DTI # # $Id: //info.ravenbrook.com/project/p4dti/master/packaging/linux/p4dti.spec#19 $ # # This is the RPM "spec" file used to create the RPM distributed as part # of a release of the Perforce Defect Tracking Integration (P4DTI). This # file is used during the Release Build Procedure [GDR 2000-10-17]. See # that document for details of how to use this file when building a # Linux distribution. See [FJMD 2001-02-13] for an explanation of the # entries in this file. # # This file must be edited each time a new release is created to update # the "Version" field (which corresponds to the P4DTI project's notion # of a "release", e.g. "1.0.6") and the "%description" with correct # compatibility information. # # --- # # This file is copyright (c) 2001 Perforce Software, Inc. All rights # reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in # the documentation and/or other materials provided with the # distribution. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS 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 COPYRIGHT # HOLDERS AND 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. # Name: p4dti Version: 2.3.2 Release: 1 Group: Development/Tools Source: http://public.perforce.com/public/perforce/p4dti/release/%{version}/p4dti-bugzilla-%{version}.tar.gz Summary: An integration between Perforce SCM and Bugzilla Prefix: %{_prefix} License: see sources Buildroot: %{_tmppath}/%{name}-buildroot Vendor: Perforce Software, Inc. Requires: python, p4, bugzilla %description This is the Perforce Defect Tracking Integration (P4DTI). P4DTI connects your defect tracking system to Perforce, so that you don't have to switch between them and enter duplicate information about your work. It also links changes made in Perforce with defect tracker issues, making it easy to find out why a change was made, find the work that was done to resolve an issue, or generate reports relating issues to files or codelines. This package supports: - Perforce 2000.2, 2001.1, 2002.1, 2002.2, 2003.1, 2003.2, or 2004.2, on any platform; - Bugzilla 2.18.4 or 2.20; - Python 2.0 or later; Use of Bugzilla 2.16.8 or 2.18 is also supported, but is deprecated: support may be dropped in a future version of the P4DTI. For more information see the Administrator's Guide installed as part of this package, or the Perforce Software web site . %prep # This is the name of the directory created by untarring the "Source" # tar file [GDR 2000-10-17, 2.3]. This should be the same as the # basename of the tar file itself. %setup -n p4dti-bugzilla-%{version} %build rm -fr $RPM_BUILD_ROOT %install mkdir -p $RPM_BUILD_ROOT%{_prefix}/p4dti cp *.py *.txt *-patch $RPM_BUILD_ROOT%{_prefix}/p4dti touch $RPM_BUILD_ROOT%{_prefix}/p4dti/config.pyc chmod 440 $RPM_BUILD_ROOT%{_prefix}/p4dti/config.py $RPM_BUILD_ROOT%{_prefix}/p4dti/config.pyc mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d install -m 755 $RPM_SOURCE_DIR/startup-script $RPM_BUILD_ROOT/etc/rc.d/init.d/p4dti %clean rm -fr $RPM_BUILD_ROOT %pre /usr/sbin/groupadd -r -f p4dti && /usr/sbin/useradd -c 'Perforce Defect Tracking Integrator' -d $RPM_INSTALL_PREFIX0 -g p4dti -r -M p4dti || printf "A p4dti user has not been created\n" %post # If the package is relocated, the start script will have to be altered # so that it uses the correct directories. printf "/^P4DTIDIR/c\nP4DTIDIR=%s\n.\nw\n" %{_prefix}/p4dti | ed -s /etc/rc.d/init.d/p4dti /sbin/chkconfig --add p4dti || true %preun for i in $(ls $RPM_INSTALL_PREFIX/*.pyc 2>/dev/null) do [ -f $i ] && rm $i done /sbin/chkconfig --del p4dti || true /sbin/service p4dti stop || true %postun if id p4dti 2>/dev/null then /usr/sbin/userdel p4dti fi %files %defattr(-,p4dti,p4dti) %doc ug ag aag %{_prefix}/p4dti %attr(-,root,root) /etc/rc.d/init.d/p4dti # # A. REFERENCES # # [FJMD 2001-02-13] "Building RPMs for P4DTI"; Francis Davey; # Ravenbrook Limited; 2001-02-13. # # [GDR 2000-10-17] "Perforce Defect Tracking Integration Release # Build Procedure"; Gareth Rees; Ravenbrook Limited; 2000-10-17. # # # B. DOCUMENT HISTORY # # 2002-02-04 GDR Updated for release 1.4.0. # # 2002-04-09 NB Updated for release 1.4.1. # # 2002-04-19 NB Updated for release 1.4.2. # # 2002-10-31 NB Updated for release 1.5.0. # # 2002-11-20 NB Updated for release 1.5.1. # # 2002-12-11 NB Updated for release 1.5.2. # # 2002-12-13 NB Extend support to Perforce 2002.2. # # 2002-12-13 NB Updated for release 1.5.3. # # 2003-06-02 NB Updated for release 2.0.0. # # 2003-09-26 NB Set permissions on config.py and config.pyc to restrict # access to passwords which are stored in these files. # # 2003-12-13 NB Add Perforce 2003.1 and 2003.2. # # 2003-12-13 NB Updated for release 2.1.0. # # 2003-12-17 NB Updated for release 2.1.1. # # 2004-01-08 NB Updated for release 2.1.2. # # 2005-02-02 NB Updated for release 2.2.1. # # 2005-02-04 NB Updated for release 2.2.2.