Blob Blame 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.11.1
Release:        14%{?dist}
Source0:        https://fedorahosted.org/releases/s/n/%{name}/%{name}-%{version}.tar.bz2
License:        GPLv2+
URL:            https://fedorahosted.org/snake
Requires:       yum, pax
BuildArch:      noarch
BuildRequires:  python2-devel
BuildRequires:  python2-setuptools


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


%package        server
Summary:        Smart Network Automated Kickstart Environment Server
Requires:       %{name} = %{version}-%{release}
Requires:       chkconfig
%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6
Requires:       dracut
%else
Requires:       mkinitrd
%endif
Requires:       pykickstart >= 1.1
Requires:       logrotate >= 3.5.2
%if 0%{?rhel} >= 5
BuildRequires:  pykickstart
%endif
%if 0%{?fedora} >= 7
BuildRequires:  pykickstart
%endif


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


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


%build
%py2_build


%install
rm -rf $RPM_BUILD_ROOT
%py2_install

install -d $RPM_BUILD_ROOT/%{_localstatedir}/lib/snake
install -d $RPM_BUILD_ROOT/%{_localstatedir}/lib/snake/{kickstarts,templates,trees,machines}



%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
%doc README LICENSE docs/DESIGN docs/cobbler.ks
%{_sbindir}/snake-install
%{_sbindir}/snake-install-tui
%{_sbindir}/snake-tree
%{_sbindir}/snake-machine
%{_sbindir}/snake-ks
%{_bindir}/snake-rawhide-status
%dir %{python_sitelib}/snake
%{python2_sitelib}/snake/__init__.py*
%{python2_sitelib}/snake/client.py*
%{python2_sitelib}/snake/constants.py*
%{python2_sitelib}/snake/dbushelper.py*
%{python2_sitelib}/snake/install.py*
%{python2_sitelib}/snake/log.py*
%{python2_sitelib}/snake/machineinfo.py*
%{python2_sitelib}/snake/machine.py*
%{python2_sitelib}/snake/saverestore.py*
%{python2_sitelib}/snake/tui.py*
%{python2_sitelib}/snake/translate.py*
%{python2_sitelib}/snake/tree.py*
%{python2_sitelib}/snake/uri.py*
%{python2_sitelib}/snake/util.py*
%{python2_sitelib}/snake/xmlhelper.py*
%{python2_sitelib}/snake/zeroconf.py*
%{python2_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
%{_sbindir}/snake-server
%dir %{_localstatedir}/lib/snake
%dir %{_localstatedir}/lib/snake/kickstarts
%{_localstatedir}/lib/snake/kickstarts/minimal.ks
%dir %{_localstatedir}/lib/snake/templates
%{_localstatedir}/lib/snake/templates/defaults.py*
%dir %{_localstatedir}/lib/snake/trees
%dir %{_localstatedir}/lib/snake/machines
%config(noreplace) %{_sysconfdir}/snake.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/snake-server
%{_sysconfdir}/init.d/snake-server
%{python2_sitelib}/snake/anamon.py*
%{python2_sitelib}/snake/compose.py*
%{python2_sitelib}/snake/config.py*
%{python2_sitelib}/snake/dbushelper.py*
%{python2_sitelib}/snake/kickstart.py*
%{python2_sitelib}/snake/machinedb.py*
%{python2_sitelib}/snake/plugins.py*
%{python2_sitelib}/snake/ksdb.py*
%{python2_sitelib}/snake/treedb.py*
%endif


%changelog
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.11.1-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.11.1-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Wed Feb 14 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.11.1-12
- Update Python 2 dependency declarations to new packaging standards
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)

* Fri Feb 09 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.11.1-11
- Escape macros in %%changelog

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.11.1-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.11.1-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.11.1-8
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Fri Feb 05 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.11.1-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.11.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Mon Jun 30 2014 Toshio Kuratomi <toshio@fedoraproject.org> - 0.11.1-5
- Replace python-setuptools-build BR with python-setuptools

* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.11.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.11.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Fri Feb 15 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.11.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Fri Aug 10 2012 James Laska <jlaska@redhat.com> 0.11.1-1
- Update project and source code URL
- Correct upstream versioning

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.11-4.0.20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.11-3.0.20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.11-2.0.20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Sat Jul 31 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.11-1.0.20
- Clean up the versioning mess as unintrusively as possible.  Opened a bug for
  jlaska to fix things upstream and here.

* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 0.11-0.21
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild

* Mon Dec 21 2009 James Laska <jlaska@redhat.com> 0.11-0.20
- Require dracut for fc12 and newer builds

* Fri Oct 26 2009 James Laska <jlaska@redhat.com> 0.11-0.19
- Correct install.py typo, use subprocess.call to gather arguments (wwoods)

* Fri Oct 23 2009 Milos Jakubicek <xjakub@fi.muni.cz> - 0.11-0.18
- Fix FTBFS: bump release to be able to tag in new branch

* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.11-0.17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Fri Jun 19 2009 James Laska <jlaska@redhat.com> 0.11-0.16
- Correct missing import in examples/defaults.py

