Skip to content

gerritjvv/lein-rpm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

lein-rpm

creates rpms for a lein project

Usage

add [fatrpm "0.1.0-SNAPSHOT"] to the plugins tag e.g in project.clj

e.g :plugins [[fatrpm "0.1.0-SNAPSHOT"]]

add an :rpm key and map with :name, :summary, :copyright, :workarea, :username, :groupname and :mappings to the project.clj file.

Type in lein fatrpm from the command line,
note that any mappings not found will be flagged as an error and the build will fail.

Example rpm configuration

  :rpm {:name      "hdfsimport"
        :summary   "hdfs import"
        :copyright "mycopyright"
        :workarea  "target"
        :username  "hdfs"
        :groupname "hdfs"
        :mappings  [; Jar
                    {:directory "/opt/hdfsimport/lib"
                     :filemode  "644"
                     :sources   [[(str "target/hdfsimport-"
                                    "0.1.0-SNAPSHOT"
                                    "-standalone.jar")
                                  "hdfsimport.jar"]]}


                    ; Log dir
                    {:directory           "/var/log/hdfsimport"
                     :filemode            "755"
                     :directory-included? true}

                    ; bin files
                    {:directory           "/opt/hdfsimport/bin"
                     :filemode            "755"
                     :directory-included? true
                     :sources             ["src/resources/bin/hdfsimport.sh"
                                           "src/resources/bin/logToHdfsSync.sh"]}

                    ; Config dir
                    {:directory           "/opt/hdfsimport/conf"
                     :filemode            "755"
                     :directory-included? true}

                    ; Config file
                    {:directory     "/opt/hdfsimport/conf"
                     :filemode      "644"
                     :configuration true
                     :sources       ["src/resources/conf/hdfsimport.edn"
                                     "src/resources/conf/log4j.properties"]}

                    ; Default file
                    {:directory     "/etc/sysconfig"
                     :filemode      "644"
                     :configuration true
                     :sources       [["src/resources/pkg/sysconfig" "hdfsimport"]]}

                    ; Init script
                    {:directory "/etc/init.d"
                     :filemode  "755"
                     :username  "root"
                     :groupname "root"
                     :sources   [["src/resources/pkg/init.sh" "hdfsimport"]]}]}

Building RPMS using Mac/Windows

You will need to use https://www.vagrantup.com:

E.g:

vagrant init chef/centos-7.1; vagrant up --provider virtualbox

Add the following to the vagrant file

config.vm.provision :shell, path: "bootstrap.sh"
config.vm.synced_folder "~/.m2", "/home/vagrant/.m2", disabled: false

The bootstrap.sh file is:

#!/usr/bin/env bash

yum install -y wget

wget https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein


sudo mv ./lein /usr/bin/

sudo chmod +x /usr/bin/lein


cd /opt/

wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" \
"http://download.oracle.com/otn-pub/java/jdk/8u25-b17/jdk-8u25-linux-x64.tar.gz"

sudo tar xvf jdk-8u25-linux-x64.tar.gz
sudo chown -R root: jdk1.8.0_25
sudo alternatives --install /usr/bin/java java /opt/jdk1.8.0_25/bin/java 1
sudo alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_25/bin/javac 1
sudo alternatives --install /usr/bin/jar jar /opt/jdk1.8.0_25/bin/jar 1

About

creates rpms for a lein project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published