engauge-digitizer/engauge-digitizer.spec

183 lines
6.1 KiB
RPMSpec

%global checkout 28de7dcffa2585192e3118a4861e9232fbb5a09b
%global date 20150115
## 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
Release: 8.%{date}git%(echo %{checkout} | cut -c-6)%{?dist}
Group: Applications/Engineering
License: GPLv2+
URL: http://digitizer.sourceforge.net/
Source0: http://sourceforge.net/code-snapshots/git/d/di/digitizer/code.git/digitizer-code-%{checkout}.zip
## Proposed in https://bugzilla.redhat.com/show_bug.cgi?id=1182409
Source1: %{name}.appdata.xml
Source2: %{name}.svg
Source3: %{name}-with-name.svg
## Main building
BuildRequires: qt-devel >= 1:4.6.0, fftw-devel, desktop-file-utils
## BR for 'transpose' building
BuildRequires: qt3-devel, byacc, flex
%if 0%{?fedora}
BuildRequires: libappstream-glib
%endif
%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
%setup -q -n digitizer-code-%{checkout}
## 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
mkdir -p %{buildroot}%{_datadir}/pixmaps
mkdir -p %{buildroot}%{_datadir}/appdata
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
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
## Desktop file installation
desktop-file-install --dir=${RPM_BUILD_ROOT}%{_datadir}/applications %{name}.desktop
%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 \
--set-key=Keywords --set-value="analog;digital;converter;" ${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
sed -e \
's|Keywords=Analog-Digital Converter;|Keywords=analog;digital;converter;|g' \
-i ${RPM_BUILD_ROOT}%{_datadir}/applications/%{name}.desktop
%endif
%if 0%{?fedora}
%check
appstream-util validate-relax --nonet %{buildroot}%{_datadir}/appdata/*.appdata.xml
%endif
%post
/usr/bin/update-desktop-database &> /dev/null || :
%postun
/usr/bin/update-desktop-database &> /dev/null || :
%files
%doc README RELEASE
%if 0%{?fedora}
%license LICENSE
%else
%doc LICENSE
%endif
%{_bindir}/engauge
%{_datadir}/pixmaps/%{name}*.svg
%if 0%{?fedora}
%{_datadir}/appdata/*.appdata.xml
%endif
%{_datadir}/applications/%{name}.desktop
%{_datadir}/%{name}-%{version}/
%files transpose
%doc utility/transpose/README
%if 0%{?fedora}
%license LICENSE
%else
%doc LICENSE
%endif
%{_bindir}/transpose
%changelog
* Mon Feb 23 2015 Antonio Trande <sagitter@fedoraproject.org> - 5.2-8.20150115git28de7d
- Fixed Keywords key in .desktop file
* Thu Jan 15 2015 Antonio Trande <sagitter@fedoraproject.org> - 5.2-7.20150115git28de7d
- Included files proposed in bz#1182409
* 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
* 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