Репозиторий Sisyphus
Последнее обновление: 22 ноября 2017 | Пакетов: 17883 | Посещений: 10418216
en ru br
Репозитории ALT

Группа :: Система/Серверы
Пакет: puppet3

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

%define confdir ext/redhat

Name:    puppet3
Version: 3.8.7
Release: alt3.1

Summary: A network tool for managing many disparate systems
Group:   System/Servers
License: ASL 2.0
URL:     https://puppetlabs.com/

BuildArch: noarch

Source:  %name-%version.tar
Patch:  %name-%version-%release.patch
Patch1: %name-%version-%release-ext-alt.diff
Patch2: puppet-3.8.7-ext-puppetlisten-rotten.patch
Patch5: puppet-3.8.7-defaultfor-alt.patch

BuildRequires(pre): rpm-build-ruby
BuildRequires: ruby-em-http-request
BuildRequires: ruby-eventmachine
BuildRequires: ruby-facter
BuildRequires: ruby-hashie
BuildRequires: ruby-heredoc_unindent
BuildRequires: ruby-hiera
BuildRequires: ruby-pathspec
BuildRequires: ruby-rgen
BuildRequires(pre): rpm-macros-kde-common-devel
%_K_if_ver_gteq %version 4
# commit 9147c43327383d24927d2070f3ff0a6ba9909c0f preceding 4.0.0-rc1
# (PUP-3272) Remove vendored safe_yaml and related patches
#
# safe_yaml is no longer needed since YAML on the network is no longer
# supported (slow because of safe_yaml, and unsecure without it).
%global no_safe_yaml 1
%else
%def_with ruby_safe_yaml
%endif
%{!?no_safe_yaml:%{?with_ruby_safe_yaml:BuildRequires: ruby-safe_yaml}}

Provides: puppet = %EVR
Conflicts: puppet
Requires: shadow-change
# provider/service/systemd.rb is hardcoded as defaultfor ALT
Requires: /bin/systemctl
Conflicts: ruby-semantic

%filter_from_requires /^ruby(.*\(win32\|windows\|wmi-lite\|semantic\|spec_helper\|puppet\/network\/client\).*)/d

%description
Puppet lets you centrally manage every important aspect of your
system using a cross-platform specification language that manages
all the separate elements normally aggregated in different files,
like users, cron jobs, and hosts, along with obviously discrete
elements like packages, services, and files.

%package  server
Summary:  Server for the puppet system management tool
Group:    System/Servers
Requires: %name = %version-%release
Provides: puppet-server = %EVR
Conflicts: puppet-server

%description server
Provides the central puppet server daemon which provides manifests
to clients.  The server can also function as a certificate authority
and file server.

%prep
%setup
%patch5 -p1
%patch2 -p1
%patch1 -p1
%patch -p1
chmod +x ext/puppet-load.rb ext/regexp_nodes/regexp_nodes.rb
# remove vendor copy of libraries and support non-Linux platforms
subst 's/require /#require /' \
      lib/puppet/util/windows.rb
#      lib/puppet/vendor/require_vendored.rb \

rm -r \
      lib/puppet/feature/cfacter.rb \
      lib/puppet/util/rdoc \
      lib/puppet/util/windows \
      %{!?no_safe_yaml:lib/puppet/vendor/safe_yaml/spec} \
      lib/puppet/module_tool/skeleton/templates/generator/spec

echo "require 'rdoc'" > lib/puppet/util/rdoc.rb

# Unbundle

rm -r lib/puppet/vendor/*{pathspec,rgen%{!?no_safe_yaml:%{?with_ruby_safe_yaml:,safe_yaml}}}*

%build

%install
%ruby_vendor install.rb \
    --destdir=%buildroot \
    --configdir=%_sysconfdir/puppet \
    --codedir=%_sysconfdir/puppet/code \
    --vardir=%_localstatedir/puppet \
    --rundir=%_runtimedir/puppet \
    --logdir=%_logdir/puppet \
    --no-rdoc \
    --no-tests

# Systemd files

install -Dp -m0644 ext/systemd/puppet.service %buildroot%_unitdir/puppet.service
ln -s %_unitdir/puppet.service -T %buildroot%_unitdir/puppetagent.service
install -Dp -m0644 ext/systemd/puppetmaster.service %buildroot%_unitdir/puppetmaster.service
# SysVInit files
install -Dp -m0644 %confdir/client.sysconfig %buildroot%_sysconfdir/sysconfig/puppet
install -Dp -m0755 %confdir/client.init %buildroot%_initrddir/puppet
install -Dp -m0644 %confdir/server.sysconfig %buildroot%_sysconfdir/sysconfig/puppetmaster
install -Dp -m0755 %confdir/server.init %buildroot%_initrddir/puppetmaster

install -Dp -m0644 %confdir/fileserver.conf %buildroot%_sysconfdir/puppet/fileserver.conf
install -Dp -m0644 %confdir/puppet.conf %buildroot%_sysconfdir/puppet/puppet.conf
install -Dp -m0644 %confdir/logrotate %buildroot%_sysconfdir/logrotate.d/puppet

# Install the ext/ directory to %%_datadir/%%name

install -d %buildroot%_datadir/puppet
cp -a ext/ -t %buildroot%_datadir/puppet

# Install emacs mode files

emacsdir=%buildroot%_datadir/emacs/site-lisp
install -Dp -m0644 ext/emacs/puppet-mode.el $emacsdir/puppet-mode.el
install -Dp -m0644 ext/emacs/puppet-mode-init.el \
   $emacsdir/site-start.d/puppet-mode-init.el

# Install vim syntax files

vimdir=%buildroot%_datadir/vim/vimfiles
install -Dp -m0644 ext/vim/ftdetect/puppet.vim $vimdir/ftdetect/puppet.vim
install -Dp -m0644 ext/vim/syntax/puppet.vim $vimdir/syntax/puppet.vim

# TODO Install wrappers for SELinux

#install -Dp -m0755 %%SOURCE4 %buildroot%_bindir/start-puppet-agent
#sed -i 's/ at  at COMMAND at  at /agent/g' %buildroot%_bindir/start-puppet-agent
#install -Dp -m0755 %%SOURCE4 %buildroot%_bindir/start-puppet-master
#sed -i 's/ at  at COMMAND at  at /master/g' %buildroot%_bindir/start-puppet-agent

# Setup tmpfiles.d config

mkdir -p %buildroot%_sysconfdir/tmpfiles.d
echo "D /var/run/puppet 0755 _puppet puppet -" > \
   %buildroot%_sysconfdir/tmpfiles.d/%name.conf

# Create puppet modules directory for puppet module tool

mkdir -p %buildroot%_sysconfdir/puppet/modules

# Create service directory

mkdir -p %buildroot{%_localstatedir,%_logdir,%_runtimedir}/puppet

# emacs and vim bits are installed elsewhere

rm -r %buildroot%_datadir/puppet/ext/{emacs,vim}
# remove misc packaging artifacts in source not applicable to rpm
rm -r %buildroot%_datadir/puppet/ext/{gentoo,freebsd,solaris,suse,windows,osx,ips,debian}
rm -r %buildroot%_datadir/puppet/ext/{redhat,systemd}
rm %buildroot%_datadir/puppet/ext/{build_defaults.yaml,project_data.yaml}
# remove obsoleted checks
rm -r %buildroot%_datadir/puppet/ext/nagios

# Add missing directories

install -d %buildroot%_localstatedir/puppet/ssl/private_keys

%pre
%_sbindir/groupadd -r -f puppet
%_sbindir/useradd -r -n -g puppet -d %_localstatedir/puppet -s /dev/null -c Puppet _puppet >/dev/null 2>&1 ||:

%post
%post_service puppet

%preun
%preun_service puppet

%post server
%post_service puppetmaster

%preun server
%preun_service puppetmaster

%files
%_initdir/puppet
%_unitdir/puppet.service
%_unitdir/puppetagent.service
%config(noreplace) %_sysconfdir/tmpfiles.d/%name.conf
%dir %_sysconfdir/puppet
%config(noreplace) %_sysconfdir/puppet/puppet.conf
%config(noreplace) %_sysconfdir/puppet/auth.conf
%config(noreplace) %_sysconfdir/sysconfig/puppet
%config(noreplace) %_sysconfdir/logrotate.d/puppet
%_bindir/puppet
%_bindir/extlookup2hiera
%ruby_sitelibdir/*
%_datadir/puppet
%_man8dir/*
%_man5dir/puppet.conf.5*
%_datadir/emacs
%_datadir/vim
%attr(1770,_puppet,puppet) %dir %_localstatedir/puppet
%_localstatedir/puppet/*
%attr(1770,_puppet,puppet) %dir %_localstatedir/puppet/ssl/private_keys
%attr(1770,_puppet,puppet) %dir %_logdir/puppet
%attr(1770,_puppet,puppet) %dir %_runtimedir/puppet

%files server
%_initdir/puppetmaster
%_unitdir/puppetmaster.service
%config(noreplace) %_sysconfdir/puppet/fileserver.conf
%config(noreplace) %_sysconfdir/sysconfig/puppetmaster

%changelog

Полный changelog можно просмотреть здесь

 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin