File webyast-ldap-ws.spec of Package webyast-ldap-ws

# spec file for package webyast-ldap-ws
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

Name:           webyast-ldap-ws
Provides:       WebYaST(org.opensuse.yast.modules.yapi.ldap)
PreReq:         webyast-base-ws
License:        GPLv2
Group:          Productivity/Networking/Web/Utilities
AutoReqProv:    on
Version:        0.2.5
Release:        1
Summary:        WebYaST - service for configuration of LDAP client
Source:         www.tar.bz2
Source1:        org.opensuse.yast.modules.yapi.ldap.policy
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
BuildRequires:  rubygem-restility rubygem-yast2-webservice-tasks

BuildRequires:  webyast-base-ws-testsuite
BuildRequires:  rubygem-mocha rubygem-test-unit

# is using yast2-ldap-client API
Requires:       yast2-ldap-client pam_ldap nss_ldap
# reasonable PATH set (bnc#617442) 
Requires:       yast2-dbus-server >= 2.17.3

%define plugin_name ldap
%define plugin_dir %{webyast_ws_dir}/vendor/plugins/%{plugin_name}

%package testsuite
License:        GPLv2
Group:          Productivity/Networking/Web/Utilities
Requires:       %{name} = %{version}
Requires:       webyast-base-ws-testsuite
Summary:        Testsuite for webyast-ldap-ws package

WebYaST - Plugin providing REST service for configuration of LDAP client

    Jiri Suchomel <>

%description testsuite
This package contains complete testsuite for webyast-ldap-ws webservice package.
It's only needed for verifying the functionality of the module and it's not
needed at runtime.

%setup -q -n www

# build restdoc documentation
mkdir -p public/ldap/restdoc

# do not package restdoc sources
rm -rf restdoc

# run the testsuite


# Install all web and frontend parts.
mkdir -p $RPM_BUILD_ROOT%{plugin_dir}
cp -a * $RPM_BUILD_ROOT%{plugin_dir}/
rm -f $RPM_BUILD_ROOT%{plugin_dir}/COPYING

# Policies
mkdir -p $RPM_BUILD_ROOT/usr/share/PolicyKit/policy
install -m 0644 %SOURCE1 $RPM_BUILD_ROOT/usr/share/PolicyKit/policy/

mkdir -p $RPM_BUILD_ROOT/usr/share/YaST2/modules/YaPI/
cp %{SOURCE2} $RPM_BUILD_ROOT/usr/share/YaST2/modules/YaPI/


# granting all permissions for the web user
/usr/sbin/grantwebyastrights --user root --action grant > /dev/null
/usr/sbin/grantwebyastrights --user %{webyast_ws_user} --action grant > /dev/null


%dir %{webyast_ws_dir}
%dir %{webyast_ws_dir}/vendor
%dir %{webyast_ws_dir}/vendor/plugins
%dir %{plugin_dir}
# YaPI dir
%dir /usr/share/YaST2/
%dir /usr/share/YaST2/modules/
%dir /usr/share/YaST2/modules/YaPI/
%dir /usr/share/PolicyKit
%dir /usr/share/PolicyKit/policy
%attr(644,root,root) %config /usr/share/PolicyKit/policy/org.opensuse.yast.modules.yapi.ldap.policy

%files testsuite

openSUSE Build Service is sponsored by