Subject: [alpine-aports] [PATCH] testing/synergy: new aport

From: Steeve Chailloux <[email-masked]>
Date: Sun, 8 May 2016 15:32:22 +0100

http://symless.com
Share one mouse and keyboard between multiple computers on your desk.
---
 testing/synergy/APKBUILD                  | 126 ++++++++++++++++++++++++++++++
 testing/synergy/cmake_options.patch       |  11 +++
 testing/synergy/gui_missing_include.patch |  11 +++
 testing/synergy/missing_include.patch     |  10 +++
 testing/synergy/synergy.confd             |   1 +
 testing/synergy/synergy.initd             |  12 +++
 testing/synergy/wrapper                   |   4 +
 7 files changed, 175 insertions(+)
 create mode 100644 testing/synergy/APKBUILD
 create mode 100644 testing/synergy/cmake_options.patch
 create mode 100644 testing/synergy/gui_missing_include.patch
 create mode 100644 testing/synergy/missing_include.patch
 create mode 100644 testing/synergy/synergy.confd
 create mode 100644 testing/synergy/synergy.initd
 create mode 100644 testing/synergy/wrapper

diff --git a/testing/synergy/APKBUILD b/testing/synergy/APKBUILD
new file mode 100644
index 0000000..80ad805
--- /dev/null
+++ b/testing/synergy/APKBUILD
@@ -0,0 +1,126 @@
+# Contributor: Steeve Chailloux <[email-masked]>
+# Maintainer: Steeve Chailloux <[email-masked]>
+pkgname=synergy
+pkgver=1.7.6
+pkgrel=0
+pkgdesc="Share one mouse and keyboard between multiple computers on your desk."
+url="http://symless.com"
+arch="all"
+license="GPL2"
+depends=""
+depends_dev=""
+makedepends="$depends_dev cmake python make gcc libx11-dev libxtst-dev qt qt-dev libcurl curl-dev openssl-dev bash avahi-dev"
+install=""
+subpackages="$pkgname-doc"
+source="http://synergy-project.org/files/packages/${pkgname}-v${pkgver}-stable-bcb9da8-Source.tar.gz
+	missing_include.patch
+	gui_missing_include.patch
+	cmake_options.patch
+	wrapper
+	synergy.initd
+	synergy.confd"
+
+builddir="$srcdir"/${pkgname}-${pkgver}-stable
+prepare() {
+	cd "$_builddir"
+	for i in $source; do
+		case $i in
+		*.patch) patch -p1 -i "$srcdir"/$i || return 1;;
+		esac
+	done
+}
+
+build() {
+	cd "$builddir"
+	./hm.sh conf -g1 || return 1
+	./hm.sh build || return 1
+}
+
+package() {
+	cd "$builddir"
+
+	# install binary
+	install -D -m755 "$builddir"/bin/synergy \
+		"$pkgdir"/usr/lib/synergy/synergy || return 1
+	install -D -m755 "$builddir"/bin/synergyc \
+		"$pkgdir"/usr/lib/synergy/synergyc || return 1
+	install -D -m755 "$builddir"/bin/synergyd \
+		"$pkgdir"/usr/lib/synergy/synergyd || return 1
+	install -D -m755 "$builddir"/bin/synergys \
+		"$pkgdir"/usr/lib/synergy/synergys || return 1
+	install -D -m755 "$builddir"/bin/syntool \
+		"$pkgdir"/usr/lib/synergy/syntool || return 1
+	install -D -m755 "$builddir"/bin/usynergy \
+		"$pkgdir"/usr/lib/synergy/usynergy || return 1
+
+	# unfuck wrapper
+	install -D -m755 "$srcdir"/wrapper \
+		"$pkgdir"/usr/lib/synergy/wrapper || return 1
+	install -d "$pkgdir"/usr/bin || return 1
+	ln -sf /usr/lib/synergy/wrapper \
+		"$pkgdir"/usr/bin/synergy || return 1
+	ln -sf /usr/lib/synergy/wrapper \
+		"$pkgdir"/usr/bin/synergyc || return 1
+	ln -sf /usr/lib/synergy/wrapper \
+		"$pkgdir"/usr/bin/synergyd || return 1
+	ln -sf /usr/lib/synergy/wrapper \
+		"$pkgdir"/usr/bin/synergys || return 1
+	ln -sf /usr/lib/synergy/wrapper \
+		"$pkgdir"/usr/bin/syntool || return 1
+	ln -sf /usr/lib/synergy/wrapper \
+		"$pkgdir"/usr/bin/usynergy || return 1
+
+	# plugin
+	install -D -m755 "$builddir"/bin/plugins/libns.so \
+		"$pkgdir"/usr/lib/${pkgname}/libns.so || return 1
+
+	# install config
+	install -d "$pkgdir"/etc/${pkgname} || return 1
+	install -D -m644 "$builddir"/doc/${pkgname}.conf.example \
+		"$pkgdir"/etc/${pkgname}/${pkgname}.conf.example || return 1
+	install -D -m644 "$builddir"/doc/${pkgname}.conf.example-advanced \
+		"$pkgdir"/etc/${pkgname}/${pkgname}.conf.example-advanced || return 1
+	install -D -m644 "$builddir"/doc/${pkgname}.conf.example-basic \
+		"$pkgdir"/etc/${pkgname}/${pkgname}.conf.example-basic || return 1
+
+	# install desktop/icon stuff
+	install -D -m644 "$builddir"/res/synergy.ico \
+		"$pkgdir"/usr/share/icons/synergy.ico || return 1
+	install -D -m644 "$builddir"/res/synergy.desktop \
+		"$pkgdir"/usr/share/applications/synergy.desktop || return 1
+
+	# init scripts and config
+	install -D -m755 "$srcdir"/synergy.initd \
+		"$pkgdir"/etc/init.d/synergy || return 1
+	install -D -m644 "$srcdir"/synergy.confd \
+		"$pkgdir"/etc/conf.d/synergy || return 1
+
+	# install documentation
+	mkdir -p "$pkgdir"/usr
+	install -D -m644 "$builddir"/doc/${pkgname}c.man \
+		"$pkgdir"/usr/share/man/man1/${pkgname}c.1 || return 1
+	install -D -m644 "$builddir"/doc/${pkgname}s.man \
+		"$pkgdir"/usr/share/man/man1/${pkgname}s.1 || return 1
+}
+
+md5sums="a324798a47445de739a7ed4baf12638f  synergy-v1.7.6-stable-bcb9da8-Source.tar.gz
+4aa283fd6bbbccf2e2af194d431f6ac0  missing_include.patch
+63aebd5b31bafbaf872cefb1a047f96d  gui_missing_include.patch
+381ae277e84ab3a6020d977efc9827da  cmake_options.patch
+547f2d1f8d047dee0250ede013deef57  wrapper
+a0ce81c8f21205d4020fa7ec78325ea3  synergy.initd
+640dcb0f1d7aa93eef44e34305677242  synergy.confd"
+sha256sums="a453b880606edbdaec82576bcb74189a7ae564feeee126b125063802a778411d  synergy-v1.7.6-stable-bcb9da8-Source.tar.gz
+213d2059c18244e9fdc0517cce3425c88fc04e7214c80182c6ae872e47e24984  missing_include.patch
+bf05fb58756c88ca5d3c83ce5cc6643d55f42f6c09ac47399c82e74acd70f622  gui_missing_include.patch
+df2a853eedaeeb333fd8c6ead085ea86cc15a93c1ed6dde869aa5c2f87e307a5  cmake_options.patch
+cc0bfa75b0ee514eb6a349d5aebdc26e100ce6c88e6bf4270a237c223a2cd200  wrapper
+66d00130f8affcb963eea64b4dae3a22ce534c3b690cf6ad87a425faacdcc3fe  synergy.initd
+d54a8710e38377f010bddea9b160800e11766850b6ed5198802e8d64a4013007  synergy.confd"
+sha512sums="025305fc1aca425b27c1d4f16dd0c6ee7798c048e234c8a27272b81b03c0c1cb35fab6639707c1b55d58e7676fe2abf058b6f93e994ae5b256034c32c6fe806a  synergy-v1.7.6-stable-bcb9da8-Source.tar.gz
+3740cf3728d2b7e8527db8de7e59446ed9bb95fafb6b1b54fb1a57298463aced8ceae900af860681d65fe1c37c5fa05a16eda380d791635bf71f4e976d63019e  missing_include.patch
+234083793ac6c6760fe2928ed02e2e9a1a10b3f3c2b318e9809f33cc67b9760f748b71e661c015627d0f26cfbd37ab3325f95789b34bcd5a5fcee547e5011b3d  gui_missing_include.patch
+031b4648c8dfa3b6887b4b2585e13f79a34b55435e899a98ba9621c14e3a0295d661c6dbb4ead3cd0e390fbc0c12be23d2efb07ee37545069e57f4ffc7075031  cmake_options.patch
+a2e126ad3ac53fb855a331134982f86ef81ffc75b73e73b242e6f854fe7e2daec160fac2161acdc7020cd7f57ae0a8826ac7a249ad10b03db614ada0062b3e93  wrapper
+183f21eab875e72a930c59c34798f89e75ecaa71fccf405731aa93e1ad9beaf3362c1d956c7fb728eeb0c954acc811d9ce67c3650e63ff10652f5b304a3c8f9e  synergy.initd
+8adc1598add245e03fa94f2b1292bcb32e427db3c90077a391a6926679fb4779ebedc740678254e2f227c9c4a279477223cea16c52d902acc04b3393f22d11dd  synergy.confd"
diff --git a/testing/synergy/cmake_options.patch b/testing/synergy/cmake_options.patch
new file mode 100644
index 0000000..22be5ca
--- /dev/null
+++ b/testing/synergy/cmake_options.patch
@@ -0,0 +1,11 @@
+--- a/synergy-1.7.6-stable/CMakeLists.txt
++++ b/synergy-1.7.6-stable/CMakeLists.txt
+@@ -77,7 +77,7 @@
+ 
+ 	# warnings as errors:
+ 	# we have a problem with people checking in code with warnings.
+-	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wno-unused-local-typedef")
++	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+ 
+ 	if (NOT APPLE)
+ 		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
diff --git a/testing/synergy/gui_missing_include.patch b/testing/synergy/gui_missing_include.patch
new file mode 100644
index 0000000..fae5a78
--- /dev/null
+++ b/testing/synergy/gui_missing_include.patch
@@ -0,0 +1,11 @@
+--- a/synergy-1.7.6-stable/src/gui/src/ZeroconfService.h
++++ b/synergy-1.7.6-stable/src/gui/src/ZeroconfService.h
+@@ -17,6 +17,8 @@
+ 
+ #pragma once
+ 
++#include <stdint.h>
++
+ #include "ZeroconfServer.h"
+ #include "ZeroconfRecord.h"
+ 
diff --git a/testing/synergy/missing_include.patch b/testing/synergy/missing_include.patch
new file mode 100644
index 0000000..a33e4c1
--- /dev/null
+++ b/testing/synergy/missing_include.patch
@@ -0,0 +1,10 @@
+--- a/synergy-1.7.6-stable/src/gui/src/CommandProcess.h
++++ b/synergy-1.7.6-stable/src/gui/src/CommandProcess.h
+@@ -18,6 +18,7 @@
+ #ifndef COMMANDTHREAD_H
+ #define COMMANDTHREAD_H
+ 
++#include <QObject>
+ #include <QStringList>
+ 
+ class CommandProcess : public QObject
diff --git a/testing/synergy/synergy.confd b/testing/synergy/synergy.confd
new file mode 100644
index 0000000..112eafc
--- /dev/null
+++ b/testing/synergy/synergy.confd
@@ -0,0 +1 @@
+SYNERGY_OPTS="--no-daemon --config /etc/synergy/synergy.conf"
diff --git a/testing/synergy/synergy.initd b/testing/synergy/synergy.initd
new file mode 100644
index 0000000..76a6d7e
--- /dev/null
+++ b/testing/synergy/synergy.initd
@@ -0,0 +1,12 @@
+#!/sbin/openrc-run
+
+name="synergy"
+command="/usr/bin/synergy"
+command_args="$SYNERGY_OPTS"
+pidfile="/var/run/synergy.pid"
+start_stop_daemon_args="-g wheel -k 027"
+
+depend() {
+	need net
+}
+
diff --git a/testing/synergy/wrapper b/testing/synergy/wrapper
new file mode 100644
index 0000000..7ea0b68
--- /dev/null
+++ b/testing/synergy/wrapper
@@ -0,0 +1,4 @@
+#!/bin/sh
+mkdir -p ~/.synergy/plugins
+ln -sf /usr/lib/synergy/libns.so ~/.synergy/plugins/libns.so
+exec "/usr/lib/synergy/$(basename $0)" "$@"
-- 
2.8.0

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---