diff --git a/cookbooks/jpackage/README.md b/cookbooks/jpackage/README.md new file mode 100644 index 0000000..2e7dcc0 --- /dev/null +++ b/cookbooks/jpackage/README.md @@ -0,0 +1,50 @@ +Description +=========== + +Configures and installs JPackage. Used to install Java-related packages on Red Hat flavored linuxes + +The JPackage Project has two primary goals: + +* To provide a coherent set of Java software packages for Linux, satisfying all quality requirements of other applications. +* To establish an efficient and robust policy for Java software packaging and installation. + +Requirements +============ + +Platform: + +* CentOS, Red Hat, Fedora + +The following Opscode cookbooks are dependencies: + +* java + +Attributes +========== + +* `node["jpackage"]["version"]` - The JPackage version to install, default "5.0". + +Usage +===== + +Simply include the recipe where you want JPackage installed. + +License and Author +================== + +Author:: Seth Chisamore () + +Copyright 2010, Opscode, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + diff --git a/cookbooks/jpackage/attributes/default.rb b/cookbooks/jpackage/attributes/default.rb new file mode 100644 index 0000000..bb7a7a8 --- /dev/null +++ b/cookbooks/jpackage/attributes/default.rb @@ -0,0 +1,20 @@ +# +# Cookbook Name:: jpackage +# Attributes:: default +# +# Copyright 2010, Opscode, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +default[:jpackage][:version] = "5.0" diff --git a/cookbooks/jpackage/metadata.json b/cookbooks/jpackage/metadata.json new file mode 100644 index 0000000..f83faea --- /dev/null +++ b/cookbooks/jpackage/metadata.json @@ -0,0 +1,42 @@ +{ + "providing": { + }, + "maintainer": "Opscode, Inc.", + "replacing": { + }, + "description": "Installs/Configures jpackage", + "maintainer_email": "cookbooks@opscode.com", + "groupings": { + }, + "attributes": { + }, + "recommendations": { + }, + "dependencies": { + "java": [ + + ] + }, + "suggestions": { + }, + "long_description": "Description\n===========\n\nConfigures and installs JPackage. Used to install Java-related packages on Red Hat flavored linuxes\n\nThe JPackage Project has two primary goals:\n\n* To provide a coherent set of Java software packages for Linux, satisfying all quality requirements of other applications.\n* To establish an efficient and robust policy for Java software packaging and installation.\n\nRequirements\n============\n\nPlatform: \n\n* CentOS, Red Hat, Fedora\n\nThe following Opscode cookbooks are dependencies:\n\n* java\n\nAttributes\n==========\n\n* `node[\"jpackage\"][\"version\"]` - The JPackage version to install, default \"5.0\".\n\nUsage\n=====\n\nSimply include the recipe where you want JPackage installed.\n\nLicense and Author\n==================\n\nAuthor:: Seth Chisamore ()\n\nCopyright 2010, Opscode, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n", + "platforms": { + "fedora": [ + + ], + "centos": [ + + ], + "redhat": [ + + ] + }, + "name": "jpackage", + "version": "0.10.0", + "conflicting": { + }, + "license": "Apache 2.0", + "recipes": { + "jpackage::default": "Installs and configures jpackage" + } +} \ No newline at end of file diff --git a/cookbooks/jpackage/metadata.rb b/cookbooks/jpackage/metadata.rb new file mode 100644 index 0000000..7847a0a --- /dev/null +++ b/cookbooks/jpackage/metadata.rb @@ -0,0 +1,14 @@ +maintainer "Opscode, Inc." +maintainer_email "cookbooks@opscode.com" +license "Apache 2.0" +description "Installs/Configures jpackage" +long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +version "0.10.0" + +depends "java" + +%w{ centos redhat fedora }.each do |os| + supports os +end + +recipe "jpackage::default", "Installs and configures jpackage" \ No newline at end of file diff --git a/cookbooks/jpackage/recipes/default.rb b/cookbooks/jpackage/recipes/default.rb new file mode 100644 index 0000000..1133e37 --- /dev/null +++ b/cookbooks/jpackage/recipes/default.rb @@ -0,0 +1,58 @@ +# +# Cookbook Name:: jpackage +# Recipe:: default +# +# Copyright 2010, Opscode, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +include_recipe "java" + +case node[:platform] +when "redhat","centos","fedora" + + package "yum-priorities" do + action :install + end + + execute "yum clean all" do + action :nothing + end + + template "/etc/yum.repos.d/jpackage#{node[:jpackage][:version].sub(/\./,'')}.repo" do + mode "0644" + source "jpackage.repo.erb" + notifies :run, resources(:execute => "yum clean all"), :immediately + end + + # fix the jpackage-utils issue + # https://bugzilla.redhat.com/show_bug.cgi?id=497213 + # http://plone.lucidsolutions.co.nz/linux/centos/jpackage-jpackage-utils-compatibility-for-centos-5.x + remote_file "#{Chef::Config[:file_cache_path]}/jpackage-utils-compat-el5-0.0.1-1.noarch.rpm" do + checksum "c61f2a97e4cda0781635310a6a595e978a2e48e64cf869df7d339f0db6a28093" + source "http://plone.lucidsolutions.co.nz/linux/centos/images/jpackage-utils-compat-el5-0.0.1-1.noarch.rpm" + mode "0644" + end + + package "jpackage-utils-compat-el5" do + source "#{Chef::Config[:file_cache_path]}/jpackage-utils-compat-el5-0.0.1-1.noarch.rpm" + options "--nogpgcheck" + version "0.0.1" + action :install + end + + package "jpackage-utils" do + action :install + end +end \ No newline at end of file diff --git a/cookbooks/jpackage/templates/default/jpackage.repo.erb b/cookbooks/jpackage/templates/default/jpackage.repo.erb new file mode 100644 index 0000000..f84be9c --- /dev/null +++ b/cookbooks/jpackage/templates/default/jpackage.repo.erb @@ -0,0 +1,49 @@ +[jpackage-generic-<%= node["jpackage"]["version"] %>] +name=JPackage (free), generic +mirrorlist=http://www.jpackage.org/mirrorlist.php?dist=generic&type=free&release=<%= node["jpackage"]["version"] %> +failovermethod=priority +gpgcheck=1 +gpgkey=http://www.jpackage.org/jpackage.asc +enabled=1 + +[jpackage-rhel-<%= node["jpackage"]["version"] %>] +name=JPackage (free) for Red Hat Enterprise Linux $releasever +mirrorlist=http://www.jpackage.org/mirrorlist.php?dist=redhat-el-$releasever&type=free&release=<%= node["jpackage"]["version"] %> +failovermethod=priority +gpgcheck=1 +gpgkey=http://www.jpackage.org/jpackage.asc +enabled=1 + +[jpackage-generic-<%= node["jpackage"]["version"] %>-nonfree] +name=JPackage (non-free), generic +mirrorlist=http://www.jpackage.org/jpackage_generic_nonfree_<%= node["jpackage"]["version"] %>.txt +failovermethod=priority +gpgcheck=1 +gpgkey=http://www.jpackage.org/jpackage.asc +enabled=1 + +# Updates + +[jpackage-generic-<%= node["jpackage"]["version"] %>-updates] +name=JPackage (free), generic +mirrorlist=http://www.jpackage.org/mirrorlist.php?dist=generic&type=free&release=<%= node["jpackage"]["version"] %>-updates +failovermethod=priority +gpgcheck=1 +gpgkey=http://www.jpackage.org/jpackage.asc +enabled=1 + +[jpackage-rhel-<%= node["jpackage"]["version"] %>-updates] +name=JPackage (free) for Red Hat Enterprise Linux $releasever +mirrorlist=http://www.jpackage.org/mirrorlist.php?dist=redhat-el-$releasever&type=free&release=<%= node["jpackage"]["version"] %>-updates +failovermethod=priority +gpgcheck=1 +gpgkey=http://www.jpackage.org/jpackage.asc +enabled=1 + +[jpackage-generic-<%= node["jpackage"]["version"] %>-nonfree-updates] +name=JPackage (non-free), generic +mirrorlist=http://www.jpackage.org/jpackage_generic_nonfree_<%= node["jpackage"]["version"] %>-updates.txt +failovermethod=priority +gpgcheck=1 +gpgkey=http://www.jpackage.org/jpackage.asc +enabled=1 diff --git a/cookbooks/jpackage/templates/fedora/jpackage.repo.erb b/cookbooks/jpackage/templates/fedora/jpackage.repo.erb new file mode 100644 index 0000000..b3b4dd7 --- /dev/null +++ b/cookbooks/jpackage/templates/fedora/jpackage.repo.erb @@ -0,0 +1,49 @@ +[jpackage-generic-<%= node["jpackage"]["version"] %>] +name=JPackage (free), generic +mirrorlist=http://www.jpackage.org/mirrorlist.php?dist=generic&type=free&release=<%= node["jpackage"]["version"] %> +failovermethod=priority +gpgcheck=1 +gpgkey=http://www.jpackage.org/jpackage.asc +enabled=1 + +[jpackage-fc-<%= node["jpackage"]["version"] %>] +name=JPackage (free) for Fedora Core $releasever +mirrorlist=http://www.jpackage.org/mirrorlist.php?dist=fedora-$releasever&type=free&release=<%= node["jpackage"]["version"] %> +failovermethod=priority +gpgcheck=1 +gpgkey=http://www.jpackage.org/jpackage.asc +enabled=1 + +[jpackage-generic-<%= node["jpackage"]["version"] %>-nonfree] +name=JPackage (non-free), generic +mirrorlist=http://www.jpackage.org/jpackage_generic_nonfree_<%= node["jpackage"]["version"] %>.txt +failovermethod=priority +gpgcheck=1 +gpgkey=http://www.jpackage.org/jpackage.asc +enabled=1 + +# Updates + +[jpackage-generic-<%= node["jpackage"]["version"] %>-updates] +name=JPackage (free), generic +mirrorlist=http://www.jpackage.org/mirrorlist.php?dist=generic&type=free&release=<%= node["jpackage"]["version"] %>-updates +failovermethod=priority +gpgcheck=1 +gpgkey=http://www.jpackage.org/jpackage.asc +enabled=1 + +[jpackage-fc-<%= node["jpackage"]["version"] %>-updates] +name=JPackage (free) for Fedora Core $releasever +mirrorlist=http://www.jpackage.org/mirrorlist.php?dist=fedora-$releasever&type=free&release=<%= node["jpackage"]["version"] %>-updates +failovermethod=priority +gpgcheck=1 +gpgkey=http://www.jpackage.org/jpackage.asc +enabled=1 + +[jpackage-generic-<%= node["jpackage"]["version"] %>-nonfree-updates] +name=JPackage (non-free), generic +mirrorlist=http://www.jpackage.org/jpackage_generic_nonfree_<%= node["jpackage"]["version"] %>-updates.txt +failovermethod=priority +gpgcheck=1 +gpgkey=http://www.jpackage.org/jpackage.asc +enabled=1