Blob Blame History Raw
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%{!?build_server: %define build_server %(%{__python} -c "import pykickstart.version;" 2>/dev/null && echo 1 || echo 0)}

Name:           snake
Summary:        Smart Network Automated Kickstart Environment
Version:        0.10
Release:        0.4git%{?dist}
Source0:        http://hosted.fedoraproject.org/projects/snake/SnakeReleases/%{name}-%{version}.tar.bz2
License:        GPLv2+
Group:          Applications/Internet
URL:            http://hosted.fedoraproject.org/projects/snake/
Requires:       yum
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildArch:      noarch
BuildRequires:  python-devel
%if 0%{?fedora} >= 8
BuildRequires:  python-setuptools-devel
%else
BuildRequires:  python-setuptools
%endif


%description
snake is a toolkit for doing automated kickstart-based installations.


%package        server
Summary:        Smart Network Automated Kickstart Environment Server
Group:          System Environment/Daemons
Requires:       %{name} = %{version}-%{release}
Requires:       mkinitrd chkconfig
Requires:       pykickstart >= 1.1


%description server
snake-server provides utilities for serving installation trees and kickstart
templates to snake-client systems


%prep
%setup -q


%build
CFLAGS="$RPM_OPT_FLAGS" %{__python} -c 'import setuptools; execfile("setup.py")' build


%install
rm -rf $RPM_BUILD_ROOT
%{__python} -c 'import setuptools; execfile("setup.py")' install --skip-build --root $RPM_BUILD_ROOT

install -d $RPM_BUILD_ROOT/%{_localstatedir}/{lib,run,cache}/snake
install -d $RPM_BUILD_ROOT/%{_localstatedir}/lib/snake/{kickstarts,trees}


%clean
rm -rf $RPM_BUILD_ROOT


%post server
/sbin/chkconfig --add snake-server


%preun server
if [ $1 -eq 0 ]; then
    /sbin/service snake-server stop >/dev/null 2>&1
    /sbin/chkconfig --del snake-server
fi


%files
%defattr(-,root,root,-)
%doc README LICENSE
%{_sbindir}/snake-install
%{_sbindir}/snake-install-tui
%{_sbindir}/snake-tree
%{_sbindir}/snake-ks
%{_bindir}/snake-rawhide-status
%dir %{python_sitelib}/snake
%{python_sitelib}/snake/__init__.py*
%{python_sitelib}/snake/client.py*
%{python_sitelib}/snake/constants.py*
%{python_sitelib}/snake/dbushelper.py*
%{python_sitelib}/snake/install.py*
%{python_sitelib}/snake/log.py*
%{python_sitelib}/snake/machineinfo.py*
%{python_sitelib}/snake/saverestore.py*
%{python_sitelib}/snake/tui.py*
%{python_sitelib}/snake/tree.py*
%{python_sitelib}/snake/uri.py*
%{python_sitelib}/snake/util.py*
%{python_sitelib}/snake/xmlhelper.py*
%{python_sitelib}/snake/zeroconf.py*
%{python_sitelib}/snake-%{version}-*.egg-info
%doc %{_mandir}/man1/snake-tree.1.gz
%doc %{_mandir}/man1/snake-ks.1.gz
%doc %{_mandir}/man1/snake-install.1.gz


%if %{build_server}
%files server
%defattr(-,root,root,-)
%doc docs/DESIGN
%{_sbindir}/snake-server
%dir %{_localstatedir}/run/snake
%dir %{_localstatedir}/cache/snake
%dir %{_localstatedir}/lib/snake
%dir %{_localstatedir}/lib/snake/kickstarts
%{_localstatedir}/lib/snake/kickstarts/minimal.ks
%dir %{_localstatedir}/lib/snake/trees
%config(noreplace) %{_sysconfdir}/snake.conf
%{_sysconfdir}/init.d/snake-server
%{python_sitelib}/snake/compose.py*
%{python_sitelib}/snake/config.py*
%{python_sitelib}/snake/dbushelper.py*
%{python_sitelib}/snake/kickstart.py*
%{python_sitelib}/snake/labindex.py*
%{python_sitelib}/snake/labquery.py*
%{python_sitelib}/snake/machine.py*
%{python_sitelib}/snake/plugins.py*
%{python_sitelib}/snake/server.py*
%{python_sitelib}/snake/ksdb.py*
%{python_sitelib}/snake/treedb.py*
%endif


%changelog
* Tue Jan 24 2008 James Laska <jlaska@redhat.com> 0.10-0.4git
- Bug#429479 - conditionally build the snake-server sub-package only when
  pykickstart.version is found (jlaska)
- Move more constants to snake/constants.py (jlaska)
- snake/tree.py - _fill_in_images() called when .treeinfo images are not found (jlaska)

* Wed Jan 17 2008 James Laska <jlaska@redhat.com> 0.10-0.3git
- Add back python-devel for older Fedora building (jlaska)
- Remove ListChoiceWindow in favor of snack.ListboxChoiceWindow (jlaska)

