File bcfg2.spec of Package bcfg2

# spec file for package bcfg2
#
# Copyright (c) bcfg2 project
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via 
# http://trac.mcs.anl.gov/projects/bcfg2/newticket
#

%define __python python
%{!?py_ver: %define py_ver %(python -c 'import sys;print(sys.version[0:3])')}
%define pythonversion %{py_ver}
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%{!?_initrddir: %define _initrddir %{_sysconfdir}/rc.d/init.d}

# Most rpm-based distributions include the lxml package a 'python-lxml',
# but some distributions and some people who roll their own lxml packages
# call it just 'lxml'. We'll try to catch both.
%define dfl_lxml python-lxml
%define alt_lxml lxml
%define lxmldep %(rpm -q %{alt_lxml} 2>&1 > /dev/null && echo %{alt_lxml} || echo %{dfl_lxml})

%define           pkgversion 0.9.6pre1

Name:             bcfg2
Version:          0.9.5+0.9.6pre1
Release: 	  0
License:          BSD
Group:            Applications/System
Summary:          Bcfg2 Client (Configuration management system)
URL:              http://trac.mcs.anl.gov/projects/bcfg2
Source:           %{name}-%{pkgversion}.tar.bz2
BuildRoot:        %{_tmppath}/%{name}-%{pkgversion}-%{release}-root-%(%{__id_u} -n)
BuildRequires:    python-devel
Requires:	  python >= %{py_ver}
Requires:         %{lxmldep} >= 0.9
%if 0%{?suse_version} > 1010 
Recommends:       cron
%endif

%description
Bcfg2 helps system administrators produce a consistent, reproducible,
and verifiable description of their environment, and offers
visualization and reporting tools to aid in day-to-day administrative
tasks. It is the fifth generation of configuration management tools
developed in the Mathematics and Computer Science Division of Argonne
National Laboratory.

It is based on an operational model in which the specification can be
used to validate and optionally change the state of clients, but in a
feature unique to bcfg2 the client\'s response to the specification can
also be used to assess the completeness of the specification. Using
this feature, bcfg2 provides an objective measure of how good a job an
administrator has done in specifying the configuration of client
systems. Bcfg2 is therefore built to help administrators construct an
accurate, comprehensive specification.

Bcfg2 has been designed from the ground up to support gentle
reconciliation between the specification and current client states. It
is designed to gracefully cope with manual system modifications.

Finally, due to the rapid pace of updates on modern networks, client
systems are constantly changing; if required in your environment,
Bcfg2 can enable the construction of complex change management and
deployment strategies.


%package -n bcfg2-server
Summary:          Bcfg2 Server (Configuration management system)
Group:            System Tools
Requires:         bcfg2
Requires:	  python >= %{py_ver}
Requires:         %{lxmldep} >= 1.2.1
%if 0%{?suse_version}
Requires:         python-fam
%endif
# TODO: test if matches on fedora
%if "%{_vendor}" == "redhat"     
Requires:         gamin-python
%endif 
%description -n bcfg2-server
Bcfg2 helps system administrators produce a consistent, reproducible,
and verifiable description of their environment, and offers
visualization and reporting tools to aid in day-to-day administrative
tasks. It is the fifth generation of configuration management tools
developed in the Mathematics and Computer Science Division of Argonne
National Laboratory.

It is based on an operational model in which the specification can be
used to validate and optionally change the state of clients, but in a
feature unique to bcfg2 the client\'s response to the specification can
also be used to assess the completeness of the specification. Using
this feature, bcfg2 provides an objective measure of how good a job an
administrator has done in specifying the configuration of client
systems. Bcfg2 is therefore built to help administrators construct an
accurate, comprehensive specification.

Bcfg2 has been designed from the ground up to support gentle
reconciliation between the specification and current client states. It
is designed to gracefully cope with manual system modifications.

Finally, due to the rapid pace of updates on modern networks, client
systems are constantly changing; if required in your environment,
Bcfg2 can enable the construction of complex change management and
deployment strategies.

%prep
%setup -q -n %{name}-%{pkgversion}

%build
%{__python}%{pythonversion} setup.py build

