# https://github.com/Boomaga/boomaga/commit/7f7ad4754b20a1027c5095b660c5229353b64c8d %global commit0 7f7ad4754b20a1027c5095b660c5229353b64c8d %global shortcommit0 %(c=%{commit0}; echo ${c:0:7}) #global _disable_ld_as_needed 1 %define rel 3 %define date 20220220 Name: boomaga Version: 3.3.0 Release: %mkrel %{rel}.%{date}git%{shortcommit0} Summary: A virtual printer for viewing a document before printing Group: System/Printing # Automatically converted from old format: GPLv2 and LGPLv2+ - review is highly recommended. License: GPLv2 and LGPLv2+ URL: https://www.boomaga.org Source0: https://github.com/Boomaga/%{name}/archive/%{commit0}/%{name}-%{commit0}.tar.gz#/%{name}-%{shortcommit0}.tar.gz #https://github.com/Boomaga/boomaga/pull/124.patch Patch0: 124.patch Patch1: 0001-boomaga-cmake-policy.patch BuildRequires: cmake BuildRequires: cups-devel BuildRequires: ghostscript-devel BuildRequires: pkgconfig(Qt5Core) BuildRequires: pkgconfig(Qt5Gui) BuildRequires: pkgconfig(Qt5PrintSupport) BuildRequires: pkgconfig(Qt5DBus) BuildRequires: pkgconfig(Qt5Help) BuildRequires: pkgconfig(poppler-cpp) BuildRequires: pkgconfig(poppler) BuildRequires: pkgconfig(snappy) Requires(pre): ghostscript Requires: snappy Requires(preun):cups-common Requires(post): paper-utils Requires(pre): task-printing-server %description Boomaga (BOOklet MAnager) is a virtual printer for viewing a document before printing it out using the physical printer. The program is very simple to work with. Running any program, click "print" and select "Boomaga" to see in several seconds (CUPS takes some time to respond) the Boomaga window open. If you print out one more document, it gets added to the previous one, and you can also print them out as one. Regardless of whether your printer supports duplex printing or not, you would be able to easily print on both sides of the sheet. If your printer does not support duplex printing, point this out in the settings, and Booklet would ask you to turn over the pages half way through printing your document. The program can also help you get your documents prepared a bit before printing. At this stage Boomaga makes it possible to: * Paste several documents together. * Print several pages on one sheet. * 1, 2, 4, 8 pages per sheet * Booklet. Folding the sheets in two, you'll get a book. %prep %autosetup -n %{name}-%{commit0} -p1 # delete unused directories and files find -name .gitignore -type f -or -name .travis.yml -type f | xargs rm -rfv sed -i -e 's|find "/usr/local/lib" "/usr/lib" -name|find "/usr/local/lib" "%{_libdir}" -name|' scripts/testBackend.sh %build %cmake_qt5 %cmake_build . # disable parallel build, is not possible # make_build %cmake_build -j1 %install %cmake_install %__mkdir -p %{buildroot}%{_datadir}/%{name}/scripts %__install -m 755 scripts/installPrinter.sh %{buildroot}%{_datadir}/%{name}/scripts/ chmod +x %{buildroot}%{_datadir}/%{name}/scripts/installPrinter.sh mkdir -p %{buildroot}/%{_localstatedir}/cache/%{name} %find_lang %{name} --with-qt %check desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %pre if [ $1 -eq 1 ];then # Start cups if is stopped if [ "$(systemctl is-active cups.service)" != "active" ]; then systemctl start cups sleep 2 fi fi %post # Install the printer to cups backends if [ $1 -eq 1 ]; then sh %{_datadir}/%{name}/scripts/installPrinter.sh ||: fi %triggerun -- boomaga < 3.0.0-4 # Start cups if is stopped if [ "$(systemctl is-active cups.service)" != "active" ]; then touch /run/cups.boomaga systemctl start cups sleep 2 fi %triggerpostun -- boomaga < 3.0.0-4 if [ -f /run/cups.boomaga ]; then systemctl stop cups rm -rf /run/cups.boomaga fi %preun # Uninstall the printer if [ $1 -eq 0 ]; then if [ "$(systemctl is-active cups.service)" != "active" ]; then systemctl start cups sleep 2 lpadmin -x "Boomaga" ||: systemctl stop cups else lpadmin -x "Boomaga" ||: fi fi %files -f %{name}.lang %dir %{_datadir}/%{name} %dir %{_datadir}/%{name}/scripts %{_bindir}/%{name} %attr(700,root,root) %{_prefix}/lib/cups/backend/%{name} %dir %{_localstatedir}/cache/%{name} %{_datadir}/dbus-1/services/org.%{name}.service %{_mandir}/man1/%{name}.1* %{_datadir}/ppd/%{name}/ %{_datadir}/%{name}/scripts/installPrinter.sh %{_datadir}/applications/%{name}.desktop %{_iconsdir}/hicolor/*/apps/%{name}.png %{_datadir}/mime/packages/%{name}.xml