%global svn_rev 3679 Name: wp34s URL: http://sourceforge.net/projects/wp34s/ Version: 3.3 Release: 1.svn%{svn_rev}%{?dist} Group: Applications/System License: GPLv3+ Summary: RPN programmable calculator # As of 24-JUL-2013 and 3-JAN-2014, getting the code from a SourceForge # subversion snapshot via their web interface randomly omits files. Source: wp34s-svn%{svn_rev}.tar.gz Source1: http://downloads.sourceforge.net/%{name}/doc/Manual_wp_34s_3_1.pdf # Fedora-specific script to fetch and create a snapshot tarball, removing the # non-free Luxi font, and Windows directory, because it is unnecessary and the # licenses of the Windows fonts have not been checked. Source1000: wp34s-get-svn-snapshot.sh # Fedora-specific patch to change use of non-free Luxi font to a free # font. The WP 34s developers may not find this aesthetically pleasing, but # did not offer a recommended replacement. Patch0: wp34s-font.patch # Fedora-specific patch to use _datadir and _pkgdocdir for paths Patch1: wp34s-sysdirs.patch # Fedora-specific patch to use generate revision.h from variable in spec # file rather than invoking svnversion. Patch2: wp34s-svnrevision.patch # Fedora-specific patch to use qextserialport package rather than # bundled library. Patch3: wp34s-qextserialport.patch BuildRequires: dos2unix BuildRequires: qt4-devel qextserialport-devel BuildRequires: desktop-file-utils %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}} %description The WP 34s project develops alternative scientific calculator firmware for the HP 20b and HP 30b calculators. This package is a build of WP 34s to run natively on Linux. # The printer subpackage is potentially useful without the base package, # e.g., with other calculator applications that can print to an HP 82240B, # so we don't define a dependency. %package printer Summary: 82240B printer emulator Group: Applications/System %description printer An 82240B emulator for use with the WP 34s calculator. # The flash subpackage is potentially useful without the base package, # e.g., to flash a physical calculator, so we don't define a dependency. %package flash Summary: 82240B firmware flash utility Group: Applications/System %description flash A utility to perform flash updates for calculators using the Atmel AT91SAM7L128 microcontroller, including the HP 20b and HP 30b, which can be used to install or upgrade WP 34s firmware. %prep %setup -q -n wp34s-svn%{svn_rev} # remove bundled font and libraries rm QtGui/fonts/DejaVuSans.ttf rm -rf QtSerial/include QtSerial/lib # convert line endings, the sources have a random mix for f in `find . -type f` do if `file $f | grep -q CRLF` then dos2unix -k $f fi done # The subversion metadata has been removed from the tarball, so # we avoid using svnversion during the build. echo 'const char SvnRevision[4] = "%{svn_rev}";' >revision.h %patch0 -p1 -b .font %patch1 -p1 -b .sysdirs %patch2 -p1 -b .svnrevision %patch3 -p1 -b .qextserialport %build cd QtGui # Can't use smp_mflags, causes make to fail make BASE_CFLAGS="%{optflags}" QMAKE=%{_qt4_qmake} RES_DIR="%{_datadir}/wp34s" DOC_DIR="%{_pkgdocdir}" cat <wp34s.desktop [Desktop Entry] Name=WP 34s Calculator GenericName=WP 34s Calculator Exec=wp34s Icon=wp34s Terminal=false Type=Application Categories=Utility;Calculator; EOF cd ../QtPrinterEmulator make BASE_CFLAGS="%{optflags}" QMAKE=%{_qt4_qmake} cat <82240b.desktop [Desktop Entry] Name=82240B Printer Emulator GenericName=82240B Printer Emulator Exec=82240b Icon=82240b Terminal=false Type=Application Categories=Utility;Calculator; EOF cd ../QtFlash make BASE_CFLAGS="%{optflags}" QMAKE=%{_qt4_qmake} cat <wp34sflash.desktop [Desktop Entry] Name=WP 34s Flash Programmer GenericName=WP 34s Flash Programmer Exec=wp34sflash Icon=wp34sflash Terminal=false Type=Application Categories=Utility;Calculator; EOF %install install -D -p -m 755 QtGui/Linux*/WP-34s %{buildroot}%{_bindir}/wp34s install -d -m 755 %{buildroot}%{_datadir}/wp34s/images install -d -m 755 %{buildroot}%{_datadir}/wp34s/skins install -D -p -m 644 QtGui/images/*.png %{buildroot}%{_datadir}/wp34s/images/ install -D -p -m 644 QtGui/skins/*.xskin %{buildroot}%{_datadir}/wp34s/skins/ install -D -p -m 644 QtGui/icons/wp34s-logo.png %{buildroot}/usr/share/pixmaps/wp34s.png install -D -p -m 644 QtGui/wp34s.desktop %{buildroot}%{_datadir}/applications/wp34s.desktop install -d -m 755 %{buildroot}%{_pkgdocdir} install -D -p -m 644 %{SOURCE1} %{buildroot}%{_pkgdocdir}/ desktop-file-validate %{buildroot}/%{_datadir}/applications/wp34s.desktop install -D -p -m 755 QtPrinterEmulator/Linux*/HP-82240B %{buildroot}%{_bindir}/82240b install -D -p -m 644 QtPrinterEmulator/icons/HP-82240B.png %{buildroot}/usr/share/pixmaps/82240b.png install -D -p -m 644 QtPrinterEmulator/82240b.desktop %{buildroot}%{_datadir}/applications/82240b.desktop desktop-file-validate %{buildroot}/%{_datadir}/applications/82240b.desktop install -D -p -m 755 QtFlash/Linux*/wp34sflash %{buildroot}%{_bindir}/wp34sflash install -D -p -m 644 QtFlash/icons/wp34s-flash-logo.png %{buildroot}/usr/share/pixmaps/wp34sflash.png install -D -p -m 644 QtFlash/wp34sflash.desktop %{buildroot}%{_datadir}/applications/wp34sflash.desktop desktop-file-validate %{buildroot}/%{_datadir}/applications/wp34sflash.desktop %files %doc COPYING %doc QtGui/README_*.txt %{_bindir}/wp34s %{_datadir}/wp34s %{_datadir}/applications/wp34s.desktop %{_datadir}/pixmaps/wp34s.png %files printer %doc COPYING %{_bindir}/82240b %{_datadir}/applications/82240b.desktop %{_datadir}/pixmaps/82240b.png %files flash %doc COPYING %{_bindir}/wp34sflash %{_datadir}/applications/wp34sflash.desktop %{_datadir}/pixmaps/wp34sflash.png %changelog * Sat Sep 20 2014 Eric Smith 3.3-1.svn3679 - Update to latest upstream. * Sun Jan 05 2014 Eric Smith 3.2-1.svn3467 - initial version