From 042fb11fa107718a831d468d16188e02f6ae3712 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Fri, 18 Jan 2008 16:20:36 -0500 Subject: Fix issues reported by rpmlint. - Removing shebangs (#!) from a bunch of python libraries - Don't use a variable name in init scripts for the lock file - Keep the init script name consistent with the binary name, so renamed ipa-kpasswd.init to ipa_kpasswd.init - Add status option to the init scripts - Move most python scripts out of /usr/share/ipa and into the python site-packages directories (ipaserver and ipaclient) - Remove unnecessary sys.path.append("/usr/share/ipa") - Fix the license string in the spec files - Rename ipa-webgui to ipa_webgui everywhere - Fix a couple of issues reported by pychecker in ipa-python --- ipa-admintools/ipa-admintools.spec | 7 +- ipa-admintools/ipa-admintools.spec.in | 7 +- ipa-client/ipa-client.spec | 13 ++- ipa-client/ipa-client.spec.in | 13 ++- ipa-client/ipa-install/ipa-client-install | 1 - ipa-client/ipaclient/Makefile.am | 2 +- ipa-client/ipaclient/__init__.py | 1 - ipa-client/ipaclient/ipadiscovery.py | 1 - ipa-python/ipa-python.spec | 11 ++- ipa-python/ipa-python.spec.in | 11 ++- ipa-python/ipaclient.py | 2 - ipa-python/krbtransport.py | 7 +- ipa-python/rpcclient.py | 4 +- ipa-radius-admintools/ipa-radius-admintools.spec | 7 +- .../ipa-radius-admintools.spec.in | 7 +- ipa-radius-server/Makefile | 4 +- ipa-radius-server/ipa-radius-install | 1 - ipa-radius-server/ipa-radius-server.spec | 11 +-- ipa-radius-server/ipa-radius-server.spec.in | 13 ++- ipa-radius-server/plugins/radiusinstance.py | 4 - ipa-server/ipa-gui/Makefile.am | 12 +-- ipa-server/ipa-gui/ipa-webgui | 110 --------------------- ipa-server/ipa-gui/ipa-webgui.cfg | 105 -------------------- ipa-server/ipa-gui/ipa-webgui.init | 73 -------------- ipa-server/ipa-gui/ipa_webgui | 110 +++++++++++++++++++++ ipa-server/ipa-gui/ipa_webgui.cfg | 105 ++++++++++++++++++++ ipa-server/ipa-gui/ipa_webgui.init | 79 +++++++++++++++ ipa-server/ipa-install/ipa-replica-install | 1 - ipa-server/ipa-install/ipa-replica-manage | 1 - ipa-server/ipa-install/ipa-replica-prepare | 1 - ipa-server/ipa-install/ipa-server-certinstall | 1 - ipa-server/ipa-install/ipa-server-install | 2 - ipa-server/ipa-kpasswd/Makefile.am | 8 +- ipa-server/ipa-kpasswd/ipa-kpasswd.init | 76 -------------- ipa-server/ipa-kpasswd/ipa_kpasswd.init | 83 ++++++++++++++++ ipa-server/ipa-server.spec | 39 +++++--- ipa-server/ipa-server.spec.in | 39 +++++--- ipa-server/ipaserver/Makefile.am | 2 +- ipa-server/ipaserver/__init__.py | 1 - ipa-server/ipaserver/bindinstance.py | 1 - ipa-server/ipaserver/dsinstance.py | 1 - ipa-server/ipaserver/ipaldap.py | 1 - ipa-server/ipaserver/krbinstance.py | 27 +++-- ipa-server/ipaserver/webguiinstance.py | 8 +- ipa-server/xmlrpc-server/Makefile.am | 8 +- ipa-server/xmlrpc-server/funcs.py | 3 +- ipa-server/xmlrpc-server/ipaxmlrpc.py | 4 +- 47 files changed, 534 insertions(+), 494 deletions(-) delete mode 100644 ipa-server/ipa-gui/ipa-webgui delete mode 100644 ipa-server/ipa-gui/ipa-webgui.cfg delete mode 100644 ipa-server/ipa-gui/ipa-webgui.init create mode 100644 ipa-server/ipa-gui/ipa_webgui create mode 100644 ipa-server/ipa-gui/ipa_webgui.cfg create mode 100644 ipa-server/ipa-gui/ipa_webgui.init delete mode 100755 ipa-server/ipa-kpasswd/ipa-kpasswd.init create mode 100644 ipa-server/ipa-kpasswd/ipa_kpasswd.init diff --git a/ipa-admintools/ipa-admintools.spec b/ipa-admintools/ipa-admintools.spec index 009893599..6a20602ff 100755 --- a/ipa-admintools/ipa-admintools.spec +++ b/ipa-admintools/ipa-admintools.spec @@ -1,10 +1,10 @@ Name: ipa-admintools Version: 0.6.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: IPA authentication server Group: System Environment/Base -License: GPL +License: GPLv2+ URL: http://www.freeipa.org Source0: %{name}-%{version}.tgz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -35,6 +35,9 @@ rm -rf %{buildroot} %{_mandir}/man1/* %changelog +* Thu Jan 17 2008 Rob Crittenden = 0.6.0-2 +- Fixed License in specfile + * Fri Dec 21 2007 Karl MacMillan - 0.6.0-1 - Version bump for release. diff --git a/ipa-admintools/ipa-admintools.spec.in b/ipa-admintools/ipa-admintools.spec.in index 7cb277729..7e8c546dc 100755 --- a/ipa-admintools/ipa-admintools.spec.in +++ b/ipa-admintools/ipa-admintools.spec.in @@ -1,10 +1,10 @@ Name: ipa-admintools Version: VERSION -Release: 1%{?dist} +Release: 2%{?dist} Summary: IPA authentication server Group: System Environment/Base -License: GPL +License: GPLv2+ URL: http://www.freeipa.org Source0: %{name}-%{version}.tgz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -35,6 +35,9 @@ rm -rf %{buildroot} %{_mandir}/man1/* %changelog +* Thu Jan 17 2008 Rob Crittenden = 0.6.0-2 +- Fixed License in specfile + * Fri Dec 21 2007 Karl MacMillan - 0.6.0-1 - Version bump for release. diff --git a/ipa-client/ipa-client.spec b/ipa-client/ipa-client.spec index 55d0970d6..f6e7525d8 100755 --- a/ipa-client/ipa-client.spec +++ b/ipa-client/ipa-client.spec @@ -1,16 +1,18 @@ Name: ipa-client Version: 0.6.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: IPA client Group: System Environment/Base -License: GPL +License: GPLv2+ URL: http://www.freeipa.org Source0: %{name}-%{version}.tgz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: python python-ldap python-krbV ipa-python cyrus-sasl-gssapi +%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} + %description IPA is a server for identity, policy, and audit. The client package provide install and configuration scripts for clients. @@ -41,7 +43,14 @@ rm -rf %{buildroot} %dir %{_usr}/share/ipa %{_usr}/share/ipa/* +%dir %{python_sitelib}/ipaclient +%{python_sitelib}/ipaclient/*.py* + %changelog +* Thu Jan 17 2008 Rob Crittenden = 0.6.0-2 +- Fixed License in specfile +- Move client python files to /usr/lib*/python*/site-packages + * Fri Dec 21 2007 Karl MacMillan - 0.6.0-1 - Version bump for release diff --git a/ipa-client/ipa-client.spec.in b/ipa-client/ipa-client.spec.in index c3c7c07c7..f69ba6b39 100644 --- a/ipa-client/ipa-client.spec.in +++ b/ipa-client/ipa-client.spec.in @@ -1,16 +1,18 @@ Name: ipa-client Version: VERSION -Release: 1%{?dist} +Release: 2%{?dist} Summary: IPA client Group: System Environment/Base -License: GPL +License: GPLv2+ URL: http://www.freeipa.org Source0: %{name}-%{version}.tgz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: python python-ldap python-krbV ipa-python cyrus-sasl-gssapi +%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} + %description IPA is a server for identity, policy, and audit. The client package provide install and configuration scripts for clients. @@ -41,7 +43,14 @@ rm -rf %{buildroot} %dir %{_usr}/share/ipa %{_usr}/share/ipa/* +%dir %{python_sitelib}/ipaclient +%{python_sitelib}/ipaclient/*.py* + %changelog +* Thu Jan 17 2008 Rob Crittenden = 0.6.0-2 +- Fixed License in specfile +- Move client python files to /usr/lib*/python*/site-packages + * Fri Dec 21 2007 Karl MacMillan - 0.6.0-1 - Version bump for release diff --git a/ipa-client/ipa-install/ipa-client-install b/ipa-client/ipa-install/ipa-client-install index e499f0e40..fda5a9006 100644 --- a/ipa-client/ipa-install/ipa-client-install +++ b/ipa-client/ipa-install/ipa-client-install @@ -22,7 +22,6 @@ VERSION = "%prog .1" import sys -sys.path.append("/usr/share/ipa") import krbV import socket diff --git a/ipa-client/ipaclient/Makefile.am b/ipa-client/ipaclient/Makefile.am index 290ffef8d..1d7df5266 100644 --- a/ipa-client/ipaclient/Makefile.am +++ b/ipa-client/ipaclient/Makefile.am @@ -1,6 +1,6 @@ NULL = -appdir = $(IPA_DATA_DIR)/ipaclient +appdir = $(pythondir)/ipaclient app_PYTHON = \ __init__.py \ ipachangeconf.py \ diff --git a/ipa-client/ipaclient/__init__.py b/ipa-client/ipaclient/__init__.py index ba14d3c4c..3eabc0f37 100644 --- a/ipa-client/ipaclient/__init__.py +++ b/ipa-client/ipaclient/__init__.py @@ -1,4 +1,3 @@ -#! /usr/bin/python -E # Authors: Simo Sorce # # Copyright (C) 2007 Red Hat diff --git a/ipa-client/ipaclient/ipadiscovery.py b/ipa-client/ipaclient/ipadiscovery.py index 939d41056..c3a1fc7d6 100644 --- a/ipa-client/ipaclient/ipadiscovery.py +++ b/ipa-client/ipaclient/ipadiscovery.py @@ -1,4 +1,3 @@ -#! /usr/bin/python -E # Authors: Simo Sorce # # Copyright (C) 2007 Red Hat diff --git a/ipa-python/ipa-python.spec b/ipa-python/ipa-python.spec index ca8c4e337..2e8a24b2b 100755 --- a/ipa-python/ipa-python.spec +++ b/ipa-python/ipa-python.spec @@ -1,10 +1,10 @@ Name: ipa-python Version: 0.6.0 -Release: 1%{?dist} -Summary: Ipa authentication server +Release: 2%{?dist} +Summary: IPA authentication server Group: System Environment/Base -License: GPL +License: GPLv2+ URL: http://www.freeipa.org Source0: http://www.freeipa.org/downloads/%{name}-%{version}.tgz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -15,7 +15,7 @@ Requires: PyKerberos %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} %description -Ipa is a server for identity, policy, and audit. +IPA is a server for identity, policy, and audit. %prep %setup -q @@ -35,6 +35,9 @@ rm -rf %{buildroot} %config(noreplace) %{_sysconfdir}/ipa/ipa.conf %changelog +* Thu Jan 17 2008 Rob Crittenden = 0.6.0-2 +- Fixed License in specfile + * Fri Dec 21 2007 Karl MacMillan - 0.6.0-1 - Version bump for release diff --git a/ipa-python/ipa-python.spec.in b/ipa-python/ipa-python.spec.in index 54923f90a..a0c8862be 100755 --- a/ipa-python/ipa-python.spec.in +++ b/ipa-python/ipa-python.spec.in @@ -1,10 +1,10 @@ Name: ipa-python Version: VERSION -Release: 1%{?dist} -Summary: Ipa authentication server +Release: 2%{?dist} +Summary: IPA authentication server Group: System Environment/Base -License: GPL +License: GPLv2+ URL: http://www.freeipa.org Source0: http://www.freeipa.org/downloads/%{name}-%{version}.tgz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -15,7 +15,7 @@ Requires: PyKerberos %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} %description -Ipa is a server for identity, policy, and audit. +IPA is a server for identity, policy, and audit. %prep %setup -q @@ -35,6 +35,9 @@ rm -rf %{buildroot} %config(noreplace) %{_sysconfdir}/ipa/ipa.conf %changelog +* Thu Jan 17 2008 Rob Crittenden = 0.6.0-2 +- Fixed License in specfile + * Fri Dec 21 2007 Karl MacMillan - 0.6.0-1 - Version bump for release diff --git a/ipa-python/ipaclient.py b/ipa-python/ipaclient.py index c05abd510..6d2e58a68 100644 --- a/ipa-python/ipaclient.py +++ b/ipa-python/ipaclient.py @@ -17,8 +17,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -#!/usr/bin/python - import ipa.rpcclient as rpcclient import entity import user diff --git a/ipa-python/krbtransport.py b/ipa-python/krbtransport.py index 95d3bc64f..c3bbe8860 100644 --- a/ipa-python/krbtransport.py +++ b/ipa-python/krbtransport.py @@ -17,12 +17,9 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -#!/usr/bin/python - import httplib import xmlrpclib import kerberos -from kerberos import GSSError class KerbTransport(xmlrpclib.SafeTransport): """Handles Kerberos Negotiation authentication to an XML-RPC server.""" @@ -39,12 +36,12 @@ class KerbTransport(xmlrpclib.SafeTransport): try: rc, vc = kerberos.authGSSClientInit(service); except kerberos.GSSError, e: - raise GSSError(e) + raise kerberos.GSSError(e) try: kerberos.authGSSClientStep(vc, ""); except kerberos.GSSError, e: - raise GSSError(e) + raise kerberos.GSSError(e) extra_headers = [ ("Authorization", "negotiate %s" % kerberos.authGSSClientResponse(vc) ) diff --git a/ipa-python/rpcclient.py b/ipa-python/rpcclient.py index 4d6b3a701..752b1c38d 100644 --- a/ipa-python/rpcclient.py +++ b/ipa-python/rpcclient.py @@ -17,8 +17,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -#!/usr/bin/python - import xmlrpclib import socket import config @@ -579,7 +577,7 @@ class RPCClient: return ipautil.unwrap_binary_data(result) - def get_all_attrs(self, opts=None): + def get_all_attrs(self): """We have a list of hardcoded attributes -> readable labels. Return that complete list if someone wants it. """ diff --git a/ipa-radius-admintools/ipa-radius-admintools.spec b/ipa-radius-admintools/ipa-radius-admintools.spec index c835d7531..62300c8f9 100755 --- a/ipa-radius-admintools/ipa-radius-admintools.spec +++ b/ipa-radius-admintools/ipa-radius-admintools.spec @@ -1,10 +1,10 @@ Name: ipa-radius-admintools Version: 0.6.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: IPA authentication server - radius admin tools Group: System Environment/Base -License: GPL +License: GPLv2+ URL: http://www.freeipa.org Source0: %{name}-%{version}.tgz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -34,6 +34,9 @@ rm -rf %{buildroot} %{_sbindir}/ipa* %changelog +* Thu Jan 17 2008 Rob Crittenden = 0.6.0-2 +- Fixed License in specfile + * Fri Dec 21 2007 Karl MacMillan - 0.6.0-1 - Version bump for release diff --git a/ipa-radius-admintools/ipa-radius-admintools.spec.in b/ipa-radius-admintools/ipa-radius-admintools.spec.in index 680b3a394..b96d627a4 100644 --- a/ipa-radius-admintools/ipa-radius-admintools.spec.in +++ b/ipa-radius-admintools/ipa-radius-admintools.spec.in @@ -1,10 +1,10 @@ Name: ipa-radius-admintools Version: VERSION -Release: 1%{?dist} +Release: 2%{?dist} Summary: IPA authentication server - radius admin tools Group: System Environment/Base -License: GPL +License: GPLv2+ URL: http://www.freeipa.org Source0: %{name}-%{version}.tgz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -34,6 +34,9 @@ rm -rf %{buildroot} %{_sbindir}/ipa* %changelog +* Thu Jan 17 2008 Rob Crittenden = 0.6.0-2 +- Fixed License in specfile + * Fri Dec 21 2007 Karl MacMillan - 0.6.0-1 - Version bump for release diff --git a/ipa-radius-server/Makefile b/ipa-radius-server/Makefile index 7de51b469..fa73de97c 100644 --- a/ipa-radius-server/Makefile +++ b/ipa-radius-server/Makefile @@ -7,7 +7,7 @@ all: install: -mkdir -p $(PLUGINS_SHARE) -mkdir -p $(PLUGINS_PYTHON) - -mkdir -p $(PLUGINS_SBINDIR) + -mkdir -p $(SBINDIR) install -m 644 plugins/*.py $(PLUGINS_PYTHON) install -m 644 share/*.template $(PLUGINS_SHARE) install -m 755 ipa-radius-install $(SBINDIR) @@ -17,4 +17,4 @@ clean: distclean: clean -test: \ No newline at end of file +test: diff --git a/ipa-radius-server/ipa-radius-install b/ipa-radius-server/ipa-radius-install index 3e759d8d2..8ed3aabb6 100644 --- a/ipa-radius-server/ipa-radius-install +++ b/ipa-radius-server/ipa-radius-install @@ -19,7 +19,6 @@ # import sys -sys.path.append("/usr/share/ipa") import traceback, logging, krbV diff --git a/ipa-radius-server/ipa-radius-server.spec b/ipa-radius-server/ipa-radius-server.spec index 4c533fda3..6ce2abe88 100755 --- a/ipa-radius-server/ipa-radius-server.spec +++ b/ipa-radius-server/ipa-radius-server.spec @@ -1,10 +1,10 @@ Name: ipa-radius-server Version: 0.6.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: IPA authentication server - radius plugin Group: System Environment/Base -License: GPL +License: GPLv2+ URL: http://www.freeipa.org Source0: %{name}-%{version}.tgz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -42,12 +42,11 @@ rm -rf %{buildroot} %{_usr}/share/ipa/ipaserver/plugins/* %changelog +* Thu Jan 17 2008 Rob Crittenden = 0.6.0-2 +- Fixed License in specfile + * Fri Dec 21 2007 Karl MacMillan - 0.6.0-1 - Version bump for release * Wed Dec 12 2007 Karl MacMillan - 0.5.0-1 - Initial version - - - - diff --git a/ipa-radius-server/ipa-radius-server.spec.in b/ipa-radius-server/ipa-radius-server.spec.in index f6569b691..02d6328ee 100755 --- a/ipa-radius-server/ipa-radius-server.spec.in +++ b/ipa-radius-server/ipa-radius-server.spec.in @@ -1,10 +1,10 @@ Name: ipa-radius-server Version: VERSION -Release: 1%{?dist} +Release: 2%{?dist} Summary: IPA authentication server - radius plugin Group: System Environment/Base -License: GPL +License: GPLv2+ URL: http://www.freeipa.org Source0: %{name}-%{version}.tgz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -42,12 +42,11 @@ rm -rf %{buildroot} %{_usr}/share/ipa/ipaserver/plugins/* %changelog -* Fri Dec 21 2007 Karl MacMillan - VERSION-1 +* Thu Jan 17 2008 Rob Crittenden = 0.6.0-2 +- Fixed License in specfile + +* Fri Dec 21 2007 Karl MacMillan - 0.6.0-1 - Version bump for release * Wed Dec 12 2007 Karl MacMillan - 0.5.0-1 - Initial version - - - - diff --git a/ipa-radius-server/plugins/radiusinstance.py b/ipa-radius-server/plugins/radiusinstance.py index 731cd65a1..2048788a4 100644 --- a/ipa-radius-server/plugins/radiusinstance.py +++ b/ipa-radius-server/plugins/radiusinstance.py @@ -1,4 +1,3 @@ -#! /usr/bin/python -E # Authors: John Dennis # # Copyright (C) 2007 Red Hat @@ -18,9 +17,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -import sys -sys.path.append("/usr/share/ipa") - import subprocess import string import tempfile diff --git a/ipa-server/ipa-gui/Makefile.am b/ipa-server/ipa-gui/Makefile.am index 35f9ff9fd..c09a5c141 100644 --- a/ipa-server/ipa-gui/Makefile.am +++ b/ipa-server/ipa-gui/Makefile.am @@ -6,19 +6,19 @@ SUBDIRS = \ $(NULL) sbin_SCRIPTS = \ - ipa-webgui \ + ipa_webgui \ $(NULL) appdir = $(IPA_DATA_DIR) app_DATA = \ - ipa-webgui.cfg \ + ipa_webgui.cfg \ $(NULL) EXTRA_DIST = \ README.txt \ $(sbin_SCRIPTS) \ $(app_DATA) \ - ipa-webgui.init \ + ipa_webgui.init \ dev.cfg \ sample-prod.cfg \ setup.py \ @@ -32,13 +32,13 @@ MAINTAINERCLEANFILES = \ initdir=$(sysconfdir)/rc.d/init.d -install-data-hook: ipa-webgui.init +install-data-hook: ipa_webgui.init if test '!' -d $(DESTDIR)$(initdir); then \ $(mkinstalldirs) $(DESTDIR)$(initdir); \ chmod 755 $(DESTDIR)$(initdir); \ fi - $(INSTALL_SCRIPT) $(srcdir)/ipa-webgui.init $(DESTDIR)$(initdir)/ipa-webgui + $(INSTALL_SCRIPT) $(srcdir)/ipa_webgui.init $(DESTDIR)$(initdir)/ipa_webgui uninstall-hook: - rm -f $(DESTDIR)$(initdir)/ipa-webgui + rm -f $(DESTDIR)$(initdir)/ipa_webgui diff --git a/ipa-server/ipa-gui/ipa-webgui b/ipa-server/ipa-gui/ipa-webgui deleted file mode 100644 index a18c2db81..000000000 --- a/ipa-server/ipa-gui/ipa-webgui +++ /dev/null @@ -1,110 +0,0 @@ -#! /usr/bin/python -E -# -# Copyright (C) 2007 Red Hat -# see file 'COPYING' for use and warranty information -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; version 2 only -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# - -import os, sys - -def daemonize(): - # fork once so the parent can exit - try: - pid = os.fork() - except OSError, e: - raise Exception, "%s [%d]" % (e.strerror, e.errno) - - if pid != 0: - os._exit(0) - - # become session leader - os.setsid() - - # fork again to reparent to init - try: - pid = os.fork() - except OSError, e: - raise Exception, "%s [%d]" % (e.strerror, e.errno) - - if pid != 0: - os._exit(0) - - os.chdir("/") - os.umask(0) - - import resource - maxfd = resource.getrlimit(resource.RLIMIT_NOFILE)[1] - if (maxfd == resource.RLIM_INFINITY): - maxfd = 1024 - - # close all file descriptors - for fd in range(0, maxfd): - try: - os.close(fd) - except OSError: - pass - - # stdin - os.open("/dev/null", os.O_RDWR) - # stdout - os.open("/dev/null", os.O_RDWR) - # stderr - os.open("/dev/null", os.O_RDWR) - -def main(): - # To make development easier, we detect if we are in the development - # environment to load a different configuration and avoid becoming - # a daemon - devel = False - if os.path.exists(os.path.join(os.path.dirname(__file__), "Makefile.am")): - devel = True - - if not devel: - try: - daemonize() - except Exception, e: - sys.stderr.write("error becoming daemon: " + str(e)) - sys.exit(1) - - sys.path.append("/usr/share/ipa/") - - # this must be after sys.path is changed to work correctly - import pkg_resources - pkg_resources.require("TurboGears") - pkg_resources.require("ipa_gui") - - - from turbogears import update_config, start_server - import cherrypy - cherrypy.lowercase_api = True - - # Load the config - look for a local file first for development - # and then the system config file - if devel: - update_config(configfile="dev.cfg", - modulename="ipagui.config") - else: - update_config(configfile="/usr/share/ipa/ipa-webgui.cfg", - modulename="ipagui.config.app") - - from ipagui.controllers import Root - - start_server(Root()) - -try: - main() -except Exception, e: - print "failed to start web gui: %s" % str(e) - sys.exit(1) diff --git a/ipa-server/ipa-gui/ipa-webgui.cfg b/ipa-server/ipa-gui/ipa-webgui.cfg deleted file mode 100644 index 35b0b4f58..000000000 --- a/ipa-server/ipa-gui/ipa-webgui.cfg +++ /dev/null @@ -1,105 +0,0 @@ -[global] -# DATABASE - -# no database for ipa-webgui since everything is stored in LDAP - -# IDENTITY - -# Our our sqlobject-derived proxy provider -identity.provider='proxyprovider' - -# the first thing checked on any request. We want to short-circuit this -# as early as possible -identity.source = 'visit' - -# Turn on identity and visit (visit is required for identity) -identity.on=True -identity.failure_url="/loginfailed" -visit.on=True -visit.manager='proxyvisit' - -# SERVER - -server.environment="production" -autoreload.package="ipagui" -autoreload.on = False - -# Sets the number of threads the server uses -server.thread_pool = 10 - -# if this is part of a larger site, you can set the path -# to the TurboGears instance here -# server.webpath="" - -# Set to True if you are deploying your App behind a proxy -# e.g. Apache using mod_proxy -# base_url_filter.on = False - -# Set to True if your proxy adds the x_forwarded_host header -# base_url_filter.use_x_forwarded_host = True - -# If your proxy does not add the x_forwarded_host header, set -# the following to the *public* host url. -# (Note: This will be overridden by the use_x_forwarded_host option -# if it is set to True and the proxy adds the header correctly. -# base_url_filter.base_url = "http://www.example.com" - -# Set to True if you'd like to abort execution if a controller gets an -# unexpected parameter. False by default -# tg.strict_parameters = False - -# LOGGING -# Logging configuration generally follows the style of the standard -# Python logging module configuration. Note that when specifying -# log format messages, you need to use *() for formatting variables. -# Deployment independent log configuration is in ipagui/config/log.cfg -[logging] - -[[formatters]] -[[[message_only]]] -format='*(message)s' - -[[[full_content]]] -format='*(asctime)s *(name)s *(levelname)s *(message)s' - -[[handlers]] -[[[debug_out]]] -# Rotate weekly on Sunday. Keep 4 backups of the log -class='TimedRotatingFileHandler' -level='DEBUG' -args="('/var/log/ipa_error.log', 'w6', 1, 4)" -formatter='full_content' - -[[[access_out]]] -# For example only if one wants to duplicate the access log in TurboGears -# Rotate weekly on Sunday. Keep 4 backups of the log -#class='TimedRotatingFileHandler' -#level='INFO' -#args="('/var/log/ipa_error.log', 'w6', 1, 4)" -#formatter='message_only' -# By default log access to stdout which will go to /dev/null in production -class='StreamHandler' -level='INFO' -args='(sys.stdout,)' -formatter='message_only' - -[[[error_out]]] -class='StreamHandler' -level='ERROR' -args='(sys.stdout,)' - -[[loggers]] -[[[ipagui]]] -level='DEBUG' -qualname='ipagui' -handlers=['debug_out'] - -[[[allinfo]]] -level='INFO' -handlers=['debug_out'] - -[[[access]]] -level='INFO' -qualname='turbogears.access' -handlers=['access_out'] -propagate=0 diff --git a/ipa-server/ipa-gui/ipa-webgui.init b/ipa-server/ipa-gui/ipa-webgui.init deleted file mode 100644 index 4e53edde2..000000000 --- a/ipa-server/ipa-gui/ipa-webgui.init +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh -# -# ipa-webgui This starts and stops ipa-webgui -# -# chkconfig: - 36 64 -# description: ipa-webgui IPA Web User Interface -# processname: /usr/sbin/ipa-webgui -# configdir: /etc/sysconfig/ipa-webgui -# - -# Source function library. -if [ -f /etc/rc.d/init.d/functions ] ; then -. /etc/rc.d/init.d/functions -fi -# Source networking configuration. -if [ -f /etc/sysconfig/network ] ; then -. /etc/sysconfig/network -fi - -# Check that networking is up. -if [ "${NETWORKING}" = "no" ] -then - echo "Networking is down" - exit 0 -fi - -NAME="ipa-webgui" -PROG="/usr/sbin/ipa-webgui" -RUNAS="apache" - -start() { - echo -n $"Starting $NAME: " - daemon --user $RUNAS $PROG - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$NAME || \ - RETVAL=1 - return $RETVAL -} - -stop() { - echo -n $"Shutting down $NAME: " - killproc $NAME - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$NAME - return $RETVAL -} - -restart() { - stop - start -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart) - restart - ;; - condrestart) - [ -f /var/lock/subsys/$NAME ] && restart || : - ;; - *) - echo $"Usage: $0 {start|stop|restart|condrestart}" - exit 2 -esac - -exit $? diff --git a/ipa-server/ipa-gui/ipa_webgui b/ipa-server/ipa-gui/ipa_webgui new file mode 100644 index 000000000..c496d7cc9 --- /dev/null +++ b/ipa-server/ipa-gui/ipa_webgui @@ -0,0 +1,110 @@ +#! /usr/bin/python -E +# +# Copyright (C) 2007 Red Hat +# see file 'COPYING' for use and warranty information +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; version 2 only +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +import os, sys + +def daemonize(): + # fork once so the parent can exit + try: + pid = os.fork() + except OSError, e: + raise Exception, "%s [%d]" % (e.strerror, e.errno) + + if pid != 0: + os._exit(0) + + # become session leader + os.setsid() + + # fork again to reparent to init + try: + pid = os.fork() + except OSError, e: + raise Exception, "%s [%d]" % (e.strerror, e.errno) + + if pid != 0: + os._exit(0) + + os.chdir("/") + os.umask(0) + + import resource + maxfd = resource.getrlimit(resource.RLIMIT_NOFILE)[1] + if (maxfd == resource.RLIM_INFINITY): + maxfd = 1024 + + # close all file descriptors + for fd in range(0, maxfd): + try: + os.close(fd) + except OSError: + pass + + # stdin + os.open("/dev/null", os.O_RDWR) + # stdout + os.open("/dev/null", os.O_RDWR) + # stderr + os.open("/dev/null", os.O_RDWR) + +def main(): + # To make development easier, we detect if we are in the development + # environment to load a different configuration and avoid becoming + # a daemon + devel = False + if os.path.exists(os.path.join(os.path.dirname(__file__), "Makefile.am")): + devel = True + + if not devel: + try: + daemonize() + except Exception, e: + sys.stderr.write("error becoming daemon: " + str(e)) + sys.exit(1) + + sys.path.append("/usr/share/ipa/") + + # this must be after sys.path is changed to work correctly + import pkg_resources + pkg_resources.require("TurboGears") + pkg_resources.require("ipa_gui") + + + from turbogears import update_config, start_server + import cherrypy + cherrypy.lowercase_api = True + + # Load the config - look for a local file first for development + # and then the system config file + if devel: + update_config(configfile="dev.cfg", + modulename="ipagui.config") + else: + update_config(configfile="/usr/share/ipa/ipa_webgui.cfg", + modulename="ipagui.config.app") + + from ipagui.controllers import Root + + start_server(Root()) + +try: + main() +except Exception, e: + print "failed to start web gui: %s" % str(e) + sys.exit(1) diff --git a/ipa-server/ipa-gui/ipa_webgui.cfg b/ipa-server/ipa-gui/ipa_webgui.cfg new file mode 100644 index 000000000..838ac32d2 --- /dev/null +++ b/ipa-server/ipa-gui/ipa_webgui.cfg @@ -0,0 +1,105 @@ +[global] +# DATABASE + +# no database for ipa_webgui since everything is stored in LDAP + +# IDENTITY + +# Our our sqlobject-derived proxy provider +identity.provider='proxyprovider' + +# the first thing checked on any request. We want to short-circuit this +# as early as possible +identity.source = 'visit' + +# Turn on identity and visit (visit is required for identity) +identity.on=True +identity.failure_url="/loginfailed" +visit.on=True +visit.manager='proxyvisit' + +# SERVER + +server.environment="production" +autoreload.package="ipagui" +autoreload.on = False + +# Sets the number of threads the server uses +server.thread_pool = 10 + +# if this is part of a larger site, you can set the path +# to the TurboGears instance here +# server.webpath="" + +# Set to True if you are deploying your App behind a proxy +# e.g. Apache using mod_proxy +# base_url_filter.on = False + +# Set to True if your proxy adds the x_forwarded_host header +# base_url_filter.use_x_forwarded_host = True + +# If your proxy does not add the x_forwarded_host header, set +# the following to the *public* host url. +# (Note: This will be overridden by the use_x_forwarded_host option +# if it is set to True and the proxy adds the header correctly. +# base_url_filter.base_url = "http://www.example.com" + +# Set to True if you'd like to abort execution if a controller gets an +# unexpected parameter. False by default +# tg.strict_parameters = False + +# LOGGING +# Logging configuration generally follows the style of the standard +# Python logging module configuration. Note that when specifying +# log format messages, you need to use *() for formatting variables. +# Deployment independent log configuration is in ipagui/config/log.cfg +[logging] + +[[formatters]] +[[[message_only]]] +format='*(message)s' + +[[[full_content]]] +format='*(asctime)s *(name)s *(levelname)s *(message)s' + +[[handlers]] +[[[debug_out]]] +# Rotate weekly on Sunday. Keep 4 backups of the log +class='TimedRotatingFileHandler' +level='DEBUG' +args="('/var/log/ipa_error.log', 'w6', 1, 4)" +formatter='full_content' + +[[[access_out]]] +# For example only if one wants to duplicate the access log in TurboGears +# Rotate weekly on Sunday. Keep 4 backups of the log +#class='TimedRotatingFileHandler' +#level='INFO' +#args="('/var/log/ipa_error.log', 'w6', 1, 4)" +#formatter='message_only' +# By default log access to stdout which will go to /dev/null in production +class='StreamHandler' +level='INFO' +args='(sys.stdout,)' +formatter='message_only' + +[[[error_out]]] +class='StreamHandler' +level='ERROR' +args='(sys.stdout,)' + +[[loggers]] +[[[ipagui]]] +level='DEBUG' +qualname='ipagui' +handlers=['debug_out'] + +[[[allinfo]]] +level='INFO' +handlers=['debug_out'] + +[[[access]]] +level='INFO' +qualname='turbogears.access' +handlers=['access_out'] +propagate=0 diff --git a/ipa-server/ipa-gui/ipa_webgui.init b/ipa-server/ipa-gui/ipa_webgui.init new file mode 100644 index 000000000..e603f9f2a --- /dev/null +++ b/ipa-server/ipa-gui/ipa_webgui.init @@ -0,0 +1,79 @@ +#!/bin/sh +# +# ipa_webgui This starts and stops ipa_webgui +# +# chkconfig: - 36 64 +# description: ipa_webgui IPA Web User Interface +# processname: /usr/sbin/ipa_webgui +# configdir: /etc/sysconfig/ipa_webgui +# + +# Source function library. +if [ -f /etc/rc.d/init.d/functions ] ; then +. /etc/rc.d/init.d/functions +fi +# Source networking configuration. +if [ -f /etc/sysconfig/network ] ; then +. /etc/sysconfig/network +fi + +# Check that networking is up. +if [ "${NETWORKING}" = "no" ] +then + echo "Networking is down" + exit 0 +fi + +NAME="ipa_webgui" +PROG="/usr/sbin/ipa_webgui" +RUNAS="apache" + +start() { + echo -n $"Starting $NAME: " + daemon --user $RUNAS $PROG + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ipa_webgui || \ + RETVAL=1 + return $RETVAL +} + +stop() { + echo -n $"Shutting down $NAME: " + killproc $NAME + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ipa_webgui + return $RETVAL +} + +restart() { + stop + start +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + status) + status $PROG + ;; + restart) + restart + ;; + condrestart) + [ -f /var/lock/subsys/ipa_webgui ] && restart || : + ;; + reload) + exit 3 + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|condrestart}" + exit 2 +esac + +exit $? diff --git a/ipa-server/ipa-install/ipa-replica-install b/ipa-server/ipa-install/ipa-replica-install index 18a56429a..d94c47ea6 100644 --- a/ipa-server/ipa-install/ipa-replica-install +++ b/ipa-server/ipa-install/ipa-replica-install @@ -19,7 +19,6 @@ # import sys -sys.path.append("/usr/share/ipa") import tempfile, os, pwd, traceback, logging from ConfigParser import SafeConfigParser diff --git a/ipa-server/ipa-install/ipa-replica-manage b/ipa-server/ipa-install/ipa-replica-manage index ec5cc5b4f..4165aa1b9 100644 --- a/ipa-server/ipa-install/ipa-replica-manage +++ b/ipa-server/ipa-install/ipa-replica-manage @@ -19,7 +19,6 @@ # import sys -sys.path.append("/usr/share/ipa") import getpass, ldap, re, krbV diff --git a/ipa-server/ipa-install/ipa-replica-prepare b/ipa-server/ipa-install/ipa-replica-prepare index 2f1e0853c..ba8455588 100644 --- a/ipa-server/ipa-install/ipa-replica-prepare +++ b/ipa-server/ipa-install/ipa-replica-prepare @@ -19,7 +19,6 @@ # import sys -sys.path.append("/usr/share/ipa") import logging, tempfile, shutil, os, pwd from ConfigParser import SafeConfigParser diff --git a/ipa-server/ipa-install/ipa-server-certinstall b/ipa-server/ipa-install/ipa-server-certinstall index 932a6be18..d3a648b10 100644 --- a/ipa-server/ipa-install/ipa-server-certinstall +++ b/ipa-server/ipa-install/ipa-server-certinstall @@ -19,7 +19,6 @@ # import sys -sys.path.append("/usr/share/ipa") import traceback diff --git a/ipa-server/ipa-install/ipa-server-install b/ipa-server/ipa-install/ipa-server-install index 7a8ebe259..041917e29 100644 --- a/ipa-server/ipa-install/ipa-server-install +++ b/ipa-server/ipa-install/ipa-server-install @@ -27,8 +27,6 @@ VERSION = "%prog .1" import sys -sys.path.append("/usr/share/ipa") - import os import socket import errno diff --git a/ipa-server/ipa-kpasswd/Makefile.am b/ipa-server/ipa-kpasswd/Makefile.am index 02145d251..2953823c9 100644 --- a/ipa-server/ipa-kpasswd/Makefile.am +++ b/ipa-server/ipa-kpasswd/Makefile.am @@ -28,7 +28,7 @@ ipa_kpasswd_LDADD = \ EXTRA_DIST = \ README \ - ipa-kpasswd.init \ + ipa_kpasswd.init \ $(NULL) MAINTAINERCLEANFILES = \ @@ -37,14 +37,14 @@ MAINTAINERCLEANFILES = \ initdir=$(sysconfdir)/rc.d/init.d -install-data-hook: ipa-kpasswd.init +install-data-hook: ipa_kpasswd.init if test '!' -d $(DESTDIR)$(initdir); then \ $(mkinstalldirs) $(DESTDIR)$(initdir); \ chmod 755 $(DESTDIR)$(initdir); \ fi - $(INSTALL_SCRIPT) $(srcdir)/ipa-kpasswd.init $(DESTDIR)$(initdir)/ipa-kpasswd + $(INSTALL_SCRIPT) $(srcdir)/ipa_kpasswd.init $(DESTDIR)$(initdir)/ipa_kpasswd uninstall-hook: - rm -f $(DESTDIR)$(initdir)/ipa-kpasswd + rm -f $(DESTDIR)$(initdir)/ipa_kpasswd diff --git a/ipa-server/ipa-kpasswd/ipa-kpasswd.init b/ipa-server/ipa-kpasswd/ipa-kpasswd.init deleted file mode 100755 index 7918867e9..000000000 --- a/ipa-server/ipa-kpasswd/ipa-kpasswd.init +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/sh -# -# ipa-kpasswd This starts and stops ipa-kpasswd -# -# chkconfig: - 36 64 -# description: ipa-kpasswd IPA Kpasswd daemon -# processname: /usr/sbin/ipa_kpasswd -# configdir: /etc/sysconfig/ipa-kpasswd -# - -# Source function library. -if [ -f /etc/rc.d/init.d/functions ] ; then -. /etc/rc.d/init.d/functions -fi -# Source networking configuration. -if [ -f /etc/sysconfig/network ] ; then -. /etc/sysconfig/network -fi - -# Check that networking is up. -if [ "${NETWORKING}" = "no" ] -then - echo "Networking is down" - exit 0 -fi - -# Source networking configuration. -if [ -f /etc/sysconfig/ipa-kpasswd ] ; then -. /etc/sysconfig/ipa-kpasswd -fi - -NAME="ipa_kpasswd" - -start() { - echo -n $"Starting $NAME: " - daemon $NAME - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$NAME || \ - RETVAL=1 - return $RETVAL -} - -stop() { - echo -n $"Shutting down $NAME: " - killproc $NAME - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$NAME - return $RETVAL -} - -restart() { - stop - start -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart) - restart - ;; - condrestart) - [ -f /var/lock/subsys/$NAME ] && restart || : - ;; - *) - echo $"Usage: $0 {start|stop|restart|condrestart}" - exit 2 -esac - -exit $? diff --git a/ipa-server/ipa-kpasswd/ipa_kpasswd.init b/ipa-server/ipa-kpasswd/ipa_kpasswd.init new file mode 100644 index 000000000..d7244bed6 --- /dev/null +++ b/ipa-server/ipa-kpasswd/ipa_kpasswd.init @@ -0,0 +1,83 @@ +#!/bin/sh +# +# ipa_kpasswd This starts and stops ipa_kpasswd +# +# chkconfig: - 36 64 +# description: ipa_kpasswd IPA Kpasswd daemon +# processname: /usr/sbin/ipa_kpasswd +# configdir: /etc/sysconfig/ipa-kpasswd +# + +# Source function library. +if [ -f /etc/rc.d/init.d/functions ] ; then +. /etc/rc.d/init.d/functions +fi +# Source networking configuration. +if [ -f /etc/sysconfig/network ] ; then +. /etc/sysconfig/network +fi + +# Check that networking is up. +if [ "${NETWORKING}" = "no" ] +then + echo "Networking is down" + exit 0 +fi + +# Source networking configuration. +if [ -f /etc/sysconfig/ipa-kpasswd ] ; then +. /etc/sysconfig/ipa-kpasswd +fi + +NAME="ipa_kpasswd" +PROG="/usr/sbin/ipa_kpasswd" + +start() { + echo -n $"Starting $NAME: " + daemon $NAME + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ipa_kpasswd || \ + RETVAL=1 + return $RETVAL +} + +stop() { + echo -n $"Shutting down $NAME: " + killproc $NAME + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ipa_kpasswd + return $RETVAL +} + +restart() { + stop + start +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + status) + status $PROG + ;; + restart) + restart + ;; + condrestart) + [ -f /var/lock/subsys/ipa_kpasswd ] && restart || : + ;; + reload) + exit 3 + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|condrestart}" + exit 2 +esac + +exit $? diff --git a/ipa-server/ipa-server.spec b/ipa-server/ipa-server.spec index 98de382cf..fc8c3fd27 100755 --- a/ipa-server/ipa-server.spec +++ b/ipa-server/ipa-server.spec @@ -1,10 +1,10 @@ Name: ipa-server Version: 0.6.0 -Release: 1%{?dist} -Summary: Ipa authentication server +Release: 2%{?dist} +Summary: IPA authentication server Group: System Environment/Base -License: GPL +License: GPLv2+ URL: http://www.freeipa.org Source0: %{name}-%{version}.tgz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -43,8 +43,10 @@ Requires: libcap %define httpd_conf /etc/httpd/conf.d %define plugin_dir %{_libdir}/dirsrv/plugins +%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} + %description -Ipa is a server for identity, policy, and audit. +IPA is a server for identity, policy, and audit. %prep %setup -q @@ -70,22 +72,22 @@ rm -rf %{buildroot} %post if [ $1 = 1 ]; then - /sbin/chkconfig --add ipa-kpasswd - /sbin/chkconfig --add ipa-webgui + /sbin/chkconfig --add ipa_kpasswd + /sbin/chkconfig --add ipa_webgui fi %preun if [ $1 = 0 ]; then - /sbin/chkconfig --del ipa-kpasswd - /sbin/chkconfig --del ipa-webgui - /sbin/service ipa-kpasswd stop >/dev/null 2>&1 || : - /sbin/service ipa-webgui stop >/dev/null 2>&1 || : + /sbin/chkconfig --del ipa_kpasswd + /sbin/chkconfig --del ipa_webgui + /sbin/service ipa_kpasswd stop >/dev/null 2>&1 || : + /sbin/service ipa_webgui stop >/dev/null 2>&1 || : fi %postun if [ "$1" -ge "1" ]; then - /sbin/service ipa-kpasswd condrestart >/dev/null 2>&1 || : - /sbin/service ipa-webgui condrestart >/dev/null 2>&1 || : + /sbin/service ipa_kpasswd condrestart >/dev/null 2>&1 || : + /sbin/service ipa_webgui condrestart >/dev/null 2>&1 || : fi %files @@ -96,13 +98,16 @@ fi %{_sbindir}/ipa-replica-manage %{_sbindir}/ipa-server-certinstall %{_sbindir}/ipa_kpasswd -%{_sbindir}/ipa-webgui -%attr(755,root,root) %{_initrddir}/ipa-kpasswd -%attr(755,root,root) %{_initrddir}/ipa-webgui +%{_sbindir}/ipa_webgui +%attr(755,root,root) %{_initrddir}/ipa_kpasswd +%attr(755,root,root) %{_initrddir}/ipa_webgui %dir %{_usr}/share/ipa %{_usr}/share/ipa/* +%dir %{python_sitelib}/ipaserver +%{python_sitelib}/ipaserver/*.py* + %attr(755,root,root) %{plugin_dir}/libipa_pwd_extop.so %attr(755,root,root) %{plugin_dir}/libipa-memberof-plugin.so %attr(755,root,root) %{plugin_dir}/libipa-dna-plugin.so @@ -111,6 +116,10 @@ fi %dir %{_localstatedir}/cache/ipa/sysrestore %changelog +* Thu Jan 17 2008 Rob Crittenden = 0.6.0-2 +- Fixed License in specfile +- Include files from /usr/lib/python*/site-packages/ipaserver + * Fri Dec 21 2007 Karl MacMillan - 0.6.0-1 - Version bump for release diff --git a/ipa-server/ipa-server.spec.in b/ipa-server/ipa-server.spec.in index 24b02c9ea..f379f629b 100644 --- a/ipa-server/ipa-server.spec.in +++ b/ipa-server/ipa-server.spec.in @@ -1,10 +1,10 @@ Name: ipa-server Version: VERSION -Release: 1%{?dist} -Summary: Ipa authentication server +Release: 2%{?dist} +Summary: IPA authentication server Group: System Environment/Base -License: GPL +License: GPLv2+ URL: http://www.freeipa.org Source0: %{name}-%{version}.tgz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -43,8 +43,10 @@ Requires: libcap %define httpd_conf /etc/httpd/conf.d %define plugin_dir %{_libdir}/dirsrv/plugins +%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} + %description -Ipa is a server for identity, policy, and audit. +IPA is a server for identity, policy, and audit. %prep %setup -q @@ -70,22 +72,22 @@ rm -rf %{buildroot} %post if [ $1 = 1 ]; then - /sbin/chkconfig --add ipa-kpasswd - /sbin/chkconfig --add ipa-webgui + /sbin/chkconfig --add ipa_kpasswd + /sbin/chkconfig --add ipa_webgui fi %preun if [ $1 = 0 ]; then - /sbin/chkconfig --del ipa-kpasswd - /sbin/chkconfig --del ipa-webgui - /sbin/service ipa-kpasswd stop >/dev/null 2>&1 || : - /sbin/service ipa-webgui stop >/dev/null 2>&1 || : + /sbin/chkconfig --del ipa_kpasswd + /sbin/chkconfig --del ipa_webgui + /sbin/service ipa_kpasswd stop >/dev/null 2>&1 || : + /sbin/service ipa_webgui stop >/dev/null 2>&1 || : fi %postun if [ "$1" -ge "1" ]; then - /sbin/service ipa-kpasswd condrestart >/dev/null 2>&1 || : - /sbin/service ipa-webgui condrestart >/dev/null 2>&1 || : + /sbin/service ipa_kpasswd condrestart >/dev/null 2>&1 || : + /sbin/service ipa_webgui condrestart >/dev/null 2>&1 || : fi %files @@ -96,13 +98,16 @@ fi %{_sbindir}/ipa-replica-manage %{_sbindir}/ipa-server-certinstall %{_sbindir}/ipa_kpasswd -%{_sbindir}/ipa-webgui -%attr(755,root,root) %{_initrddir}/ipa-kpasswd -%attr(755,root,root) %{_initrddir}/ipa-webgui +%{_sbindir}/ipa_webgui +%attr(755,root,root) %{_initrddir}/ipa_kpasswd +%attr(755,root,root) %{_initrddir}/ipa_webgui %dir %{_usr}/share/ipa %{_usr}/share/ipa/* +%dir %{python_sitelib}/ipaserver +%{python_sitelib}/ipaserver/*.py* + %attr(755,root,root) %{plugin_dir}/libipa_pwd_extop.so %attr(755,root,root) %{plugin_dir}/libipa-memberof-plugin.so %attr(755,root,root) %{plugin_dir}/libipa-dna-plugin.so @@ -111,6 +116,10 @@ fi %dir %{_localstatedir}/cache/ipa/sysrestore %changelog +* Thu Jan 17 2008 Rob Crittenden = 0.6.0-2 +- Fixed License in specfile +- Include files from /usr/lib/python*/site-packages/ipaserver + * Fri Dec 21 2007 Karl MacMillan - 0.6.0-1 - Version bump for release diff --git a/ipa-server/ipaserver/Makefile.am b/ipa-server/ipaserver/Makefile.am index 99b74b504..ac8b9818f 100644 --- a/ipa-server/ipaserver/Makefile.am +++ b/ipa-server/ipaserver/Makefile.am @@ -1,6 +1,6 @@ NULL = -appdir = $(IPA_DATA_DIR)/ipaserver +appdir = $(pythondir)/ipaserver app_PYTHON = \ __init__.py \ bindinstance.py \ diff --git a/ipa-server/ipaserver/__init__.py b/ipa-server/ipaserver/__init__.py index 6aced0db7..ef86f9ec5 100644 --- a/ipa-server/ipaserver/__init__.py +++ b/ipa-server/ipaserver/__init__.py @@ -1,4 +1,3 @@ -#! /usr/bin/python -E # Authors: Karl MacMillan # see inline # diff --git a/ipa-server/ipaserver/bindinstance.py b/ipa-server/ipaserver/bindinstance.py index 9e26925ad..e15d93351 100644 --- a/ipa-server/ipaserver/bindinstance.py +++ b/ipa-server/ipaserver/bindinstance.py @@ -1,4 +1,3 @@ -#! /usr/bin/python -E # Authors: Simo Sorce # # Copyright (C) 2007 Red Hat diff --git a/ipa-server/ipaserver/dsinstance.py b/ipa-server/ipaserver/dsinstance.py index 3a71634a4..b3a445d88 100644 --- a/ipa-server/ipaserver/dsinstance.py +++ b/ipa-server/ipaserver/dsinstance.py @@ -1,4 +1,3 @@ -#! /usr/bin/python -E # Authors: Karl MacMillan # # Copyright (C) 2007 Red Hat diff --git a/ipa-server/ipaserver/ipaldap.py b/ipa-server/ipaserver/ipaldap.py index 7bb9719ea..49a60bf02 100644 --- a/ipa-server/ipaserver/ipaldap.py +++ b/ipa-server/ipaserver/ipaldap.py @@ -1,4 +1,3 @@ -#! /usr/bin/python -E # Authors: Rich Megginson # Rob Crittenden # # Copyright (C) 2007 Red Hat @@ -118,7 +117,7 @@ class KrbInstance(service.Service): def __common_post_setup(self): self.step("starting the KDC", self.__start_instance) self.step("configuring KDC to start on boot", self.__enable) - self.step("enabling and starting ipa-kpasswd", self.__enable_kpasswd) + self.step("enabling and starting ipa_kpasswd", self.__enable_kpasswd) def create_instance(self, ds_user, realm_name, host_name, admin_password, master_password): self.master_password = master_password @@ -183,10 +182,10 @@ class KrbInstance(service.Service): logging.critical("krb5kdc service failed to start") def __enable_kpasswd(self): - sysrestore.backup_state("ipa-kpasswd", "enabled", service.is_enabled("ipa-kpasswd")) - sysrestore.backup_state("ipa-kpasswd", "running", service.is_running("ipa-kpasswd")) - service.chkconfig_on("ipa-kpasswd") - service.start("ipa-kpasswd") + sysrestore.backup_state("ipa_kpasswd", "enabled", service.is_enabled("ipa_kpasswd")) + sysrestore.backup_state("ipa_kpasswd", "running", service.is_running("ipa_kpasswd")) + service.chkconfig_on("ipa_kpasswd") + service.start("ipa_kpasswd") def __setup_sub_dict(self): self.sub_dict = dict(FQDN=self.fqdn, @@ -374,8 +373,8 @@ class KrbInstance(service.Service): sysrestore.backup_file("/var/kerberos/krb5kdc/kpasswd.keytab") installutils.create_keytab("/var/kerberos/krb5kdc/kpasswd.keytab", "kadmin/changepw") - sysrestore.backup_file("/etc/sysconfig/ipa-kpasswd") - update_key_val_in_file("/etc/sysconfig/ipa-kpasswd", "export KRB5_KTNAME", "/var/kerberos/krb5kdc/kpasswd.keytab") + sysrestore.backup_file("/etc/sysconfig/ipa_kpasswd") + update_key_val_in_file("/etc/sysconfig/ipa_kpasswd", "export KRB5_KTNAME", "/var/kerberos/krb5kdc/kpasswd.keytab") pent = pwd.getpwnam(self.ds_user) os.chown("/var/kerberos/krb5kdc/kpasswd.keytab", pent.pw_uid, pent.pw_gid) @@ -383,18 +382,18 @@ class KrbInstance(service.Service): running = self.restore_state("running") enabled = self.restore_state("enabled") - kpasswd_running = sysrestore.restore_state("ipa-kpasswd", "running") - kpasswd_enabled = sysrestore.restore_state("ipa-kpasswd", "enabled") + kpasswd_running = sysrestore.restore_state("ipa_kpasswd", "running") + kpasswd_enabled = sysrestore.restore_state("ipa_kpasswd", "enabled") if not running is None: self.stop() if not kpasswd_running is None: - service.stop("ipa-kpasswd") + service.stop("ipa_kpasswd") if not enabled is None and not enabled: self.chkconfig_off() if not kpasswd_enabled is None and not kpasswd_enabled: - service.chkconfig_off("ipa-kpasswd") + service.chkconfig_off("ipa_kpasswd") for f in ["/var/kerberos/krb5kdc/ldappwd", "/var/kerberos/krb5kdc/kdc.conf", @@ -406,10 +405,10 @@ class KrbInstance(service.Service): "/etc/sysconfig/dirsrv", "/etc/krb5.keytab", "/var/kerberos/krb5kdc/kpasswd.keytab", - "/etc/sysconfig/ipa-kpasswd"]: + "/etc/sysconfig/ipa_kpasswd"]: sysrestore.restore_file(f) if not running is None and running: self.start() if not kpasswd_running is None and kpasswd_running: - service.start("ipa-kpasswd") + service.start("ipa_kpasswd") diff --git a/ipa-server/ipaserver/webguiinstance.py b/ipa-server/ipaserver/webguiinstance.py index 10b80ec37..58969cb74 100644 --- a/ipa-server/ipaserver/webguiinstance.py +++ b/ipa-server/ipaserver/webguiinstance.py @@ -21,12 +21,12 @@ import service class WebGuiInstance(service.Service): def __init__(self): - service.Service.__init__(self, "ipa-webgui") + service.Service.__init__(self, "ipa_webgui") def create_instance(self): - self.step("starting ipa-webgui", self.__start) - self.step("configuring ipa-webgui to start on boot", self.__enable) - self.start_creation("Configuring ipa-webgui") + self.step("starting ipa_webgui", self.__start) + self.step("configuring ipa_webgui to start on boot", self.__enable) + self.start_creation("Configuring ipa_webgui") def __start(self): self.backup_state("running", self.is_running()) diff --git a/ipa-server/xmlrpc-server/Makefile.am b/ipa-server/xmlrpc-server/Makefile.am index 5e9da0651..cf1420197 100644 --- a/ipa-server/xmlrpc-server/Makefile.am +++ b/ipa-server/xmlrpc-server/Makefile.am @@ -10,10 +10,14 @@ html_DATA = \ unauthorized.html \ $(NULL) -serverdir = $(IPA_DATA_DIR)/ipaserver -server_PYTHON = \ +coredir = $(pythondir)/ipaserver +core_PYTHON = \ attrs.py \ funcs.py \ + $(NULL) + +serverdir = $(IPA_DATA_DIR)/ipaserver +server_PYTHON = \ ipaxmlrpc.py \ $(NULL) diff --git a/ipa-server/xmlrpc-server/funcs.py b/ipa-server/xmlrpc-server/funcs.py index d0600b51a..cc2705d24 100644 --- a/ipa-server/xmlrpc-server/funcs.py +++ b/ipa-server/xmlrpc-server/funcs.py @@ -18,7 +18,6 @@ # import sys -sys.path.append("/usr/share/ipa") import krbV import ldap @@ -26,7 +25,7 @@ import ldap.dn import ipaserver.dsinstance import ipaserver.ipaldap import copy -import attrs +from ipaserver import attrs from ipa import ipaerror from ipa import ipautil from urllib import quote,unquote diff --git a/ipa-server/xmlrpc-server/ipaxmlrpc.py b/ipa-server/xmlrpc-server/ipaxmlrpc.py index 3f3e38b8e..59f5e596c 100644 --- a/ipa-server/xmlrpc-server/ipaxmlrpc.py +++ b/ipa-server/xmlrpc-server/ipaxmlrpc.py @@ -24,7 +24,6 @@ # Rob Crittenden import sys -sys.path.append("/usr/share/ipa") import time @@ -34,8 +33,7 @@ from xmlrpclib import Marshaller,loads,dumps,Fault from mod_python import apache import logging -import ipaserver -import funcs +from ipaserver import funcs from ipa import ipaerror, ipautil import ldap -- cgit