Permalink
Browse files

Merge puppetlabs-mock and puppetlabs-pe-mock into puppetlabs-rpmbuilder

This commit merges these three closely related modules
into a single 'rpmbuilder' module.
  • Loading branch information...
1 parent 810f6d9 commit e10fde3ed6410b31aa23ae2f4b8b83b70b96015a Will Hopper committed Aug 24, 2012
View
@@ -1,5 +1,5 @@
name 'puppetlabs-rpmbuilder'
-version '0.0.1'
+version '0.0.2'
source 'https://github.com/Whopper92/puppetlabs-rpmbuilder'
author 'Puppet Labs'
license 'Apache License 2.0'
View
@@ -8,14 +8,10 @@ RPM packages. Mock is the central package building tool utilized in this module.
By default, standard mock configurations are installed for package building for Enterprise
Linux 4, 5 and 6, as well as Fedora 15 and higher.
-The recommended 'puppet-module-mock' module provides configurations to build Puppet Labs RPM
+The puppetlabs::mock class provides configurations to build Puppet Labs RPM
packages for all of the previously stated distributions.
## Dependencies
Facter 1.6.3 or higher
puppet-module-epel
-
-## Recommended Modules
-
- puppetlabs-mock
View
@@ -2,5 +2,5 @@
include rpmbuilder::repos
include rpmbuilder::packages::essential
include rpmbuilder::packages::extra
- include mock
+ include rpmbuilder::mock::puppetlabs_mocks
}
@@ -0,0 +1,31 @@
+define rpmbuilder::mock::pe_config (
+ $config,
+ $build_root,
+ $target_arch,
+ $legal_host_arches = "'i386','i586','i686','x86_64'",
+ $chroot_setup_cmd = "install bash bzip2 coreutils cpio curl cvs diffutils\
+ fedpkg findutils gawk gcc gcc-c++ gnupg grep gzip info make patch redhat-release\
+ redhat-release-server redhat-rpm-config rpm-build sed shadow-utils tar unzip\
+ util-linux-ng which xz buildsys-macros",
+ $dist,
+ $ccache_enable = 'False',
+ $dist_macro = undef,
+ $base_repo_baseurl = undef,
+ $base_mirrorlist = undef,
+ $updates_repo_baseurl = undef,
+ $updates_repo_enabled = '1',
+ $updates_mirrorlist = undef,
+ $pe_repo_baseurl,
+ $extras_repo_baseurl = undef,
+ $failover_priority = undef,
+) {
+
+ file { "${config}":
+ ensure => present,
+ mode => '0644',
+ owner => 'root',
+ group => 'root',
+ content => template("pe_mock/pupent-mock-config.erb"),
+ require => Package['mock'],
+ }
+}
View
@@ -0,0 +1,299 @@
+class rpmbuilder::mock::pe_config {
+
+ $mock_path = '/etc/mock'
+ Package['mock'] -> Rpmbuilder::Mock::Pe_mocks<| |>
+
+ rpmbuilder::mock::pe_config { 'pupent-1.1-el4-i386-cve.cfg':
+ config => "${mock_path}/pupent-1.1-el4-i386-cve.cfg",
+ build_root => 'pupent-1.1-el4-i386-cve',
+ target_arch => 'i386',
+ dist => 'el4',
+ dist_macro => '.el4',
+ base_repo_baseurl => 'http://vault.centos.org/4.9/os/i386',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/1.1/repos/el-4-i386',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-1.1-el4-x86_64-cve.cfg':
+ config => "${mock_path}/pupent-1.1-el4-x86_64-cve.cfg",
+ build_root => 'pupent-1.1-el4-x86_64-cve',
+ target_arch => 'x86_64',
+ dist => 'el4',
+ dist_macro => '.el4',
+ base_repo_baseurl => 'http://vault.centos.org/4.9/os/x86_64/',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/1.1/repos/el-4-x86_64',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-1.1-el5-i386-cve.cfg':
+ config => "${mock_path}/pupent-1.1-el5-i386-cve.cfg",
+ build_root => 'pupent-1.1-el5-i386-cve',
+ target_arch => 'i386',
+ dist => 'el5',
+ dist_macro => '.el5',
+ base_repo_baseurl => 'http://yo.puppetlabs.lan/cent5latestserver-i386/RPMS.os',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/1.1/repos/el-5-i386/',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-1.1-el5-x86_64-cve.cfg':
+ config => "${mock_path}/pupent-1.1-el5-x86_64-cve.cfg",
+ build_root => 'pupent-1.1-el5-x86_64-cve',
+ target_arch => 'x86_64',
+ dist => 'el5',
+ dist_macro => '.el5',
+ base_repo_baseurl => 'http://yo.puppetlabs.lan/cent5latestserver-x86_64/RPMS.os',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/1.1/repos/el-5-x86_64',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-1.1-el6-i386-cve.cfg':
+ config => "${mock_path}/pupent-1.1-el6-i386-cve.cfg",
+ build_root => 'pupent-1.1-el6-i386-cve',
+ target_arch => 'i386',
+ dist => 'el6',
+ base_repo_baseurl => 'http://yo.puppetlabs.lan/cent6latestserver-i386/RPMS.os',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/1.1/repos/el-6-i386',
+ failover_priority => 'base',
+ }
+ rpmbuilder::mock::pe_config { 'pupent-1.1-el6-x86_64-cve.cfg':
+ config => "${mock_path}/pupent-1.1-el6-x86_64-cve.cfg",
+ build_root => 'pupent-1.1-el6-x86_64-cve',
+ target_arch => 'x86_64',
+ dist => 'el6',
+ base_repo_baseurl => 'http://yo.puppetlabs.lan/cent6latestserver-x86_64/RPMS.os',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/1.1/repos/el-6-x86_64',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-1.2-el4-i386-cve.cfg':
+ config => "${mock_path}/pupent-1.2-el4-i386-cve.cfg",
+ build_root => 'pupent-1.2-el4-i386-cve',
+ target_arch => 'i386',
+ dist => 'el4',
+ dist_macro => '.el4',
+ base_repo_baseurl => 'http://vault.centos.org/4.9/os/i386',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/1.2/repos/el-4-i386',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-1.2-el4-x86_64-cve.cfg':
+ config => "${mock_path}/pupent-1.2-el4-x86_64-cve.cfg",
+ build_root => 'pupent-1.2-el4-x86_64-cve',
+ target_arch => 'x86_64',
+ dist => 'el4',
+ dist_macro => '.el4',
+ base_repo_baseurl => 'http://vault.centos.org/4.9/os/x86_64/',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/1.2/repos/el-4-x86_64',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-1.2-el5-i386-cve.cfg':
+ config => "${mock_path}/pupent-1.2-el5-i386-cve.cfg",
+ build_root => 'pupent-1.2-el5-i386-cve',
+ target_arch => 'i386',
+ dist => 'el5',
+ dist_macro => '.el5',
+ base_repo_baseurl => 'http://yo.puppetlabs.lan/cent5latestserver-i386/RPMS.os',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/1.2/repos/el-5-i386/',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-1.2-el5-x86_64-cve.cfg':
+ config => "${mock_path}/pupent-1.2-el5-x86_64-cve.cfg",
+ build_root => 'pupent-1.2-el5-x86_64-cve',
+ target_arch => 'x86_64',
+ dist => 'el5',
+ dist_macro => '.el5',
+ base_repo_baseurl => 'http://yo.puppetlabs.lan/cent5latestserver-x86_64/RPMS.os',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/1.2/repos/el-5-x86_64',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-1.2-el6-i386-cve.cfg':
+ config => "${mock_path}/pupent-1.2-el6-i386-cve.cfg",
+ build_root => 'pupent-1.2-el6-i386-cve',
+ target_arch => 'i386',
+ dist => 'el6',
+ base_repo_baseurl => 'http://yo.puppetlabs.lan/cent6latestserver-i386/RPMS.os',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/1.2/repos/el-6-i386',
+ failover_priority => 'base',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-1.2-el6-x86_64-cve.cfg':
+ config => "${mock_path}/pupent-1.2-el6-x86_64-cve.cfg",
+ build_root => 'pupent-1.2-el6-x86_64-cve',
+ target_arch => 'x86_64',
+ dist => 'el6',
+ base_repo_baseurl => 'http://yo.puppetlabs.lan/cent6latestserver-x86_64/RPMS.os',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/1.2/repos/el-6-x86_64',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-2.0-el4-i386-cve.cfg':
+ config => "${mock_path}/pupent-2.0-el4-i386-cve.cfg",
+ build_root => 'pupent-2.0-el4-i386-cve',
+ target_arch => 'i386',
+ dist => 'el4',
+ dist_macro => '.el4',
+ base_repo_baseurl => 'http://vault.centos.org/4.9/os/i386',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.0/repos/el-4-i386',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-2.0-el4-x86_64-cve.cfg':
+ config => "${mock_path}/pupent-2.0-el4-x86_64-cve.cfg",
+ build_root => 'pupent-2.0-el4-x86_64-cve',
+ target_arch => 'x86_64',
+ dist => 'el4',
+ dist_macro => '.el4',
+ base_repo_baseurl => 'http://vault.centos.org/4.9/os/x86_64/',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.0/repos/el-4-x86_64',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-2.0-el5-i386-cve.cfg':
+ config => "${mock_path}/pupent-2.0-el5-i386-cve.cfg",
+ build_root => 'pupent-2.0-el5-i386-cve',
+ target_arch => 'i386',
+ dist => 'el5',
+ dist_macro => '.el5',
+ base_repo_baseurl => 'http://yo.puppetlabs.lan/cent5latestserver-i386/RPMS.os',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.0/repos/el-5-i386/',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-2.0-el5-x86_64-cve.cfg':
+ config => "${mock_path}/pupent-2.0-el5-x86_64-cve.cfg",
+ build_root => 'pupent-2.0-el5-x86_64-cve',
+ target_arch => 'x86_64',
+ dist => 'el5',
+ dist_macro => '.el5',
+ base_repo_baseurl => 'http://yo.puppetlabs.lan/cent5latestserver-x86_64/RPMS.os',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.0/repos/el-5-x86_64',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-2.0-el6-i386-cve.cfg':
+ config => "${mock_path}/pupent-2.0-el6-i386-cve.cfg",
+ build_root => 'pupent-2.0-el6-i386-cve',
+ target_arch => 'i386',
+ dist => 'el6',
+ base_repo_baseurl => 'http://yo.puppetlabs.lan/cent6latestserver-i386/RPMS.os',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.0/repos/el-6-i386',
+ failover_priority => 'base',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-2.0-el6-x86_64-cve.cfg':
+ config => "${mock_path}/pupent-2.0-el6-x86_64-cve.cfg",
+ build_root => 'pupent-2.0-el6-x86_64-cve',
+ target_arch => 'x86_64',
+ dist => 'el6',
+ base_repo_baseurl => 'http://yo.puppetlabs.lan/cent6latestserver-x86_64/RPMS.os',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.0/repos/el-6-x86_64',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-el4-i386.cfg':
+ config => "${mock_path}/pupent-el4-i386.cfg",
+ build_root => 'pupent-el4-i386',
+ target_arch => 'i386',
+ dist => 'el4',
+ base_repo_baseurl => 'http://vault.centos.org/4.9/os/i386',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.0/repos/el-4-i386',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-el4-x86_64.cfg':
+ config => "${mock_path}/pupent-el4-x86_64.cfg",
+ build_root => 'pupent-el4-x86_64',
+ target_arch => 'x86_64',
+ dist => 'el4',
+ base_repo_baseurl => 'http://vault.centos.org/4.9/os/x86_64/',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.0/repos/el-4-x86_64',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-el5-i386.cfg':
+ config => "${mock_path}/pupent-el5-i386.cfg",
+ build_root => 'pupent-el5-i386',
+ target_arch => 'i386',
+ dist => 'el5',
+ dist_macro => '.el5',
+ base_repo_baseurl => 'http://mirrors.cat.pdx.edu/centos/5/os/i386/',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.5/repos/el-5-i386/',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-el5-x86_64.cfg':
+ config => "${mock_path}/pupent-el5-x86_64.cfg",
+ build_root => 'pupent-el5-x86_64',
+ target_arch => 'x86_64',
+ dist => 'el5',
+ dist_macro => '.el5',
+ base_repo_baseurl => 'http://yo.puppetlabs.lan/cent5latestserver-x86_64/RPMS.os',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.5/repos/el-5-x86_64',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-el6-i386.cfg':
+ config => "${mock_path}/pupent-el6-i386.cfg",
+ build_root => 'pupent-el6-i386',
+ target_arch => 'i386',
+ dist => 'el6',
+ base_repo_baseurl => 'http://mirrors.cat.pdx.edu/centos/6/os/i386/',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.5/repos/el-6-i386',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-el6-x86_64.cfg':
+ config => "${mock_path}/pupent-el6-x86_64.cfg",
+ build_root => 'pupent-el6-x86_64',
+ target_arch => 'x86_64',
+ dist => 'el6',
+ base_repo_baseurl => 'http://yo.puppetlabs.lan/cent6latestserver-x86_64/RPMS.os',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.5/repos/el-6-x86_64',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-extras-el5-i386.cfg':
+ config => "${mock_path}/pupent-extras-el5-i386.cfg",
+ build_root => 'pupent-extras-el5-i386',
+ target_arch => 'i386',
+ dist => 'el5',
+ dist_macro => '.el5',
+ base_repo_baseurl => 'http://yo.puppetlabs.lan/cent5latestserver-i386/RPMS.os',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.5/repos/el-5-i386/',
+ extras_repo_baseurl => 'http://neptune.puppetlabs.lan/2.5/repos/yum-enterprise/el/5/extras/i386',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-extras-el5-x86_64.cfg':
+ config => "${mock_path}/pupent-extras-el5-x86_64.cfg",
+ build_root => 'pupent-extras-el5-x86_64',
+ target_arch => 'x86_64',
+ dist => 'el5',
+ dist_macro => '.el5',
+ base_repo_baseurl => 'http://yo.puppetlabs.lan/cent5latestserver-x86_64/RPMS.os',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.5/repos/el-5-x86_64',
+ extras_repo_baseurl => 'http://neptune.puppetlabs.lan/2.5/repos/yum-enterprise/el/5/extras/x86_64',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-extras-el6-i386.cfg':
+ config => "${mock_path}/pupent-extras-el6-i386.cfg",
+ build_root => 'pupent-extras-el6-i386',
+ target_arch => 'i386',
+ dist => 'el6',
+ base_mirrorlist => 'http://mirrorlist.centos.org/?release=6&arch=i386&repo=os',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.5/repos/el-6-i386',
+ extras_repo_baseurl => 'http://neptune.puppetlabs.lan/2.5/repos/yum-enterprise/el/6/extras/i386',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-extras-el6-x86_64.cfg':
+ config => "${mock_path}/pupent-extras-el6-x86_64.cfg",
+ build_root => 'pupent-extras-el6-x86_64',
+ target_arch => 'x86_64',
+ dist => 'el6',
+ base_repo_baseurl => 'http://yo.puppetlabs.lan/cent6latestserver-x86_64/RPMS.os',
+ pe_repo_baseurl => 'http://neptune.puppetlabs.lan/2.5/repos/el-6-x86_64',
+ extras_repo_baseurl => 'http://neptune.puppetlabs.lan/2.5/repos/yum-enterprise/el/6/extras/x86_64',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-fc15-i386.cfg':
+ config => "${mock_path}/pupent-fc15-i386.cfg",
+ build_root => 'pupent-fc15-i386',
+ target_arch => 'i386',
+ legal_host_arches => 'i386',
+ dist => 'fc15',
+ base_repo_baseurl => 'http://localhost/os/fc/15/i386',
+ pe_repo_baseurl => 'file:///tmp/output/pe/fc/15/i386',
+ }
+
+ rpmbuilder::mock::pe_config { 'pupent-fc15-x86_64.cfg':
+ config => "${mock_path}/pupent-fc15-x86_64.cfg",
+ build_root => 'pupent-fc15-x86_64',
+ target_arch => 'x86_64',
+ legal_host_arches => 'x86_64',
+ dist => 'fc15',
+ base_repo_baseurl => 'http://localhost/os/fc/15/x86_64',
+ pe_repo_baseurl => 'file:///tmp/output/pe/fc/15/x86_64',
+ }
+}
@@ -0,0 +1,33 @@
+define rpmbuilder::mock::pl_config (
+ $config,
+ $build_root,
+ $target_arch,
+ $legal_host_arches = "'i386','i586','i686','x86_64'",
+ $chroot_setup_cmd = "groupinstall buildsys-build",
+ $dist,
+ $dist_macro = undef,
+ $base_repo_baseurl = undef,
+ $base_mirrorlist = undef,
+ $base_debug_mirrorlist = undef,
+ $updates_repo_baseurl = undef,
+ $updates_mirrorlist = undef,
+ $updates_debug_mirrorlist = undef,
+ $updates_repo_enabled = '1',
+ $debug_mirrorlist = undef,
+ $puppet_prod_baseurl = undef,
+ $puppet_deps_baseurl = undef,
+ $puppet_dev_baseurl = undef,
+ $epel_repo_mirrorlist = undef,
+ $failover_priority = undef,
+ $is_vendor_puppetlabs = undef,
+) {
+
+ file { "${config}":
+ ensure => present,
+ mode => '0644',
+ owner => 'root',
+ group => 'root',
+ content => template("rpmbuilder/pl-mock-config.erb"),
+ require => Package['mock'],
+ }
+}
Oops, something went wrong.

0 comments on commit e10fde3

Please sign in to comment.