Building an RPM for Perforce ============================ This directory contains all the files you need to build an RPM for Perforce, with two notable exceptions - the p4 and p4d binaries. The intention is to make it easy to rebuild your RPM when new versions of the client and server become available. FILES ----- README - This file buildp4rpm.pl - Perl script to automate the build p4.spec - Describes how to build the RPM p4-redhat/ - Supporting scripts for Redhat based distros p4-suse/ - Supporting scripts for SuSE based distros How to build your RPM and SRPM ============================== First identify your RPM build directory. Here are some common places to look: Red Hat: /usr/src/RedHat Mandrake: /usr/src/RPM If you want to build the RPM's in your home directory, then put the following line in ~/.rpmmacros: %_topdir /home/tony/RPM Then create the following directories: /home/tony/RPM /home/tony/RPM/SPECS /home/tony/RPM/RPMS/i386 /home/tony/RPM/RPMS/i486 /home/tony/RPM/RPMS/i586 /home/tony/RPM/RPMS/i686 /home/tony/RPM/RPMS/k6 /home/tony/RPM/RPMS/noarch /home/tony/RPM/SRPMS /home/tony/RPM/SOURCES /home/tony/RPM/BUILD Once you have created (or located) the RPM build directories, you need to ensure that you have the following files available: p4.spec p4 (optional) p4d (optional) p4-redhat/* p4-suse/* The buildp4rpm.pl script will do everything necessary to build the RPM's, including downloading the binaries if you want it to. Just pick the command line flags to suit. EXAMPLES: perl buildp4rpm.pl --rpmroot /home/tony/RPM \ --ftp Would build the RPM using the tarball and specfile in the current directory, but will download the p4 and p4d binaries from the Perforce FTP site. The RPM built will do things the RedHat way. perl buildp4rpm.pl --rpmroot /usr/src/RPM --distro suse Would build the RPM using the script files in the local subdirectory p4-suse and p4 and p4d binaries from either (a) the current directory or (b) the path. Then install the RPM's. You must install the client RPM first as the server RPM requires the client to be present. rpm -i /usr/src/RPM/i386/p4-client-2000.1-16895.i386.rpm rpm -i /usr/src/RPM/i386/p4-server-2000.1-16895.i386.rpm The SRPM is also built just so that you have a copy of all of the necessary scripts and files, but this file, and the buildp4rpm.pl script are not yet included in the SRPM as it would lead to an excessively complicated script.