MCOP-245 Add pl:packaging
Add the necessary boilerplate to build packages with the current Puppet Labs build infrastructure. Based on the packaging of mcollective-sysctl-data
This commit is contained in:
21
ext/build_defaults.yaml
Normal file
21
ext/build_defaults.yaml
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
packaging_url: 'git://github.com/puppetlabs/packaging.git --branch=master'
|
||||
packaging_repo: 'packaging'
|
||||
pbuild_conf: '/etc/pbuilderrc'
|
||||
default_cow: 'base-squeeze-i386.cow'
|
||||
cows: 'base-lucid-i386.cow base-precise-i386.cow base-squeeze-i386.cow base-stable-i386.cow base-testing-i386.cow base-trusty-i386.cow base-wheezy-i386.cow base-saucy-i386.cow'
|
||||
packager: 'puppetlabs'
|
||||
gpg_name: 'info@puppetlabs.com'
|
||||
gpg_key: '4BD6EC30'
|
||||
sign_tar: FALSE
|
||||
# a space separated list of mock configs
|
||||
final_mocks: 'pl-el-5-i386 pl-el-6-i386 pl-el-7-x86_64 pl-fedora-19-i386 pl-fedora-20-i386'
|
||||
yum_host: 'yum.puppetlabs.com'
|
||||
yum_repo_path: '/opt/repository/yum/'
|
||||
build_gem: FALSE
|
||||
build_dmg: FALSE
|
||||
build_doc: FALSE
|
||||
build_ips: FALSE
|
||||
apt_host: 'apt.puppetlabs.com'
|
||||
apt_repo_url: 'http://apt.puppetlabs.com'
|
||||
apt_repo_path: '/opt/repository/incoming'
|
||||
5
ext/debian/changelog.erb
Normal file
5
ext/debian/changelog.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
mcollective-actionpolicy-auth (<%= @debversion %>) lucid unstable sid squeeze wheezy precise; urgency=low
|
||||
|
||||
* Update to version <%= @debversion %>
|
||||
|
||||
-- Puppet Labs Release <info@puppetlabs.com> <%= Time.now.strftime("%a, %d %b %Y %H:%M:%S %z")%>
|
||||
1
ext/debian/compat
Normal file
1
ext/debian/compat
Normal file
@@ -0,0 +1 @@
|
||||
7
|
||||
13
ext/debian/control
Normal file
13
ext/debian/control
Normal file
@@ -0,0 +1,13 @@
|
||||
Source: mcollective-actionpolicy-auth
|
||||
Homepage: https://github.com/puppetlabs/mcollective-actionpolicy-auth
|
||||
Section: utils
|
||||
Priority: extra
|
||||
Maintainer: Puppet Labs
|
||||
Build-Depends: cdbs, debhelper
|
||||
Standards-Version: 3.8.0
|
||||
|
||||
Package: mcollective-actionpolicy-auth
|
||||
Architecture: all
|
||||
Description: Action Policy simplerpc authorization plugin
|
||||
Depends: mcollective-common(>= 2.2.1)
|
||||
|
||||
5
ext/debian/copyright
Normal file
5
ext/debian/copyright
Normal file
@@ -0,0 +1,5 @@
|
||||
Upstream Author:
|
||||
Puppet Labs https://github.com/puppetlabs/mcollective-actionpolicy-auth
|
||||
|
||||
License:
|
||||
ASL 2.0
|
||||
1
ext/debian/install
Normal file
1
ext/debian/install
Normal file
@@ -0,0 +1 @@
|
||||
util/* usr/share/mcollective/plugins/mcollective/util/
|
||||
4
ext/debian/rules
Normal file
4
ext/debian/rules
Normal file
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/make -f
|
||||
|
||||
%:
|
||||
dh $@
|
||||
36
ext/packaging.rake
Normal file
36
ext/packaging.rake
Normal file
@@ -0,0 +1,36 @@
|
||||
build_defs_file = File.join(RAKE_ROOT, 'ext', 'build_defaults.yaml')
|
||||
if File.exist?(build_defs_file)
|
||||
begin
|
||||
require 'yaml'
|
||||
@build_defaults ||= YAML.load_file(build_defs_file)
|
||||
rescue Exception => e
|
||||
STDERR.puts "Unable to load yaml from #{build_defs_file}:"
|
||||
raise e
|
||||
end
|
||||
@packaging_url = @build_defaults['packaging_url']
|
||||
@packaging_repo = @build_defaults['packaging_repo']
|
||||
raise "Could not find packaging url in #{build_defs_file}" if @packaging_url.nil?
|
||||
raise "Could not find packaging repo in #{build_defs_file}" if @packaging_repo.nil?
|
||||
|
||||
namespace :package do
|
||||
desc "Bootstrap packaging automation, e.g. clone into packaging repo"
|
||||
task :bootstrap do
|
||||
if File.exist?(File.join(RAKE_ROOT, "ext", @packaging_repo))
|
||||
puts "It looks like you already have ext/#{@packaging_repo}. If you don't like it, blow it away with package:implode."
|
||||
else
|
||||
cd File.join(RAKE_ROOT, 'ext') do
|
||||
%x{git clone #{@packaging_url}}
|
||||
end
|
||||
end
|
||||
end
|
||||
desc "Remove all cloned packaging automation"
|
||||
task :implode do
|
||||
rm_rf File.join(RAKE_ROOT, "ext", @packaging_repo)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
begin
|
||||
load File.join(RAKE_ROOT, 'ext', 'packaging', 'packaging.rake')
|
||||
rescue LoadError
|
||||
end
|
||||
14
ext/project_data.yaml
Normal file
14
ext/project_data.yaml
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
project: 'mcollective-actionpolicy-auth'
|
||||
author: 'Puppet Labs'
|
||||
email: 'info@puppetlabs.com'
|
||||
homepage: 'https://github.com/puppetlabs/mcollective-actionpolicy-auth'
|
||||
summary: 'Action Policy simplerpc authorization plugin'
|
||||
description: 'Action Policy simplerpc authorization plugin'
|
||||
# files and gem_files are space separated lists
|
||||
files:
|
||||
- util
|
||||
# List of packaging related templates to evaluate before the tarball is packed
|
||||
templates:
|
||||
- "ext/redhat/mcollective-actionpolicy-auth.spec.erb"
|
||||
- "ext/debian/changelog.erb"
|
||||
39
ext/redhat/mcollective-actionpolicy-auth.spec.erb
Normal file
39
ext/redhat/mcollective-actionpolicy-auth.spec.erb
Normal file
@@ -0,0 +1,39 @@
|
||||
# VERSION is subbed out during rake srpm process
|
||||
%global realversion <%= @version %>
|
||||
%global rpmversion <%= @rpmversion %>
|
||||
|
||||
Summary: Action Policy simplerpc authorization plugin
|
||||
Name: mcollective-actionpolicy-auth
|
||||
Version: %{rpmversion}
|
||||
Release: <%= @rpmrelease -%>%{?dist}
|
||||
Vendor: %{?_host_vendor}
|
||||
License: ASL 2.0
|
||||
URL: https://github.com/puppetlabs/mcollective-actionpolicy-auth
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
BuildArch: noarch
|
||||
Group: System Tools
|
||||
Source0: mcollective-actionpolicy-auth-%{realversion}.tar.gz
|
||||
Requires: mcollective-common >= 2.2.1
|
||||
|
||||
%description
|
||||
Action Policy simplerpc authorization plugin
|
||||
|
||||
%prep
|
||||
%setup -q -n %{name}-%{realversion}
|
||||
|
||||
%build
|
||||
|
||||
%install
|
||||
rm -rf %{buildroot}
|
||||
%{__install} -d -m0755 %{buildroot}%{_libexecdir}/mcollective/mcollective
|
||||
cp -a util %{buildroot}%{_libexecdir}/mcollective/mcollective
|
||||
|
||||
%clean
|
||||
rm -rf %{buildroot}
|
||||
|
||||
%files
|
||||
%{_libexecdir}/mcollective/mcollective/util/*
|
||||
|
||||
%changelog
|
||||
* <%= Time.now.strftime("%a %b %d %Y") %> Puppet Labs Release <info@puppetlabs.com> - <%= @rpmversion %>-<%= @rpmrelease %>
|
||||
- Build for <%= @version %>
|
||||
Reference in New Issue
Block a user