source: spec/trunk/SPECS/cups-pdf.spec@ 1569

Last change on this file since 1569 was 1534, checked in by Silvan Scherrer, 7 years ago

spec: cups-pdf: Release version 3.0.1-1.

File size: 2.6 KB
Line 
1Summary: Extension for creating pdf-Files with CUPS
2Name: cups-pdf
3Version: 3.0.1
4Release: 1%{?dist}
5Group: Applications/Publishing
6URL: http://www.cups-pdf.de/
7License: GPLv2+
8Vendor: bww bitwise works GmbH
9
10%scm_source github https://github.com/bitwiseworks/%{name}-os2 master-os2
11
12
13BuildRequires: gcc
14BuildRequires: cups-devel
15
16Requires: 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
39System" (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
51cd src
52gcc $RPM_OPT_FLAGS -lcups -Zhigh-mem -Zomf -Zargs-wild -Zargs-resp -lcx -o cups-pdf.exe cups-pdf.c
53cd ..
54
55
56%install
57rm -rf %{buildroot}
58mkdir -p %{buildroot}%{CPBACKEND}
59mkdir -p %{buildroot}%{CPSPOOL}
60mkdir -p %{buildroot}%{CPOUT}
61mkdir -p %{buildroot}%{CPLOG}
62mkdir -p %{buildroot}%{CPBACKEND}
63mkdir -p %{buildroot}%{ETCCUPS}
64mkdir -p %{buildroot}%{_datadir}/cups/model/
65install -m644 extra/CUPS-PDF_noopt.ppd %{buildroot}%{_datadir}/cups/model/
66install -m644 extra/CUPS-PDF_opt.ppd %{buildroot}%{_datadir}/cups/model/
67install -m644 extra/cups-pdf.conf %{buildroot}%{ETCCUPS}/
68install -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
75if [ "$1" -eq "1" ] && %{_bindir}/pgrep -u root -f %{_sbindir}/cupsd >/dev/null
76then
77 /@unixroot/usr/sbin/lpadmin -p Cups-PDF -v cups-pdf:/ -m CUPS-PDF_noopt.ppd -E || :
78fi
79%endif
80
81%postun
82if [ "$1" -eq "0" ]; then
83 # Delete the printer
84 /@unixroot/usr/sbin/lpadmin -x Cups-PDF || :
85fi
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
Note: See TracBrowser for help on using the repository browser.