Blob Blame History Raw
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%{!?python_siteinc: %define python_siteinc %(%{__python} -c "from distutils.sysconfig import get_python_inc; print get_python_inc()")}

Name:           veusz
Version:        1.4
Release:        1%{?dist}
Summary:        GUI scientific plotting package

Group:          Applications/Productivity
# The entire source code is GPLv2+ except helpers/src/_nc_cntr.c which is Python
License:        GPLv2+ and Python
URL:            http://home.gna.org/veusz/
Source0:        http://download.gna.org/veusz/veusz-%{version}.tar.gz
Source1:        %{name}.desktop
Source2:        %{name}.xml
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  python-devel desktop-file-utils numpy
Requires:       numpy PyQt4 /usr/bin/env
Provides:       python-veusz
Requires(post): shared-mime-info desktop-file-utils
Requires(postun): shared-mime-info desktop-file-utils

# for eggs
%if 0%{?fedora} >= 8
BuildRequires:  python-setuptools-devel
%else
BuildRequires:  python-setuptools
%endif

%description
Veusz is a scientific plotting package, designed to create
publication-ready Postscript/PDF output. It features GUI,
command-line, and scripting interfaces. Graphs are constructed from
components, allowing complex layouts to be designed. Veusz supports
plotting functions, data with errors, keys, labels, stacked plots,
multiple plots, contours, shapes and fitting data.

%prep
%setup -q -n veusz-%{version}
find -name \*~ | xargs rm -f

# change path of where to lookup bitmaps
# this is so we can move the icons out of the python directory
# and into /usr/share/pixmaps/veusz
sed -i "/imagedir =/c\\imagedir = '%{_datadir}/pixmaps/veusz'" \
        ${RPM_BUILD_DIR}/veusz-%{version}/utils/action.py

# change path of where to look for COPYING - should be docdir
sed -i "/f =/s+utils.veuszDirectory+'%{_docdir}/veusz-%{version}'+" \
	${RPM_BUILD_DIR}/veusz-%{version}/dialogs/aboutdialog.py

%build
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build

%install
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT

# install desktop file
desktop-file-install --vendor fedora                            \
        --dir ${RPM_BUILD_ROOT}%{_datadir}/applications         \
        --add-category X-Red-Hat-Extra                          \
        %{SOURCE1}

# file to register .vsz mimetype
mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/mime/packages/
cp %{SOURCE2} ${RPM_BUILD_ROOT}%{_datadir}/mime/packages/