%install
%{__python}%{pythonversion} setup.py install --root=%{buildroot} --record=INSTALLED_FILES --prefix=/usr
%{__install} -d %{buildroot}%{_bindir}
%{__install} -d %{buildroot}%{_sbindir}
%{__install} -d %{buildroot}%{_initrddir}
%{__install} -d %{buildroot}%{_sysconfdir}/default
%{__install} -d %{buildroot}%{_sysconfdir}/cron.daily
%{__install} -d %{buildroot}%{_sysconfdir}/cron.hourly
%{__install} -d %{buildroot}%{_prefix}/lib/bcfg2
%{__mv} %{buildroot}/usr/bin/bcfg2* %{buildroot}%{_sbindir}
%{__install} -m 755 debian/buildsys/common/bcfg2.init %{buildroot}%{_initrddir}/bcfg2
%{__install} -m 755 debian/buildsys/common/bcfg2-server.init %{buildroot}%{_initrddir}/bcfg2-server
%{__install} -m 644 debian/bcfg2.default %{buildroot}%{_sysconfdir}/default/bcfg2
%{__install} -m 644 debian/bcfg2.cron.daily %{buildroot}%{_sysconfdir}/cron.daily/bcfg2
%{__install} -m 644 debian/bcfg2.cron.hourly %{buildroot}%{_sysconfdir}/cron.hourly/bcfg2
%{__install} -m 644 tools/bcfg2-cron %{buildroot}%{_prefix}/lib/bcfg2/bcfg2-cron

%files -n bcfg2
%defattr(-,root,root,-)
%{_sbindir}/bcfg2
%{python_sitelib}/Bcfg2/*.py*
%{python_sitelib}/Bcfg2/tlslite/*
%{python_sitelib}/Bcfg2/Client/*
%{_mandir}/man1/*
%{_mandir}/man5/*
%{_initrddir}/bcfg2
%config(noreplace) %{_sysconfdir}/default/bcfg2
%{_sysconfdir}/cron.hourly/bcfg2
%{_sysconfdir}/cron.daily/bcfg2
%{_prefix}/lib/bcfg2/bcfg2-cron
%attr(0755, root, root) %{_libdir}/python*/site-packages/Bcfg2/Client/Tools/rpmtools.py

%post -n bcfg2-server
/sbin/chkconfig --add bcfg2-server

%files -n bcfg2-server
%defattr(-,root,root,-)
%attr(0755, root, root) %{_libdir}/python*/site-packages/Bcfg2/Server/Reports/importscript.py 
%attr(0755, root, root) %{_libdir}/python*/site-packages/Bcfg2/Server/Reports/manage.py
%attr(0755, root, root) %{_libdir}/python*/site-packages/Bcfg2/Server/Hostbase/manage.py
%{_initrddir}/bcfg2-server
%{python_sitelib}/Bcfg2/Server
%if "%{pythonversion}" == "2.5"
%{python_sitelib}/*egg-info
%endif
%{_datadir}/bcfg2
%{_sbindir}/bcfg2-admin
%{_sbindir}/bcfg2-build-reports
%{_sbindir}/bcfg2-info
%{_sbindir}/bcfg2-ping-sweep
%{_sbindir}/bcfg2-query
%{_sbindir}/bcfg2-repo-validate
%{_sbindir}/bcfg2-server
%{_sbindir}/bcfg2-remote
%{_mandir}/man8/*.8*
%dir %{_prefix}/lib/bcfg2

# %if 0%?suse_version && 0%?suse_version < 1030
# blafasel
# %endif

%changelog
* Tue Aug 5 2008 Marko Jung <mjung@markojung.net> 0.9.5+0.9.6pre1
- updated specfile to match SUSE requirements 

* Fri Feb 2 2007 Mike Brady <mike.brady@devnull.net.nz> 0.9.1
- Removed use of _libdir due to Red Hat x86_64 issue.

* Fri Dec 22 2006 Jeffrey C. Ollie <jeff@ocjtech.us> - 0.8.7.1-5
- Server needs client library files too so put them in main package

* Wed Dec 20 2006 Jeffrey C. Ollie <jeff@ocjtech.us> - 0.8.7.1-4
- Yes, actually we need to require openssl

* Wed Dec 20 2006 Jeffrey C. Ollie <jeff@ocjtech.us> - 0.8.7.1-3
- Don't generate SSL cert in post script, it only needs to be done on
  the server and is handled by the bcfg2-admin tool.
- Move the /etc/bcfg2.key file to the server package
- Don't install a sample copy of the config file, just ghost it
- Require gamin-python for the server package
- Don't require openssl
- Make the client a separate package so you don't have to have the
  client if you don't want it

* Wed Dec 20 2006 Jeffrey C. Ollie <jeff@ocjtech.us> - 0.8.7.1-2
- Add more documentation

* Mon Dec 18 2006 Jeffrey C. Ollie <jeff@ocjtech.us> - 0.8.7.1-1
- First version for Fedora Extras

* Fri Sep 15 2006 Narayan Desai <desai@mcs.anl.gov> - 0.8.4-1
- Initial log

openSUSE Build Service is sponsored by