lein-iplant-rpm

Leiningen Plugin for generating RPMs for Clojure projects.

License

License

BSD
Categories

Categories

Ant Build Tools
GroupId

GroupId

org.iplantc
ArtifactId

ArtifactId

lein-iplant-rpm
Last Version

Last Version

1.4.3
Release Date

Release Date

Type

Type

jar
Description

Description

lein-iplant-rpm
Leiningen Plugin for generating RPMs for Clojure projects.
Project URL

Project URL

http://www.iplantcollaborative.org
Source Code Management

Source Code Management

https://github.com/iPlantCollaborativeOpenSource/lein-iplant-rpm

Download lein-iplant-rpm

How to add to project

<!-- https://jarcasting.com/artifacts/org.iplantc/lein-iplant-rpm/ -->
<dependency>
    <groupId>org.iplantc</groupId>
    <artifactId>lein-iplant-rpm</artifactId>
    <version>1.4.3</version>
</dependency>
// https://jarcasting.com/artifacts/org.iplantc/lein-iplant-rpm/
implementation 'org.iplantc:lein-iplant-rpm:1.4.3'
// https://jarcasting.com/artifacts/org.iplantc/lein-iplant-rpm/
implementation ("org.iplantc:lein-iplant-rpm:1.4.3")
'org.iplantc:lein-iplant-rpm:jar:1.4.3'
<dependency org="org.iplantc" name="lein-iplant-rpm" rev="1.4.3">
  <artifact name="lein-iplant-rpm" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.iplantc', module='lein-iplant-rpm', version='1.4.3')
)
libraryDependencies += "org.iplantc" % "lein-iplant-rpm" % "1.4.3"
[org.iplantc/lein-iplant-rpm "1.4.3"]

Dependencies

compile (2)

Group / Artifact Type Version
org.clojure : clojure jar 1.5.1
fleet » fleet jar 0.9.5

test (2)

Group / Artifact Type Version
org.clojure : tools.nrepl jar 0.2.3
clojure-complete » clojure-complete jar 0.2.3

Project Modules

There are no modules declared in this project.

Leiningen Plugin for Generating RPMs

This is a leiningen plugin that can be used to generate RPM files for stand-alone services or command-line utilities that are written in Clojure.

Services are installed in the directory, /usr/local/lib/{project-name}, with an init.d script added to /etc/init.d. Upon installation, the service is configured to automatically start at run levels 2, 3, 4 and 5.

The JAR files for command-line utilities are installed in the directory, /usr/local/lib/{project-name}, with an automatically generated wrapper script installed in /usr/local/bin. Additional executable files, if present, are also installed in /usr/local/bin.

Note: the RPM files generated by this plugin are specific to iPlant. This plugin will have to be modified to work anywhere else.

Leiningen 1 Compatibility

This plugin is not currently compatible with Leiningen 1 although previous versions of it are. Please use version 1.1.1 of this plugin with Leiningen 1.

Usage

This plugin is stored in iPlant's Archiva repository, which will have to be defined in project.clj:

:repositories {"iplantCollaborative"
               "http://projects.iplantcollaborative.org/archiva/repository/internal/"}

Next, the plugin has to be added to the plugins section of project.clj:

[org.iplantc/lein-iplant-rpm "1.2.0-SNAPSHOT"]

Finally, a configuration section needs to be added to project.clj in order to control how the RPM is generated:

  :iplant-rpm {:summary "project summary"
               :release 1
               :provides "some name"
               :dependencies ["some-dependency >= some.version"]
               :config-files ["some.file" "someother.file"]
               :resources ["some.glob.pattern" "someother.glob.pattern"]
               :config-path "conf"}

Here's an example configuration file for one of iPlant's web services:

(defproject snowdog "1.1.0-SNAPSHOT"
  :description "Back-End Services for Something"
  :dependencies [[org.clojure/clojure "1.3.0"]
                 [org.clojure/data.json "0.1.1"]
                 [org.clojure/tools.logging "0.2.3"]
                 [org.clojure/java.jdbc "0.1.0"]
                 [org.iplantc/clojure-commons "1.1.0-SNAPSHOT"]
                 [compojure "1.0.1"]
                 [swank-clojure "1.4.0-SNAPSHOT"]
                 [log4j/log4j "1.2.16"]
                 [postgresql/postgresql "9.0-801.jdbc4"]
                 [c3p0/c3p0 "0.9.1.2"]
                 [ring/ring-jetty-adapter "1.0.1"]]
  :plugins [[org.iplantc/lein-iplant-rpm "1.1.0-SNAPSHOT"]
            [lein-ring "0.4.5"]
            [swank-clojure "1.4.0-SNAPSHOT"]]
  :aot [snowdog.core]
  :main snowdog.core
  :ring {:handler snowdog.core/app :init snowdog.core/load-configuration}
  :iplant-rpm {:summary "iPlant SnowDog"
               :release 1
               :provides "snowdog"
               :type :service
               :dependencies ["iplant-service-config >= 0.1.0-4"]
               :config-files ["log4j.properties"]
               :config-path "conf/main"}
  :repositories {"iplantCollaborative"
                 "http://projects.iplantcollaborative.org/archiva/repository/internal/"})