# move icon files to /usr/share/pixmaps/veusz
# symlink main veusz icon also into pixmaps (for desktop file)
mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/pixmaps/veusz
mv ${RPM_BUILD_ROOT}%{python_sitearch}/veusz/windows/icons/*.png \
        ${RPM_BUILD_ROOT}%{_datadir}/pixmaps/veusz
mv ${RPM_BUILD_ROOT}%{python_sitearch}/veusz/windows/icons/*.svg \
        ${RPM_BUILD_ROOT}%{_datadir}/pixmaps/veusz
ln -s veusz/veusz_48.png ${RPM_BUILD_ROOT}%{_datadir}/pixmaps/veusz.png

# Mark some scripts as executable.
# This isn't really needed, but Veusz includes shebangs in scripts
# so that they can be run when not installed.
# Do this so that the scripts don't need modification.
chmod +x ${RPM_BUILD_ROOT}%{python_sitearch}/veusz/veusz_main.py
chmod +x ${RPM_BUILD_ROOT}%{python_sitearch}/veusz/veusz_listen.py

%post
update-mime-database %{_datadir}/mime > /dev/null 2>&1 || :
update-desktop-database %{_datadir}/applications

%postun
update-mime-database %{_datadir}/mime > /dev/null 2>&1 || :
update-desktop-database %{_datadir}/applications

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%doc README AUTHORS COPYING
%doc examples
%doc Documents/manual.html
%doc Documents/manimages
%{_bindir}/veusz
%{_bindir}/veusz_listen
%{_datadir}/applications/fedora-%{name}.desktop
%{_datadir}/mime/packages/veusz.xml
%dir %{python_sitearch}/veusz
%{python_sitearch}/*
%{python_sitearch}/veusz/VERSION
%{python_sitearch}/veusz/*.py
%{python_sitearch}/veusz/*.py[co]
%{python_sitearch}/veusz/dialogs/*.py
%{python_sitearch}/veusz/dialogs/*.py[co]
%{python_sitearch}/veusz/dialogs/*.ui
%{python_sitearch}/veusz/document/*.py
%{python_sitearch}/veusz/document/*.py[co]
%{python_sitearch}/veusz/helpers/*.py
%{python_sitearch}/veusz/helpers/*.py[co]
%{python_sitearch}/veusz/helpers/*.so
%{python_sitearch}/veusz/setting/*.py
%{python_sitearch}/veusz/setting/*.py[co]
%{python_sitearch}/veusz/utils/*.py
%{python_sitearch}/veusz/utils/*.py[co]
%{python_sitearch}/veusz/widgets/*.py
%{python_sitearch}/veusz/widgets/*.py[co]
%{python_sitearch}/veusz/widgets/data/colormaps.dat
%{python_sitearch}/veusz/windows/*.py
%{python_sitearch}/veusz/windows/*.py[co]
%dir %{_datadir}/pixmaps/veusz
%{_datadir}/pixmaps/veusz/*.png
%{_datadir}/pixmaps/veusz/*.svg
%{_datadir}/pixmaps/veusz.png

%changelog
* Fri Jun  5 2009 Jeremy Sanders <jeremy@jeremysanders.net> - 1.4-1
- Update to Veusz 1.4

* Mon Apr 6 2009 Jeremy Sanders <jeremy@jeremysanders.net> - 1.3-3
- Remove file that is not included

* Mon Apr 6 2009 Jeremy Sanders <jeremy@jeremysanders.net> - 1.3-2
- Fix readme location build issue

* Mon Apr 6 2009 Jeremy Sanders <jeremy@jeremysanders.net> - 1.3-1
- Update to Veusz 1.3

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Sun Dec 7 2008 Jeremy Sanders <jeremy@jeremysanders.net> - 1.2.1-1
- Update to Veusz 1.2.1
- Fix location of COPYING file for about dialog

* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 1.2-4
- Rebuild for Python 2.6

* Tue Nov 25 2008 Jeremy Sanders <jeremy@jeremysanders.net> - 1.2-3
- Fix bug in icon symlink

* Tue Nov 25 2008 Jeremy Sanders <jeremy@jeremysanders.net> - 1.2-2
- Fix move of icon location

* Tue Nov 25 2008 Jeremy Sanders <jeremy@jeremysanders.net> - 1.2-1
- Move to Veusz 1.2

* Thu Oct  2 2008 Jeremy Sanders <jeremy@jeremysanders.net> - 1.1-3
- Got email address wrong - bumping again

* Thu Oct  2 2008 Jeremy Sanders <jeremy@jeremysanders.net> - 1.1-2
- Forgot to add changelog for previous entry. Bumping.

* Thu Oct  2 2008 Jeremy Sanders <jeremy@jeremysanders.net> - 1.1-1
- Updated to Veusz 1.1

* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.0-3
- Autorebuild for GCC 4.3

* Sun Dec 20 2007 Jeremy Sanders <jeremy@jeremysanders.net> - 1.0-2
- Package egg file

* Sun Dec 20 2007 Jeremy Sanders <jeremy@jeremysanders.net> - 1.0-1
- Update to Veusz-1.0 (now based on PyQt4/numpy)

* Thu Aug  2 2007 Jeremy Sanders <jeremy@jeremysanders.net> - 0.10-16
- Rebuilt as forgot to commit changes before make tag

* Thu Aug  2 2007 Jeremy Sanders <jeremy@jeremysanders.net> - 0.10-15
- Rebuilt as forgot to include comment for license update

* Thu Aug 2 2007 Jeremy Sanders <jeremy@jeremysanders.net> - 0.10-14
- Changed for new licensing guidelines. Now indicates the single file
with Python licensing

* Mon Dec 11 2006 Jeremy Sanders <jeremy@jeremysanders.net> - 0.10-13
- Bumped for FC-devel

* Sat Sep 16 2006 Jeremy Sanders <jeremy@jeremysanders.net> - 0.10-12
- Bump release for FC-devel rebuild

* Wed Sep  6 2006 Jeremy Sanders <jeremy@jeremysanders.net> - 0.10-11
- Package .pyo files

* Wed Sep  6 2006 Jeremy Sanders <jeremy@jeremysanders.net> - 0.10-10
- Removed ghosts, as per new Fedora guidelines

* Wed Jul 12 2006 Jeremy Sanders <jeremy@jeremysanders.net> - 0.10-9
- Add -O1 to install to generate .pyo files on FC4

* Mon Jul 10 2006 Jeremy Sanders <jeremy@jeremysanders.net> - 0.10-8
- Remove tab characters from spec file

* Fri Jul  7 2006 Jeremy Sanders <jeremy@jeremysanders.net> - 0.10-7
- Change from python_sitelib to python_sitearch to fix x86_64

* Wed Jun 28 2006 Jeremy Sanders <jeremy@jeremysanders.net> - 0.10-6
- Added semicolon to end of categories in .desktop file

* Mon Jun 26 2006 Jeremy Sanders <jeremy@jeremysanders.net> - 0.10-5
- Add desktop-file-utils dependancy to post and postun
- Explicitly ghost *.pyo files
- Add X-Fedora category to installed .desktop file

* Tue Jun 20 2006 Jeremy Sanders <jeremy@jeremysanders.net> - 0.10-4
- Own python module and pixmaps directory
- Fix location of icon for Gnome (use symlink)
- Register application/x-veusz mimetype
- Update mime and desktop databases in post and postun

* Mon Jun 19 2006 Jeremy Sanders <jeremy@jeremysanders.net> - 0.10-3
- Fix rpmlint errors

* Mon Jun 19 2006 Jeremy Sanders <jeremy@jeremysanders.net> - 0.10-2
- Renamed from python-veusz to veusz