[PyMca] Update to 4.7.3

Christopher Meng cicku at fedoraproject.org
Sat Aug 2 08:15:17 UTC 2014


commit e3ec114440a8ffc32e4678171536d8fd345ca9b2
Author: Christopher Meng <i at cicku.me>
Date:   Sat Aug 2 16:14:29 2014 +0800

    Update to 4.7.3

 .gitignore                                       |    1 +
 0001-PyMca-4.7.3-set-Fedora-specific-paths.patch |   27 +++++
 PyMca-4.5.0-format-security.patch                |   13 ---
 PyMca.desktop                                    |    2 +-
 PyMca.spec                                       |  117 ++++++++++++++++++++-
 edfviewer.desktop                                |   10 ++
 elementsinfo.desktop                             |   10 ++
 mca2edf.desktop                                  |   10 ++
 peakidentifier.desktop                           |   10 ++
 pymcabatch.desktop                               |   10 ++
 pymcapostbatch.desktop                           |   10 ++
 pymcaroitool.desktop                             |   10 ++
 sources                                          |    2 +-
 13 files changed, 211 insertions(+), 21 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index d0e2141..9da8272 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@ pymca4.4.0-src.tgz
 /pymca4.4.1-src.tgz
 /pymca4.4.1p1-src.tgz
 /pymca4.5.0-src.tgz
+/pymca4.7.3-src-clean.tgz
diff --git a/0001-PyMca-4.7.3-set-Fedora-specific-paths.patch b/0001-PyMca-4.7.3-set-Fedora-specific-paths.patch
new file mode 100644
index 0000000..2b0ebbe
--- /dev/null
+++ b/0001-PyMca-4.7.3-set-Fedora-specific-paths.patch
@@ -0,0 +1,27 @@
+From 8558867d2ede525b8c5f61564b4f7ec3faa647ff Mon Sep 17 00:00:00 2001
+From: Christopher Meng <i at cicku.me>
+Date: Wed, 23 Jul 2014 21:24:53 +0800
+Subject: [PATCH] PyMca-4.7.3-set-Fedora-specific-paths
+
+---
+ setup.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index cd1ff24..e3fae11 100644
+--- a/setup.py
++++ b/setup.py
+@@ -42,8 +42,8 @@ global USE_SMART_INSTALL_SCRIPTS
+ # The sift module implements a patented algorithm. The algorithm can be used
+ # for non-commercial research purposes. If you do not want to distribute it
+ # with the PyMca sources you just need to delete the PyMca/sift directory.
+-PYMCA_DATA_DIR = os.path.join('PyMca','PyMcaData')
+-PYMCA_DOC_DIR = os.path.join('PyMca','PyMcaData')
++PYMCA_DATA_DIR = '/usr/share/PyMca'
++PYMCA_DOC_DIR = '/usr/share/doc/PyMca'
+ USE_SMART_INSTALL_SCRIPTS = False
+ if "--install-scripts" in sys.argv:
+     USE_SMART_INSTALL_SCRIPTS = True
+-- 
+2.0.1
+
diff --git a/PyMca.desktop b/PyMca.desktop
index 976b334..09d1806 100644
--- a/PyMca.desktop
+++ b/PyMca.desktop
@@ -1,6 +1,6 @@
 [Desktop Entry] 
-Encoding=UTF-8
 Name=PyMca
+GenericName=X-Ray Fluorescence Toolkit
 Comment=A collection of Python tools for visualization and analysis of energy-dispersive X-ray fluorescence data
 Exec=pymca
 Icon=PyMca
diff --git a/PyMca.spec b/PyMca.spec
index 5dd932b..94fde16 100644
--- a/PyMca.spec
+++ b/PyMca.spec
@@ -1,46 +1,121 @@
+# Linking issue, temporarily disabled.
+# %if 0%{?fedora} >= 22 || 0%{?rhel} >= 8
+# %global with_python3      1
+# %else
+%global with_python3      0
+# %endif
+
 Name:           PyMca
 Version:        4.7.3
 Release:        1%{?dist}
 Summary:        PyMca X-ray Fluorescence Toolkit 
 License:        GPLv2+
 URL:            http://pymca.sourceforge.net/
-Source0:        http://downloads.sourceforge.net/sourceforge/pymca/pymca%{version}-src.tgz
+# Original source: http://downloads.sourceforge.net/sourceforge/pymca/pymca%{version}-src.tgz
+# However it bundles a copy of the "sift" module which implements a patented algorithm. 
+# The algorithm can be used for non-commercial research purposes ONLY. Per:
+# http://fedoraproject.org/wiki/Packaging:SourceURL#When_Upstream_uses_Prohibited_Code
+# we must remove them before uploading.
+# rm -frv PyMca/sift
+Source0:        pymca%{version}-src-clean.tgz
 Source1:        PyMca.desktop
+Source2:        edfviewer.desktop
+Source3:        elementsinfo.desktop
+Source4:        mca2edf.desktop
+Source5:        peakidentifier.desktop
+Source6:        pymcabatch.desktop
+Source7:        pymcapostbatch.desktop
+Source8:        pymcaroitool.desktop
+Patch0:         0001-PyMca-4.7.3-set-Fedora-specific-paths.patch
 BuildRequires:  desktop-file-utils
 BuildRequires:  ImageMagick