Configuration Settings

Many of the configuration settings for lein-iplant-rpm come from the project definition itself. In cases where the configuration settings can't be obtained from the project definitions or it may be helpful to override the setting from the project definition, the configuration setting is made available in the iplant-rpm section of project.clj. The configuration settings are described in detail below.

Summary

The summary, which is used as the value of the Summary tag of the RPM specification file, is specified using the :summary key in the :iplant-rpm configuration settings. This should contain a brief description of what is contained in the RPM.

Name

The RPM name is obtained directly from the project name (the first argument to the defproject macro). This field is used as the value of the Name tag in the RPM specification file, which is then used as part of the BuildRoot tag, part of the name of the source tarball, and the names of several other files and directories. This value is also used as the name of the init.d script and part of the name of the RPM specification file.

Version

The version string is obtained from the portion of the project version (the second argument to the defproject macro) prior to the first hyphen. For example, if the version string in the project file is 1.0.0-SNAPSHOT, the version string in this configuration setting is 1.0.0. This field is used as the value of the Version tag in the RPM specification file, which is used as part of the value of the BuildRoot tag, part of the name of the source tarball, and in the names of several other files and directories.

Release

The release number is configured in the :release attribute of the :iplant-rpm configuration settings. The value of this setting is used as the value of the Release tag in the RPM specification file. The release number defaults to 1 if it's not specified.

Provides

The name of the package that the RPM provides is configured in the :provides attribute of the :iplant-rpm configuration settings. The value of this setting is used as the value of the Provides tag in the RPM specification file. The package name defaults to the project name if it's not specified.

Type

This configuration setting indicates the type of the project, and its value must be a Clojure keyword. The currently accepted settings are :service, for a standalone service and :command for a command-line tool. This setting is obtained from the :type attribute of the :iplant-rpm configuration settings. For backward compatibility with lein-iplant-rpm version 1.0.0-SNAPSHOT, this setting defaults to :service if it's not specified.

Dependencies

The dependencies that this setting refers to here are the RPM dependencies rather than the JVM dependencies, which are automatically packaged in the JAR file. These dependencies are configured in the :dependencies attribute of the iplant-rpm configuration settings, which contains a vector of strings. Each string in this vector represents the name of the required RPM and any version number requirements associated with that RPM.

Description

The RPM description is obtained directly from the project description in project.clj, and is used as the value of the %description tag in the RPM specification file.

JAR Version Number

The JAR version string is obtained directly from the project version (the second project to the defproject macro. This version number contains the full version string rather than just the portion of the string prior to the first hyphen. This value is used to build the name of the JAR file in the %install section of the RPM specification file. It's also used to build the name of the JAR file that is being used in the init.d script.

Configuration Files

Any configuration files that are rquired by the service may be specified using the :config-files attribute of the :iplant-rpm configuration settings. This setting contains only the names of the configuration files, not the full paths to the files. This setting is used in conjunction with the :config-path setting to generate portions of the %install and %files sections of the RPM specification file.

Resources

Additional resource files can be specified using the :resources attribute of the :iplant-rpm configuration settings. This setting contains shell glob patterns that can be used to install the resource files into the same directory as the configuration files for services. Additional resources are not currently supported for command-line utilities. As with configuration files, only the names of the resource files are included on the command line. At this time, the plugin assumes that the resource files are in the same directory as the configuration files. This can be changed in the future if necessary.

Configuration Path

The path to the directory containing the configuration files, relative to the directory containing project.clj is specified using the :config-path attribute of the :iplant-rpm configuration settings. This setting is used in conjunction with the :config-files setting to generate portions of the %install and %files sections of the RPM specification file. This setting must be specified if any configuration files are listed in the in the :config-files setting.

Executable Files

This configuration setting, which is obtained from the :exe-files attribute of the :iplant-rpm configuration settings, is used to specify the paths (relative to the directory containing project.clj) to additional executable files that should be included in the RPM. The value of this setting should be a vector of strings. This setting is currently only supported for command-line tools.

Extra Classpath Directories

This setting is obtained directly from the :extra-classpath-dirs setting in project.clj. This setting is not used in the RPM specification or the init.d script, but it is used to determine if any additional directories need to be included in the source tarball.

Account Used to Run Services

This configuration setting, which is obtained from the :runuser attribute of the :iplant-rpm configuration settings, is used to specify the username that should be used when running the service. If this setting is not specified then the username will be set to iplant.

Known Issues

Leiningen 2 no longer supports the :extra-classpath-dirs option. Instead, it relies on the :dev profile to provide additional resource paths. Support for profiles will have to be added to this plugin before Leiningen 1 projects that rely on the :extra-classpath-dirs option can be migrated.

org.iplantc

iPlant Collaborative Open Source

This is an old github organization. The new organization is github.com/cyverse

Versions

Version
1.4.3