pkgsrc-WIP-changes archive

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

Provide additional taskd features (taskd user, smf manifest)



Module Name:	pkgsrc-wip
Committed By:	Thomas Merkel <tm%core.io@localhost>
Pushed By:	drscream
Date:		Mon Aug 21 17:19:02 2017 +0200
Changeset:	91c01eb2a4ae26ceb6efcc47eba29e870621339d

Modified Files:
	taskserver/Makefile
	taskserver/distinfo
	taskserver/patches/patch-src_TLSServer.cpp
Added Files:
	taskserver/MESSAGE
	taskserver/files/smf/manifest.xml

Log Message:
Provide additional taskd features (taskd user, smf manifest)

- Create taskd user with home (TASKDDATA) folder
- Provide SMF manifest to start taskd service
- Add MESSAGE with initialization information

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=91c01eb2a4ae26ceb6efcc47eba29e870621339d

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

diffstat:
 taskserver/MESSAGE                         | 14 ++++++++++++
 taskserver/Makefile                        | 21 +++++++++++++++++
 taskserver/distinfo                        |  2 +-
 taskserver/files/smf/manifest.xml          | 36 ++++++++++++++++++++++++++++++
 taskserver/patches/patch-src_TLSServer.cpp |  2 ++
 5 files changed, 74 insertions(+), 1 deletion(-)

diffs:
diff --git a/taskserver/MESSAGE b/taskserver/MESSAGE
new file mode 100644
index 0000000000..5c73938fa7
--- /dev/null
+++ b/taskserver/MESSAGE
@@ -0,0 +1,14 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.0 2017/08/21 16:04:13 drscream Exp $
+
+Be sure you initialize the ${PKGNAME} server in the TASKDDATA directory:
+
+  export TASKDDATA=${TASKD_DATA}
+  taskd init
+
+Follow additional steps to configure the SSL certificates and keys on the
+official website:
+
+https://taskwarrior.org/docs/taskserver/configure.html
+
+===========================================================================
diff --git a/taskserver/Makefile b/taskserver/Makefile
index 343dd9cb73..696787e60f 100644
--- a/taskserver/Makefile
+++ b/taskserver/Makefile
@@ -1,6 +1,7 @@
 # $NetBSD$
 
 DISTNAME=	taskd-1.1.0
+PKGREVISION=	1
 CATEGORIES=	net
 MASTER_SITES=	http://taskwarrior.org/download/
 
@@ -17,8 +18,28 @@ CMAKE_ARGS+=	-DTASKD_MAN5DIR=${PREFIX}/${PKGMANDIR}/man5
 
 LDFLAGS.SunOS+=	-lsocket -lnsl
 
+.include "../../mk/bsd.prefs.mk"
+SMF_NAME=	taskd
+TASKD_USER?=	taskd
+TASKD_GROUP?=	taskd
+TASKD_DATA?=	${VARBASE}/taskd
+PKG_GROUPS=	${TASKD_GROUP}
+PKG_USERS=	${TASKD_USER}:${TASKD_GROUP}
+PKG_GROUPS_VARS=	TASKD_USER
+PKG_USERS_VARS=	TASKD_GROUP
+PKG_HOME.${TASKD_USER}=	${TASKD_DATA}
+
+FILES_SUBST+=	TASKD_USER=${TASKD_USER} TASKD_GROUP=${TASKD_GROUP} \
+		TASKD_DATA=${TASKD_DATA}
+MESSAGE_SUBST+=	TASKD_DATA=${TASKD_DATA}
+
+BUILD_DEFS+=	TASKD_USER TASKD_GROUP TASKD_DATA VARBASE
+
 REPLACE_SH=	src/taskdctl
 
+MAKE_DIRS=+	${TASKD_DATA}
+OWN_DIRS_PERMS+=	${TASKD_DATA} ${TASKD_USER} ${TASKD_GROUP} 0750
+
 .include "../../devel/libuuid/buildlink3.mk"
 .include "../../security/gnutls/buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/taskserver/distinfo b/taskserver/distinfo
