Difference between revisions of "Package Management"

From GlueXWiki
Jump to: navigation, search
 
(yum repository access (Fedora, SUSE, ...))
 
(20 intermediate revisions by 3 users not shown)
Line 1: Line 1:
HOWTO install and/or create Hall-D software packages
+
=HOWTO install and/or create JLab software packages=
  
==Creating an RPM==
 
  
Here are instructions on how I created an RPM. There are other ways, but this one seemed to work easily enough so I'm documenting it here for myself and others. This was done on a Fedora Core 6 system running on a virtual machine on my MacBook Pro using Parallels.
+
==Introduction==
 +
 
 +
This page gives information on accessing as well as adding to the JLab pre-compiled binary repository. This repository is ''not'' where we keep the source code written for Hall-D. For information on that, check out the [[Getting started with GlueX Software|"Getting Started"]] page. The binary repository is where we will place support packages needed to compile and/or run the Hall-D specific code. The intent is to make it easier to setup new systems or update old ones without having to track down and install numerous other 3rd party packages.
 +
 
 +
This page contains sections that give detailed instructions on making the package files (.rpm and .deb) and regenerating the indexes used by the high-level package managers. The packages and indexes are kept at a well known URL at jlab (http://www.jlab.org/12gev_phys/packages) so updates and new packages can be easily distributed.
 +
 
 +
 
 +
 
 +
===Some Background on Package Managers===
 +
 
 +
The term "package manager" seems to apply to two different levels of management. The lower level deals with the package files themselves which contain information about the files they contain as well as any dependencies on other packages. This level is implemented by rpm (for .rpm files) or dpkg (for .deb files). The higher level maintains an inter-dependency tree of the packages that can span multiple repositories across the internet. This level takes care of automatically downloading and installing additional packages that are needed to satisfy the dependencies of a package one wishes to install. This is implemented by things like "yum", "up2date", and "APT" (a.k.a. apt-get).
 +
 
 +
Inter-package dependancies should be handled by the package manager your system uses. For Fedora, and SuSE it is '''YUM''' and for Mac OS X, Ubuntu Linux and OpenSolaris, it's '''APT'''. Red Hat Enterprise Linux systems (3,4 and maybe 5) use ''up2date'' which supposedly can interface with yum or apt-rpm repositories. In practice, on my RHEL4, it used "header.info" files which are different from the "repodata" directory that modern yum clients look for.
 +
 
 +
===Supported Platforms Table===
 +
 
 +
Here is a table of the supported operating systems and processors. These are systems for which all core packages needed to run the Hall-D software are available through the system's native package management system.
 +
 
 +
 
 +
 
 +
<table border="1">
 +
<TR>
 +
  <TH colspan="2"></TH>
 +
  <TH colspan="100" bgcolor="cyan">processor</TH>
 +
</TR>
 +
  <TR>
 +
  <TH bgcolor="yellow">OS</TH>
 +
  <TH>Package<br>Manager</TH>
 +
  <TH bgcolor="cyan">i386/i686</TH>
 +
  <TH bgcolor="cyan">athlon</TH>
 +
  <TH bgcolor="cyan">x86_64</TH>
 +
  <TH bgcolor="cyan">powerpc</TH>
 +
</TR>
 +
<TR><TH bgcolor="yellow">Fedora Core 6</TH>
 +
    <TD>yum</TD>
 +
    <TD>Y</TD>
 +
    <TD>N</TD>
 +
    <TD>N</TD>
 +
    <TD>N</TD>
 +
</TR>
 +
<TR><TH bgcolor="yellow">Red Hat EL3</TH>
 +
    <TD>rpm</TD>
 +
    <TD>Y</TD>
 +
    <TD>N</TD>
 +
    <TD>N</TD>
 +
    <TD>N</TD>
 +
</TR>
 +
<TR><TH bgcolor="yellow">Red Hat EL4</TH>
 +
    <TD>up2date</TD>
 +
    <TD>Y</TD>
 +
    <TD>Y</TD>
 +
    <TD>Y</TD>
 +
    <TD>N</TD>
 +
</TR>
 +
<TR><TH bgcolor="yellow">Ubuntu 6</TH>
 +
    <TD>apt-get</TD>
 +
    <TD>Y</TD>
 +
    <TD>N</TD>
 +
    <TD>N</TD>
 +
    <TD>N</TD>
 +
</TR>
 +
<TR><TH bgcolor="yellow">Mac OS X 10.4</TH>
 +
  <TD>apt-get</TD>
 +
  <TD>Y</TD>
 +
    <TD>N</TD>
 +
    <TD>N</TD>
 +
    <TD>Y</TD>
 +
</TR>
 +
</table>
 +
 
 +
 
 +
== Accessing the Repository ==
 +
The repository keeps both .rpm and .deb files in one location. The repository is accesible via the web at:
 +
 
 +
http://www.jlab.org/12gev_phys/packages
 +
 
 +
On the JLab CUE, the actual directory that holds the package files is /group/12gev_phys/www/packages.
 +
 
 +
One can always download package files directly from the repository, but the better way is to tell your native package manager where the repository is located so you can install your packages through it. This will also allow you to get updates easier when needed. Instructions for setting up your package manager to look at the JLab repository are given in the following sections.
 +
 
 +
 
 +
===yum repository access (Fedora,  SUSE, ...)===
 +
 
 +
http://www.jlab.org/12gev_phys/RPMS/noarch/jlab-phys-1.2-1.noarch.rpm
 +
 
 +
<!--
 +
### This block commented out because it is *probably* no longer relevant, but just in case ....
 +
 
 +
http://www.jlab.org/12gev_phys/packages/linux/jlab-phys-0.0-0.i386.rpm
 +
<blockquote>''The above rpm has a bug in it.  After downloading and installing the rpm using "rpm -Uv jlab-phys-0.0-0.i386.rpm" you need to open the file /etc/yum.repos.d/jlab-phys.repo in your favorite editor.  Find the line that contains the URL to the Jlab yum repository.  One of the fields in the directory path contains the string "yum".  Change "yum" to "packages".  Save the file and exit the editor.  Patch complete.''</blockquote>
 +
-->
 +
 
 +
===apt-get repository access (Mac OS X, Ubuntu, ...)===
 +
 
 +
===up2date repository access (Red Hat EL4, ...)===
 +
 
 +
 
 +
If you already have ''yum'' installed (if you're using fedora then you do) you can just install the rpm that adds the JLab Physics repository to your yum configuration. You can get it from here:
 +
 
 +
==Adding to the repository==
 +
===Creating an RPM===
 +
 
 +
Here is the "easy" way to create an RPM in your user account without needing ''root'' privilege. Before you get started, note that you will need the ''rpmbuild'' program installed on your system. I believe this is done by default on FC6 if you install the developer tools. Otherwise, you can get them with ''yum install rpm-build''.
 +
 
 +
# Create a file named ''.rpmmacros'' in your home directory with these "magic" lines:
 +
#:
 +
#: %_topdir      %(echo $HOME)/rpmbuild
 +
#: %_smp_mflags  -j3
 +
#:
 +
# Create a directory named ''rpmbuild'' in your home directory and inside it create directories named: BUILD  RPMS  SOURCES  SPECS  SRPMS like so:
 +
#:
 +
#: > mkdir ~/rpmbuild
 +
#: > cd ~/rpmbuild
 +
#: > mkdir BUILD  RPMS  SOURCES  SPECS  SRPMS
 +
#:
 +
# Prepare the files for the package:
 +
#* The files you wish to include in your RPM should be placed in the ~/rpmbuild/SOURCES/<''packagename''> directory where <''packagename''> is the base name of your package. The base name is specified by the ''Name:'' tag in your spec file discussed below. Subdirectories should be created as necessary to include the full path of the final destination directory where the file(s) should be installed. For example, to get the include and lib directories to install into /usr/local, I created a usr/local/include and a usr/local/lib directory inside my ''/home/davidl/rpmbuild/SOURCES/jana'' directory.
 +
#* Create any README, INSTALL, Changelog, or TODO files that you want to include in your package. Put them in the topmost directory and they will be found automatically.
 +
#:
 +
# Create a ''spec'' file. It seems there are tools to help do this from templates. See mine for jana below. Modify the fields as appropriate.
 +
#:
 +
# Run ''rpmbuild'' to create your rpm.
 +
#: > rpmbuild -bb --target=i386-jlab-fc6 --buildroot=${HOME}/rpmbuild jana.spec
 +
#:
 +
#: where the target argument has the form ''arch''-''vendor''-''os'' and you should give it the name of your spec file.
 +
#:
 +
# The new rpm file should be left in the directory ~/rpmbuilds/RPMS/''arch'' where ''arch'' is the value passed to --target in the build command above.
 +
 
 +
 
 +
Example: jana.spec
 +
Name: jana
 +
Summary: JLab Reconstruction Framework
 +
Version: 1.0
 +
Release: fc6
 +
License: GPL
 +
URL: http://www.jlab.org/JANA
 +
Group: Misc
 +
Packager: JLab
 +
Distribution: JLAB
 +
BuildRoot: /usr/src/packages/SOURCES/%{name}-%{version}
 +
 +
%description
 +
 +
 +
Framework for doing threaded event reconstruction in Nuclear Physics experiments.
 +
 +
%files
 +
%defattr(-,root,root,0755)
 +
/
 +
 
 +
 
 +
You can check the contents of your new rpm file with
 +
 
 +
> rpm -qlp ''file.rpm''
 +
 
 +
You can test installation and removal of you new RPM with:
 +
 
 +
>rpm -i ''file.rpm''
 +
 
 +
>rpm -e ''file.rpm''
 +
 
 +
===Creating a DEB file (fink)===
 +
 
 +
The Mac OS X package [http://finkproject.org fink] uses debian package files and the ''apt-get'' program to manage the interpackage dependancies. The debian package management system is also used by a number of other Unix-like OSes including Debian Linux, Ubuntu Linux, and OpenSolaris. Creating a package is fairly straightforward and unlike RPMs, it seems to not require ''root'' access. Here is how I was able to create a debian package on Mac OS X.
  
 
# Prerequisites:
 
# Prerequisites:
#* You must have ''root'' access on the machine you are building the RPM on. This is because the rpmbuild tools like to write things into /usr/src which usually only ''root'' has access to. I believe there are ways around this, but I have not explored them as of yet.
+
#* If you're on Mac OS X, you should have [http://finkproject.org fink] installed.
#* The rpm tools must be installed on your system. I believe this is done by default on FC6 if you install the developer tools. Otherwise, you can get them with
+
#* The ''dpkg'' program must be installed. Any system based on debian packages, including fink on Mac OS X, will already have this.
#*:  ''yum install rpm-build''
+
#* Install the [http://www.kde-apps.org/content/show.php?content=33228 "RPM Package Maker""] program. This provides a nice graphical interface to creating the RPM and it's what the instructions below refer to.
+
 
#:
 
#:
 +
# Setup a directory to hold your package contents and ''control'' file. This can be anywhere and any name you want. Inside this should be a subdirectory called "DEBIAN". This directory will hold information used by ''dpkg'' when building the package, but will not be included in the files the package installs.
 +
# Inside the DEBIAN directory, create a file called "control". This is where the configuration info about the package is supplied. Here is what mine looked like:
 
#:
 
#:
# Preparing the files for the package:
+
#:<tt>
## Create a directory to hold the files you wish to be included in the RPM. The directory name should be the base name and version number of the RPM package. e.g. "''xerces-c-2.7.0''". This can be anywhere you want and does not need to be owned by ''root''.
+
#: Package: xerces-c
## Copy the files into this directory. Subdirectories should be created as necessary to include the full path of the final destination directory where the file(s) should be installed. For example, to get the include and lib directories to install into /usr/local, I created a usr/local directory inside my xerces-c-2.7.0 directory.
+
#: Version: 2.7.0
## Create any README, INSTALL, Changelog, or TODO files that you want to include in your package. Put them in the topmost directory and they will be found automatically.
+
#: Section: libs
 +
#: Architecture: darwin-i386
 +
#: Essential: no
 +
#: Depends:
 +
#: Installed-Size: 10916
 +
#: Maintainer: David Lawrence <davidl@jlab.org>
 +
#: Provides: xerces-c
 +
#: Description: Binary package of xerces-c 2.7.0
 +
#: </tt>
 
#:
 
#:
 +
#: There are more options than listed here and one should [http://www.debian.org/doc/debian-policy/ch-controlfields.html check the web] for an up-to-date list with descriptions.
 
#:
 
#:
# Run the ''/opt/kde/bin/rpmpm'' program as ''root''.
+
# Two other files must exist in the DEBIAN directory. These are scripts called ''postinst'' and ''prerm'' wich are run before installation and after package removal repsectively. For my package, I did not have any special tasks that I needed these for so I just made them trivial scripts that did nothing:
## Click the "Dir..." button and select the directory that holds your files.
+
#:
## Click the "New Spec File" button on the top left. (If you already tried creating an RPM, a spec file may already exist. In this case select it from the list on the left hand side and click the "Edit" button. If you want to get rid of the old spec file and start fresh, delete it from ''/usr/src/packages/SPECS/mini'').
+
#: <tt>
## Fill in the fields. Note that:
+
#: #!/bin/sh
##* The "Release" field should contain the target platform for the RPM. For example, for Fedora Core 6, I put "fc6".
+
#:</tt>
##* The "Distribution" field should contain something about the home repository where this RPM will be kept. I put "JLab".
+
#:
##* The summary field is required to be filled out as well.
+
# Copy all of your files into the directory that hold the DEBIAN directory (not the DEBIAN directory itself!). This should be considered the root of the install files system so if you want a file to end up in /usr/local/lib, you need to create a usr/local/lib directory here to put the file in. '''NOTE:''' if you are making a package to be installed with fink on Mac OS X, then you should place everything in the /sw directory path. This will keep all fink-installed packages consistent and contained.
##:
+
# Run the ''dpkg'' program to create your package. The first argument is the directory with all of your files and the second is the name of the final package file. Naming conventions dictate they follow this format:
## In the main window, deselect the "Autodetect" checkbox and select the "RPM" radiobutton.
+
#:
## Click "Start". The output window should appear and after several seconds it should complete with numerous informational messages.
+
#: ''package-version_os-arch.deb''
## Copy the new RPM file from where it was built to somewhere more convienient. For my system, it was left in ''/usr/src/redhat/RPMS/i386''.
+
#:
## Check that the install paths are correct using ''rpm -qlp file.rpm'' where you give it the name of your new RPM file.
+
#: For example, my package was named ''xerces-c-2.7.0_darwin-i386.deb''
 +
#:
 +
 
 +
You can check the contents of your new package with:
 +
dpkg -c ''file.deb''
 +
 
 +
To test installation and removal do:
 +
 
 +
dpkg -i ''file.deb''
 +
dpkg -r ''file.deb''
 +
 
 +
 
 +
 
 +
===Creating a yum repository index===
 +
 
 +
'''yum''' is a package management system built on top of RPM. It is used by several Linux distributions, most notably Fedora. Creating a yum repository is pretty easy. Since I have done this already, you probably don't need to. You just need to get the RPMs in the right place and re-run the "createrepo" program to rebuild the database. I document how I set up the repository here anyway.
 +
 
 +
# Prerequisites:
 +
#* Install the ''createrepo'' package (if not already). I did this using
 +
#*: ''yum install createrepo''
 +
#:
 +
# Create a directory to hold the yum repository. I did this in /group/12gev_phys/www/yum on the JLab CUE. This is because I wanted the repository to be accessible via http. Note that in order for this to work, directory listing must be enabled. I did this by creating a .htaccess file in the /group/12gev_phys/www directory that contained the following:
 +
#: <tt>
 +
#: Options +Indexes
 +
#: LayoutHeaderOff
 +
#: </tt>
 +
#:
 +
# Put all of your RPMs in the yum repository directory. I believe they can be placed inside subdirectories if you desire. The directory tree will be traversed when the repository database is created.
 +
# Run the ''createrepo'' program giving the name of the directory holding the yum repository. This will generate a few files and place them in a directory called "repodata" at the top of your repository.
 +
#:
 +
# Create a configuration file with the location of you repository. Here's the one I set up called ''jlab-phys.repo":
 +
#:
 +
#: <tt>
 +
#: [jlab-phys]
 +
#: name=JLab - Physics
 +
#: baseurl=http://www.jlab.org/12gev_phys/yum/linux
 +
#: enabled=1
 +
#: gpgcheck=0
 +
#: </tt>
 +
#:
 +
# Now you have a choice, you can just post this file with instructions to install it into /etc/yum/yum.repos.d or you can put it in an RPM that installs it there automatically. I did the latter and created a file jlab-phys-0.0-0.i386.rpm.
 +
#:
 +
 
 +
Now you should be all set. You can use your favorite yum client to look at the repository (once you've installed the configuration file in /etc/yum/yum.repos.d). I've use ''kyum'' which provides a nice graphical interface that allows me to check that my repository is being recognized by yum as well as temporarily disable other repositories while testing.
 +
 
 +
 
 +
 
 +
===Creating an apt-get repository index===
 +
 
 +
Install apt-ftparchive to handle multiple architectures when generating Packages file(s).
 +
 
 +
 
 +
 
 +
===Creating an up2date repository index===

Latest revision as of 09:45, 23 September 2009

HOWTO install and/or create JLab software packages

Introduction

This page gives information on accessing as well as adding to the JLab pre-compiled binary repository. This repository is not where we keep the source code written for Hall-D. For information on that, check out the "Getting Started" page. The binary repository is where we will place support packages needed to compile and/or run the Hall-D specific code. The intent is to make it easier to setup new systems or update old ones without having to track down and install numerous other 3rd party packages.

This page contains sections that give detailed instructions on making the package files (.rpm and .deb) and regenerating the indexes used by the high-level package managers. The packages and indexes are kept at a well known URL at jlab (http://www.jlab.org/12gev_phys/packages) so updates and new packages can be easily distributed.


Some Background on Package Managers

The term "package manager" seems to apply to two different levels of management. The lower level deals with the package files themselves which contain information about the files they contain as well as any dependencies on other packages. This level is implemented by rpm (for .rpm files) or dpkg (for .deb files). The higher level maintains an inter-dependency tree of the packages that can span multiple repositories across the internet. This level takes care of automatically downloading and installing additional packages that are needed to satisfy the dependencies of a package one wishes to install. This is implemented by things like "yum", "up2date", and "APT" (a.k.a. apt-get).

Inter-package dependancies should be handled by the package manager your system uses. For Fedora, and SuSE it is YUM and for Mac OS X, Ubuntu Linux and OpenSolaris, it's APT. Red Hat Enterprise Linux systems (3,4 and maybe 5) use up2date which supposedly can interface with yum or apt-rpm repositories. In practice, on my RHEL4, it used "header.info" files which are different from the "repodata" directory that modern yum clients look for.

Supported Platforms Table

Here is a table of the supported operating systems and processors. These are systems for which all core packages needed to run the Hall-D software are available through the system's native package management system.


processor
OS Package
Manager
i386/i686 athlon x86_64 powerpc
Fedora Core 6 yum Y N N N
Red Hat EL3 rpm Y N N N
Red Hat EL4 up2date Y Y Y N
Ubuntu 6 apt-get Y N N N
Mac OS X 10.4 apt-get Y N N Y


Accessing the Repository

The repository keeps both .rpm and .deb files in one location. The repository is accesible via the web at:

http://www.jlab.org/12gev_phys/packages

On the JLab CUE, the actual directory that holds the package files is /group/12gev_phys/www/packages.

One can always download package files directly from the repository, but the better way is to tell your native package manager where the repository is located so you can install your packages through it. This will also allow you to get updates easier when needed. Instructions for setting up your package manager to look at the JLab repository are given in the following sections.


yum repository access (Fedora, SUSE, ...)

http://www.jlab.org/12gev_phys/RPMS/noarch/jlab-phys-1.2-1.noarch.rpm


apt-get repository access (Mac OS X, Ubuntu, ...)

up2date repository access (Red Hat EL4, ...)

If you already have yum installed (if you're using fedora then you do) you can just install the rpm that adds the JLab Physics repository to your yum configuration. You can get it from here:

Adding to the repository

Creating an RPM

Here is the "easy" way to create an RPM in your user account without needing root privilege. Before you get started, note that you will need the rpmbuild program installed on your system. I believe this is done by default on FC6 if you install the developer tools. Otherwise, you can get them with yum install rpm-build.

  1. Create a file named .rpmmacros in your home directory with these "magic" lines:
     %_topdir  %(echo $HOME)/rpmbuild
     %_smp_mflags -j3
  2. Create a directory named rpmbuild in your home directory and inside it create directories named: BUILD RPMS SOURCES SPECS SRPMS like so:
    > mkdir ~/rpmbuild
    > cd ~/rpmbuild
    > mkdir BUILD RPMS SOURCES SPECS SRPMS
  3. Prepare the files for the package:
    • The files you wish to include in your RPM should be placed in the ~/rpmbuild/SOURCES/<packagename> directory where <packagename> is the base name of your package. The base name is specified by the Name: tag in your spec file discussed below. Subdirectories should be created as necessary to include the full path of the final destination directory where the file(s) should be installed. For example, to get the include and lib directories to install into /usr/local, I created a usr/local/include and a usr/local/lib directory inside my /home/davidl/rpmbuild/SOURCES/jana directory.
    • Create any README, INSTALL, Changelog, or TODO files that you want to include in your package. Put them in the topmost directory and they will be found automatically.
  4. Create a spec file. It seems there are tools to help do this from templates. See mine for jana below. Modify the fields as appropriate.
  5. Run rpmbuild to create your rpm.
    > rpmbuild -bb --target=i386-jlab-fc6 --buildroot=${HOME}/rpmbuild jana.spec
    where the target argument has the form arch-vendor-os and you should give it the name of your spec file.
  6. The new rpm file should be left in the directory ~/rpmbuilds/RPMS/arch where arch is the value passed to --target in the build command above.


Example: jana.spec

Name: jana
Summary: JLab Reconstruction Framework
Version: 1.0
Release: fc6
License: GPL
URL: http://www.jlab.org/JANA
Group: Misc
Packager: JLab
Distribution: JLAB
BuildRoot: /usr/src/packages/SOURCES/%{name}-%{version}

%description


Framework for doing threaded event reconstruction in Nuclear Physics experiments. 

%files
%defattr(-,root,root,0755)
/


You can check the contents of your new rpm file with

> rpm -qlp file.rpm

You can test installation and removal of you new RPM with:

>rpm -i file.rpm

>rpm -e file.rpm

Creating a DEB file (fink)

The Mac OS X package fink uses debian package files and the apt-get program to manage the interpackage dependancies. The debian package management system is also used by a number of other Unix-like OSes including Debian Linux, Ubuntu Linux, and OpenSolaris. Creating a package is fairly straightforward and unlike RPMs, it seems to not require root access. Here is how I was able to create a debian package on Mac OS X.

  1. Prerequisites:
    • If you're on Mac OS X, you should have fink installed.
    • The dpkg program must be installed. Any system based on debian packages, including fink on Mac OS X, will already have this.
  2. Setup a directory to hold your package contents and control file. This can be anywhere and any name you want. Inside this should be a subdirectory called "DEBIAN". This directory will hold information used by dpkg when building the package, but will not be included in the files the package installs.
  3. Inside the DEBIAN directory, create a file called "control". This is where the configuration info about the package is supplied. Here is what mine looked like:
    Package: xerces-c
    Version: 2.7.0
    Section: libs
    Architecture: darwin-i386
    Essential: no
    Depends:
    Installed-Size: 10916
    Maintainer: David Lawrence <davidl@jlab.org>
    Provides: xerces-c
    Description: Binary package of xerces-c 2.7.0
    There are more options than listed here and one should check the web for an up-to-date list with descriptions.
  4. Two other files must exist in the DEBIAN directory. These are scripts called postinst and prerm wich are run before installation and after package removal repsectively. For my package, I did not have any special tasks that I needed these for so I just made them trivial scripts that did nothing:
    #!/bin/sh
  5. Copy all of your files into the directory that hold the DEBIAN directory (not the DEBIAN directory itself!). This should be considered the root of the install files system so if you want a file to end up in /usr/local/lib, you need to create a usr/local/lib directory here to put the file in. NOTE: if you are making a package to be installed with fink on Mac OS X, then you should place everything in the /sw directory path. This will keep all fink-installed packages consistent and contained.
  6. Run the dpkg program to create your package. The first argument is the directory with all of your files and the second is the name of the final package file. Naming conventions dictate they follow this format:
    package-version_os-arch.deb
    For example, my package was named xerces-c-2.7.0_darwin-i386.deb

You can check the contents of your new package with:

dpkg -c file.deb

To test installation and removal do:

dpkg -i file.deb 
dpkg -r file.deb


Creating a yum repository index

yum is a package management system built on top of RPM. It is used by several Linux distributions, most notably Fedora. Creating a yum repository is pretty easy. Since I have done this already, you probably don't need to. You just need to get the RPMs in the right place and re-run the "createrepo" program to rebuild the database. I document how I set up the repository here anyway.

  1. Prerequisites:
    • Install the createrepo package (if not already). I did this using
      yum install createrepo
  2. Create a directory to hold the yum repository. I did this in /group/12gev_phys/www/yum on the JLab CUE. This is because I wanted the repository to be accessible via http. Note that in order for this to work, directory listing must be enabled. I did this by creating a .htaccess file in the /group/12gev_phys/www directory that contained the following:
    Options +Indexes
    LayoutHeaderOff
  3. Put all of your RPMs in the yum repository directory. I believe they can be placed inside subdirectories if you desire. The directory tree will be traversed when the repository database is created.
  4. Run the createrepo program giving the name of the directory holding the yum repository. This will generate a few files and place them in a directory called "repodata" at the top of your repository.
  5. Create a configuration file with the location of you repository. Here's the one I set up called jlab-phys.repo":
    [jlab-phys]
    name=JLab - Physics
    baseurl=http://www.jlab.org/12gev_phys/yum/linux
    enabled=1
    gpgcheck=0
  6. Now you have a choice, you can just post this file with instructions to install it into /etc/yum/yum.repos.d or you can put it in an RPM that installs it there automatically. I did the latter and created a file jlab-phys-0.0-0.i386.rpm.

Now you should be all set. You can use your favorite yum client to look at the repository (once you've installed the configuration file in /etc/yum/yum.repos.d). I've use kyum which provides a nice graphical interface that allows me to check that my repository is being recognized by yum as well as temporarily disable other repositories while testing.


Creating an apt-get repository index

Install apt-ftparchive to handle multiple architectures when generating Packages file(s).


Creating an up2date repository index