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

Last change on this file since 76953 was 76953, checked in by blb@…, 10 years ago

Numerous ports: add license field

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