| 1 | Name: %{_package} |
| 2 | Version: %{_version} |
| 3 | Release: %{_release} |
| 4 | |
| 5 | %define __python python |
| 6 | %{!?py_ver: %define py_ver %(python -c 'import sys;print(sys.version[0:3])')} |
| 7 | %define pythonversion %{py_ver} |
| 8 | %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} |
| 9 | %{!?_initrddir: %define _initrddir %{_sysconfdir}/rc.d/init.d} |
| 10 | |
| 11 | # Most rpm-based distributions include the lxml package a 'python-lxml', |
| 12 | # but some distributions and some people who roll their own lxml packages |
| 13 | # call it just 'lxml'. We'll try to catch both. |
| 14 | %define dfl_lxml python-lxml |
| 15 | %define alt_lxml lxml |
| 16 | %define lxmldep %(rpm -q %{alt_lxml} 2>&1 > /dev/null && echo %{alt_lxml} || echo %{dfl_lxml}) |
| 17 | |
| 18 | Summary: Configuration management system |
| 19 | Group: Applications/System |
| 20 | License: BSD |
| 21 | URL: http://trac.mcs.anl.gov/projects/bcfg2 |
| 22 | Source0: %{name}-%{version}-%{release}.tar.gz |
| 23 | BuildRoot: %{_builddir}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) |
| 24 | |
| 25 | BuildArch: noarch |
| 26 | |
| 27 | %if 0%{?fedora} >= 8 |
| 28 | BuildRequires: python-setuptools-devel |
| 29 | %else |
| 30 | BuildRequires: python-setuptools |
| 31 | %endif |
| 32 | |
| 33 | Requires: %{lxmldep} >= 0.9 |
| 34 | Requires(post): /sbin/chkconfig |
| 35 | Requires(preun): /sbin/chkconfig |
| 36 | Requires(preun): /sbin/service |
| 37 | Requires(postun): /sbin/service |
| 38 | |
| 39 | |
| 40 | %description |
| 41 | Bcfg2 helps system administrators produce a consistent, reproducible, |
| 42 | and verifiable description of their environment, and offers |
| 43 | visualization and reporting tools to aid in day-to-day administrative |
| 44 | tasks. It is the fifth generation of configuration management tools |
| 45 | developed in the Mathematics and Computer Science Division of Argonne |
| 46 | National Laboratory. |
| 47 | |
| 48 | It is based on an operational model in which the specification can be |
| 49 | used to validate and optionally change the state of clients, but in a |
| 50 | feature unique to bcfg2 the client's response to the specification can |
| 51 | also be used to assess the completeness of the specification. Using |
| 52 | this feature, bcfg2 provides an objective measure of how good a job an |
| 53 | administrator has done in specifying the configuration of client |
| 54 | systems. Bcfg2 is therefore built to help administrators construct an |
| 55 | accurate, comprehensive specification. |
| 56 | |
| 57 | Bcfg2 has been designed from the ground up to support gentle |
| 58 | reconciliation between the specification and current client states. It |
| 59 | is designed to gracefully cope with manual system modifications. |
| 60 | |
| 61 | Finally, due to the rapid pace of updates on modern networks, client |
| 62 | systems are constantly changing; if required in your environment, |
| 63 | Bcfg2 can enable the construction of complex change management and |
| 64 | deployment strategies. |
| 65 | |
| 66 | %package server |
| 67 | Summary: Configuration management server |
| 68 | Group: System Environment/Daemons |
| 69 | Requires: bcfg2 = %{version}-%{release} |
| 70 | Requires: /usr/sbin/sendmail |
| 71 | Requires: /usr/bin/openssl |
| 72 | Requires: gamin-python |
| 73 | Requires: redhat-lsb |
| 74 | Requires: python-genshi |
| 75 | Requires: python-cheetah |
| 76 | Requires(post): /sbin/chkconfig |
| 77 | Requires(preun): /sbin/chkconfig |
| 78 | Requires(preun): /sbin/service |
| 79 | Requires(postun): /sbin/service |
| 80 | |
| 81 | %description server |
| 82 | Configuration management server |
| 83 | |
| 84 | %prep |
| 85 | %setup -q -n %{name}-%{version}-%{release} |
| 86 | |
| 87 | # fixup some paths |
| 88 | %{__perl} -pi -e '[email protected]/etc/[email protected]%{_sysconfdir}/[email protected]' debian/buildsys/common/bcfg2.init |
| 89 | %{__perl} -pi -e '[email protected]/etc/[email protected]%{_sysconfdir}/[email protected]' tools/bcfg2-cron |
| 90 | |
| 91 | %{__perl} -pi -e '[email protected]/usr/lib/[email protected]%{_libexecdir}@g' debian/bcfg2.cron.daily |
| 92 | %{__perl} -pi -e '[email protected]/usr/lib/[email protected]%{_libexecdir}@g' debian/bcfg2.cron.hourly |
| 93 | |
| 94 | # don't start servers by default |
| 95 | %{__perl} -pi -e '[email protected]: (\d+)@chkconfig: [email protected]' debian/buildsys/common/bcfg2.init |
| 96 | %{__perl} -pi -e '[email protected]: (\d+)@chkconfig: [email protected]' debian/buildsys/common/bcfg2-server.init |
| 97 | |
| 98 | # get rid of extraneous shebangs |
| 99 | for f in `find src/lib -name \*.py` |
| 100 | do |
| 101 | %{__sed} -i -e '/^#!/,1d' $f |
| 102 | done |
| 103 | |
| 104 | %build |
| 105 | %{__python} -c 'import setuptools; execfile("setup.py")' build |
| 106 | |
| 107 | |
| 108 | %install |
| 109 | rm -rf %{buildroot} |
| 110 | %{__python} -c 'import setuptools; execfile("setup.py")' install --skip-build --root %{buildroot} |
| 111 | |
| 112 | mkdir -p %{buildroot}%{_sbindir} |
| 113 | mkdir -p %{buildroot}%{_initrddir} |
| 114 | mkdir -p %{buildroot}%{_sysconfdir}/cron.daily |
| 115 | mkdir -p %{buildroot}%{_sysconfdir}/cron.hourly |
| 116 | mkdir -p %{buildroot}%{_sysconfdir}/sysconfig |
| 117 | mkdir -p %{buildroot}%{_libexecdir} |
| 118 | mkdir -p %{buildroot}%{_var}/lib/bcfg2 |
| 119 | mkdir -p %{buildroot}%{_var}/cache/bcfg2 |
| 120 | |
| 121 | mv %{buildroot}%{_bindir}/bcfg2* %{buildroot}%{_sbindir} |
| 122 | |
| 123 | install -m 755 debian/buildsys/common/bcfg2.init %{buildroot}%{_initrddir}/bcfg2 |
| 124 | install -m 755 debian/buildsys/common/bcfg2-server.init %{buildroot}%{_initrddir}/bcfg2-server |
| 125 | install -m 755 debian/bcfg2.cron.daily %{buildroot}%{_sysconfdir}/cron.daily/bcfg2 |
| 126 | install -m 755 debian/bcfg2.cron.hourly %{buildroot}%{_sysconfdir}/cron.hourly/bcfg2 |
| 127 | install -m 755 tools/bcfg2-cron %{buildroot}%{_libexecdir}/bcfg2-cron |
| 128 | |
| 129 | install -m 644 debian/bcfg2.default %{buildroot}%{_sysconfdir}/sysconfig/bcfg2 |
| 130 | |
| 131 | touch %{buildroot}%{_sysconfdir}/bcfg2.conf |
| 132 | touch %{buildroot}%{_sysconfdir}/bcfg2.key |
| 133 | |
| 134 | %clean |
| 135 | rm -rf %{buildroot} |
| 136 | |
| 137 | %post |
| 138 | /sbin/chkconfig --add bcfg2 |
| 139 | |
| 140 | %preun |
| 141 | if [ $1 = 0 ]; then |
| 142 | /sbin/service bcfg2 stop >/dev/null 2>&1 || : |
| 143 | /sbin/chkconfig --del bcfg2 |
| 144 | fi |
| 145 | |
| 146 | %postun |
| 147 | if [ "$1" -ge "1" ]; then |
| 148 | /sbin/service bcfg2 condrestart >/dev/null 2>&1 || : |
| 149 | fi |
| 150 | |
| 151 | %post server |
| 152 | /sbin/chkconfig --add bcfg2-server |
| 153 | |
| 154 | %preun server |
| 155 | if [ $1 = 0 ]; then |
| 156 | /sbin/service bcfg2-server stop >/dev/null 2>&1 || : |
| 157 | /sbin/chkconfig --del bcfg2-server |
| 158 | fi |
| 159 | |
| 160 | %postun server |
| 161 | if [ "$1" -ge "1" ]; then |
| 162 | /sbin/service bcfg2-server condrestart >/dev/null 2>&1 || : |
| 163 | fi |
| 164 | |
| 165 | %files |
| 166 | %defattr(-,root,root,-) |
| 167 | %doc AUTHORS examples COPYRIGHT README |
| 168 | |
| 169 | %ghost %attr(600,root,root) %config(noreplace) %{_sysconfdir}/bcfg2.conf |
| 170 | |
| 171 | %config(noreplace) %{_sysconfdir}/sysconfig/bcfg2 |
| 172 | %{_sysconfdir}/cron.daily/bcfg2 |
| 173 | %{_sysconfdir}/cron.hourly/bcfg2 |
| 174 | |
| 175 | %{_initrddir}/bcfg2 |
| 176 | |
| 177 | %{python_sitelib}/Bcfg2*.egg-info |
| 178 | %dir %{python_sitelib}/Bcfg2 |
| 179 | %{python_sitelib}/Bcfg2/__init__.* |
| 180 | %{python_sitelib}/Bcfg2/Client |
| 181 | %{python_sitelib}/Bcfg2/Component.* |
| 182 | %{python_sitelib}/Bcfg2/Daemon.* |
| 183 | %{python_sitelib}/Bcfg2/Logging.* |
| 184 | %{python_sitelib}/Bcfg2/Options.* |
| 185 | %{python_sitelib}/Bcfg2/Proxy.* |
| 186 | %{python_sitelib}/Bcfg2/tlslite |
| 187 | |
| 188 | %{_sbindir}/bcfg2 |
| 189 | %{_mandir}/man1/bcfg2.1* |
| 190 | %{_mandir}/man5/bcfg2.conf.5* |
| 191 | |
| 192 | %{_libexecdir}/bcfg2-cron |
| 193 | |
| 194 | %dir %{_var}/cache/bcfg2 |
| 195 | |
| 196 | |
| 197 | %files server |
| 198 | %defattr(-,root,root,-) |
| 199 | |
| 200 | %ghost %attr(600,root,root) %config(noreplace) %{_sysconfdir}/bcfg2.key |
| 201 | |
| 202 | %{_initrddir}/bcfg2-server |
| 203 | |
| 204 | %{python_sitelib}/Bcfg2/Server |
| 205 | |
| 206 | %{_datadir}/bcfg2 |
| 207 | |
| 208 | %{_sbindir}/bcfg2-admin |
| 209 | %{_sbindir}/bcfg2-build-reports |
| 210 | %{_sbindir}/bcfg2-info |
| 211 | %{_sbindir}/bcfg2-ping-sweep |
| 212 | %{_sbindir}/bcfg2-repo-validate |
| 213 | %{_sbindir}/bcfg2-remote |
| 214 | %{_sbindir}/bcfg2-server |
| 215 | |
| 216 | %{_mandir}/man8/bcfg2-admin.8* |
| 217 | %{_mandir}/man8/bcfg2-build-reports.8* |
| 218 | %{_mandir}/man8/bcfg2-info.8* |
| 219 | %{_mandir}/man8/bcfg2-repo-validate.8* |
| 220 | %{_mandir}/man8/bcfg2-remote.8* |
| 221 | %{_mandir}/man8/bcfg2-server.8* |
| 222 | |
| 223 | %dir %{_var}/lib/bcfg2 |
| 224 | |
| 225 | %changelog |
| 226 | * Thu May 08 2008 Robin Bowes <[email protected]> 0.9.6-0.1 |
| 227 | - Revised spec file to build directly from svn checkout using Makefile |
| 228 | - copied lots of stuff from the "official" spec file |
| 229 | |
| 230 | * Fri Feb 2 2007 Mike Brady <[email protected]> 0.9.1 |
| 231 | - Removed use of _libdir due to Red Hat x86_64 issue. |
| 232 | |
| 233 | * Fri Dec 22 2006 Jeffrey C. Ollie <[email protected]> - 0.8.7.1-5 |
| 234 | - Server needs client library files too so put them in main package |
| 235 | |
| 236 | * Wed Dec 20 2006 Jeffrey C. Ollie <[email protected]> - 0.8.7.1-4 |
| 237 | - Yes, actually we need to require openssl |
| 238 | |
| 239 | * Wed Dec 20 2006 Jeffrey C. Ollie <[email protected]> - 0.8.7.1-3 |
| 240 | - Don't generate SSL cert in post script, it only needs to be done on |
| 241 | the server and is handled by the bcfg2-admin tool. |
| 242 | - Move the /etc/bcfg2.key file to the server package |
| 243 | - Don't install a sample copy of the config file, just ghost it |
| 244 | - Require gamin-python for the server package |
| 245 | - Don't require openssl |
| 246 | - Make the client a separate package so you don't have to have the |
| 247 | client if you don't want it |
| 248 | |
| 249 | * Wed Dec 20 2006 Jeffrey C. Ollie <[email protected]> - 0.8.7.1-2 |
| 250 | - Add more documentation |
| 251 | |
| 252 | * Mon Dec 18 2006 Jeffrey C. Ollie <[email protected]> - 0.8.7.1-1 |
| 253 | - First version for Fedora Extras |
| 254 | |
| 255 | * Fri Sep 15 2006 Narayan Desai <[email protected]> - 0.8.4-1 |
| 256 | - Initial log |
| 257 | |