| 1 | Summary: Extension for creating pdf-Files with CUPS
|
|---|
| 2 | Name: cups-pdf
|
|---|
| 3 | Version: 3.0.1
|
|---|
| 4 | Release: 1%{?dist}
|
|---|
| 5 | Group: Applications/Publishing
|
|---|
| 6 | URL: http://www.cups-pdf.de/
|
|---|
| 7 | License: GPLv2+
|
|---|
| 8 | Vendor: bww bitwise works GmbH
|
|---|
| 9 |
|
|---|
| 10 | %scm_source github https://github.com/bitwiseworks/%{name}-os2 master-os2
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 | BuildRequires: gcc
|
|---|
| 14 | BuildRequires: cups-devel
|
|---|
| 15 |
|
|---|
| 16 | Requires: ghostscript, cups
|
|---|
| 17 | #Requires(post): %{_bindir}/pgrep
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 | # These are the defaults paths defined in config.h
|
|---|
| 21 | # CUPS-PDF spool directory
|
|---|
| 22 | %global CPSPOOL %{_localstatedir}/spool/cups-pdf/SPOOL
|
|---|
| 23 |
|
|---|
| 24 | # CUPS-PDF output directory
|
|---|
| 25 | %global CPOUT %{_localstatedir}/spool/cups-pdf
|
|---|
| 26 |
|
|---|
| 27 | # CUPS-PDF log directory
|
|---|
| 28 | %global CPLOG %{_localstatedir}/log/cups
|
|---|
| 29 |
|
|---|
| 30 | # CUPS-PDF cups-pdf.conf config file
|
|---|
| 31 | %global ETCCUPS %(cups-config --serverroot 2>/dev/null || echo %{_sysconfdir}/cups)
|
|---|
| 32 |
|
|---|
| 33 | # Additional path to backend directory
|
|---|
| 34 | %global CPBACKEND %(cups-config --serverbin 2>/dev/null || echo %{_libdir}/cups)/backend
|
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 | %description
|
|---|
| 38 | "cups-pdf" is a backend script for use with CUPS - the "Common UNIX Printing
|
|---|
| 39 | System" (see more for CUPS under http://www.cups.org/).
|
|---|
| 40 | "cups-pdf" uses the ghostscript pdfwrite device to produce PDF Files.
|
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 | %debug_package
|
|---|
| 44 |
|
|---|
| 45 |
|
|---|
| 46 | %prep
|
|---|
| 47 | %scm_setup
|
|---|
| 48 |
|
|---|
| 49 |
|
|---|
| 50 | %build
|
|---|
| 51 | cd src
|
|---|
| 52 | gcc $RPM_OPT_FLAGS -lcups -Zhigh-mem -Zomf -Zargs-wild -Zargs-resp -lcx -o cups-pdf.exe cups-pdf.c
|
|---|
| 53 | cd ..
|
|---|
| 54 |
|
|---|
| 55 |
|
|---|
| 56 | %install
|
|---|
| 57 | rm -rf %{buildroot}
|
|---|
| 58 | mkdir -p %{buildroot}%{CPBACKEND}
|
|---|
| 59 | mkdir -p %{buildroot}%{CPSPOOL}
|
|---|
| 60 | mkdir -p %{buildroot}%{CPOUT}
|
|---|
| 61 | mkdir -p %{buildroot}%{CPLOG}
|
|---|
| 62 | mkdir -p %{buildroot}%{CPBACKEND}
|
|---|
| 63 | mkdir -p %{buildroot}%{ETCCUPS}
|
|---|
| 64 | mkdir -p %{buildroot}%{_datadir}/cups/model/
|
|---|
| 65 | install -m644 extra/CUPS-PDF_noopt.ppd %{buildroot}%{_datadir}/cups/model/
|
|---|
| 66 | install -m644 extra/CUPS-PDF_opt.ppd %{buildroot}%{_datadir}/cups/model/
|
|---|
| 67 | install -m644 extra/cups-pdf.conf %{buildroot}%{ETCCUPS}/
|
|---|
| 68 | install -m700 src/cups-pdf.exe %{buildroot}%{CPBACKEND}/
|
|---|
| 69 |
|
|---|
| 70 |
|
|---|
| 71 | %post
|
|---|
| 72 | # not right now, as we lack pgrep
|
|---|
| 73 | %if 0
|
|---|
| 74 | # First install : create the printer if cupsd is running
|
|---|
| 75 | if [ "$1" -eq "1" ] && %{_bindir}/pgrep -u root -f %{_sbindir}/cupsd >/dev/null
|
|---|
| 76 | then
|
|---|
| 77 | /@unixroot/usr/sbin/lpadmin -p Cups-PDF -v cups-pdf:/ -m CUPS-PDF_noopt.ppd -E || :
|
|---|
| 78 | fi
|
|---|
| 79 | %endif
|
|---|
| 80 |
|
|---|
| 81 | %postun
|
|---|
| 82 | if [ "$1" -eq "0" ]; then
|
|---|
| 83 | # Delete the printer
|
|---|
| 84 | /@unixroot/usr/sbin/lpadmin -x Cups-PDF || :
|
|---|
| 85 | fi
|
|---|
| 86 |
|
|---|
| 87 |
|
|---|
| 88 | %files
|
|---|
| 89 | %doc ChangeLog COPYING README INSTALL.RPM
|
|---|
| 90 | %dir %{CPSPOOL}
|
|---|
| 91 | %dir %{CPOUT}
|
|---|
| 92 | %attr(700, root, root) %{CPBACKEND}/cups-pdf.exe
|
|---|
| 93 | %config(noreplace) %{ETCCUPS}/cups-pdf.conf
|
|---|
| 94 | %{_datadir}/cups/model/CUPS-PDF_noopt.ppd
|
|---|
| 95 | %{_datadir}/cups/model/CUPS-PDF_opt.ppd
|
|---|
| 96 |
|
|---|
| 97 |
|
|---|
| 98 | %changelog
|
|---|
| 99 | * Mon Dec 10 2018 Silvan Scherrer <silvan.scherrer@aroa> 3.0.1-1
|
|---|
| 100 | - first rpm version
|
|---|