Upgrade to 5.4.3

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2019-04-30 15:59:47 +02:00
commit 3bf2d233be
5 changed files with 75 additions and 68 deletions

11
.gitignore vendored
View file

@ -1,5 +1,6 @@
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
/pymca-*.tar.xz
*~
/x86_64/
/noarch/
/.build*.log
/pymca-*/

View file

@ -1,27 +0,0 @@
From 8558867d2ede525b8c5f61564b4f7ec3faa647ff Mon Sep 17 00:00:00 2001
From: Christopher Meng <i@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

View file

@ -1,16 +1,18 @@
Name: PyMca
Version: 4.7.3
Release: 14%{?dist}
Summary: PyMca X-ray Fluorescence Toolkit
Version: 5.4.3
Release: 1%{?dist}
Summary: X-ray Fluorescence Toolkit
License: GPLv2+
URL: http://pymca.sourceforge.net/
# 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
%if 0
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:
./getsources.sh %{version}
%endif
Source0: pymca-%{version}-filtered.tar.xz
Source1: PyMca.desktop
Source2: edfviewer.desktop
Source3: elementsinfo.desktop
@ -19,40 +21,37 @@ Source5: peakidentifier.desktop
Source6: pymcabatch.desktop
Source7: pymcapostbatch.desktop
Source8: pymcaroitool.desktop
Patch0: 0001-PyMca-4.7.3-set-Fedora-specific-paths.patch
BuildRequires: gcc
BuildRequires: desktop-file-utils
BuildRequires: ImageMagick
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-numpy
BuildRequires: %py3_dist cython
BuildRequires: %py3_dist numpy
BuildRequires: python3-PyQt4
BuildRequires: %py3_dist fisx
BuildRequires: mesa-libGL-devel
BuildRequires: mesa-libGLU-devel
BuildRequires: PyQwt
BuildRequires: qhull-devel
Requires: hicolor-icon-theme
Requires: python3-numpy
Requires: python3-PyQt4
Requires: PyQwt
Requires: %{name}-data = %{version}-%{release}
%description
PyMCA provides a graphical interface for multi-channel analyser spectra
PyMCA provides a graphical interface for multi-channel analyzer 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
%autosetup -p1 -n pymca-%{version}
# Drop bundled qhull.
rm -frv third-party/
# Patch for the craps qhull brings in.
@ -60,10 +59,10 @@ sed -i -e 's|"geom.h"|<geom.h>|' \
-e 's|"libqhull.h"|<libqhull.h>|' \
-e 's|"poly.h"|<poly.h>|' \
-e 's|"qset.h"|<qset.h>|' \
PyMca/Object3D/Object3DQhull/Object3DQhull.c
PyMca5/Object3D/Object3DQhull/Object3DQhull.c
# Fix wrong shebang of pymcapostbatch.
sed -i "s|!python|!%{__python3}|g" PyMca/scripts/pymcapostbatch
sed -i "s|!python|!%{__python3}|g" PyMca5/scripts/pymcapostbatch
%build
# Need to define manually. Note using pkg-config to export the cflags
@ -72,9 +71,13 @@ sed -i "s|!python|!%{__python3}|g" PyMca/scripts/pymcapostbatch
QHULL_CFLAGS="-I%{_includedir}/libqhull" \
QHULL_LIBS="-lqhull" \
SPECFILE_USE_GNU_SOURCE=1 \
PYMCA_DATA_DIR=/usr/share/PyMca \
PYMCA_DOC_DIR=/usr/share/doc/PyMca \
%py3_build
%install
PYMCA_DATA_DIR=/usr/share/PyMca \
PYMCA_DOC_DIR=/usr/share/doc/PyMca \
%py3_install
# Install desktop file.
@ -170,27 +173,29 @@ EOF
# 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
install -pdm755 \
%{buildroot}%{_datadir}/icons/hicolor/${size}/apps
%{buildroot}%{_datadir}/icons/hicolor/${size}/apps
convert -resize ${size} icons/PyMca_256x256.png \
%{buildroot}%{_datadir}/icons/hicolor/${size}/apps/%{name}.png
%{buildroot}%{_datadir}/icons/hicolor/${size}/apps/%{name}.png
done
# Get rid of spurious executable rights.
find %{buildroot}%{python3_sitearch}/PyMca/ -type f -exec chmod 644 {} +
find %{buildroot}%{python3_sitearch}/PyMca/ -name *.so -exec chmod 755 {} +
find %{buildroot}%{python3_sitearch}/PyMca5/ -type f -exec chmod 644 {} +
find %{buildroot}%{python3_sitearch}/PyMca5/ -name *.so -exec chmod 755 {} +
# Get rid of /usr/bin/env in libraries.
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
find %{buildroot}%{python3_sitearch}/PyMca5 -type f -name '*.py' \
-exec sed -i '/\/usr\/bin\/env/d' {} + \
-exec touch -r setup.py {} +
%check
PYTHONPATH=%{buildroot}%{python3_sitearch} %{__python3} PyMca/tests/TestAll.py
PYTHONPATH=%{buildroot}%{python3_sitearch} \
PYMCA_DATA_DIR=%{buildroot}/usr/share/PyMca \
PYMCA_DOC_DIR=%{buildroot}/usr/share/doc/PyMca \
%{__python3} PyMca5/tests/TestAll.py
%files
%doc changelog.txt LICENSE.GPL README
%license LICENSE.GPL
%doc changelog.txt README
%{_bindir}/edfviewer
%{_bindir}/elementsinfo
%{_bindir}/mca2edf
@ -201,15 +206,18 @@ PYTHONPATH=%{buildroot}%{python3_sitearch} %{__python3} PyMca/tests/TestAll.py
%{_datadir}/applications/*.desktop
%{_datadir}/icons/hicolor/*x*/apps/%{name}.png
%{_mandir}/man1/*.1*
%{python3_sitearch}/PyMca/
%{python3_sitearch}/PyMca-%{version}-py%{python3_version}.egg-info
%exclude %{_pkgdocdir}/
%{python3_sitearch}/PyMca5/
%{python3_sitearch}/PyMca5-%{version}-py%{python3_version}.egg-info
%exclude %{_pkgdocdir}
%files data
%{_datadir}/%{name}/
%{_pkgdocdir}/
%changelog
* Tue Apr 30 2019 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 5.4.3-1
- Update to latest version (#1198140)
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.7.3-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

25
getsources.sh Executable file
View file

@ -0,0 +1,25 @@
#!/bin/sh -e
# Usage: ./getsources.sh [version]
# (this produces pymca-[version]-filtered.tar.xz)
if [ -n "$1" ]; then
version="$1"
else
version="$(awk '/^Version:/{print $2}' *.spec)"
fi
fname="pymca-${version}-filtered.tar.xz"
if [ -e "$fname" ]; then
echo "$fname already exists, not downloading"
exit 0
fi
echo "Downloading version ${version}"
[ -x /bin/pxz ] && xz=pxz || xz=xz
curl -sSL https://github.com/vasole/pymca/archive/v${version}/PyMca-${version}.tar.gz | \
zcat | \
tar --delete --wildcards -f - '*/sift/*' | \
$xz -9v > "$fname"
echo "$fname is ready"

View file

@ -1 +1 @@
a7ee68844591e15b1b65738f58929fb8 pymca4.7.3-src-clean.tgz
SHA512 (pymca-5.4.3-filtered.tar.xz) = d865bf5d65d707598d8662966b8c25143a3c2fa02e841f5a84508e7595c9650f7b1e8f704b82f50c89237e05761227d5155612ce84153f2c3158e7221c98bbf9