index a946cc60e3..3662c35b6e 100644
--- a/taskserver/distinfo
+++ b/taskserver/distinfo
@@ -4,4 +4,4 @@ SHA1 (taskd-1.1.0.tar.gz) = ded339deeee65277e4712f71a9159502f8b20b52
 RMD160 (taskd-1.1.0.tar.gz) = f5256fda0de4dc46a4f09167666e81bed3452f69
 SHA512 (taskd-1.1.0.tar.gz) = df2349c354258fd1b014b1a9c78f68dc10c9e5a48357e282e8a760cf4e4aaf4d36486796ad094ee2b050e7506195b778e3316c90ef543a2f8242de313daa13aa
 Size (taskd-1.1.0.tar.gz) = 120115 bytes
-SHA1 (patch-src_TLSServer.cpp) = ed5eef524031aa67ad78e1326d4a64b1b80e1a6d
+SHA1 (patch-src_TLSServer.cpp) = 6e47c0ef59dc6c265539152b7abce75b5e518d45
diff --git a/taskserver/files/smf/manifest.xml b/taskserver/files/smf/manifest.xml
new file mode 100644
index 0000000000..b2cecb240e
--- /dev/null
+++ b/taskserver/files/smf/manifest.xml
@@ -0,0 +1,36 @@
+<?xml version='1.0'?>
+<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
+<service_bundle type='manifest' name='export'>
+  <service name='@SMF_PREFIX@/@SMF_NAME@' type='service' version='0'>
+    <dependency name='net-physical' grouping='require_all' restart_on='none' type='service'>
+      <service_fmri value='svc:/network/physical'/>
+    </dependency>
+    <dependency name='filesystem' grouping='require_all' restart_on='none' type='service'>
+      <service_fmri value='svc:/system/filesystem/local'/>
+    </dependency>
+    <exec_method name='start' type='method' exec='@PREFIX@/bin/taskd server --data %{config/taskdata}' timeout_seconds='0'/>
+    <exec_method name='stop' type='method' exec=':kill' timeout_seconds='10'/>
+    <exec_method name='refresh' type='method' exec=':kill -HUP' timeout_seconds='60'/>
+    <property_group name='startd' type='framework'>
+      <propval name='duration' type='astring' value='child'/>
+      <propval name='ignore_error' type='astring' value='core,signal'/>
+    </property_group>
+    <instance name='default' enabled='false'>
+      <method_context working_directory='@TASKD_DATA@'>
+        <method_credential user="@TASKD_USER@" group="@TASKD_GROUP@" />
+        <method_environment>
+          <envvar name='PATH' value='@PREFIX@/bin:/opt/local/sbin:/usr/bin:/usr/sbin:/bin'/>
+        </method_environment>
+      </method_context>
+      <property_group name='config' type='application'>
+        <propval name='taskdata' type='astring' value='@TASKD_DATA@'/>
+      </property_group>
+    </instance>
+    <stability value='Evolving'/>
+    <template>
+      <common_name>
+        <loctext xml:lang='C'>The Taskserver is a server to access task data</loctext>
+      </common_name>
+    </template>
+  </service>
+</service_bundle>
diff --git a/taskserver/patches/patch-src_TLSServer.cpp b/taskserver/patches/patch-src_TLSServer.cpp
index b272dcfecd..cf8aeccae2 100644
--- a/taskserver/patches/patch-src_TLSServer.cpp
+++ b/taskserver/patches/patch-src_TLSServer.cpp
@@ -1,5 +1,7 @@
 $NetBSD$
 
+errno.h is also required on NetBSD
+
 --- src/TLSServer.cpp.orig	2015-05-10 21:35:22.000000000 +0000
 +++ src/TLSServer.cpp
 @@ -38,7 +38,7 @@


Home | Main Index | Thread Index | Old Index