pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
- adding syncthing-discosrv - chroot stuff may be NetBSD-only ... needs further testing and development
Module Name: pkgsrc-wip
Committed By: Izaac <izaac%setec.org@localhost>
Pushed By: izaac
Date: Thu Jun 2 12:49:51 2016 -0400
Changeset: 35342242a2df6c876aac9c55879f0638095f8f2e
Added Files:
syncthing-discosrv/DESCR
syncthing-discosrv/Makefile
syncthing-discosrv/PLIST
syncthing-discosrv/distinfo
syncthing-discosrv/files/stdisco.sh
syncthing-discosrv/patches/patch-aa
Log Message:
- adding syncthing-discosrv
- chroot stuff may be NetBSD-only ... needs further testing and development
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=35342242a2df6c876aac9c55879f0638095f8f2e
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
syncthing-discosrv/DESCR | 1 +
syncthing-discosrv/Makefile | 49 +++++++++++++++++++++++++++++++++
syncthing-discosrv/PLIST | 2 ++
syncthing-discosrv/distinfo | 7 +++++
syncthing-discosrv/files/stdisco.sh | 55 +++++++++++++++++++++++++++++++++++++
syncthing-discosrv/patches/patch-aa | 18 ++++++++++++
6 files changed, 132 insertions(+)
diffs:
diff --git a/syncthing-discosrv/DESCR b/syncthing-discosrv/DESCR
new file mode 100644
index 0000000..9be2d90
--- /dev/null
+++ b/syncthing-discosrv/DESCR
@@ -0,0 +1 @@
+This is the discovery server for the syncthing project.
diff --git a/syncthing-discosrv/Makefile b/syncthing-discosrv/Makefile
new file mode 100644
index 0000000..3c94be5
--- /dev/null
+++ b/syncthing-discosrv/Makefile
@@ -0,0 +1,49 @@
+# $NetBSD$
+
+PKGNAME= syncthing-discosrv-0.13.0
+PKGREVISION= 1
+CATEGORIES= local
+DISTNAME= syncthing-discosrv-0.13.0
+MASTER_SITES= ${MASTER_SITE_GITHUB:=syncthing/}
+GITHUB_PROJECT= discosrv
+GITHUB_TAG= v${PKGVERSION_NOREV}
+
+MAINTAINER= izaac%setec.org@localhost
+HOMEPAGE= ${MASTER_SITE_GITHUB:=syncthing/discosrv/}
+COMMENT= Syncthing discovery server
+LICENSE= mit
+
+WRKSRC= ${WRKDIR}/discosrv-0.13.0
+BUILD_DEPENDS+= go-[0-9]*:../../lang/go
+NO_CONFIGURE= yes
+USE_LANGUAGES= c # and go
+INSTALLATION_DIRS= bin
+
+BUILD_DEFS+= VARBASE
+STDISCO_USER?= stdisco
+STDISCO_GROUP?= stdisco
+PKG_USERS_VARS= STDISCO_USER
+PKG_GROUPS_VARS= STDISCO_GROUP
+PKG_USERS= ${STDISCO_USER}:${STDISCO_GROUP}
+PKG_GROUPS= ${STDISCO_GROUP}
+PKG_GECOS.${STDISCO_USER}= syncthing-discosrv
+PKG_HOME.${STDISCO_USER}= ${VARBASE}/chroot/stdisco
+OWN_DIRS_PERMS= ${PKG_HOME.${STDISCO_USER}} ${STDISCO_USER} ${STDISCO_GROUP} 0700
+
+USE_TOOLS+= pax
+FILES_SUBST+= INSTALL=${INSTALL}
+FILES_SUBST+= PAX=${PAX}
+FILES_SUBST+= PKG_HOME=${PKG_HOME.${STDISCO_USER}}
+FILES_SUBST+= STDISCO_GROUP=${STDISCO_GROUP}
+FILES_SUBST+= STDISCO_USER=${STDISCO_USER}
+RCD_SCRIPTS= stdisco
+
+MAKE_ENV+= GOPATH=${WRKSRC}
+
+do-build:
+ cd ${WRKSRC} && ${MV} vendor src && ${SETENV} ${MAKE_ENV} ${PREFIX}/bin/go build -i -v -ldflags -w
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/discosrv-0.13.0 ${DESTDIR}${PREFIX}/bin/syncthing-discosrv
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/syncthing-discosrv/PLIST b/syncthing-discosrv/PLIST
new file mode 100644
index 0000000..8c247c6
--- /dev/null
+++ b/syncthing-discosrv/PLIST
@@ -0,0 +1,2 @@
+@comment $NetBSD$
+bin/syncthing-discosrv
diff --git a/syncthing-discosrv/distinfo b/syncthing-discosrv/distinfo
new file mode 100644
index 0000000..8f0e355
--- /dev/null
+++ b/syncthing-discosrv/distinfo
@@ -0,0 +1,7 @@
+$NetBSD$
+
+SHA1 (syncthing-discosrv-0.13.0.tar.gz) = a26327ec1c86152ab53c5bef8deeb5792c4889fd
+RMD160 (syncthing-discosrv-0.13.0.tar.gz) = f59234a73c65d378dbe3dca1324b0bdf957ee3b1
+SHA512 (syncthing-discosrv-0.13.0.tar.gz) = cb8c1d5978b08c3e8c381b2be9baa95b9fbca39c46b28d3aceb744877803edcfb14897fb82bcb67ab883cfd012c67c269ba37d7a5b976e7773d7a2c9c7058868
+Size (syncthing-discosrv-0.13.0.tar.gz) = 2401348 bytes
+SHA1 (patch-aa) = 1259e1d0e06e6dd853167aa7c5811a836f98efc1
diff --git a/syncthing-discosrv/files/stdisco.sh b/syncthing-discosrv/files/stdisco.sh
new file mode 100644
index 0000000..be008bf
--- /dev/null
+++ b/syncthing-discosrv/files/stdisco.sh
@@ -0,0 +1,55 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD$
+#
+# PROVIDE: stdisco
+# REQUIRE: DAEMON
+
+if [ -f /etc/rc.subr ]
+then
+ . /etc/rc.subr
+fi
+
+name="stdisco"
+rcvar="$name"
+command="@PREFIX@/bin/syncthing-discosrv"
+command_args="2>&1 > @PKG_HOME@/var/log/syncthing-discosrv.log &"
+stdisco_user=@STDISCO_USER@
+stdisco_group=@STDISCO_GROUP@
+stdisco_chroot="@PKG_HOME@"
+required_files="@PKG_HOME@/cert.pem @PKG_HOME@/key.pem"
+chrootbuild_cmd="chrootbuild"
+extra_commands="chrootbuild"
+
+chrootbuild()
+{
+ if [ -s @PKG_HOME@/cert.pem -o -s @PKG_HOME@/key.pem ]; then
+ @ECHO@ "Keyfiles still exist in @PKG_HOME@! (Re)move to continue!"
+# exit 1
+ fi
+ @ECHO@ "Purging @PKG_HOME@ ..."
+ @RM@ -r @PKG_HOME@
+
+ @ECHO@ "Populating @PKG_HOME@ ..."
+ [ -f /etc/openssl/certs/ca-certificates.crt ] && \
+ STROPTFILE="${STROPTFILE} /etc/openssl/certs/ca-certificates.crt"
+ [ -f /etc/ssl/cert.pem ] && \
+ STROPTFILE="${STROPTFILE} /etc/ssl/cert.pem"
+ [ -f /system/etc/security/cacerts ] && \
+ STROPTFILE="${STROPTFILE} /system/etc/security/cacerts"
+ [ -f /usr/local/share/certs/ca-root-nss.crt ] && \
+ STROPTFILE="${STROPTFILE} /usr/local/share/certs/ca-root-nss.crt"
+ @INSTALL@ -d -o @STDISCO_USER@ -g @STDISCO_GROUP@ -m 0775 @PKG_HOME@
+ @INSTALL@ -d -o @STDISCO_USER@ -g @STDISCO_GROUP@ -m 0775 @PKG_HOME@/var/log
+ @PAX@ -rw -v /dev/urandom /etc/hosts /etc/nsswitch.conf /etc/resolv.conf \
+ /lib/libc.so* /lib/libgcc_s.so* /libexec/ld.elf_so /usr/lib/libc.so* \
+ /usr/lib/libgcc_s.so* /usr/lib/libpthread.so* /usr/libexec/ld.elf_so \
+ ${STROPTFILE} @PREFIX@/bin/syncthing-discosrv @PKG_HOME@
+}
+
+if [ ! -x @PKG_HOME@@PREFIX@/bin/syncthing-discosrv ]; then
+ eval chrootbuild
+fi
+
+load_rc_config $name
+run_rc_command $1
diff --git a/syncthing-discosrv/patches/patch-aa b/syncthing-discosrv/patches/patch-aa
new file mode 100644
index 0000000..f31dcb8
--- /dev/null
+++ b/syncthing-discosrv/patches/patch-aa
@@ -0,0 +1,18 @@
+$NetBSD$
+--- querysrv.go 2016-04-30 04:53:42.000000000 -0400
++++ querysrv.go 2016-06-01 21:36:11.000000000 -0400
+@@ -329,10 +329,12 @@
+ }
+
+ ip := net.ParseIP(host)
+- if len(ip) == 0 || ip.IsUnspecified() {
+- uri.Host = net.JoinHostPort(remote.String(), port)
++ if host == "" || ip.IsUnspecified() {
++ host = remote.String()
+ }
+
++ uri.Host = net.JoinHostPort(host, port)
++
+ if err := s.updateAddress(ctx, tx, deviceID, uri.String()); err != nil {
+ internalErr = err
+ return
Home |
Main Index |
Thread Index |
Old Index