engauge-digitizer/engauge-digitizer.spec

175 lines
5.8 KiB
RPMSpec
Raw Normal View History

2015-01-15 17:20:00 +00:00
%global checkout 28de7dcffa2585192e3118a4861e9232fbb5a09b
%global date 20150115
2013-11-13 20:58:45 +00:00
## Define the Qt3/Qt4 qmake
%global qmake %{_libdir}/qt-3.3/bin/qmake
%global qmake4 %{_libdir}/qt4/bin/qmake-qt4
Name: engauge-digitizer
Summary: Convert graphs or map files into numbers
Version: 5.2
2015-01-15 21:33:49 +00:00
Release: 7.%{date}git%(echo %{checkout} | cut -c-6)%{?dist}
2013-11-13 20:58:45 +00:00
Group: Applications/Engineering
License: GPLv2+
URL: http://digitizer.sourceforge.net/
2015-01-15 17:20:00 +00:00
Source0: http://sourceforge.net/code-snapshots/git/d/di/digitizer/code.git/digitizer-code-%{checkout}.zip
2013-11-13 20:58:45 +00:00
2015-01-15 21:33:49 +00:00
## Proposed in https://bugzilla.redhat.com/show_bug.cgi?id=1182409
Source1: %{name}.appdata.xml
Source2: %{name}.svg
Source3: %{name}-with-name.svg
2013-11-13 20:58:45 +00:00
## Main building
BuildRequires: qt-devel >= 1:4.6.0, fftw-devel, desktop-file-utils
## BR for 'transpose' building
BuildRequires: qt3-devel, byacc, flex
2015-01-15 21:33:49 +00:00
%if 0%{?fedora}
2015-01-15 17:20:00 +00:00
BuildRequires: libappstream-glib
2015-01-15 21:33:49 +00:00
%endif
2013-11-13 20:58:45 +00:00
%description
This open source, digitizing software converts an image file
showing a graph or map, into numbers.
The image file can come from a scanner, digital camera
or screen-shot. The numbers can be read on the screen,
and written or copied to a spreadsheet.
The process starts with an image file containing a graph or map.
The final result is digitized data that can be used by other tools
such as Gnumeric.
%package transpose
Summary: The %{name} transpose utility
Group: Applications/Engineering
%description transpose
This utility often proves useful for post-processing the
output of Engauge Digitizer. Specifically, this utility can transpose the output
matrices found in the export files.
%prep
2015-01-15 17:20:00 +00:00
%setup -q -n digitizer-code-%{checkout}
2013-11-13 20:58:45 +00:00
## Fix 'src/pointset.cpp' compilation error.
sed -i '36a #include <algorithm>' src/digitdoc.cpp
sed -i '32a #include <algorithm>' src/pointset.cpp
%build
%qmake4 -makefile \
QMAKE_CFLAGS="$RPM_OPT_FLAGS -D_REENTRANT -DQT_QT3SUPPORT_LIB -DQT3_SUPPORT -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB" \
QMAKE_CXXFLAGS="$RPM_OPT_FLAGS -D_REENTRANT -DQT_QT3SUPPORT_LIB -DQT3_SUPPORT -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB"
make %{?_smp_mflags}
pushd utility/transpose
%qmake -makefile \
QMAKE_CFLAGS="$RPM_OPT_FLAGS -D_REENTRANT -DQT_THREAD_SUPPORT" \
QMAKE_CXXFLAGS="$RPM_OPT_FLAGS -D_REENTRANT -DQT_THREAD_SUPPORT"
## Fix Qt3 destination directories
sed -i '13a QTDIR=%{_libdir}/qt-3.3' Makefile
make %{?_smp_mflags}
popd
%install
mkdir -p %{buildroot}%{_datadir}/%{name}-%{version}/samples
mkdir -p %{buildroot}%{_datadir}/%{name}-%{version}/animation
mkdir -p %{buildroot}%{_datadir}/%{name}-%{version}/img
mkdir -p %{buildroot}%{_datadir}/%{name}-%{version}/usermanual
mkdir -p %{buildroot}%{_datadir}/applications
2015-01-15 17:20:00 +00:00
mkdir -p %{buildroot}%{_datadir}/pixmaps
2015-01-15 21:33:49 +00:00
mkdir -p %{buildroot}%{_datadir}/appdata
2013-11-13 20:58:45 +00:00
mkdir -p %{buildroot}%{_bindir}
install -p -m 755 bin/engauge %{buildroot}%{_bindir}
install -p -m 755 utility/transpose/transpose %{buildroot}%{_bindir}
install -p -m 644 samples/* %{buildroot}%{_datadir}/%{name}-%{version}/samples
install -p -m 644 src/img/* %{buildroot}%{_datadir}/%{name}-%{version}/img
install -p -m 644 usermanual/* %{buildroot}%{_datadir}/%{name}-%{version}/usermanual
install -p -m 644 animation/* %{buildroot}%{_datadir}/%{name}-%{version}/animation
2015-01-15 21:33:49 +00:00
install -p -m 644 %{SOURCE2} %{buildroot}%{_datadir}/pixmaps
install -p -m 644 %{SOURCE3} %{buildroot}%{_datadir}/pixmaps
%if 0%{?fedora}
install -p -m 644 %{SOURCE1} %{buildroot}%{_datadir}/appdata
%endif
2013-11-13 20:58:45 +00:00
## Desktop file installation
2015-01-15 17:20:00 +00:00
desktop-file-install --dir=${RPM_BUILD_ROOT}%{_datadir}/applications %{name}.desktop
2015-01-15 21:33:49 +00:00
%if 0%{?fedora}
desktop-file-edit \
--set-key=Exec --set-value="env ENGAUGE_BROWSER=firefox engauge -manual %{_datadir}/%{name}-%{version}/usermanual" \
--set-icon=%{name}-with-name ${RPM_BUILD_ROOT}%{_datadir}/applications/%{name}.desktop
%else
sed -e \
's|Exec=engauge %F|Exec=env ENGAUGE_BROWSER=firefox engauge -manual %{_datadir}/%{name}-%{version}/usermanual|g' \
-i ${RPM_BUILD_ROOT}%{_datadir}/applications/%{name}.desktop
sed -e \
's|Icon=%{_datadir}/pixmaps/%{name}.xpm|Icon=%{name}-with-name|g' \
-i ${RPM_BUILD_ROOT}%{_datadir}/applications/%{name}.desktop
%endif
%if 0%{?fedora}
2015-01-15 17:20:00 +00:00
%check
2015-01-15 21:33:49 +00:00
appstream-util validate-relax --nonet %{buildroot}%{_datadir}/appdata/*.appdata.xml
%endif
2013-11-13 20:58:45 +00:00
%post
2015-01-15 17:20:00 +00:00
/usr/bin/update-desktop-database &> /dev/null || :
2013-11-13 20:58:45 +00:00
%postun
2015-01-15 17:20:00 +00:00
/usr/bin/update-desktop-database &> /dev/null || :
2013-11-13 20:58:45 +00:00
%files
2015-01-15 17:20:00 +00:00
%doc README RELEASE
2015-01-15 21:33:49 +00:00
%if 0%{?fedora}
2015-01-15 17:20:00 +00:00
%license LICENSE
2015-01-15 21:33:49 +00:00
%else
%doc LICENSE
%endif
2013-11-13 20:58:45 +00:00
%{_bindir}/engauge
2015-01-15 21:33:49 +00:00
%{_datadir}/pixmaps/%{name}*.svg
%if 0%{?fedora}
%{_datadir}/appdata/*.appdata.xml
%endif
2013-11-13 20:58:45 +00:00
%{_datadir}/applications/%{name}.desktop
%{_datadir}/%{name}-%{version}/
%files transpose
%doc utility/transpose/README
2015-01-15 21:33:49 +00:00
%if 0%{?fedora}
%license LICENSE
%else
%doc LICENSE
%endif
2013-11-13 20:58:45 +00:00
%{_bindir}/transpose
%changelog
2015-01-15 21:33:49 +00:00
* Thu Jan 15 2015 Antonio Trande <sagitter@fedoraproject.org> - 5.2-7.20150115git28de7d
- Included files proposed in bz#1182409
2015-01-15 17:20:00 +00:00
* Thu Jan 15 2015 Antonio Trande <sagitter@fedoraproject.org> - 5.2-6.20150115git28de7d
- Update to commit 28de7d
- Package appdata and SVG files
- data sub-package incorporated in the main one
- Used the new macro %%license
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
2013-11-13 20:58:45 +00:00
* Wed Nov 13 2013 Antonio Trande <sagitter@fedoraproject.org> 5.2-3
- Data files splitted into a noarch -data subpackage
- .h/.cpp files not packaged anymore
* Tue Nov 12 2013 Antonio Trande <sagitter@fedoraproject.org> 5.2-2
- Fix 'src/pointset.cpp' compilation error in EPEL
- Defined Qt3/Qt4 qmake
- Fix BR Qt4 for EPEL
- RPM_OPT_FLAGS fixed without patches
* Sun Nov 10 2013 Antonio Trande <sagitter@fedoraproject.org> 5.2-1
- First package