Files

82 lines
3.4 KiB
Tcl

# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
PortSystem 1.0
PortGroup golang 1.0
go.setup github.com/syncthing/syncthing 2.1.2 v
go.offline_build no
revision 0
homepage https://syncthing.net
description Open Source Continuous File Synchronization
long_description Syncthing replaces proprietary sync and cloud services \
with something open, trustworthy and decentralized.\
Your data is your data alone and you deserve to choose \
where it is stored, if it is shared with some third party \
and how it's transmitted over the Internet.
checksums rmd160 1713c828b16c7eab2a73d6e8e0e99f8c261a9d6c \
sha256 cddcd03945de492f5c995f6fcda910fc49c1174a74899a26704aae63aa558c4a \
size 5451112
categories net
installs_libs no
license MPL-2
maintainers {gmail.com:herby.gillot @herbygillot} \
openmaintainer
build.cmd ${go.bin} run build.go
build.target install syncthing
build.pre_args -version v${version} -no-upgrade
build.post_args ${build.target}
test.run yes
test.cmd ${build.cmd}
test.target test
set syncthing_label net.syncthing.syncthing
set syncthing_plist ${syncthing_label}.plist
destroot {
xinstall -W ${worksrcpath}/bin syncthing ${destroot}${prefix}/bin
foreach mancat {1 5 7} {
xinstall -m 0444 {*}[glob ${worksrcpath}/man/*.${mancat}] \
${destroot}${prefix}/share/man/man${mancat}
}
xinstall -d ${destroot}${prefix}/share/doc/${name}
xinstall -W ${worksrcpath} AUTHORS LICENSE ${destroot}${prefix}/share/doc/${name}
xinstall {*}[glob ${worksrcpath}/*.md] ${destroot}${prefix}/share/doc/${name}
# launchd plist
xinstall -d ${destroot}${prefix}/share/examples/${name}
xinstall -m 0644 -W ${worksrcpath}/etc/macos-launchd syncthing.plist ${destroot}${prefix}/share/examples/${name}
move ${destroot}${prefix}/share/examples/${name}/syncthing.plist \
${destroot}${prefix}/share/examples/${name}/${syncthing_plist}
reinplace "s|/Users/USERNAME/bin/|${prefix}/bin/|g" ${destroot}${prefix}/share/examples/${name}/${syncthing_plist}
system -W ${destroot}${prefix}/share/examples/${name} \
"/usr/bin/plutil -insert UserName -string USERNAME ${syncthing_plist}"
system -W ${destroot}${prefix}/share/examples/${name} \
"/usr/bin/plutil -insert GroupName -string staff ${syncthing_plist}"
}
notes-append \
"Syncthing provides an example launchd plist. To use it:" \
"1. Copy ${prefix}/share/examples/${name}/${syncthing_plist} to ~/Library/LaunchAgents" \
"2. Edit syncthing.plist by replacing USERNAME with your actual username" \
"3. Log out and in again, or run:" \
"launchctl load ~/Library/LaunchAgents/${syncthing_plist}"
if {${os.major} >= 14} {
notes-append \
"" \
"The modern launchctl syntax to load/start/stop the daemon is:" \
"launchctl bootstrap \"gui/\$(id -u)\" ~/Library/LaunchAgents/${syncthing_plist}" \
"launchctl kickstart -k \"gui/\$(id -u)/${syncthing_label}\"" \
"launchctl bootout \"gui/\$(id -u)/${syncthing_label}\""
}
github.livecheck.regex {([0-9.-]+)}