Version Control & Packaging

Set Subversion Properties

This page explains how to set svn props: http://svnbook.red-bean.com/en/1.1/ch07s02.html

  • To set the $Id$ property, we do
    $ svn propset svn:keywords "Id" filename
  • To set executable on a file, we do
    $ svn propset svn:executable on filename

svn: This client is too old to work with working copy

Once in a while, I ran into this error with subversion:

svn: This client is too old to work with working copy ...

There are a couple of senarios:

1. The subversion is indeed too old, then we just upgrade it.

2. We temporarily tried a newer version of subversion. And the trial upgraded the format of the svn metadata.

3. We copied (rsync) the entire directory from another server that has a higher subversion.

Create User in RPM Package

In building an RPM .spec file, I wanted to create a user during pre-installation. So I had:

%pre
/usr/sbin/useradd -d /home/project/userid userid

This would fail if the directory "/home/project/" doesn't exist. My way to get aound this is to add a mkdir:

%pre
mkdir -p /home/project
/usr/sbin/useradd -d /home/project/userid userid

Create MySQL RPM

To create your own MySQL RPM package, you can:

Install PHP-APC on CentOS

  1. Yum up some packages:
    yum install make php-pear php-devel httpd-devel
  2. Install APC using pear (the pear installer is smarter than the pecl installer):
    When the installer asks about APXS, say ‘no’. 
    pear install pecl/apc
  3. Tell PHP to load APC:
    echo extension=apc.so > /etc/php.d/apc.ini
  4. Edit the file /etc/php.d/apc.ini, and add the following lines:
    apc.ttl="7200"
    apc.user_ttl="7200"
    apc.shm_segments="3"

Create CentOS PHP RPM

YUM Prerequisites

Before we start, we need to have all the dependencies installed:

Newer Software Versions in CentOS

In general, the software version in CentOS are behind. It's just the way CentOS and Red Hat operate. They aim for long term support and stability.

But if you have to use a newer software package, you may find that some newer packages in CentOS's test repository, as listed in this page Available Repositories for CentOS. For CentOS 5 testing packages, you can find them in CentOS Test Repos.

YUM Download Source RPM

How do I yum install SRPM from CentOS/Red Hat site, instead of manually download the srpm from one of the ftp website?

Install yum-utils

# yum install yum-utils

Yum and RPM Tips

Get the dependency

If the package is already installed, use "rpm -qR <package-name>" to get the list of packages that this package depends on. For example:

$ rpm -qR openldap

If the package is not yet installed, use "yum  deplist <package-name>" to get the list of packages that this package depends on. For example: