ykarel / rpms / puppet

Forked from rpms/puppet 5 years ago
Clone
e23a2a8
%{!?ruby_sitelibdir: %define ruby_sitelibdir %(ruby -rrbconfig -e 'puts Config::CONFIG["sitelibdir"]')}
e23a2a8
%define pbuild %{_builddir}/%{name}-%{version}
e23a2a8
%define confdir conf/redhat
e23a2a8
afc3b92
%define has_ruby_abi 0%{?fedora:%fedora} >= 5 || 0%{?rhel:%rhel} >= 5
afc3b92
%define has_ruby_noarch %has_ruby_abi
afc3b92
e23a2a8
Summary: A network tool for managing many disparate systems
e23a2a8
Name: puppet
222e9ae
Version: 0.22.2
222e9ae
Release: 1%{?dist}
e23a2a8
License: GPL
e23a2a8
Group: System Environment/Base
e23a2a8
e23a2a8
URL: http://reductivelabs.com/projects/puppet/
e23a2a8
Source: http://reductivelabs.com/downloads/puppet/%{name}-%{version}.tgz
e23a2a8
e23a2a8
Requires: ruby >= 1.8.1
afc3b92
%if %has_ruby_abi
e23a2a8
Requires: ruby(abi) = 1.8
afc3b92
%endif
e23a2a8
Requires: facter >= 1.1.4
e23a2a8
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
afc3b92
%if %has_ruby_noarch
e23a2a8
BuildArchitectures: noarch
afc3b92
%endif
e23a2a8
BuildRequires: ruby >= 1.8.1
e23a2a8
e23a2a8
%description
e23a2a8
Puppet lets you centrally manage every important aspect of your system using a 
e23a2a8
cross-platform specification language that manages all the separate elements 
e23a2a8
normally aggregated in different files, like users, cron jobs, and hosts, 
e23a2a8
along with obviously discrete elements like packages, services, and files.
e23a2a8
e23a2a8
%package server
e23a2a8
Group: System Environment/Base
e23a2a8
Summary: Server for the puppet system management tool
e23a2a8
Requires: puppet = %{version}-%{release}
e23a2a8
e23a2a8
%description server
e23a2a8
Provides the central puppet server daemon which provides manifests to clients.
e23a2a8
The server can also function as a certificate authority and file server.
e23a2a8
e23a2a8
%prep
e23a2a8
%setup -q
e23a2a8
a0148e4
%build
a0148e4
for f in bin/* ; do 
a0148e4
  sed -i -e '1c#!/usr/bin/ruby' $f
a0148e4
done
a0148e4
e23a2a8
%install
e23a2a8
%{__rm} -rf %{buildroot}
e23a2a8
%{__install} -d -m0755 %{buildroot}%{_sbindir}
e23a2a8
%{__install} -d -m0755 %{buildroot}%{_bindir}
e23a2a8
%{__install} -d -m0755 %{buildroot}%{ruby_sitelibdir}
e23a2a8
%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/puppet/manifests
e23a2a8
%{__install} -d -m0755 %{buildroot}%{_docdir}/%{name}-%{version}
e23a2a8
%{__install} -d -m0755 %{buildroot}%{_localstatedir}/lib/puppet
e23a2a8
%{__install} -d -m0755 %{buildroot}%{_localstatedir}/run/puppet
e23a2a8
%{__install} -d -m0755 %{buildroot}%{_localstatedir}/log/puppet
e23a2a8
%{__install} -Dp -m0755 %{pbuild}/bin/* %{buildroot}%{_sbindir}
e23a2a8
%{__mv} %{buildroot}%{_sbindir}/puppet %{buildroot}%{_bindir}/puppet
e23a2a8
%{__mv} %{buildroot}%{_sbindir}/puppetrun %{buildroot}%{_bindir}/puppetrun
e23a2a8
%{__install} -Dp -m0644 %{pbuild}/lib/puppet.rb %{buildroot}%{ruby_sitelibdir}/puppet.rb
e23a2a8
%{__cp} -a %{pbuild}/lib/puppet %{buildroot}%{ruby_sitelibdir}
e23a2a8
find %{buildroot}%{ruby_sitelibdir} -type f -perm +ugo+x -print0 | xargs -0 -r %{__chmod} a-x
e23a2a8
%{__install} -Dp -m0644 %{confdir}/client.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/puppet
e23a2a8
%{__install} -Dp -m0755 %{confdir}/client.init %{buildroot}%{_initrddir}/puppet
e23a2a8
%{__install} -Dp -m0644 %{confdir}/server.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/puppetmaster
e23a2a8
%{__install} -Dp -m0755 %{confdir}/server.init %{buildroot}%{_initrddir}/puppetmaster
e23a2a8
%{__install} -Dp -m0644 %{confdir}/fileserver.conf %{buildroot}%{_sysconfdir}/puppet/fileserver.conf
e23a2a8
%{__install} -Dp -m0644 %{confdir}/puppetd.conf %{buildroot}%{_sysconfdir}/puppet/puppetd.conf
e23a2a8
%{__ln_s} puppetd.conf %{buildroot}%{_sysconfdir}/puppet/puppetmasterd.conf
e23a2a8
%{__ln_s} puppetd.conf %{buildroot}%{_sysconfdir}/puppet/puppetca.conf
e23a2a8
%{__install} -Dp -m0644 %{confdir}/logrotate %{buildroot}%{_sysconfdir}/logrotate.d/puppet
e23a2a8
e23a2a8
%files
e23a2a8
%defattr(-, root, root, 0755)
e23a2a8
%{_bindir}/puppet
e23a2a8
%{_sbindir}/puppetd
e23a2a8
%{ruby_sitelibdir}/*
e23a2a8
%{_initrddir}/puppet
e23a2a8
%config(noreplace) %{_sysconfdir}/sysconfig/puppet
e23a2a8
%config(noreplace) %{_sysconfdir}/puppet/puppetd.conf
e23a2a8
%doc CHANGELOG COPYING LICENSE README TODO examples
e23a2a8
%exclude %{_sbindir}/puppetdoc
e23a2a8
%config(noreplace) %{_sysconfdir}/logrotate.d/puppet
e23a2a8
# These need to be owned by puppet so the server can
e23a2a8
# write to them
e23a2a8
%attr(-, puppet, puppet) %{_localstatedir}/run/puppet
e23a2a8
%attr(-, puppet, puppet) %{_localstatedir}/log/puppet
e23a2a8
%attr(-, puppet, puppet) %{_localstatedir}/lib/puppet
e23a2a8
e23a2a8
%files server
e23a2a8
%defattr(-, root, root, 0755)
e23a2a8
%{_sbindir}/puppetmasterd
e23a2a8
%{_bindir}/puppetrun
e23a2a8
%{_initrddir}/puppetmaster
e23a2a8
%config(noreplace) %{_sysconfdir}/puppet/*
e23a2a8
%config(noreplace) %{_sysconfdir}/sysconfig/puppetmaster
e23a2a8
%{_sbindir}/puppetca
e23a2a8
e23a2a8
%pre
e23a2a8
/usr/sbin/groupadd -r puppet 2>/dev/null || :
e23a2a8
/usr/sbin/useradd -g puppet -c "Puppet" \
222e9ae
    -s /sbin/nologin -r -d /var/lib/puppet puppet 2> /dev/null || :
222e9ae
if [ $1 -gt 1 ] ; then
222e9ae
  /usr/sbin/usermod -d /var/lib/puppet puppet || :
222e9ae
fi
e23a2a8
%post
e23a2a8
/sbin/chkconfig --add puppet
e23a2a8
exit 0
e23a2a8
e23a2a8
%post server
e23a2a8
/sbin/chkconfig --add puppetmaster
e23a2a8
e23a2a8
%preun
e23a2a8
if [ "$1" = 0 ] ; then
afc3b92
  /sbin/service puppet stop > /dev/null 2>&1
afc3b92
  /sbin/chkconfig --del puppet
e23a2a8
fi
e23a2a8
e23a2a8
%preun server
e23a2a8
if [ "$1" = 0 ] ; then
afc3b92
  /sbin/service puppetmaster stop > /dev/null 2>&1
afc3b92
  /sbin/chkconfig --del puppetmaster
e23a2a8
fi
e23a2a8
e23a2a8
%postun server
e23a2a8
if [ "$1" -ge 1 ]; then
afc3b92
  /sbin/service puppetmaster condrestart > /dev/null 2>&1
e23a2a8
fi
e23a2a8
e23a2a8
%clean
e23a2a8
%{__rm} -rf %{buildroot}
e23a2a8
e23a2a8
%changelog
222e9ae
* Mon Mar 19 2007 David Lutterkort <dlutter@redhat.com> - 0.22.2-1
222e9ae
- Set puppet's homedir to /var/lib/puppet, not /var/puppet
222e9ae
- Remove no-lockdir patch, not needed anymore
222e9ae
caa2306
* Mon Feb 12 2007 David Lutterkort <dlutter@redhat.com> - 0.22.1-2
caa2306
- Fix bogus config parameter in puppetd.conf
caa2306
17555ad
* Sat Feb  3 2007 David Lutterkort <dlutter@redhat.com> - 0.22.1-1
17555ad
- New version
17555ad
afc3b92
* Fri Jan  5 2007 David Lutterkort <dlutter@redhat.com> - 0.22.0-1
afc3b92
- New version
afc3b92
afc3b92
* Mon Nov 20 2006 David Lutterkort <dlutter@redhat.com> - 0.20.1-2
afc3b92
- Make require ruby(abi) and buildarch: noarch conditional for fedora 5 or
afc3b92
  later to allow building on older fedora releases
afc3b92
2c3fc45
* Mon Nov 13 2006 David Lutterkort <dlutter@redhat.com> - 0.20.1-1
2c3fc45
- New version
2c3fc45
2ec0b2f
* Mon Oct 23 2006 David Lutterkort <dlutter@redhat.com> - 0.20.0-1
2ec0b2f
- New version
2ec0b2f
5e89698
* Tue Sep 26 2006 David Lutterkort <dlutter@redhat.com> - 0.19.3-1
5e89698
- New version
5e89698
a05502a
* Mon Sep 18 2006 David Lutterkort <dlutter@redhat.com> - 0.19.1-1
a05502a
- New version
a05502a
f255b7b
* Thu Sep  7 2006 David Lutterkort <dlutter@redhat.com> - 0.19.0-1
f255b7b
- New version
f255b7b
a0148e4
* Tue Aug  1 2006 David Lutterkort <dlutter@redhat.com> - 0.18.4-2
a0148e4
- Use /usr/bin/ruby directly instead of /usr/bin/env ruby in
a0148e4
  executables. Otherwise, initscripts break since pidof can't find the
a0148e4
  right process
a0148e4
bf90110
* Tue Aug  1 2006 David Lutterkort <dlutter@redhat.com> - 0.18.4-1
bf90110
- New version
bf90110
ff4285b
* Fri Jul 14 2006 David Lutterkort <dlutter@redhat.com> - 0.18.3-1
ff4285b
- New version
ff4285b
e23a2a8
* Wed Jul  5 2006 David Lutterkort <dlutter@redhat.com> - 0.18.2-1
e23a2a8
- New version
e23a2a8
e23a2a8
* Wed Jun 28 2006 David Lutterkort <dlutter@redhat.com> - 0.18.1-1
e23a2a8
- Removed lsb-config.patch and yumrepo.patch since they are upstream now
e23a2a8
e23a2a8
* Mon Jun 19 2006 David Lutterkort <dlutter@redhat.com> - 0.18.0-1
e23a2a8
- Patch config for LSB compliance (lsb-config.patch)
e23a2a8
- Changed config moves /var/puppet to /var/lib/puppet, /etc/puppet/ssl 
e23a2a8
  to /var/lib/puppet, /etc/puppet/clases.txt to /var/lib/puppet/classes.txt,
e23a2a8
  /etc/puppet/localconfig.yaml to /var/lib/puppet/localconfig.yaml
e23a2a8
e23a2a8
* Fri May 19 2006 David Lutterkort <dlutter@redhat.com> - 0.17.2-1
e23a2a8
- Added /usr/bin/puppetrun to server subpackage
e23a2a8
- Backported patch for yumrepo type (yumrepo.patch)
e23a2a8
e23a2a8
* Wed May  3 2006 David Lutterkort <dlutter@redhat.com> - 0.16.4-1
e23a2a8
- Rebuilt
e23a2a8
e23a2a8
* Fri Apr 21 2006 David Lutterkort <dlutter@redhat.com> - 0.16.0-1
e23a2a8
- Fix default file permissions in server subpackage
e23a2a8
- Run puppetmaster as user puppet
e23a2a8
- rebuilt for 0.16.0
e23a2a8
e23a2a8
* Mon Apr 17 2006 David Lutterkort <dlutter@redhat.com> - 0.15.3-2
e23a2a8
- Don't create empty log files in post-install scriptlet
e23a2a8
e23a2a8
* Fri Apr  7 2006 David Lutterkort <dlutter@redhat.com> - 0.15.3-1
e23a2a8
- Rebuilt for new version
e23a2a8
e23a2a8
* Wed Mar 22 2006 David Lutterkort <dlutter@redhat.com> - 0.15.1-1
e23a2a8
- Patch0: Run puppetmaster as root; running as puppet is not ready 
e23a2a8
  for primetime
e23a2a8
e23a2a8
* Mon Mar 13 2006 David Lutterkort <dlutter@redhat.com> - 0.15.0-1
e23a2a8
- Commented out noarch; requires fix for bz184199
e23a2a8
e23a2a8
* Mon Mar  6 2006 David Lutterkort <dlutter@redhat.com> - 0.14.0-1
e23a2a8
- Added BuildRequires for ruby
e23a2a8
e23a2a8
* Wed Mar  1 2006 David Lutterkort <dlutter@redhat.com> - 0.13.5-1
e23a2a8
- Removed use of fedora-usermgmt. It is not required for Fedora Extras and
e23a2a8
  makes it unnecessarily hard to use this rpm outside of Fedora. Just
e23a2a8
  allocate the puppet uid/gid dynamically
e23a2a8
e23a2a8
* Sun Feb 19 2006 David Lutterkort <dlutter@redhat.com> - 0.13.0-4
e23a2a8
- Use fedora-usermgmt to create puppet user/group. Use uid/gid 24. Fixed 
e23a2a8
problem with listing fileserver.conf and puppetmaster.conf twice
e23a2a8
e23a2a8
* Wed Feb  8 2006 David Lutterkort <dlutter@redhat.com> - 0.13.0-3
e23a2a8
- Fix puppetd.conf
e23a2a8
e23a2a8
* Wed Feb  8 2006 David Lutterkort <dlutter@redhat.com> - 0.13.0-2
e23a2a8
- Changes to run puppetmaster as user puppet
e23a2a8
e23a2a8
* Mon Feb  6 2006 David Lutterkort <dlutter@redhat.com> - 0.13.0-1
e23a2a8
- Don't mark initscripts as config files
e23a2a8
e23a2a8
* Mon Feb  6 2006 David Lutterkort <dlutter@redhat.com> - 0.12.0-2
e23a2a8
- Fix BuildRoot. Add dist to release
e23a2a8
e23a2a8
* Tue Jan 17 2006 David Lutterkort <dlutter@redhat.com> - 0.11.0-1
e23a2a8
- Rebuild
e23a2a8
e23a2a8
* Thu Jan 12 2006 David Lutterkort <dlutter@redhat.com> - 0.10.2-1
e23a2a8
- Updated for 0.10.2 Fixed minor kink in how Source is given
e23a2a8
e23a2a8
* Wed Jan 11 2006 David Lutterkort <dlutter@redhat.com> - 0.10.1-3
e23a2a8
- Added basic fileserver.conf
e23a2a8
e23a2a8
* Wed Jan 11 2006 David Lutterkort <dlutter@redhat.com> - 0.10.1-1
e23a2a8
- Updated. Moved installation of library files to sitelibdir. Pulled 
e23a2a8
initscripts into separate files. Folded tools rpm into server
e23a2a8
e23a2a8
* Thu Nov 24 2005 Duane Griffin <d.griffin@psenterprise.com>
e23a2a8
- Added init scripts for the client
e23a2a8
e23a2a8
* Wed Nov 23 2005 Duane Griffin <d.griffin@psenterprise.com>
e23a2a8
- First packaging