Category: "RPMs"

Web application RPM notes

Key elements of RPM spec files when used with web applications:

  • Source: - source should be the distribution tar file. If it isn’t yours (meaning it is an open source application), it is best to use the original or distribution URL. That way, you are sure it is unaltered
  • Build: - this is really just a copy into a directory
  • Files: - since there really isn’t a build process, you are just identifying the files and where they will go. The command suggestion below can be used to generate the filelist.
  • Provides and requires must be set carefully to make this work well for complex systems

tar -tzf eztagcloud.tgz | grep -v ".*/$" | awk '{ print "\"""%{targetdir}"$0"\""; }'

RPMs for web applications

Web applications are traditionally distributed with tar files, but they can be packaged as RPMs.

A web application in an RPM should have a tar file with the source. The tar file should have the files from the top of the application file tree, to make it easier if the target directory needs to change. The only parts of the .spec file that really need to be defined are the install, which will copy the files from the build root into a target directory, and clean, to delete the files after the RPM is built. Use tar tf to list the files from that tar (don’t list the directories or warnings will be issued for duplicate files). Be sure to encase the filenames in double quotes, write them to a file and then include them into the files section with the -f option. Using the -f option allows all the files for the tar to be specified, automatically, and ensures additional packages can be defined for the same directory with minimal conflicts.

The group for most web applications is Applications/Internet

RPMs can be created to allow the files to be relocated, another excellent approach would be to use symlinks into a single installation on a server, with account level configuration/access and databases.

During development, a script which creates tar files from the modules can be used to support both the RPM packaging, and create quick distribution packages for updates from a version control system.

Drupal RPM architecture

Drupal is one of the most popular content management systems and modular web application architectures available.

It would be an excellent system to deploy an RPM management system on. This system would generate .spec files for the modules, ensuring dependencies could be enforced and allowing the use of yum or other methods to automate upgrades.

The success of this approach for developers would be dependent upon their ability to architect their implementations without modifying Drupal and interfacing correctly to the module system.

It also requires that Drupal serve as a server component, rather than just an account-level application. Managed carefully, with configuration files and other innovative methods, rapid deployment of manageable Drupal sites would be extremely cost-effective.

http://web-notes.wirehopper.com/2008/06/23/open-source-rpm-spec-file

1 3