File python-ns_nitro.spec of Package python-ns_nitro

#
# spec file for package python-ns_nitro
#
# Copyright (c) 2016 SUSE LINUX 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 http://bugs.opensuse.org/
#


Name:           python-ns_nitro
Version:        10.5.60.7
Release:        1.1
Url:            https://www.citrix.com.br/downloads/netscaler-adc/sdks/netscaler-sdk-release-105.html
Summary:        Citrix® NetScaler® NITRO for Python
License:        Apache-2.0
Group:          Development/Languages/Python
Source:         ns_nitro-python_tagma_60_7.tar.bz2
Patch0:		fill_monitor_name.patch
Patch1:		fix_dnsglobal_return.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  python-devel
BuildRequires:  python-setuptools
BuildRequires:	dos2unix
Requires:       python-paramiko
Requires:	python-mysql
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
BuildArch:      noarch
%endif

%description
The Citrix® NetScaler® NITRO for Python allows you to configure and monitor the NetScaler appliance programmatically
in Python based applications.

%prep
%setup -q -n nitro-python-1.0 

%patch0 -p1
%patch1 -p1

%build

%install

python setup.py install --prefix=%{_prefix} --root=%{buildroot}

# fix wrong end-of-line warnings for the scripts
find %{python_sitelib} -type f -name *py -exec dos2unix {} \;
find %{python_sitelib} -type f -name *py -exec chmod 0644 {} \;
mkdir -p $RPM_BUILD_ROOT/%{_defaultdocdir}/%{name}

for f in $RPM_BUILD_ROOT/usr/bin/*\.py *txt; do 
	dos2unix $f
done

%files
%defattr(0644,root,root)
%doc License.txt readme_start.txt doc/getting_started_guide_python.pdf
%attr(0755,root,root) %{python_sitelib}
%attr(0755,root,root) %{python_sitelib}/nssrc
%attr(0755,root,root) %{_defaultdocdir}/%{name}
%{python_sitelib}/*
%attr(0755,root,root) %{_bindir}/*py

%changelog
openSUSE Build Service is sponsored by