+%if 0%{?with_python3}
+BuildRequires:  python3-devel
+BuildRequires:  python3-setuptools
+BuildRequires:  python3-numpy
+BuildRequires:  python3-PyQt4
+%else
 BuildRequires:  python2-devel
 BuildRequires:  python-setuptools
-BuildRequires:  mesa-libGL-devel
-BuildRequires:  mesa-libGLU-devel
 BuildRequires:  numpy
 BuildRequires:  PyQt4
+%endif
+BuildRequires:  mesa-libGL-devel
+BuildRequires:  mesa-libGLU-devel
 BuildRequires:  PyQwt
 BuildRequires:  qhull-devel
 Requires:       hicolor-icon-theme
+%if 0%{?with_python3}
+Requires:       python3-numpy
+Requires:       python3-PyQt4
+%else
 Requires:       numpy
 Requires:       PyQt4
+%endif
 Requires:       PyQwt
+Requires:       %{name}-data = %{version}-%{release}
 
 %description
 PyMCA provides a graphical interface for multi-channel analyser spectra
 visualization and analysis. PyMca can display spectra from a file or directly
 from SPEC during acquisitions.
 
+%package        data
+Summary:        Data files for %{name}
+BuildArch:      noarch
+Requires:       %{name} = %{version}-%{release}
+
+%description    data
+This package contains photon interaction data/elements data for %{name}.
+
 %prep
 %setup -q
+%patch0 -p1
+# Drop bundled qhull.
 rm -frv third-party/
+# Patch for the craps qhull brings in.
+sed -i -e 's|"geom.h"|<geom.h>|'      \
+       -e 's|"libqhull.h"|<qhull.h>|' \
+       -e 's|"poly.h"|<poly.h>|'      \
+       -e 's|"qset.h"|<qset.h>|'      \
+       PyMca/Object3D/Object3DQhull/Object3DQhull.c
 
 # Fix wrong shebang of pymcapostbatch.
+%if 0%{?with_python3}
+sed -i "s|!python|!%{__python3}|g" PyMca/scripts/pymcapostbatch
+%else
 sed -i "s|!python|!%{__python2}|g" PyMca/scripts/pymcapostbatch
+%endif
 
 %build
+# Need to define manually. Note using pkg-config to export the cflags
+# is not identified by the setup.py script as it requires non-blank
+# stdin for both CFLAGS/LDFLAGS, so we manually define the CFLAGS.
+QHULL_CFLAGS="-I%{_includedir}/qhull" \
+QHULL_LIBS="-lqhull" \
+SPECFILE_USE_GNU_SOURCE=1 \
+%if 0%{?with_python3}
+%{__python3} setup.py build
+%else
 %{__python2} setup.py build
+%endif
 
 %install
+%if 0%{?with_python3}
+%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
+%else
 %{__python2} setup.py install -O1 --skip-build --root %{buildroot}
+%endif
 
 # Install desktop file.
 desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{S:1}
+desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{S:2}
+desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{S:3}
+desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{S:4}
+desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{S:5}
+desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{S:6}
+desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{S:7}
+desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{S:8}
 
 # Convert to various sizes, via the 256x256 source.
 for size in 192x192 128x128 96x96 72x72 64x64 48x48 40x40 36x36 32x32 26x26 24x24 22x22 16x16 ; do
@@ -51,15 +126,35 @@ for size in 192x192 128x128 96x96 72x72 64x64 48x48 40x40 36x36 32x32 26x26 24x2
 done
 
 # Get rid of spurious executable rights.
-find %{buildroot}%{python2_sitearch}/PyMca/ -type f -exec chmod 644 {} \;
-find %{buildroot}%{python2_sitearch}/PyMca/ -name *.so -exec chmod 755 {} \;
+%if 0%{?with_python3}
+find %{buildroot}%{python3_sitearch}/PyMca/ -type f -exec chmod 644 {} +
+find %{buildroot}%{python3_sitearch}/PyMca/ -name *.so -exec chmod 755 {} +
+%else
+find %{buildroot}%{python2_sitearch}/PyMca/ -type f -exec chmod 644 {} +
+find %{buildroot}%{python2_sitearch}/PyMca/ -name *.so -exec chmod 755 {} +
+%endif
 
 # Get rid of /usr/bin/env in libraries.
