Ignore:
Timestamp:
Dec 21, 2013, 10:12:35 PM (5 years ago)
Author:
landonf@…
Message:

Use a custom launchd plist to handle on-demand launching of certsync.

By watching the target directories with WatchPaths, we can avoid keeping certsync memory resident entirely.
This also makes it easier to support Tiger, where FSEvents is not available.

Location:
trunk/dports/security/certsync
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/security/certsync/Portfile

    r113511 r115007  
    44
    55name                    certsync
    6 version                 1.0.5
    7 revision                1
     6version                 1.0.6
    87categories              security
    98conflicts               curl-ca-bundle
     
    2221extract.mkdir           yes
    2322post-extract {
    24         xinstall -m 644 -W ${filespath} certsync.m update-ca-certificates ${worksrcpath}
     23        xinstall -m 644 -W ${filespath} certsync.m certsync.plist update-ca-certificates ${worksrcpath}
    2524}
    2625
    2726post-patch {
    28         reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/update-ca-certificates
     27        reinplace "s|@PREFIX@|${prefix}|g" \
     28                ${worksrcpath}/update-ca-certificates \
     29                ${worksrcpath}/certsync.plist
     30
     31        reinplace "s|@LABEL@|${startupitem.uniquename}|g" ${worksrcpath}/certsync.plist
    2932}
    3033
     
    3336variant universal {}
    3437
    35 startupitem.create      yes
    36 startupitem.executable  ${prefix}/bin/certsync -s -o ${prefix}/etc/openssl/cert.pem
    37 # trunk forward compatibility
    38 if {[info exists startupitem.autostart]} {
    39         startupitem.autostart   yes
    40 }
     38# We inject our own launchd plist to allow the use of WatchPaths
     39startupitem.create      no
     40startupitem.autostart   yes
    4141
    4242build {
     
    5252
    5353destroot {
    54         xinstall -m 755 -W ${worksrcpath} certsync update-ca-certificates ${destroot}${prefix}/bin
     54        # Install the binaries
     55        xinstall -m 755 -W ${worksrcpath} certsync ${destroot}${prefix}/libexec
     56        xinstall -m 755 -W ${worksrcpath} update-ca-certificates ${destroot}${prefix}/bin
     57
     58        # Install our custom plist
     59        set launchd_dir "${prefix}/etc/${startupitem.location}/${startupitem.uniquename}"
     60        xinstall -m 755 -d ${destroot}/${launchd_dir}
     61        xinstall -m 644 -W ${worksrcpath} certsync.plist  ${destroot}/${launchd_dir}/${startupitem.plist}
     62
     63        if {[getuid] == 0 && ${startupitem.install} != "no"} {
     64                file mkdir "${destroot}/Library/${startupitem.location}"
     65                ln -sf "${launchd_dir}/${startupitem.plist}" "${destroot}/Library/${startupitem.location}"
     66        }
    5567
    5668        # Provide backwards compatibility with curl-ca-bundle
  • trunk/dports/security/certsync/files/update-ca-certificates

    r105983 r115007  
    11#!/bin/sh
    22mkdir -p "@PREFIX@/etc/openssl"
    3 exec "@PREFIX@/bin/certsync" -o "@PREFIX@/etc/openssl/cert.pem"
     3exec "@PREFIX@/libexec/certsync" -o "@PREFIX@/etc/openssl/cert.pem"
Note: See TracChangeset for help on using the changeset viewer.