74 | | notes "\ |
75 | | Edit ${prefix}/etc/sane.d/dll.conf to enable only\ |
76 | | specific backends for a noticeable performance gain." |
| 74 | set plistDir ${prefix}/Library/LaunchDaemons |
| 75 | set plistFl ${plistDir}/org.xsane.saned.plist |
| 76 | |
| 77 | post-destroot { |
| 78 | # Simplify startup script over startupitem.create. |
| 79 | # See http://trac.macports.org/ticket/15081 |
| 80 | xinstall -d -m 0755 ${destroot}${plistDir} |
| 81 | set plist [open "${destroot}${plistFl}" w 0644] |
| 82 | puts ${plist} "<?xml version='1.0' encoding='UTF-8'?>" |
| 83 | puts ${plist} "<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\"" |
| 84 | puts ${plist} "\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\" >" |
| 85 | puts ${plist} "<plist version='1.0'>" |
| 86 | puts ${plist} "<dict>" |
| 87 | puts ${plist} "<key>Label</key><string>org.xsane.saned</string>" |
| 88 | puts ${plist} "<key>ProgramArguments</key>" |
| 89 | puts ${plist} "<array>" |
| 90 | puts ${plist} " <string>/opt/local/sbin/saned</string>" |
| 91 | puts ${plist} "</array>" |
| 92 | puts ${plist} "<key>OnDemand</key><true/>" |
| 93 | puts ${plist} "<key>Disabled</key><true/>" |
| 94 | puts ${plist} "<key>Sockets</key>" |
| 95 | puts ${plist} " <dict>" |
| 96 | puts ${plist} " <key>Listeners</key>" |
| 97 | puts ${plist} " <dict>" |
| 98 | puts ${plist} " <key>SockServiceName</key>" |
| 99 | puts ${plist} " <string>sane-port</string>" |
| 100 | puts ${plist} " <key>SockType</key>" |
| 101 | puts ${plist} " <string>stream</string>" |
| 102 | puts ${plist} " </dict>" |
| 103 | puts ${plist} " </dict>" |
| 104 | puts ${plist} "<key>inetdCompatibility</key>" |
| 105 | puts ${plist} " <dict>" |
| 106 | puts ${plist} " <key>Wait</key><false/>" |
| 107 | puts ${plist} " </dict>" |
| 108 | puts ${plist} "</dict>" |
| 109 | puts ${plist} "</plist>" |
| 110 | |
| 111 | close ${plist} |
| 112 | ln -sf ${prefix}/Library/LaunchDaemons/org.xsane.saned.plist /Library/LaunchDaemons |
| 113 | } |
| 114 | |
| 115 | |
| 116 | |
| 117 | notes "\ |
| 118 | ############################################################################ |
| 119 | # If you wish to use the saned daemon to share a scanner on the network, |
| 120 | # be sure to edit ${prefix}/etc/sane.d/net.conf and read the security notes. |
| 121 | # |
| 122 | # Startup items have been generated that will aid in |
| 123 | # starting saned with launchd. They are disabled |
| 124 | # by default. Execute the following command to start them, |
| 125 | # and to cause them to launch at startup: |
| 126 | # |
| 127 | # sudo launchctl load -w /Library/LaunchDaemons/[file tail ${plistFl}] |
| 128 | # |
| 129 | # Also, edit ${prefix}/etc/sane.d/dll.conf to enable only |
| 130 | # specific backends for a noticeable performance gain. |
| 131 | # To used saned, you must enable the "net" backend IN ADDITION to |
| 132 | # whatever backend is appropriate to your scanner. |
| 133 | ############################################################################" |
| 134 | |