+%if 0%{?with_python3}
+for lib in %{buildroot}%{python3_sitearch}/PyMca/*.py; do
+ sed '/\/usr\/bin\/env/d' $lib > $lib.new &&
+ touch -r $lib $lib.new &&
+ mv $lib.new $lib
+done
+%else
 for lib in %{buildroot}%{python2_sitearch}/PyMca/*.py; do
  sed '/\/usr\/bin\/env/d' $lib > $lib.new &&
  touch -r $lib $lib.new &&
  mv $lib.new $lib
 done
+%endif
+
+%check
+%if 0%{?with_python3}
+PYTHONPATH=%{buildroot}%{python3_sitearch} %{__python3} PyMca/tests/TestAll.py
+%else
+PYTHONPATH=%{buildroot}%{python2_sitearch} %{__python2} PyMca/tests/TestAll.py
+%endif
 
 %post
 touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
@@ -81,11 +176,21 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
 %{_bindir}/peakidentifier
 %{_bindir}/pymca*
 %{_bindir}/rgbcorrelator
-%{_datadir}/applications/PyMca.desktop
+%{_datadir}/applications/*.desktop
 %{_datadir}/icons/hicolor/*x*/apps/%{name}.png
 %{_mandir}/man1/*.1*
+%if 0%{?with_python3}
+%{python3_sitearch}/PyMca/
+%{python3_sitearch}/PyMca-%{version}-py%{python3_version}.egg-info
+%else
 %{python2_sitearch}/PyMca/
 %{python2_sitearch}/PyMca-%{version}-py%{python2_version}.egg-info
+%endif
+%exclude %{_pkgdocdir}/
+
+%files data
+%{_datadir}/%{name}/
+%{_pkgdocdir}/
 
 %changelog
 * Fri Jul 04 2014 Christopher Meng <rpm at cicku.me> - 4.7.3-1
diff --git a/edfviewer.desktop b/edfviewer.desktop
new file mode 100644
index 0000000..27d68a1
--- /dev/null
+++ b/edfviewer.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Name=EDFviewer
+Comment=Tool to visualize image files which format has been wrapped as EDF into PyMca
+GenericName=Simple ESRF Data Format(EDF) file viewer
+Exec=edfviewer
+Icon=PyMca
+Terminal=false
+StartupNotify=true
+Type=Application
+Categories=Education;Science;DataVisualization;Physics;
diff --git a/elementsinfo.desktop b/elementsinfo.desktop
new file mode 100644
index 0000000..5113c60
--- /dev/null
+++ b/elementsinfo.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Name=Elementsinfo
+Comment=Displaying the shell constants and X-ray emission branching ratios as function of photon excitation energy
+GenericName=Periodic table with Atomic Constants used by PyMca
+Exec=elementsinfo
+Icon=PyMca
+Terminal=false
+StartupNotify=true
+Type=Application
+Categories=Education;Science;DataVisualization;Physics;
diff --git a/mca2edf.desktop b/mca2edf.desktop
new file mode 100644
index 0000000..4f0a119
--- /dev/null
+++ b/mca2edf.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Name=mca2EDF
+Comment=Convert SPEC file format files to EDF format
+GenericName=EDF format converter
+Exec=mca2edf
+Icon=PyMca
+Terminal=false
+StartupNotify=true
+Type=Application
+Categories=Education;Science;DataVisualization;Physics;
diff --git a/peakidentifier.desktop b/peakidentifier.desktop
new file mode 100644
index 0000000..5669868
--- /dev/null
+++ b/peakidentifier.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Name=Peakidentifier
+Comment=Given an energy and a threshold, list all the elements emitting X-rays in the range
+GenericName=List the possible elements of a given photon energy
+Exec=peakidentifier
+Icon=PyMca
+Terminal=false
+StartupNotify=true
+Type=Application
+Categories=Education;Science;DataVisualization;Physics;
diff --git a/pymcabatch.desktop b/pymcabatch.desktop
new file mode 100644
index 0000000..bdd5e3a
--- /dev/null
+++ b/pymcabatch.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Name=PyMcabatch
+Comment=Batch fitting of X-ray Fluorescence Spectra
+GenericName=Storing fitted parameters
+Exec=pymcabatch
+Icon=PyMca
+Terminal=false
+StartupNotify=true
+Type=Application
+Categories=Education;Science;DataVisualization;Physics;
diff --git a/pymcapostbatch.desktop b/pymcapostbatch.desktop
new file mode 100644
index 0000000..980dc1f
--- /dev/null
+++ b/pymcapostbatch.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Name=PyMcapostbatch
+Comment=PyMca batch result analysis application
+GenericName=Batch result analyzor
+Exec=pymcapostbatch
+Icon=PyMca
+Terminal=false
+StartupNotify=true
+Type=Application
+Categories=Education;Science;DataVisualization;Physics;
diff --git a/pymcaroitool.desktop b/pymcaroitool.desktop
new file mode 100644
index 0000000..b03fc32
--- /dev/null
+++ b/pymcaroitool.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Name=PyMcaROItool
+Comment=Handling datasets represented by three-dimensional arrays, like stacks of images or 2D maps of 1D spectra
+GenericName=Region of Interest imaging tool for XRF analysis
+Exec=pymcaroitool
+Icon=PyMca
+Terminal=false
+StartupNotify=true
+Type=Application
+Categories=Education;Science;DataVisualization;Physics;
diff --git a/sources b/sources
index fa7fcbb..ee10b47 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-a624a37cee7d8cc916b33f3759429cc4  pymca4.5.0-src.tgz
+a7ee68844591e15b1b65738f58929fb8  pymca4.7.3-src-clean.tgz


More information about the scm-commits mailing list