# $Id: Portfile 43527 2008-12-11 09:03:47Z blb@macports.org $ PortSystem 1.0 name cups-pdf version 2.4.8 categories print textproc maintainers blb description Provides a print-to-PDF feature through CUPS long_description \ This software is designed to produce PDF files in a heterogeneous \ network by providing a PDF printer on the central fileserver. platforms darwin homepage http://www.cups-pdf.de/ master_sites ${homepage}src/ distname ${name}_${version} worksrcdir ${name}-${version} checksums md5 0d17dc5e094b366c8ad43cc27c7f82c9 \ sha1 7da47c61fef313e47fa6db9f1859499683fc72e8 \ rmd160 ceed244effd0c9e63ec0a376a2adabb98abd9a4f post-extract { reinplace "s|/etc|${prefix}/etc|" ${worksrcpath}/src/cups-pdf.h reinplace "s|/var/spool|${prefix}/var/spool|" \ ${worksrcpath}/src/cups-pdf.h reinplace "s|/var/log|${prefix}/var/log|" ${worksrcpath}/src/cups-pdf.h } use_configure no build { system "cd ${worksrcpath}/src && ${configure.cc} -Os -o cups-pdf cups-pdf.c" } destroot { xinstall -m 755 -d ${destroot}${prefix}/libexec/cups/backend \ ${destroot}/${prefix}/etc/cups ${destroot}${prefix}/share/cups/model \ ${destroot}/${prefix}/share/doc/${name} \ ${destroot}${prefix}/var/spool/cups-pdf \ ${destroot}${prefix}/var/log/cups xinstall -m 700 ${worksrcpath}/src/cups-pdf \ ${destroot}${prefix}/libexec/cups/backend xinstall -m 644 ${worksrcpath}/extra/cups-pdf.conf \ ${destroot}${prefix}/etc/cups/cups-pdf.conf.dist xinstall -m 644 ${worksrcpath}/extra/CUPS-PDF.ppd \ ${destroot}${prefix}/share/cups/model xinstall -m 644 -W ${worksrcpath} README COPYING ChangeLog \ ${destroot}${prefix}/share/doc/${name} # Some initial changes to the conf file reinplace "s|#Out .*|Out \${HOME}/Desktop/cups-pdf/|" \ ${destroot}${prefix}/etc/cups/cups-pdf.conf.dist reinplace "s| /var/spool| ${prefix}/var/spool|" \ ${destroot}${prefix}/etc/cups/cups-pdf.conf.dist reinplace "s| /var/log| ${prefix}/var/log|" \ ${destroot}${prefix}/etc/cups/cups-pdf.conf.dist reinplace "s|#Cut .*|Cut 3|" \ ${destroot}${prefix}/etc/cups/cups-pdf.conf.dist reinplace "s|#Label .*|Label 1|" \ ${destroot}${prefix}/etc/cups/cups-pdf.conf.dist reinplace "s|#Log |Log |" \ ${destroot}${prefix}/etc/cups/cups-pdf.conf.dist reinplace "s|#Log |Log |" \ ${destroot}${prefix}/etc/cups/cups-pdf.conf.dist reinplace "s|#GhostScript .*|GhostScript /usr/bin/pstopdf|" \ ${destroot}${prefix}/etc/cups/cups-pdf.conf.dist reinplace "s|#GSCall .*|GSCall %s %s -o %s %s|" \ ${destroot}${prefix}/etc/cups/cups-pdf.conf.dist reinplace "s|#PDFVer .*|PDFVer |" \ ${destroot}${prefix}/etc/cups/cups-pdf.conf.dist } destroot.keepdirs ${destroot}${prefix}/var/spool/cups-pdf \ ${destroot}${prefix}/var/log/cups post-install { ui_msg "\n*************************************************************" ui_msg "If this is the first installation, there are a couple of items" ui_msg "to do:" ui_msg " First, symlink the cups-pdf backend with:" ui_msg " sudo ln -s ${prefix}/libexec/cups/backend/cups-pdf /usr/libexec/cups/backend/" ui_msg " Next, symlink the color postscript model:" ui_msg " sudo ln -s ${prefix}/share/cups/model/CUPS-PDF.ppd /usr/share/cups/model/" ui_msg " Then, create the config file:" ui_msg " sudo cp ${prefix}/etc/cups/cups-pdf.conf.dist ${prefix}/etc/cups/cups-pdf.conf" ui_msg " Edit cups-pdf.conf as needed" ui_msg " Finally, tell cupsd to update (it may not be running on 10.5):" ui_msg " sudo killall -1 cupsd" ui_msg "\n*************************************************************" }