File pymol.spec of Package pymol

#
# spec file for package pymol
#
# Copyright (c) 2018 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/
#


%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define oldpython python
Name:           pymol
Version:        1.9.0.0.svn4184
Release:        0
Url:            http://pymol.org
Summary:        A Molecular Viewer
License:        Python-2.0
Group:          Productivity/Scientific/Chemistry
Source:         %{name}-%{version}.tar.xz
# PATCH-FIX-OPENSUSE no-build-date.patch dhall@wustl.edu -- patch eliminates build date
Patch0:         no-build-date.patch
# PATCH-FIX-OPENSUSE python3.patch dhall@wustl.edu -- patch names bin/pymol as bin/pymol3 in python3
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module numpy-devel}
BuildRequires:  freeglut-devel
BuildRequires:  freetype2-devel
BuildRequires:  gcc-c++
BuildRequires:  glew-devel
BuildRequires:  libmsgpack-devel
BuildRequires:  libpng-devel
BuildRequires:  libxml2-devel
BuildRequires:  python-rpm-macros
Requires:       glew
Requires:       python-numpy
Requires:       python-pmw
BuildRequires:  fdupes
Obsoletes:      pymol < %{version}
Provides:       pymol = %{version}
Requires(post): update-alternatives
Requires(postun): update-alternatives

%python_subpackages

%description
PyMOL is a molecular graphics system targetted at medium to large
biomolecules like proteins. It can generate high-quality
publication-ready molecular graphics images and animations. 

Features include:

* Visualization of molecules, molecular trajectories and surfaces
  of crystallography data or orbitals
* Molecular builder and sculptor
* Internal raytracer and movie generator
* Fully extensible and scriptable via a python interface

File formats PyMOL can read include PDB, XYZ, CIF, MDL Molfile,
ChemDraw, CCP4 maps, XPLOR maps and Gaussian cube maps. 

%prep
%setup -q
%patch0
sed -i "1d" modules/pmg_tk/startup/apbs_tools.py # Remove she-bang line

%build
%python_build

%install
%python_install
%python_clone -a %{buildroot}%{_bindir}/pymol
%fdupes %{buildroot}%{_prefix}

%post
%python_install_alternative pymol

%postun
%python_uninstall_alternative pymol

%clean
rm -rf %{buildroot}

%files %python_files
%defattr(-,root,root,-)
%python_alternative %{_bindir}/pymol
%{python_sitearch}*

%changelog
openSUSE Build Service is sponsored by