* Wed Jun 17 2009 James Laska <jlaska@redhat.com> 0.11-0.15
- ticket#67 - For F11 and newer, specify a UI method if template does not
  provide one
- ticket#66 - Snake will use grubby --copy-default to retain any existing
  required boot arguments
- Improve handling of non-anonymous FTP URL's

* Mon Mar 2 2009 James Laska <jlaska@redhat.com> 0.11-0.14
- Bump to work around previous koji tag

* Mon Mar 2 2009 James Laska <jlaska@redhat.com> 0.11-0.13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Mon Jan 5 2009 James Laska <jlaska@redhat.com> 0.11-0.12
- Minor fix to cobbler template and move %%doc into base package (jlaska)

* Thu Dec 18 2008 James Laska <jlaska@redhat.com> 0.11-0.11
- ticket#64 - only parse kickstarts when requested during snake-ks generate
  (jlaska)

* Fri Aug 29 2008 James Laska <jlaska@redhat.com> 0.11-0.10
- ticket#54 - correct for older grubby that can't handle --title that contains
  spaces (jlaska)
- handle version parsing problems by falling back to "devel" (wwoods)

* Mon Jul 28 2008 James Laska <jlaska@redhat.com> 0.11-0.9
- ticket#60 - Added snake/anamon.py to packaging

* Mon Jul 28 2008 James Laska <jlaska@redhat.com> 0.11-0.8
- ticket#59 - snake-install-tui will auto-register an unregistered system when
  using server-side kickstarts
- ticket#57 - Fixed snake-install -c argument handling
- Enable 'writefp' support for python templates

* Tue Jun 17 2008 James Laska <jlaska@redhat.com> 0.11-0.7
- ticket#56 - Fixed translate.py traceback for older python

* Tue Jun 13 2008 James Laska <jlaska@redhat.com> 0.11-0.6
- ticket#37 - snake-server support for hosting http,ftp and nfs kickstarts
- ticket#42 - snake/tui.py - add ksmethod selection screen
- snake-install-tui should remember the selected tree
- ticket#53 - Add snake-ks --ksmeta parameter to pass optional values to the
  python kickstart template.
- Add snake-machine check to ensure xmlrpc server supports machine.* methods
- Include /var/lib/snake/machines in spec file
- ticket#11 - Removed xml support from compose.py and tree.py
- Dropped snake-server labquery.py, labindex.py, and server.py

* Wed May 16 2008 James Laska <jlaska@redhat.com> 0.11-0.5
- ticket#51 - Call ybin or zipl when appropriate after updating grubby
- ticket#39 - add snake-install cmdline arg support
- ticket#25 - added a snake/tui boot argument screen
- ticket#52 - snake.tree _makename and __str__ result in the same name

* Wed Apr 16 2008 James Laska <jlaska@redhat.com> 0.11-0.4
- ticket#13 - snake-install-tui will politely display "No boot images found"
- ticket#43 - snake-install-tui won't choke on a mal-formed .treeinfo
- ticket#49 - snake/uri.py uses virtinst ImageFetcher code and will perform nfs
  [u]mounts as needed
- ticket#32 - fixed snake/log such that any verbosity settings apply to the
  root logger

* Wed Mar 26 2008 James Laska <jlaska@redhat.com> 0.11-0.3
- ticket#50 - Updated include release number in tarball name

* Tue Mar 18 2008 James Laska <jlaska@redhat.com> 0.11-0.2
- uninitialized variable fix in snake/tui.py
- limit content in snack windows to maximum window width

* Tue Mar 18 2008 James Laska <jlaska@redhat.com> 0.11-0.1
- ticket#48 - fixed string replacement issue while reading /etc/mtab
- snake/zeroconf.py - find_servers fix bug where AllForNow event received
  before ResolveServer responded (jlaska)
- ticket#46 - replaced SNAKE_SERVER with SNAKE_SERVER and SNAKE_PORT (jlaska)
- Updated snake/zeroconf.py to return multiple snake servers to the user
  (jlaska)

* Fri Feb 12 2008 James Laska <jlaska@redhat.com> 0.10-0.8
- Added missing BuildRequires so that pykickstart.version can be inspected

* Fri Feb 12 2008 James Laska <jlaska@redhat.com> 0.10-0.7
- Improved snake-server logging by subclassing XMLRPCServer objects (jlaska)
- Added missing %%dir to snake.spec for templatedir (jlaska)

* Thu Feb 11 2008 James Laska <jlaska@redhat.com> 0.10-0.6
- ticket#14 - added back support for pykickstart templates (jlaska)
- snake-tree and snake-ks will make use of a server config file when running
  against a local db (jlaska)
- Added logrotate script to snake-server package (jlaska)
- ticket#41 - removed optparse default= ... let snake.config handle that (jlaska)
- ticket#44 - snake-install-tui shouldn't try to parse the tree if snake-server
  already did (jlaska)

* Mon Jan 28 2008 James Laska <jlaska@redhat.com> 0.10-0.5
- RHEL5 doesn't like when snake/tui.py calls screen.pop() multiple times

* 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