The config system is as a method to easily and automatically generate RPM packages. A package can be created simply by creating a directory containing the necessary files, with additional metadata files as needed for each package. New packages or changes in existing packages are detected when the checkandgen script is run and the RPM is rebuilt and placed on the mirror.
NOTE: Spaces in file names will break this system.
The scripts and templates are located in /var/lib/packagebuilding/cfgfilerpms/ on the config server (config.srv.lcsr.rutgers.edu)
The package cache is stored in a directory under /var/lib/packagebuilding/cfgfilerpms/ on the config server, for instance /var/lib/packagebuilding/cfgfilerpms/FC5/ for the set of packages for FC5. /var/lib/packagebuilding/cfgfilerpms/ contains a directory called skel which is an empty package cache, in case you want to start a new one.
/rpminfo/cfgfiles/ on the config server contains the source files for packages. The current hierarchy is as follows:
/rpminfo/cfgfiles/production/ – packages currently in use, changes here may affect all installed machines during the nightly update
/rpminfo/cfgfiles/production/FC3/ – production packages for FC3
/rpminfo/cfgfiles/production/FC3.done/ – packages for FC3 which have already been completed and built (placed in a separate directory to decrease the run time of the checkandgen script)
/rpminfo/cfgfiles/testing/ – packages only used on a few machines for testing
/rpminfo/cfgfiles/testing/FC3.testing/ – testing packages for FC3
/rpminfo/cfgfiles/testing/FC5.testing/ – testing packages for FC5
/rpminfo/cfgfiles/testing/FC5.done/ – packages for FC5 which have already been completed and built
/vol/vol1/ftp/pub/lcsr/fedora/linux/ on filer2 is the destination for the completed RPMs.
/vol/vol1/ftp/pub/fedora/linux/[FC version]/lcsr-configsystem/[packagename]/ - production packages
/vol/vol1/ftp/pub/fedora/linux/testing/[FC version]/lcsr-configsystem/[packagename]/ - testing packages
In the current implementation the same package cache is used for both the testing and production versions of packages from the same version of Fedora Core. This is to ensure consistent numbering between the testing and production versions.
Create a directory with the same name as the package you wish to create (ex: lcsr-foo-config)
If your package depends on other packages or libraries, create a file called requires
List dependencies with the package name one per line.
Comparison operators can be used to designate specific version numbers (ex: lcsr-sshd-config >= 1.1)
rpmbuilder has “AutoReqProv” enabled by default, which causes executables to be searched for libraries they depend on. The config system disables this, so if there is anything the package needs it must be explicitly specified.
If your package provides anything besides itself, create a file called provides
List one package name per line in this file
This is used mainly for virtual packages or package substitutes
If your package conflicts with another package, create a file called conflicts
List one package name per line in this file
Comparison operators can be used to designate specific version numbers (ex: lcsr-sshd-config >= 1.1)
If your package obsoletes another package, create a file called obsoletes
List one package name per line in this file
Using obsoletes to replace a package with a customized one is not recommended, as automatic updates to the new package will not
Create a file called version
Within this file, put the version number that you wish your package to have (ex: 1.0)
Release numbers are automatically generated based on change detection in the package directory structure / contents.
Depending on the type of files your package will include, create some or all of these following directories:
files – this directory is used for regular files you wish to include in your package
configs – this directory is used for configuration files you wish to include in your package
docs – this directory is used for documentation files you wish to include in your package
Within each of these directories, simply create a directory and file structure that includes the files you wish to have in your package.
For example, if you would like to include a specific /etc/hosts.equiv file, within the configs directory, you would simply create a directory called etc, and then place the hosts.equiv file that you wish to include in your package.
Make sure to set file permissions how you would like them to wind up on the system, as rpm will store permissions, and set them upon a package install.
If you wish to create an empty directory, or if you think your package should own a directory, simply create a file called .rpmdir within the directory. This will affect all subdirectories, as well.
File and directory permissions are preserved by default. File ownership in RPMs is stored by user and group name, not ID.
If you know that your package contains files that will conflict with files installed by other packages, but you want to force them to be installed, add .forcefilerpm to the end of the file name. Scripts will be created to back up the previous file and force yours in its place on installation, and to restore the backup on uninstallation.
When the package has been completely set up, run the checkandgen script, which finds changes, increments revision numbers, and generates new packages. The syntax is: /var/lib/packagebuilding/cfgfilerpms/checkandgen [package source directory] [destination directory on filer] [package cache label]
For example: /var/lib/packagebuilding/cfgfilerpms/checkandgen /rpminfo/cfgfiles/production/FC3.done/ /vol/vol1/ftp/pub/lcsr/fedora/linux/3/lcsr-configsystem/ FC3
In the future you can change packages or add new packages and run the same command line to update the filer.
If you choose a destination directory where the package does not exist it will be rebuilt, even if it is unchanged. An instance where this would be helpful is moving a package from testing to production, simply move it into the production directory and run checkandgen. Even if there is already an up to date package in testing, it will be rebuilt for the production repository.