* Wed Jan 16 2008 James Laska <jlaska@redhat.com> 0.10-0.2git
- Fix snake.spec for better handling of F9 .egg-info files (jlaska)

* Tue Jan 15 2008 James Laska <jlaska@redhat.com> 0.10-0.1git
- Ticket#6 - Initial support for alternative kickstart delivery support (jlaska)
- Created man pages (snake-install, snake-ks, and snake-tree) (jlaska)
- Created man pages (snake-install, snake-ks, and snake-tree) (jlaska)
- Ticket#31 - added sample minimal.ks template (jlaska)
- Ticket#15 - make cli tools operate on remote server (jlaska)
- Ticket#34 - added 'describe' and 'rename' cmds to snake-ks (jlaska)
- Move tree verification to snake.client.check_tree with proper return codes (wwoods)
- Ticket#10 - created snake/tui.py to handle text-mode snack screens (jlaska)

* Thu Dec 3 2007 James Laska <jlaska@redhat.com> 0.9-0.5git
- Fix bug#12 - make snake-install python2.3 friendly (jlaska)
- Support for ext2 initrd's (jlaska)

* Thu Nov 21 2007 James Laska <jlaska@redhat.com> 0.9-0.4git
- Fedora package review clean up (jlaska)

* Thu Nov 20 2007 James Laska <jlaska@redhat.com> 0.9-0.3git
- Use tree.version when generating kickstart (wwoods)

* Thu Nov 19 2007 James Laska <jlaska@redhat.com> 0.9-0.2git
- Support for loading NFS uri's (jlaska)
- Support for loading .discinfo files (wwoods+jlaska)

* Thu Nov 16 2007 James Laska <jlaska@redhat.com> 0.9-0.1git
- New snake-install, snake-install-tui, snake-tree, snake-ks cmdline utilities (wwoods)
- Cleanup packaging (jlaska)

* Thu Jun 13 2007 James Laska <jlaska@redhat.com> 0.8-1
- Cleaned up source tree (jlaska)
- Added license information (mzazrivec)
- Added file client save/restore support (mzazrivec)
- Added snake-genks to test pykickstart template generation (wwoods)
- Change to python-sqlobject to model tree information (jlaska)
- Improve architecture detection by using rpmUtils.arch (getBaseArch and getCanonArch) (jlaska)

* Thu Mar 2 2007 James Laska <jlaska@redhat.com> 0.7-1
- Machine registration is now controlled by plugins on the snake-server (mzazrivec)
- Support for .treeinfo and .composeinfo parsing (wwoods)
- snake-server now refreshes in-memory tree list on a timer pop (mzazrivec)
- snake-client supports nfs installs (jlaska)

* Thu Feb 8 2007 Will Woods <wwoods@redhat.com> 0.6-1
- Default to using internal webserver for http urls unless http_root is set
- Fixes for updated dbus bindings (make sure dbus strings are marshallable)
- Stop using deprecated dbus.dbus_bindings.DBusException
- Fixes to use pykickstart-0.91 or higher (kickstart versioning support!)
- Fixes for cElementTree move in python 2.5
- snake-client works on RHEL4 (python 2.3) systems

* Fri Jan 5 2007 Will Woods <wwoods@redhat.com> 0.5-1
- merge snake.hack into mkcache.py
- fix 'generic' installations on unregistered machines (mzazrivec)
- snake-server passes server config data to plugins
- plugin call changed to (item,**context)
- add flags to snake-client to allow kickstart overrides (--lang,--packages)
- 'snake' is softlinked to snake-client

* Wed Dec 19 2006 Will Woods <wwoods@redhat.com> 0.4-6
- snake-server now uses kickstart_hook plugins
- Add plugins dir and a couple of default plugins

* Wed Dec 07 2006 James Laska <jlaska@redhat.com> 0.4-4
- Break out package into snake and snake-server sub packages

* Wed Nov 29 2006 James Laska <jlaska@redhat.com> 0.4-3
- Added snake-server runlevel script
- Added --list-templates flag to snake-client
- Kickstart templates now perform a fully hands-free install

* Tue Nov 28 2006 Will Woods <wwoods@redhat.com> 0.4-2
- Improve plugin.py to do kickstart template loading
- Add initial kickstart template support to snake-server
- Add some generic templates, with examples in doc/
- Add basic kickstart template use to snake-client

* Wed Nov 15 2006 Will Woods <wwoods@redhat.com> 0.4-1
- add machine.py, plugin.py, kickstart.py
- make snake-client use avahi stuff
- xml metadata is in dotfiles now
- plugin architecture with example plugin

* Wed Nov 1 2006 Will Woods <wwoods@redhat.com> 0.3-1
- snake-client can actually kick off an install!

* Tue Oct 31 2006 Will Woods <wwoods@redhat.com> 0.2-1
- Add binaries to sbindir and docs, bump version

* Wed Oct 25 2006 Will Woods <wwoods@redhat.com> 0.1-1
- Initial attempt at packaging