pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

- add syncthing-relaysrv - 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:55:54 2016 -0400
Changeset:	f6b7e5dfcdc44a3dce77d8b946feeaba638bc0e6

Modified Files:
	Makefile
Added Files:
	syncthing-relaysrv/DESCR
	syncthing-relaysrv/Makefile
	syncthing-relaysrv/PLIST
	syncthing-relaysrv/distinfo
	syncthing-relaysrv/files/strelay.sh

Log Message:
- add syncthing-relaysrv
- 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=f6b7e5dfcdc44a3dce77d8b946feeaba638bc0e6

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 Makefile                            |  2 ++
 syncthing-relaysrv/DESCR            |  1 +
 syncthing-relaysrv/Makefile         | 48 +++++++++++++++++++++++++++++++++
 syncthing-relaysrv/PLIST            |  2 ++
 syncthing-relaysrv/distinfo         |  6 +++++
 syncthing-relaysrv/files/strelay.sh | 54 +++++++++++++++++++++++++++++++++++++
 6 files changed, 113 insertions(+)

diffs:
diff --git a/Makefile b/Makefile
index 0d340c5..2228fba 100644
--- a/Makefile
+++ b/Makefile
@@ -3907,7 +3907,9 @@ SUBDIR+=	sync-server-dependencies
 SUBDIR+=	synce-dynamite
 SUBDIR+=	synce-kde
 SUBDIR+=	synce-orange
+SUBDIR+=	syncthing-discosrv
 SUBDIR+=	syncthing-inotify
+SUBDIR+=	syncthing-relaysrv
 SUBDIR+=	synfig
 SUBDIR+=	synfigstudio
 SUBDIR+=	sysklogd
diff --git a/syncthing-relaysrv/DESCR b/syncthing-relaysrv/DESCR
new file mode 100644
index 0000000..5281a37
--- /dev/null
+++ b/syncthing-relaysrv/DESCR
@@ -0,0 +1 @@
+This is the relay server for the syncthing project.
diff --git a/syncthing-relaysrv/Makefile b/syncthing-relaysrv/Makefile
new file mode 100644
index 0000000..0dc3a2d
--- /dev/null
+++ b/syncthing-relaysrv/Makefile
@@ -0,0 +1,48 @@
+# $NetBSD$
+
+PKGNAME=	syncthing-relaysrv-0.12.18
+CATEGORIES=	local
+DISTNAME=	syncthing-relaysrv-0.12.18
+MASTER_SITES=	${MASTER_SITE_GITHUB:=syncthing/}
+GITHUB_PROJECT=	relaysrv
+GITHUB_TAG=	v${PKGVERSION_NOREV}
+
+MAINTAINER=	izaac%setec.org@localhost
+HOMEPAGE=	${MASTER_SITE_GITHUB:=syncthing/relaysrv/}
+COMMENT=	syncthing relay server
+LICENSE=	mit
+
+WRKSRC=			${WRKDIR}/relaysrv-0.12.18
+BUILD_DEPENDS+=		go-[0-9]*:../../lang/go
+USE_LANGUAGES=		# go
+NO_CONFIGURE=		yes
+INSTALLATION_DIRS=	bin
+
+BUILD_DEFS+=			VARBASE
+STRELAY_USER?=			strelay
+STRELAY_GROUP?=			strelay
+PKG_USERS_VARS=			STRELAY_USER
+PKG_GROUPS_VARS=		STRELAY_GROUP
+PKG_USERS=			${STRELAY_USER}:${STRELAY_GROUP}
+PKG_GROUPS=			${STRELAY_GROUP}
+PKG_GECOS.${STRELAY_USER}=	syncthing-relaysrv
+PKG_HOME.${STRELAY_USER}=	${VARBASE}/chroot/strelay
+OWN_DIRS_PERMS=			${PKG_HOME.${STRELAY_USER}} ${STRELAY_USER} ${STRELAY_GROUP} 0700
+
+USE_TOOLS+=			pax
+FILES_SUBST+=			INSTALL=${INSTALL}
+FILES_SUBST+=			PAX=${PAX}
+FILES_SUBST+=			PKG_HOME=${PKG_HOME.${STRELAY_USER}}
+FILES_SUBST+=			STRELAY_GROUP=${STRELAY_GROUP}
+FILES_SUBST+=			STRELAY_USER=${STRELAY_USER}
+RCD_SCRIPTS=			strelay
+
+MAKE_ENV+=	GOPATH=${WRKSRC}/Godeps/_workspace
+
+do-build:
+	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${PREFIX}/bin/go build -i -v -ldflags -w
+
+do-install:
+	${INSTALL_PROGRAM} ${WRKSRC}/relaysrv-0.12.18 ${DESTDIR}${PREFIX}/bin/syncthing-relaysrv
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/syncthing-relaysrv/PLIST b/syncthing-relaysrv/PLIST
new file mode 100644
index 0000000..a048c44
--- /dev/null
+++ b/syncthing-relaysrv/PLIST
@@ -0,0 +1,2 @@
+@comment $NetBSD$
+bin/syncthing-relaysrv
diff --git a/syncthing-relaysrv/distinfo b/syncthing-relaysrv/distinfo
new file mode 100644
index 0000000..daf4963
--- /dev/null
+++ b/syncthing-relaysrv/distinfo
@@ -0,0 +1,6 @@
+$NetBSD$
+
+SHA1 (syncthing-relaysrv-0.12.18.tar.gz) = 3315cfea060385097bac830e63c732e1377acc04
+RMD160 (syncthing-relaysrv-0.12.18.tar.gz) = 6d50606fe20f2a9f5cb02b9de7067aece9a36a3e
+SHA512 (syncthing-relaysrv-0.12.18.tar.gz) = 58f0494bc61e2d62e54535483b8ff7053d433b17a94c85a006a72a9d82d4cd454f97daa9c2648cf63ff4dd55f2fc6c3a85eb5295309cacec3ea2b8fa58d166ff
+Size (syncthing-relaysrv-0.12.18.tar.gz) = 174413 bytes
diff --git a/syncthing-relaysrv/files/strelay.sh b/syncthing-relaysrv/files/strelay.sh
new file mode 100644
index 0000000..823e0a9
--- /dev/null
+++ b/syncthing-relaysrv/files/strelay.sh
@@ -0,0 +1,54 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD$
+#
+# PROVIDE: strelay
+# REQUIRE: DAEMON
+
+if [ -f /etc/rc.subr ]
+then
+   . /etc/rc.subr
+fi
+
+name="strelay"
+rcvar="$name"
+command="@PREFIX@/bin/syncthing-relaysrv"
+command_args="2> @PKG_HOME@/var/log/syncthing-relaysrv.log &"
+strelay_user=@STRELAY_USER@
+strelay_group=@STRELAY_GROUP@
+strelay_chroot="@PKG_HOME@"
+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 @STRELAY_USER@ -g @STRELAY_GROUP@ -m 0775 @PKG_HOME@
+   @INSTALL@ -d -o @STRELAY_USER@ -g @STRELAY_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-relaysrv @PKG_HOME@
+}
+
+if [ ! -x @PKG_HOME@@PREFIX@/bin/syncthing-relaysrv ]; then
+   eval chrootbuild
+fi
+
+load_rc_config $name
+run_rc_command $1


Home | Main Index | Thread Index | Old Index