source: trunk/dports/print/cups-pdf/Portfile

Last change on this file was 133452, checked in by jmr@…, 3 years ago

cups-pdf: respect archflags

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.0 KB
Line 
1# $Id: Portfile 133452 2015-03-02 03:45:01Z ryandesign@macports.org $
2
3PortSystem          1.0
4
5name                cups-pdf
6version             2.6.1
7categories          print textproc
8license             GPL-2+
9maintainers         nomaintainer
10description         Provides a print-to-PDF feature through CUPS
11long_description \
12   This software is designed to produce PDF files in a heterogeneous \
13   network by providing a PDF printer on the central fileserver.
14
15platforms           darwin
16
17if {${os.platform} eq "darwin" && ${os.major} > 9} {
18   set notes-darwinover9 "
19   As of Mac OS X 10.6, cups can no longer write into user directories, so
20   the output directory for ${name} has been updated to reflect this.
21   ${name} will now write PDF files into ${prefix}/var/spool/cups-pdf/\$USER .
22   You can create a symlink to this location from Desktop to have it behave as
23   before:
24      ln -s ${prefix}/var/spool/cups-pdf/\$USER ~/Desktop/cups-pdf
25
26   If you are upgrading, your ${prefix}/etc/cups/cups-pdf.conf file will
27   not be touched, and will probably need the Out parameter updated; see the
28   ${prefix}/etc/cups/cups-pdf.conf.dist file for an example."
29} else {
30   set notes-darwinover9 ""
31}
32
33notes "
34   *************************************************************
35   If this is the first installation, there are a couple of items to do:
36   -  First, symlinks in /usr are needed for CUPS to see cups-pdf, so run
37      (it will run sudo so may ask for your password):
38         ${prefix}/libexec/cups-pdf_links.sh
39   -  Edit ${prefix}/etc/cups/cups-pdf.conf as needed
40   -  Finally, tell cupsd to update (it may not be running on 10.5+):
41         sudo killall -1 cupsd
42   *************************************************************
43   ${notes-darwinover9}"
44
45homepage            http://www.cups-pdf.de/
46master_sites        ${homepage}src/
47distname            ${name}_${version}
48worksrcdir          ${name}-${version}
49
50checksums           md5     65f3fd525c4a9b1d736b91594b3166d5 \
51                    sha1    6806f0004dfed5216625ab60cfe307ded23c2f6a \
52                    rmd160  ebb7ed5192ff91201e2ef9d87d8f24c1c7a393cc
53
54post-patch {
55   reinplace "s|/etc|${prefix}/etc|" ${worksrcpath}/src/cups-pdf.h
56   reinplace "s|/var/spool|${prefix}/var/spool|" \
57      ${worksrcpath}/src/cups-pdf.h
58   reinplace "s|/var/log|${prefix}/var/log|" ${worksrcpath}/src/cups-pdf.h
59}
60
61use_configure       no
62
63build {
64   system -W ${worksrcpath}/src "${configure.cc} ${configure.cflags} [get_canonical_archflags] -o cups-pdf cups-pdf.c"
65}
66
67destroot {
68   xinstall -m 755 -d ${destroot}${prefix}/libexec/cups/backend \
69      ${destroot}${prefix}/etc/cups ${destroot}${prefix}/share/cups/model \
70      ${destroot}${prefix}/share/doc/${name} \
71      ${destroot}${prefix}/var/spool/cups-pdf \
72      ${destroot}${prefix}/var/log/cups
73   xinstall -m 700 ${worksrcpath}/src/cups-pdf \
74      ${destroot}${prefix}/libexec/cups/backend
75   xinstall -m 644 ${worksrcpath}/extra/cups-pdf.conf \
76      ${destroot}${prefix}/etc/cups/cups-pdf.conf.dist
77   xinstall -m 644 ${worksrcpath}/extra/CUPS-PDF.ppd \
78      ${destroot}${prefix}/share/cups/model
79   xinstall -m 644 -W ${worksrcpath} README COPYING ChangeLog \
80      ${destroot}${prefix}/share/doc/${name}
81
82   # Some initial changes to the conf file
83   if {${os.platform} eq "darwin" && ${os.major} > 9} {
84      reinplace "s|#Out .*|Out ${prefix}/var/spool/cups-pdf/\${USER}/|" \
85         ${destroot}${prefix}/etc/cups/cups-pdf.conf.dist
86   } else {
87      reinplace "s|#Out .*|Out \${HOME}/Desktop/cups-pdf/|" \
88         ${destroot}${prefix}/etc/cups/cups-pdf.conf.dist
89   }
90   reinplace "s| /var/spool| ${prefix}/var/spool|" \
91      ${destroot}${prefix}/etc/cups/cups-pdf.conf.dist
92   reinplace "s| /var/log| ${prefix}/var/log|" \
93      ${destroot}${prefix}/etc/cups/cups-pdf.conf.dist
94   reinplace "s|#Cut .*|Cut 3|" \
95      ${destroot}${prefix}/etc/cups/cups-pdf.conf.dist
96   reinplace "s|#Label .*|Label 1|" \
97      ${destroot}${prefix}/etc/cups/cups-pdf.conf.dist
98   reinplace "s|#Log |Log |" \
99      ${destroot}${prefix}/etc/cups/cups-pdf.conf.dist
100   reinplace "s|#Log |Log |" \
101      ${destroot}${prefix}/etc/cups/cups-pdf.conf.dist
102   reinplace "s|#GhostScript .*|GhostScript /usr/bin/pstopdf|" \
103      ${destroot}${prefix}/etc/cups/cups-pdf.conf.dist
104   reinplace "s|#GSCall .*|GSCall %s %s -o %s %s|" \
105      ${destroot}${prefix}/etc/cups/cups-pdf.conf.dist
106   reinplace "s|#PDFVer .*|PDFVer |" \
107      ${destroot}${prefix}/etc/cups/cups-pdf.conf.dist
108}
109destroot.keepdirs   ${destroot}${prefix}/var/spool/cups-pdf \
110                    ${destroot}${prefix}/var/log/cups
111post-destroot {
112   xinstall -m 755 -W ${filespath} cups-pdf_links.sh \
113      ${destroot}${prefix}/libexec/
114   reinplace "s|@@PREFIX@@|${prefix}|g" \
115      ${destroot}${prefix}/libexec/cups-pdf_links.sh
116}
117
118post-activate {
119   if {![file exists ${prefix}/etc/cups/cups-pdf.conf]} {
120      copy ${prefix}/etc/cups/cups-pdf.conf.dist \
121         ${prefix}/etc/cups/cups-pdf.conf
122   }
123}
124
125livecheck.type      regex
126livecheck.url       http://www.cups-pdf.de/src
127livecheck.regex     cups-pdf_(\\d(?:\\.\\d)+)${extract.suffix}
Note: See TracBrowser for help on using the repository browser.