[PyMca] Update to 4.7.3 Convert icons to proper sizes for display Add Icon entry in the desktop file | "-"

Christopher Meng cicku at fedoraproject.org
Wed Jul 9 10:52:17 UTC 2014


commit cd87d59f19d24cc8a5f2baedd8cc2410c27f3837
Author: Christopher Meng <i at cicku.me>
Date:   Wed Jul 9 18:51:38 2014 +0800

    Update to 4.7.3
    Convert icons to proper sizes for display
    Add Icon entry in the desktop file | "-"

 PyMca.desktop |    1 +
 PyMca.spec    |  126 ++++++++++++++++++++++++++++----------------------------
 2 files changed, 64 insertions(+), 63 deletions(-)
---
diff --git a/PyMca.desktop b/PyMca.desktop
index 493c7c6..976b334 100644
--- a/PyMca.desktop
+++ b/PyMca.desktop
@@ -3,6 +3,7 @@ Encoding=UTF-8
 Name=PyMca
 Comment=A collection of Python tools for visualization and analysis of energy-dispersive X-ray fluorescence data
 Exec=pymca
+Icon=PyMca
 Terminal=false
 Type=Application
 Categories=Education;Science;DataVisualization;Physics;
diff --git a/PyMca.spec b/PyMca.spec
index 22b45e4..5dd932b 100644
--- a/PyMca.spec
+++ b/PyMca.spec
@@ -1,35 +1,25 @@
-%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
-
-%{?filter_setup:
-%filter_provides_in %{python_sitearch}.*\.so$
-%filter_setup
-}
-
-Name:		PyMca
-Version:	4.5.0
-Release:	6%{?dist}
-Summary:	GUI for multi-channel analyser spectra visualization and analysis
-Group:		Applications/Engineering
-License:	GPLv2+
-URL:		http://pymca.sourceforge.net/
-Source0:	http://downloads.sourceforge.net/sourceforge/pymca/pymca%{version}-src.tgz
-# Desktop file
-Source1:	PyMca.desktop
-Patch0:		PyMca-4.5.0-format-security.patch
-
-BuildRequires:	desktop-file-utils
-BuildRequires:	python-devel
-BuildRequires:	python-setuptools
-BuildRequires:	mesa-libGL-devel
-BuildRequires:	mesa-libGLU-devel
-
-# Needed for normal operations
-BuildRequires:	numpy
-BuildRequires:	PyQt4
-BuildRequires:	PyQwt
-Requires:	numpy
-Requires:	PyQt4
-Requires:	PyQwt
+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
+Source1:        PyMca.desktop
+BuildRequires:  desktop-file-utils
+BuildRequires:  ImageMagick
+BuildRequires:  python2-devel
+BuildRequires:  python-setuptools
+BuildRequires:  mesa-libGL-devel
+BuildRequires:  mesa-libGLU-devel
+BuildRequires:  numpy
+BuildRequires:  PyQt4
+BuildRequires:  PyQwt
+BuildRequires:  qhull-devel
+Requires:       hicolor-icon-theme
+Requires:       numpy
+Requires:       PyQt4
+Requires:       PyQwt
 
 %description
 PyMCA provides a graphical interface for multi-channel analyser spectra
@@ -37,51 +27,54 @@ visualization and analysis. PyMca can display spectra from a file or directly
 from SPEC during acquisitions.
 
 %prep
-%setup -q -n %{name}%{version}
-%patch0 -p1
-# Fix perms
-chmod 644 LICENSE.GPL README
-find -name *.c -exec chmod 644 {} \;
-find -name *.h -exec chmod 644 {} \;
-
-# Fix shebang on pymcapostbatch
-sed "s|#!python|#!%{_bindir}/python|g" -i PyMca/scripts/pymcapostbatch
+%setup -q
+rm -frv third-party/
 
+# Fix wrong shebang of pymcapostbatch.
+sed -i "s|!python|!%{__python2}|g" PyMca/scripts/pymcapostbatch
 
 %build
-# setup.py asks for license approval
-echo yes | python setup.py build 
+%{__python2} setup.py build
 
 %install
-# setup.py asks for license approval
-echo yes | python setup.py install -O1 --skip-build --root %{buildroot}
-
-# Install desktop file
-desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE1}
-
-# Get rid of mention of buildroot in files in %{_bindir}
-for bin in %{buildroot}%{_bindir}/*; do
- sed 's|%{buildroot}||g' $bin > $bin.new && \
- touch -r $bin $bin.new && \
- mv $bin.new $bin && \
- chmod 755 $bin
+%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
+
+# Install desktop file.
+desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{S:1}
+
+# 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
+    convert -resize ${size} icons/PyMca_256x256.png \
+        %{buildroot}%{_datadir}/icons/hicolor/${size}/apps/%{name}.png
 done
 
-# Get rid of spurious executable rights
-find %{buildroot}%{python_sitearch}/PyMca/ -type f -exec chmod 644 {} \;
-find %{buildroot}%{python_sitearch}/PyMca/ -name *.so -exec chmod 755 {} \;
+# 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 {} \;
 
-# Get rid of /usr/bin/env in libraries
-for lib in %{buildroot}%{python_sitearch}/PyMca/*.py; do
+# Get rid of /usr/bin/env in libraries.
+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
 
+%post
+touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
+
+%postun
+if [ $1 -eq 0 ] ; then
+    touch --no-create %{_datadir}/icons/hicolor &>/dev/null
+    gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
+fi
+
+%posttrans
+gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
+
 %files
-%doc LICENSE.GPL README
-%{python_sitearch}/PyMca/
-%{python_sitearch}/PyMca-%{version}-py*.egg-info
+%doc changelog.txt LICENSE.GPL README
 %{_bindir}/edfviewer
 %{_bindir}/elementsinfo
 %{_bindir}/mca2edf
@@ -89,8 +82,15 @@ done
 %{_bindir}/pymca*
 %{_bindir}/rgbcorrelator
 %{_datadir}/applications/PyMca.desktop
+%{_datadir}/icons/hicolor/*x*/apps/%{name}.png
+%{_mandir}/man1/*.1*
+%{python2_sitearch}/PyMca/
+%{python2_sitearch}/PyMca-%{version}-py%{python2_version}.egg-info
 
 %changelog
+* Fri Jul 04 2014 Christopher Meng <rpm at cicku.me> - 4.7.3-1
+- Update to 4.7.3
+
 * Wed Jun 18 2014 Yaakov Selkowitz <yselkowi at redhat.com> - 4.5.0-6
 - Fix FTBFS with -Werror=format-security (#1105919)
 - Cleanup spec


More information about the scm-commits mailing list