Building and Updating Courier-Authlib RPMs

The courier-authlib package consists of a set of programs created to handle authentication of login requests to the services of the courier-imap package, IMAP and POP3.

I developed the directions on this page using CentOS. However they should work with any RPM based Linux distro.

Note: The following instructions should be completed by a non-root user, except for a few specific commands as noted in the text.

  1. If you have not already done so, configure your home directory so that you can build RPM files without needing root privileges. This involves two steps:

    1. Create an RPM build directory structure in your home directory. I call mine "rpm", you may want to call yours "rpmbuild" or whatever... but choose a name which doesn't already exist. The example assumes you are using "rpm" as the name:

      % cd
      % mkdir -m 755 rpm
      % cd rpm
      % mkdir -m 755 BUILD RPMS SOURCES SPECS SRPMS

    2. Create a .rpmmacros file in your home directory which contains a pointer to the directory structure you just created. I use a second line which marks any RPM packages I build with my own name and email address- while not strictly required, it is a good idea. My file looks like this:

      %_topdir /home/marlowe/rpm
      %packager Patrick R McDonald <marlowe@antagonism.org>

      Obviously you need to substitute the full path to the "rpm" directory within your home directory, as well as your own name and email address.

  2. Download the latest source package from the mirror located nearest you to your rpm/SOURCES directory. Build the RPM with the source tarball.

    % cd ~/rpm/SOURCES
    % wget http://prdownloads.sourceforge.net/courier/courier-authlib-0.59.tar.bz2
    % rpmbuild -tb --define 'srcext .bz2' courier-authlib-0.59.tar.bz2

    (The below section is taken almost verbatim from the following page by John Simpson.

    This should go through the process of configuring and compiling the courier-authlib software according to the courier-authlib.spec file contained in the tarball. It will then "install" the software to a temporary working directory, and then scan that directory to build a list of the files which were installed. It then compares that list to a checklist in the spec file to make sure you aren't missing anything, and you aren't forgetting to include any files which are installed from the source, and then builds the binary RPM files.

    If it complains about missing dependencies, read the error message carefully. In many cases the message will tell you the name of the package or library it needs, and a simple "yum install" command as root will be all you need in order to install what it needs (and then try the "rpmbuild" command again.)

  3. Upgrade the courier-authlib software.

    If your current courier-authlib was installed using an earlier RPM package...

    % su -
    Password:
    # cd ~userid/rpm/RPMS/i386
    # rpm -Fvh courier-authlib-*
    # exit

    If your current courier-authlib was installed using some other method...
    • Shut down any IMAP or POP3 services which use courier-authlib.

    • Shut down any "authdaemond" process which may already be running. This may involve a command like "service authdaemon stop", or "/etc/init.d/authdaemon stop", or "killall authdaemond".

    • Uninstall the existing courier-authlib software. If it was installed from an RPM package you should be able to do "rpm -e courier-authlib". If it was installed from source, you should be able to go to the original source directory and run "make uninstall".

    • Install the new courier-authlib software.

      % su -
      Password:
      # cd ~userid/rpm/RPMS/i386
      # rpm -ivh courier-authlib-*
      # exit

  4. Make sure the authdaemond service is running, and that it will start automatically when the system boots up. If you are running authdaemond from daemontools simply start the service back up with the svc command. The below example covers the init script method.

    % su -
    Password:
    # /etc/init.d/authdaemon start
    # chkconfig --level 345 authdaemon on
    # exit

  5. Start your IMAP and POP3 services back up.