## 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: 3%{?dist} Group: Applications/Engineering License: GPLv2+ URL: http://digitizer.sourceforge.net/ Source0: http://sourceforge.net/projects/digitizer/files/Engauge%20Digitizer/digitizer-%{version}/engauge_%{version}.tgz ## Desktop file Source1: %{name}.desktop ## Main building BuildRequires: qt-devel >= 1:4.6.0, fftw-devel, desktop-file-utils ## BR for 'transpose' building BuildRequires: qt3-devel, byacc, flex Requires: %{name}-data = %{version}-%{release} %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 data Summary: The %{name} data files Group: Applications/Engineering BuildArch: noarch %description data Data files of %{name} application. %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 engauge-%{version} ## Fix 'src/pointset.cpp' compilation error. sed -i '36a #include ' src/digitdoc.cpp sed -i '32a #include ' 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}/icons/%{name} 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 src/img/digitizer.ico %{buildroot}%{_datadir}/icons/%{name} ## Desktop file installation desktop-file-install \ --dir=${RPM_BUILD_ROOT}%{_datadir}/applications \ %{SOURCE1} %post /bin/touch --no-create %{_datadir}/icons &>/dev/null || : %postun if [ $1 -eq 0 ] ; then /bin/touch --no-create %{_datadir}/icons &>/dev/null /usr/bin/gtk-update-icon-cache %{_datadir}/icons &>/dev/null || : fi %posttrans /usr/bin/gtk-update-icon-cache %{_datadir}/icons &>/dev/null || : %files %doc LICENSE README RELEASE Doxyfile %{_bindir}/engauge %{_datadir}/icons/%{name}/ %{_datadir}/applications/%{name}.desktop %files data %doc LICENSE %{_datadir}/%{name}-%{version}/ %files transpose %doc utility/transpose/README %doc LICENSE %{_bindir}/transpose %changelog * Wed Nov 13 2013 Antonio Trande 5.2-3 - Data files splitted into a noarch -data subpackage - .h/.cpp files not packaged anymore * Tue Nov 12 2013 Antonio Trande 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 5.2-1 - First package