summaryrefslogtreecommitdiff
path: root/app-misc/g15daemon
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /app-misc/g15daemon
reinit the tree, so we can have metadata
Diffstat (limited to 'app-misc/g15daemon')
-rw-r--r--app-misc/g15daemon/Manifest16
-rw-r--r--app-misc/g15daemon/files/20g15daemon15
-rw-r--r--app-misc/g15daemon/files/99-g15daemon.rules1
-rw-r--r--app-misc/g15daemon/files/g15daemon-1.2.7.confd9
-rw-r--r--app-misc/g15daemon/files/g15daemon-1.9.5.3-forgotten-open-mode.patch11
-rw-r--r--app-misc/g15daemon/files/g15daemon-1.9.5.3-g510-keys.patch340
-rw-r--r--app-misc/g15daemon/files/g15daemon-1.9.5.3-overflow-fix.patch11
-rw-r--r--app-misc/g15daemon/files/g15daemon-1.9.5.3.initd45
-rw-r--r--app-misc/g15daemon/files/g15daemon-hotplug15
-rw-r--r--app-misc/g15daemon/files/g15daemon.conf27
-rw-r--r--app-misc/g15daemon/g15daemon-1.9.5.3-r13.ebuild160
-rw-r--r--app-misc/g15daemon/g15daemon-1.9.5.3-r21.ebuild162
-rw-r--r--app-misc/g15daemon/g15daemon-9999.ebuild174
-rw-r--r--app-misc/g15daemon/metadata.xml14
14 files changed, 1000 insertions, 0 deletions
diff --git a/app-misc/g15daemon/Manifest b/app-misc/g15daemon/Manifest
new file mode 100644
index 000000000000..9d6c7cd14f52
--- /dev/null
+++ b/app-misc/g15daemon/Manifest
@@ -0,0 +1,16 @@
+AUX 20g15daemon 173 SHA256 27be8c2dfa6b4b09203b783b64615947434087d405363141b62dd12bdb17bad6 SHA512 daee2c432860dd3147209724417cbf04ec1ed0c8e882900900722420cbe67d88f32efc81422e04221e54796b66d69e050135b72a96baf40137da58023202d3ca WHIRLPOOL 5ad5f7fd2b4da69d64ba90d5334d8cbe5d8e8fdcc66ff4fa862cb8636a95337a9104a97dfabbd84a4b78710def245a2789a5d18d819ac6428c5413893e429646
+AUX 99-g15daemon.rules 90 SHA256 dab916b3cb839bb55f4b6f599f83de2c4dbdd87005394f737dc59ab4df7d4e84 SHA512 f3ff958bb4e0344b600328fcab86674ce14d852287ec2e083751d0eb855a0591aa17fdae767de4517bcd8a1fa542ab9b559ee79fe284207d2872b8901f2c77f7 WHIRLPOOL 68345a96a004a0a6e1a4aa93f5f91581e210621b9e4b3c2e42de12c57dbd112de6a698ea08b2bab00392d953031fe1765c2b959e42780f5c963e4593708d52e5
+AUX g15daemon-1.2.7.confd 329 SHA256 a7977e03f0faaed85f659b077fddc3a589c2e2d4386df1e9afc89133c25bc613 SHA512 ea94ab43c78566c570a510cccb6860ade6c26a281956b6e37ea746eb06608a5a00ed55773752c7aad44bf86cdfec5788e9f1137667fd5030d54b20b97811b43a WHIRLPOOL e3a3a79d94fdbc6a325ad31f61d0e8350d74f3fe8e1f233a1cd475beae52d838d17503c716e4fba975abc8d8bd6c9b588ef6b5a7f3ef5cede7a45150e2133dc0
+AUX g15daemon-1.9.5.3-forgotten-open-mode.patch 639 SHA256 0d97a53d63052d2da325b39b6186330432fbf1a16be3e09eef4f250410f79e38 SHA512 dc603a576eaf6bd8512827de712c3ba6a116905d5f6c692dccda1b499a3bab8480a785155d3b0189b41e2dff099fc5896cb958bcc83357ff54333a82f4b6ca93 WHIRLPOOL b2e8194e4bc32426b498a4852e744c57c5c928c24f331c3629718ca4153438d190ce71f7dcfd418216a7b1527f6703141a2aee375b3a11c0122dd406861a5b5e
+AUX g15daemon-1.9.5.3-g510-keys.patch 14095 SHA256 dacdcd566502a0b6c49e30c2fe535c660f2f845d8a410a4ac1c8c25fd7bb87f3 SHA512 ac43f573175a8842ac571fe4d30fe2b2bb901d46da75fb9a7fe591b6a144df6308c5aecb65319667e01a316414cbccf44dbb492412e0d28bd9fb1cd09ce9bb75 WHIRLPOOL 4b9b7c7f9eea7c35f874bff245901e9024b8a313a1feb38094b65109ffb5b57e1b3f7365ae63eb477760981cd939c7e644dc4287fe6ee873d0e636cdacd7614c
+AUX g15daemon-1.9.5.3-overflow-fix.patch 619 SHA256 0c9c888c4f2e26cf51981714e917e963b371ed2b8d84c6e00b4c13df371afeda SHA512 e5f4494c0890ce985391d5a07d809e7168f765549c17b55457d93436ce816074aa97f991b894067badacf5e0bcc7f482d6b7e1623b0157a04d728f2ca4b1bf27 WHIRLPOOL 56a2674397e61c3c065e3ebe47b1da3617b3a91024ff213b5bbc4eb34ba85b98dc370842b331c7cb4d119355e98421b1f4b19cd700dbf120ca817f8646c99733
+AUX g15daemon-1.9.5.3.initd 955 SHA256 3fad6371f206be83cbaa9b904f494bbe7828d1da6ef5ec3ea202bc5959f2b402 SHA512 a2e21fe65f730e0a3f0062da07a9896884329e3d3b2cb89ce41b96f33851868c0c27281fc87a13eb7bb7ba934175df19dddfd78b695339b4a89512c42951fd1a WHIRLPOOL 29e7c22c305387ef9ee2b7f378410c46c4bd9fa74fb90fe70f36b1c68204a7f00da94342211bc1143d0960b05f5be0c36758e90b23cb418a123be461182b6875
+AUX g15daemon-hotplug 224 SHA256 ff7fc4857cab25ab57c9ceca9e4c1f9ca365fc140da21e8cfa9788ee9544ba38 SHA512 6384aa8267a665b0b26f45f7339856647374ad5b1860f299b2e19afb0209b8637919f00b3638affbe4fb86adaf115eb93e814b70c17d52f1c878d840e1e464e8 WHIRLPOOL 80c477f97bebb55815746d6361da04139661da111e63497ee7d2c057074a76a67fff479d7beb47bc7acb77667348eb436372afd5bef16d1efb06114ce32d6d5b
+AUX g15daemon.conf 516 SHA256 94a79cea3ac0fa566cd6515e32eec22bb6a26e353c83608767dc65d1a2404037 SHA512 e575fd8a91c87f226481ae406a1b66de6d8eb66f061b0ce7f2b89ce63f7bda88470eac50adcc9de97ef866970ee835af8a1bb0402a2e4b4d214251d0b8ebe25c WHIRLPOOL 2b94c324074a8936343bc22bd9d58e2b58a4b9220000b6544d901ff718b2e055bd363e0202fd72fb212520cb8be7e325af3be3ac7423922c0f481339c8813d92
+DIST g15daemon-1.9.5.3.tar.gz 414603 SHA256 40ff07a4186c1fd01ea23d1753a2cb3bef25f92cc496ddddc6abde6a574cd60a SHA512 7a1770d08d1d4155866bba3b676d33bf943363f4519af41a13ab6ec73cc5d6c536b173977b3e3583b594b149b7f01ffbc51123a4678c2a249a51ff0b42c8b69a WHIRLPOOL 216e8d7ef3a79064e161e7b579271946215cbd49566672dccf9c69e0d478b1bf19b8b19334eb180c129bef03e900bd7fb532ba524a5cfd384f6abd9162ae3eb1
+EBUILD g15daemon-1.9.5.3-r13.ebuild 3834 SHA256 4f3ef9be8cc4f1767cb8fc691a03148bb0f98c08528babf9642b7b2bbe27c066 SHA512 9a97a513aa527990654adc6c962c984971d49252d33602ea57f0a4a9752490994f47e1cc2be83751bfde6fe13aee4f80fbd23ea67e73ef1aac45698863347b77 WHIRLPOOL 369bd3270c707e625ca6ab8de7c7a94e6ecda68e7729b1c5ed3103ecca32a6f6be3efbf746df97d17a936ce81b909596d8c346825b475f2421e9fc237d2e5d9f
+EBUILD g15daemon-1.9.5.3-r21.ebuild 3851 SHA256 fdccea040cf709c095f7e7b1d8152eafa6b594bf5cf6c539845dd1fc720414d2 SHA512 8223ca5034c6306cdeb9b592342035f1409f0287f85ada6360af2054d01e43f328816da72c435d2bb282816ac50931fe7e906ec95df329f8d164188fc7d1c9a5 WHIRLPOOL 98d463dfceba0336706cf2c2ac31380324b30cf37abde5b755f1008eb1bf41507fe83c0cfc8e445be284541765d5edec5fafb9f8e8be491eec40c5ff63c9d43d
+EBUILD g15daemon-9999.ebuild 4191 SHA256 3a8682f1fc64033d12135c0566b0b5f0033fa10e0e08d1279be71cac6d52dc2c SHA512 7b7518b1276a447be1c0a68141efb8f750e7402fb7dd0950bdf69d7dccd5a9022d10fb449a7b3de5047cd62350299de15c0e50bda585a1da2224f3d1860cc460 WHIRLPOOL d3dada86312e81db912b303736734fedb79529df32a70b878a1d59e1d9c22f5997ae526c46e1a4a5a746b813fb587b21dac81a04a19251ccf4ba1fb6f915ecd0
+MISC ChangeLog 3613 SHA256 8902167abbf85d80ae891a713d782eb174f35a34a564c1878c53edf4826a7038 SHA512 32c81f23bb0c54ad67c8de58944a16c4eed11e861ea8b5c9b4cd55c76448a543a88da844ec5c3f1d3f2d781a1e791d84e9fbc92bc68ab9e95ffceb8b3db7d758 WHIRLPOOL e215625b289ad45527e32b43bd7106274acb5e1e08697a31491cb4293daf1da794efd36816812e0195704d4da8846fbf35363f2b5c0d68b25bde3aa75b13eea1
+MISC ChangeLog-2015 10995 SHA256 df2fa949350acf8bfb19fe50baab37a99b2fc426a0e3ca2fba4777459a6aa6a0 SHA512 31858d810c653c16052f03d6ad7371ae1e1be287c7286f75b7e3bd35fcfe4e0ff19d77b9e837b823a204b6f14987c13cbd7701f6b7bed86b1359d5ed12c3f891 WHIRLPOOL 4553193d88a3d41729d31dddfc9a9b819d5cf7b179f2c90f0e69c40d8b9b75792150899edfb1cc41f33ff11624bdb388b786fe79d391a40023315b9dc1867584
+MISC metadata.xml 409 SHA256 514a297b9e32650b16ad8c11ba2093833cc78a4b44b303e6fe5bc6a14841b5a6 SHA512 f37883d9542d61a9abcc2596e88d80aa41aac439b1366239c7fa234c00776ce837cf19c8b2d153333c22e050380d7add26b7531423ef02e655157d39a72b121e WHIRLPOOL a8898028adeabb634eee02191065d3bd04260be8489f82a031dc407cfa48d6e060ce77b2f8620e310e2b990fd4b2ffc44bd3d42bf5aeb1e6d26e65b4723786bf
diff --git a/app-misc/g15daemon/files/20g15daemon b/app-misc/g15daemon/files/20g15daemon
new file mode 100644
index 000000000000..ee1422537f25
--- /dev/null
+++ b/app-misc/g15daemon/files/20g15daemon
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+. "${PM_FUNCTIONS}"
+
+case "$1" in
+ hibernate|suspend)
+ /etc/init.d/g15daemon stop
+ ;;
+ thaw|resume)
+ /etc/init.d/g15daemon start
+ ;;
+ *)
+ exit $NA
+ ;;
+esac
diff --git a/app-misc/g15daemon/files/99-g15daemon.rules b/app-misc/g15daemon/files/99-g15daemon.rules
new file mode 100644
index 000000000000..d491d683684f
--- /dev/null
+++ b/app-misc/g15daemon/files/99-g15daemon.rules
@@ -0,0 +1 @@
+SUBSYSTEM=="usb", ATTR{product}=="G15 Gaming Keyboard", RUN+="/usr/bin/g15daemon-hotplug"
diff --git a/app-misc/g15daemon/files/g15daemon-1.2.7.confd b/app-misc/g15daemon/files/g15daemon-1.2.7.confd
new file mode 100644
index 000000000000..08ea97f49763
--- /dev/null
+++ b/app-misc/g15daemon/files/g15daemon-1.2.7.confd
@@ -0,0 +1,9 @@
+# /etc/conf.d/g15daemon: Configuration for the g15daemon
+
+# Key to switch the client-screens. Default is the MR key,
+# Set to "yes" to use L1 key instead (black round key below the LCD, above the multimedia keys).
+CLIENT_SWITCH_L1="no"
+
+# Set to "yes" to switch off the lcd backlight when stopping g15daemon.
+BACKLIGHT_OFF="no"
+
diff --git a/app-misc/g15daemon/files/g15daemon-1.9.5.3-forgotten-open-mode.patch b/app-misc/g15daemon/files/g15daemon-1.9.5.3-forgotten-open-mode.patch
new file mode 100644
index 000000000000..b475f1d58d69
--- /dev/null
+++ b/app-misc/g15daemon/files/g15daemon-1.9.5.3-forgotten-open-mode.patch
@@ -0,0 +1,11 @@
+--- ./g15daemon-1.9.5.3/g15daemon/utility_funcs.c 2008-01-26 06:02:07.000000000 +0100
++++ ./g15daemon-1.9.5.3/g15daemon/utility_funcs.c 2009-02-01 17:00:55.203009264 +0100
+@@ -356,7 +356,7 @@
+ config_items_t * item=NULL;
+ char line[1024];
+
+- config_fd = open(filename,O_CREAT|O_RDWR|O_TRUNC);
++ config_fd = open(filename,O_CREAT|O_RDWR|O_TRUNC,0664);
+ if(config_fd){
+ snprintf(line,1024,"# G15Daemon Configuration File\n# any items entered before a [section] header\n# will be in the Global config space\n# comments you wish to keep should start with a semicolon';'\n");
+ write(config_fd,line,strlen(line));
diff --git a/app-misc/g15daemon/files/g15daemon-1.9.5.3-g510-keys.patch b/app-misc/g15daemon/files/g15daemon-1.9.5.3-g510-keys.patch
new file mode 100644
index 000000000000..e00836766795
--- /dev/null
+++ b/app-misc/g15daemon/files/g15daemon-1.9.5.3-g510-keys.patch
@@ -0,0 +1,340 @@
+From https://sourceforge.net/tracker/?func=detail&aid=3152167&group_id=167869&atid=844658
+
+diff -aNru trunk/g15daemon-wip/plugins/g15_plugin_uinput.c mod/g15daemon-wip/plugins/g15_plugin_uinput.c
+--- trunk/g15daemon-wip/plugins/g15_plugin_uinput.c 2011-06-26 06:50:50.000000000 +0000
++++ mod/g15daemon-wip/plugins/g15_plugin_uinput.c 2011-06-26 06:51:42.000000000 +0000
+@@ -164,146 +164,195 @@
+
+ static void g15_process_keys(g15daemon_t *masterlist, unsigned int currentkeys, unsigned int lastkeys)
+ {
+- /* 'G' keys */
+- if((currentkeys & G15_KEY_G1) && !(lastkeys & G15_KEY_G1))
+- keydown(GKEY_OFFSET);
+- else if(!(currentkeys & G15_KEY_G1) && (lastkeys & G15_KEY_G1))
+- keyup(GKEY_OFFSET);
+-
+- if((currentkeys & G15_KEY_G2) && !(lastkeys & G15_KEY_G2))
+- keydown(GKEY_OFFSET+1);
+- else if(!(currentkeys & G15_KEY_G2) && (lastkeys & G15_KEY_G2))
+- keyup(GKEY_OFFSET+1);
+-
+- if((currentkeys & G15_KEY_G3) && !(lastkeys & G15_KEY_G3))
+- keydown(GKEY_OFFSET+2);
+- else if(!(currentkeys & G15_KEY_G3) && (lastkeys & G15_KEY_G3))
+- keyup(GKEY_OFFSET+2);
+-
+- if((currentkeys & G15_KEY_G4) && !(lastkeys & G15_KEY_G4))
+- keydown(GKEY_OFFSET+3);
+- else if(!(currentkeys & G15_KEY_G4) && (lastkeys & G15_KEY_G4))
+- keyup(GKEY_OFFSET+3);
+-
+- if((currentkeys & G15_KEY_G5) && !(lastkeys & G15_KEY_G5))
+- keydown(GKEY_OFFSET+4);
+- else if(!(currentkeys & G15_KEY_G5) && (lastkeys & G15_KEY_G5))
+- keyup(GKEY_OFFSET+4);
+-
+- if((currentkeys & G15_KEY_G6) && !(lastkeys & G15_KEY_G6))
+- keydown(GKEY_OFFSET+5);
+- else if(!(currentkeys & G15_KEY_G6) && (lastkeys & G15_KEY_G6))
+- keyup(GKEY_OFFSET+5);
+-
+- if((currentkeys & G15_KEY_G7) && !(lastkeys & G15_KEY_G7))
+- keydown(GKEY_OFFSET+6);
+- else if(!(currentkeys & G15_KEY_G7) && (lastkeys & G15_KEY_G7))
+- keyup(GKEY_OFFSET+6);
+-
+- if((currentkeys & G15_KEY_G8) && !(lastkeys & G15_KEY_G8))
+- keydown(GKEY_OFFSET+7);
+- else if(!(currentkeys & G15_KEY_G8) && (lastkeys & G15_KEY_G8))
+- keyup(GKEY_OFFSET+7);
+-
+- if((currentkeys & G15_KEY_G9) && !(lastkeys & G15_KEY_G9))
+- keydown(GKEY_OFFSET+8);
+- else if(!(currentkeys & G15_KEY_G9) && (lastkeys & G15_KEY_G9))
+- keyup(GKEY_OFFSET+8);
+-
+- if((currentkeys & G15_KEY_G10) && !(lastkeys & G15_KEY_G10))
+- keydown(GKEY_OFFSET+9);
+- else if(!(currentkeys & G15_KEY_G10) && (lastkeys & G15_KEY_G10))
+- keyup(GKEY_OFFSET+9);
+-
+- if((currentkeys & G15_KEY_G11) && !(lastkeys & G15_KEY_G11))
+- keydown(GKEY_OFFSET+10);
+- else if(!(currentkeys & G15_KEY_G11) && (lastkeys & G15_KEY_G11))
+- keyup(GKEY_OFFSET+10);
+-
+- if((currentkeys & G15_KEY_G12) && !(lastkeys & G15_KEY_G12))
+- keydown(GKEY_OFFSET+11);
+- else if(!(currentkeys & G15_KEY_G12) && (lastkeys & G15_KEY_G12))
+- keyup(GKEY_OFFSET+11);
+-
+- if((currentkeys & G15_KEY_G13) && !(lastkeys & G15_KEY_G13))
+- keydown(GKEY_OFFSET+12);
+- else if(!(currentkeys & G15_KEY_G13) && (lastkeys & G15_KEY_G13))
+- keyup(GKEY_OFFSET+12);
+-
+- if((currentkeys & G15_KEY_G14) && !(lastkeys & G15_KEY_G14))
+- keydown(GKEY_OFFSET+13);
+- else if(!(currentkeys & G15_KEY_G14) && (lastkeys & G15_KEY_G14))
+- keyup(GKEY_OFFSET+13);
+-
+- if((currentkeys & G15_KEY_G15) && !(lastkeys & G15_KEY_G15))
+- keydown(GKEY_OFFSET+14);
+- else if(!(currentkeys & G15_KEY_G15) && (lastkeys & G15_KEY_G15))
+- keyup(GKEY_OFFSET+14);
+-
+- if((currentkeys & G15_KEY_G16) && !(lastkeys & G15_KEY_G16))
+- keydown(GKEY_OFFSET+15);
+- else if(!(currentkeys & G15_KEY_G16) && (lastkeys & G15_KEY_G16))
+- keyup(GKEY_OFFSET+15);
+-
+- if((currentkeys & G15_KEY_G17) && !(lastkeys & G15_KEY_G17))
+- keydown(GKEY_OFFSET+16);
+- else if(!(currentkeys & G15_KEY_G17) && (lastkeys & G15_KEY_G17))
+- keyup(GKEY_OFFSET+16);
+-
+- if((currentkeys & G15_KEY_G18) && !(lastkeys & G15_KEY_G18))
+- keydown(GKEY_OFFSET+17);
+- else if(!(currentkeys & G15_KEY_G18) && (lastkeys & G15_KEY_G18))
+- keyup(GKEY_OFFSET+17);
+-
+- /* 'M' keys */
+-
+- if((currentkeys & G15_KEY_M1) && !(lastkeys & G15_KEY_M1))
+- keydown(MKEY_OFFSET);
+- else if(!(currentkeys & G15_KEY_M1) && (lastkeys & G15_KEY_M1))
+- keyup(MKEY_OFFSET);
+-
+- if((currentkeys & G15_KEY_M2) && !(lastkeys & G15_KEY_M2))
+- keydown(MKEY_OFFSET+1);
+- else if(!(currentkeys & G15_KEY_M2) && (lastkeys & G15_KEY_M2))
+- keyup(MKEY_OFFSET+1);
+-
+- if((currentkeys & G15_KEY_M3) && !(lastkeys & G15_KEY_M3))
+- keydown(MKEY_OFFSET+2);
+- else if(!(currentkeys & G15_KEY_M3) && (lastkeys & G15_KEY_M3))
+- keyup(MKEY_OFFSET+2);
+-
+- if((currentkeys & G15_KEY_MR) && !(lastkeys & G15_KEY_MR))
+- keydown(MKEY_OFFSET+3);
+- else if(!(currentkeys & G15_KEY_MR) && (lastkeys & G15_KEY_MR))
+- keyup(MKEY_OFFSET+3);
+-
+- if(map_Lkeys){
+- /* 'L' keys... */
+- if((currentkeys & G15_KEY_L1) && !(lastkeys & G15_KEY_L1))
+- keydown(LKEY_OFFSET);
+- else if(!(currentkeys & G15_KEY_L1) && (lastkeys & G15_KEY_L1))
+- keyup(LKEY_OFFSET);
+-
+- if((currentkeys & G15_KEY_L2) && !(lastkeys & G15_KEY_L2))
+- keydown(LKEY_OFFSET+1);
+- else if(!(currentkeys & G15_KEY_L2) && (lastkeys & G15_KEY_L2))
+- keyup(LKEY_OFFSET+1);
+-
+- if((currentkeys & G15_KEY_L3) && !(lastkeys & G15_KEY_L3))
+- keydown(LKEY_OFFSET+2);
+- else if(!(currentkeys & G15_KEY_L3) && (lastkeys & G15_KEY_L3))
+- keyup(LKEY_OFFSET+2);
+-
+- if((currentkeys & G15_KEY_L4) && !(lastkeys & G15_KEY_L4))
+- keydown(LKEY_OFFSET+3);
+- else if(!(currentkeys & G15_KEY_L4) && (lastkeys & G15_KEY_L4))
+- keyup(LKEY_OFFSET+3);
+-
+- if((currentkeys & G15_KEY_L5) && !(lastkeys & G15_KEY_L5))
+- keydown(LKEY_OFFSET+4);
+- else if(!(currentkeys & G15_KEY_L5) && (lastkeys & G15_KEY_L5))
+- keyup(LKEY_OFFSET+4);
++ if(!(currentkeys & G15_KEY_LIGHT))
++ {
++ /* 'G' keys */
++ if((currentkeys & G15_KEY_G1) && !(lastkeys & G15_KEY_G1))
++ keydown(GKEY_OFFSET);
++ else if(!(currentkeys & G15_KEY_G1) && (lastkeys & G15_KEY_G1))
++ keyup(GKEY_OFFSET);
++
++ if((currentkeys & G15_KEY_G2) && !(lastkeys & G15_KEY_G2))
++ keydown(GKEY_OFFSET+1);
++ else if(!(currentkeys & G15_KEY_G2) && (lastkeys & G15_KEY_G2))
++ keyup(GKEY_OFFSET+1);
++
++ if((currentkeys & G15_KEY_G3) && !(lastkeys & G15_KEY_G3))
++ keydown(GKEY_OFFSET+2);
++ else if(!(currentkeys & G15_KEY_G3) && (lastkeys & G15_KEY_G3))
++ keyup(GKEY_OFFSET+2);
++
++ if((currentkeys & G15_KEY_G4) && !(lastkeys & G15_KEY_G4))
++ keydown(GKEY_OFFSET+3);
++ else if(!(currentkeys & G15_KEY_G4) && (lastkeys & G15_KEY_G4))
++ keyup(GKEY_OFFSET+3);
++
++ if((currentkeys & G15_KEY_G5) && !(lastkeys & G15_KEY_G5))
++ keydown(GKEY_OFFSET+4);
++ else if(!(currentkeys & G15_KEY_G5) && (lastkeys & G15_KEY_G5))
++ keyup(GKEY_OFFSET+4);
++
++ if((currentkeys & G15_KEY_G6) && !(lastkeys & G15_KEY_G6))
++ keydown(GKEY_OFFSET+5);
++ else if(!(currentkeys & G15_KEY_G6) && (lastkeys & G15_KEY_G6))
++ keyup(GKEY_OFFSET+5);
++
++ if((currentkeys & G15_KEY_G7) && !(lastkeys & G15_KEY_G7))
++ keydown(GKEY_OFFSET+6);
++ else if(!(currentkeys & G15_KEY_G7) && (lastkeys & G15_KEY_G7))
++ keyup(GKEY_OFFSET+6);
++
++ if((currentkeys & G15_KEY_G8) && !(lastkeys & G15_KEY_G8))
++ keydown(GKEY_OFFSET+7);
++ else if(!(currentkeys & G15_KEY_G8) && (lastkeys & G15_KEY_G8))
++ keyup(GKEY_OFFSET+7);
++
++ if((currentkeys & G15_KEY_G9) && !(lastkeys & G15_KEY_G9))
++ keydown(GKEY_OFFSET+8);
++ else if(!(currentkeys & G15_KEY_G9) && (lastkeys & G15_KEY_G9))
++ keyup(GKEY_OFFSET+8);
++
++ if((currentkeys & G15_KEY_G10) && !(lastkeys & G15_KEY_G10))
++ keydown(GKEY_OFFSET+9);
++ else if(!(currentkeys & G15_KEY_G10) && (lastkeys & G15_KEY_G10))
++ keyup(GKEY_OFFSET+9);
++
++ if((currentkeys & G15_KEY_G11) && !(lastkeys & G15_KEY_G11))
++ keydown(GKEY_OFFSET+10);
++ else if(!(currentkeys & G15_KEY_G11) && (lastkeys & G15_KEY_G11))
++ keyup(GKEY_OFFSET+10);
++
++ if((currentkeys & G15_KEY_G12) && !(lastkeys & G15_KEY_G12))
++ keydown(GKEY_OFFSET+11);
++ else if(!(currentkeys & G15_KEY_G12) && (lastkeys & G15_KEY_G12))
++ keyup(GKEY_OFFSET+11);
++
++ if((currentkeys & G15_KEY_G13) && !(lastkeys & G15_KEY_G13))
++ keydown(GKEY_OFFSET+12);
++ else if(!(currentkeys & G15_KEY_G13) && (lastkeys & G15_KEY_G13))
++ keyup(GKEY_OFFSET+12);
++
++ if((currentkeys & G15_KEY_G14) && !(lastkeys & G15_KEY_G14))
++ keydown(GKEY_OFFSET+13);
++ else if(!(currentkeys & G15_KEY_G14) && (lastkeys & G15_KEY_G14))
++ keyup(GKEY_OFFSET+13);
++
++ if((currentkeys & G15_KEY_G15) && !(lastkeys & G15_KEY_G15))
++ keydown(GKEY_OFFSET+14);
++ else if(!(currentkeys & G15_KEY_G15) && (lastkeys & G15_KEY_G15))
++ keyup(GKEY_OFFSET+14);
++
++ if((currentkeys & G15_KEY_G16) && !(lastkeys & G15_KEY_G16))
++ keydown(GKEY_OFFSET+15);
++ else if(!(currentkeys & G15_KEY_G16) && (lastkeys & G15_KEY_G16))
++ keyup(GKEY_OFFSET+15);
++
++ if((currentkeys & G15_KEY_G17) && !(lastkeys & G15_KEY_G17))
++ keydown(GKEY_OFFSET+16);
++ else if(!(currentkeys & G15_KEY_G17) && (lastkeys & G15_KEY_G17))
++ keyup(GKEY_OFFSET+16);
++
++ if((currentkeys & G15_KEY_G18) && !(lastkeys & G15_KEY_G18))
++ keydown(GKEY_OFFSET+17);
++ else if(!(currentkeys & G15_KEY_G18) && (lastkeys & G15_KEY_G18))
++ keyup(GKEY_OFFSET+17);
++
++ /* 'M' keys */
++
++ if((currentkeys & G15_KEY_M1) && !(lastkeys & G15_KEY_M1))
++ keydown(MKEY_OFFSET);
++ else if(!(currentkeys & G15_KEY_M1) && (lastkeys & G15_KEY_M1))
++ keyup(MKEY_OFFSET);
++
++ if((currentkeys & G15_KEY_M2) && !(lastkeys & G15_KEY_M2))
++ keydown(MKEY_OFFSET+1);
++ else if(!(currentkeys & G15_KEY_M2) && (lastkeys & G15_KEY_M2))
++ keyup(MKEY_OFFSET+1);
++
++ if((currentkeys & G15_KEY_M3) && !(lastkeys & G15_KEY_M3))
++ keydown(MKEY_OFFSET+2);
++ else if(!(currentkeys & G15_KEY_M3) && (lastkeys & G15_KEY_M3))
++ keyup(MKEY_OFFSET+2);
++
++ if((currentkeys & G15_KEY_MR) && !(lastkeys & G15_KEY_MR))
++ keydown(MKEY_OFFSET+3);
++ else if(!(currentkeys & G15_KEY_MR) && (lastkeys & G15_KEY_MR))
++ keyup(MKEY_OFFSET+3);
++
++ if(map_Lkeys){
++ /* 'L' keys... */
++ if((currentkeys & G15_KEY_L1) && !(lastkeys & G15_KEY_L1))
++ keydown(LKEY_OFFSET);
++ else if(!(currentkeys & G15_KEY_L1) && (lastkeys & G15_KEY_L1))
++ keyup(LKEY_OFFSET);
++
++ if((currentkeys & G15_KEY_L2) && !(lastkeys & G15_KEY_L2))
++ keydown(LKEY_OFFSET+1);
++ else if(!(currentkeys & G15_KEY_L2) && (lastkeys & G15_KEY_L2))
++ keyup(LKEY_OFFSET+1);
++
++ if((currentkeys & G15_KEY_L3) && !(lastkeys & G15_KEY_L3))
++ keydown(LKEY_OFFSET+2);
++ else if(!(currentkeys & G15_KEY_L3) && (lastkeys & G15_KEY_L3))
++ keyup(LKEY_OFFSET+2);
++
++ if((currentkeys & G15_KEY_L4) && !(lastkeys & G15_KEY_L4))
++ keydown(LKEY_OFFSET+3);
++ else if(!(currentkeys & G15_KEY_L4) && (lastkeys & G15_KEY_L4))
++ keyup(LKEY_OFFSET+3);
++
++ if((currentkeys & G15_KEY_L5) && !(lastkeys & G15_KEY_L5))
++ keydown(LKEY_OFFSET+4);
++ else if(!(currentkeys & G15_KEY_L5) && (lastkeys & G15_KEY_L5))
++ keyup(LKEY_OFFSET+4);
++ }
+ }
++ else
++ {
++ // G15_KEY_LIGHT - Key modifier for Logitech G510 Media Keys implementation
++
++ // XF86AudioPlay
++ if((currentkeys & G15_KEY_G1) && !(lastkeys & G15_KEY_G1))
++ keydown(KEY_PLAYPAUSE);
++ else if(!(currentkeys & G15_KEY_G1) && (lastkeys & G15_KEY_G1))
++ keyup(KEY_PLAYPAUSE);
++
++ // XF86AudioStop
++ if((currentkeys & G15_KEY_G2) && !(lastkeys & G15_KEY_G2))
++ keydown(KEY_STOPCD);
++ else if(!(currentkeys & G15_KEY_G2) && (lastkeys & G15_KEY_G2))
++ keyup(KEY_STOPCD);
++
++ // XF86AudioPrev
++ if((currentkeys & G15_KEY_G3) && !(lastkeys & G15_KEY_G3))
++ keydown(KEY_PREVIOUSSONG);
++ else if(!(currentkeys & G15_KEY_G3) && (lastkeys & G15_KEY_G3))
++ keyup(KEY_PREVIOUSSONG);
++
++ // XF86AudioNext
++ if((currentkeys & G15_KEY_G4) && !(lastkeys & G15_KEY_G4))
++ keydown(KEY_NEXTSONG);
++ else if(!(currentkeys & G15_KEY_G4) && (lastkeys & G15_KEY_G4))
++ keyup(KEY_NEXTSONG);
++
++ // XF86AudioMute
++ if((currentkeys & G15_KEY_G5) && !(lastkeys & G15_KEY_G5))
++ keydown(KEY_MUTE);
++ else if(!(currentkeys & G15_KEY_G5) && (lastkeys & G15_KEY_G5))
++ keyup(KEY_MUTE);
++
++ // XF86AudioRaiseVolume
++ if((currentkeys & G15_KEY_G6) && !(lastkeys & G15_KEY_G6))
++ keydown(KEY_VOLUMEUP);
++ else if(!(currentkeys & G15_KEY_G6) && (lastkeys & G15_KEY_G6))
++ keyup(KEY_VOLUMEUP);
++
++ // XF86AudioLowerVolume
++ if((currentkeys & G15_KEY_G7) && !(lastkeys & G15_KEY_G7))
++ keydown(KEY_VOLUMEDOWN);
++ else if(!(currentkeys & G15_KEY_G7) && (lastkeys & G15_KEY_G7))
++ keyup(KEY_VOLUMEDOWN);
++ }
+ }
+
+
diff --git a/app-misc/g15daemon/files/g15daemon-1.9.5.3-overflow-fix.patch b/app-misc/g15daemon/files/g15daemon-1.9.5.3-overflow-fix.patch
new file mode 100644
index 000000000000..71cbf914d839
--- /dev/null
+++ b/app-misc/g15daemon/files/g15daemon-1.9.5.3-overflow-fix.patch
@@ -0,0 +1,11 @@
+--- ./g15daemon-1.9.5.3/libg15daemon_client/g15daemon_net.c 2008-01-25 05:45:05.000000000 +0100
++++ ./g15daemon-1.9.5.3/libg15daemon_client/g15daemon_net.c 2011-02-14 22:51:55.203009264 +0100
+@@ -217,7 +217,7 @@
+ if(poll(pfd,1,100)>0){
+ if(pfd[0].revents & POLLPRI && !(pfd[0].revents & POLLERR || pfd[0].revents & POLLHUP || pfd[0].revents & POLLNVAL)) {
+ memset(packet,0,sizeof(packet));
+- msgret = recv(sock, packet, 10 , MSG_OOB);
++ msgret = recv(sock, packet, sizeof(packet), MSG_OOB);
+ if (msgret < 1) {
+ return -1;
+ }
diff --git a/app-misc/g15daemon/files/g15daemon-1.9.5.3.initd b/app-misc/g15daemon/files/g15daemon-1.9.5.3.initd
new file mode 100644
index 000000000000..aa4d82c9d6b6
--- /dev/null
+++ b/app-misc/g15daemon/files/g15daemon-1.9.5.3.initd
@@ -0,0 +1,45 @@
+#!/sbin/openrc-run
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# Init script for g15daemon
+
+pidfile="/var/run/g15daemon.pid"
+command="/usr/sbin/g15daemon"
+start_stop_daemon_args="--wait 30"
+command_args=""
+
+depend() {
+ after hotplug
+ after usb
+ after modules
+}
+
+start_pre() {
+ # Does the input device already exist?
+ if [ -e "/proc/modules" ] ; then
+ if [ ! -e "/dev/input/uinput" ] && [ ! -e "/dev/uinput" ] ; then
+ # We can load modules, but uinput device does not exist
+ einfo "Loading uinput module"
+ /sbin/modprobe uinput > /dev/null 2> /dev/null \
+ || return 1
+ fi
+ fi
+
+ if [ "${CLIENT_SWITCH_L1}" = "yes" ] ; then
+ command_args="--switch"
+ fi
+}
+
+stop() {
+ ebegin "Stopping g15daemon"
+ local KILLOPT="-k"
+ if [ $BACKLIGHT_OFF = "yes" ]; then
+ KILLOPT="-K"
+ fi
+ while [ -f "${pidfile}" ] && kill -0 $(cat ${pidfile}) ; do
+ ${command} ${KILLOPT}
+ sleep 1
+ done
+ eend $?
+}
diff --git a/app-misc/g15daemon/files/g15daemon-hotplug b/app-misc/g15daemon/files/g15daemon-hotplug
new file mode 100644
index 000000000000..2ae8be0bde01
--- /dev/null
+++ b/app-misc/g15daemon/files/g15daemon-hotplug
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+export IN_HOTPLUG=1
+
+case "$ACTION" in
+ "add")
+ /etc/init.d/g15daemon --quiet restart
+ ;;
+ "remove")
+ /etc/init.d/g15daemon --quiet stop
+ ;;
+ *)
+ exit 0
+ ;;
+esac
diff --git a/app-misc/g15daemon/files/g15daemon.conf b/app-misc/g15daemon/files/g15daemon.conf
new file mode 100644
index 000000000000..2d2bfc3cabde
--- /dev/null
+++ b/app-misc/g15daemon/files/g15daemon.conf
@@ -0,0 +1,27 @@
+# G15Daemon Configuration File
+# any items entered before a [section] header
+# will be in the Global config space
+# comments you wish to keep should start with a semicolon';'
+
+[Global]
+Use MR as Cycle Key: Off
+
+[PLUGIN_LOAD_ORDER]
+0: g15plugin_uinput.so
+1: g15plugin_clock.so
+2: g15plugin_tcpserver.so
+TotalPlugins: 3
+
+[PLUGINS]
+Linux UINPUT Keyboard Output: Load
+Clock: Load
+LCDServer: Load
+
+[Keyboard OS Mapping (uinput)]
+device: /dev/input/uinput
+Lkeys.mapped: 0
+
+[Clock]
+24hrFormat: On
+ShowDate: Off
+Digital: On
diff --git a/app-misc/g15daemon/g15daemon-1.9.5.3-r13.ebuild b/app-misc/g15daemon/g15daemon-1.9.5.3-r13.ebuild
new file mode 100644
index 000000000000..d5f349cd4d0a
--- /dev/null
+++ b/app-misc/g15daemon/g15daemon-1.9.5.3-r13.ebuild
@@ -0,0 +1,160 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+GENTOO_DEPEND_ON_PERL="no"
+
+inherit eutils linux-info perl-module python-r1 base
+
+DESCRIPTION="Takes control of the G15 keyboard, through the linux kernel uinput device driver"
+HOMEPAGE="http://g15daemon.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc ppc64 x86"
+IUSE="perl python static-libs"
+
+DEPEND="virtual/libusb:0
+ >=dev-libs/libg15-1.2.4
+ >=dev-libs/libg15render-1.2
+ perl? (
+ dev-lang/perl
+ dev-perl/GDGraph
+ >=dev-perl/Inline-0.4
+ )
+ python? ( ${PYTHON_DEPS} )"
+RDEPEND="${DEPEND}"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+PATCHES=(
+ "${FILESDIR}/${P}-forgotten-open-mode.patch"
+ "${FILESDIR}/${P}-overflow-fix.patch"
+)
+uinput_check() {
+ ebegin "Checking for uinput support"
+ local rc=1
+ linux_config_exists && linux_chkconfig_present INPUT_UINPUT
+ rc=$?
+
+ if [[ $rc -ne 0 ]] ; then
+ eerror "To use g15daemon, you need to compile your kernel with uinput support."
+ eerror "Please enable uinput support in your kernel config, found at:"
+ eerror
+ eerror "Device Drivers -> Input Device ... -> Miscellaneous devices -> User level driver support."
+ eerror
+ eerror "Once enabled, you should have the /dev/input/uinput device."
+ eerror "g15daemon will not work without the uinput device."
+ fi
+}
+
+pkg_setup() {
+ linux-info_pkg_setup
+ uinput_check
+}
+
+src_unpack() {
+ unpack ${A}
+ if use perl; then
+ unpack "./${P}/lang-bindings/perl-G15Daemon-0.2.tar.gz"
+ fi
+ if use python; then
+ unpack "./${P}/lang-bindings/pyg15daemon-0.0.tar.bz2"
+ fi
+}
+
+src_prepare() {
+ if use perl; then
+ perl-module_src_prepare
+ sed -i \
+ -e '1i#!/usr/bin/perl' \
+ "${S}"/contrib/testbindings.pl
+ else
+ # perl-module_src_prepare always calls base_src_prepare
+ base_src_prepare
+ fi
+}
+
+src_configure() {
+ econf \
+ --docdir="${EPREFIX}/usr/share/doc/${PF}" \
+ $(use_enable static-libs static)
+
+ if use perl; then
+ cd "${WORKDIR}/G15Daemon-0.2"
+ perl-module_src_configure
+ fi
+}
+
+src_compile() {
+ default
+
+ if use perl; then
+ cd "${WORKDIR}/G15Daemon-0.2"
+ perl-module_src_compile
+ fi
+}
+
+src_install() {
+ default
+
+ find "${ED}" -name '*.la' -exec rm -f {} +
+
+ # remove odd docs installed my make
+ rm "${ED}/usr/share/doc/${PF}/"{LICENSE,README.usage}
+
+ insinto /usr/share/${PN}/contrib
+ doins contrib/xmodmaprc
+ doins contrib/xmodmap.sh
+ if use perl; then
+ doins contrib/testbindings.pl
+ fi
+
+ newconfd "${FILESDIR}/${PN}-1.2.7.confd" ${PN}
+ newinitd "${FILESDIR}/${PN}-1.9.5.3.initd" ${PN}
+ dobin "${FILESDIR}/g15daemon-hotplug"
+ insinto /lib/udev/rules.d
+ doins "${FILESDIR}/99-g15daemon.rules"
+
+ insinto /etc
+ doins "${FILESDIR}"/g15daemon.conf
+
+ # Gentoo bug #301340, debian bug #611649
+ exeinto /usr/lib/pm-utils/sleep.d
+ doexe "${FILESDIR}"/20g15daemon
+
+ if use perl; then
+ ebegin "Installing Perl Bindings (G15Daemon.pm)"
+ cd "${WORKDIR}/G15Daemon-0.2"
+ docinto perl
+ perl-module_src_install
+ fi
+
+ if use python; then
+ ebegin "Installing Python Bindings (g15daemon.py)"
+ cd "${WORKDIR}/pyg15daemon"
+
+ python_foreach_impl python_domodule g15daemon.py
+
+ docinto python
+ dodoc AUTHORS
+ fi
+}
+
+pkg_postinst() {
+ elog "To use g15daemon, you need to add g15daemon to the default runlevel."
+ elog "This can be done with:"
+ elog "# /sbin/rc-update add g15daemon default"
+ elog "You can edit some g15daemon options at /etc/conf.d/g15daemon"
+ elog ""
+ elog "To have all new keys working in X11, you'll need create a "
+ elog "specific xmodmap in your home directory or edit the existent one."
+ elog ""
+ elog "Create the xmodmap:"
+ elog "cp /usr/share/g15daemon/contrib/xmodmaprc ~/.Xmodmap"
+ elog ""
+ elog "Adding keycodes to an existing xmodmap:"
+ elog "cat /usr/share/g15daemon/contrib/xmodmaprc >> ~/.Xmodmap"
+}
diff --git a/app-misc/g15daemon/g15daemon-1.9.5.3-r21.ebuild b/app-misc/g15daemon/g15daemon-1.9.5.3-r21.ebuild
new file mode 100644
index 000000000000..c6635310b014
--- /dev/null
+++ b/app-misc/g15daemon/g15daemon-1.9.5.3-r21.ebuild
@@ -0,0 +1,162 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+GENTOO_DEPEND_ON_PERL="no"
+
+inherit eutils linux-info perl-module python-r1 base
+
+DESCRIPTION="Takes control of the G15 keyboard, through the linux kernel uinput device driver"
+HOMEPAGE="http://g15daemon.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS=""
+IUSE="perl python static-libs"
+
+DEPEND="virtual/libusb:0
+ >=dev-libs/libg15-9999
+ >=dev-libs/libg15render-1.2
+ perl? (
+ dev-lang/perl
+ dev-perl/GDGraph
+ >=dev-perl/Inline-0.4
+ )
+ python? ( ${PYTHON_DEPS} )"
+RDEPEND="${DEPEND}"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+PATCHES=(
+ "${FILESDIR}/${P}-forgotten-open-mode.patch"
+ "${FILESDIR}/${P}-overflow-fix.patch"
+ "${FILESDIR}/${P}-g510-keys.patch"
+)
+
+uinput_check() {
+ ebegin "Checking for uinput support"
+ local rc=1
+ linux_config_exists && linux_chkconfig_present INPUT_UINPUT
+ rc=$?
+
+ if [[ $rc -ne 0 ]] ; then
+ eerror "To use g15daemon, you need to compile your kernel with uinput support."
+ eerror "Please enable uinput support in your kernel config, found at:"
+ eerror
+ eerror "Device Drivers -> Input Device ... -> Miscellaneous devices -> User level driver support."
+ eerror
+ eerror "Once enabled, you should have the /dev/input/uinput device."
+ eerror "g15daemon will not work without the uinput device."
+ fi
+}
+
+pkg_setup() {
+ linux-info_pkg_setup
+ uinput_check
+}
+
+src_unpack() {
+ unpack ${A}
+ if use perl; then
+ unpack "./${P}/lang-bindings/perl-G15Daemon-0.2.tar.gz"
+ fi
+ if use python; then
+ unpack "./${P}/lang-bindings/pyg15daemon-0.0.tar.bz2"
+ fi
+}
+
+src_prepare() {
+ if use perl; then
+ perl-module_src_prepare
+ sed -i \
+ -e '1i#!/usr/bin/perl' \
+ "${S}"/contrib/testbindings.pl
+ else
+ # perl-module_src_prepare always calls base_src_prepare
+ base_src_prepare
+ fi
+}
+
+src_configure() {
+ econf \
+ --docdir="${EPREFIX}/usr/share/doc/${PF}" \
+ $(use_enable static-libs static)
+
+ if use perl; then
+ cd "${WORKDIR}/G15Daemon-0.2"
+ perl-module_src_configure
+ fi
+}
+
+src_compile() {
+ default
+
+ if use perl; then
+ cd "${WORKDIR}/G15Daemon-0.2"
+ perl-module_src_compile
+ fi
+}
+
+src_install() {
+ default
+
+ find "${ED}" -name '*.la' -exec rm -f {} +
+
+ # remove odd docs installed my make
+ rm "${ED}/usr/share/doc/${PF}/"{LICENSE,README.usage}
+
+ insinto /usr/share/${PN}/contrib
+ doins contrib/xmodmaprc
+ doins contrib/xmodmap.sh
+ if use perl; then
+ doins contrib/testbindings.pl
+ fi
+
+ newconfd "${FILESDIR}/${PN}-1.2.7.confd" ${PN}
+ newinitd "${FILESDIR}/${PN}-1.9.5.3.initd" ${PN}
+ dobin "${FILESDIR}/g15daemon-hotplug"
+ insinto /lib/udev/rules.d
+ doins "${FILESDIR}/99-g15daemon.rules"
+
+ insinto /etc
+ doins "${FILESDIR}"/g15daemon.conf
+
+ # Gentoo bug #301340, debian bug #611649
+ exeinto /usr/lib/pm-utils/sleep.d
+ doexe "${FILESDIR}"/20g15daemon
+
+ if use perl; then
+ ebegin "Installing Perl Bindings (G15Daemon.pm)"
+ cd "${WORKDIR}/G15Daemon-0.2"
+ docinto perl
+ perl-module_src_install
+ fi
+
+ if use python; then
+ ebegin "Installing Python Bindings (g15daemon.py)"
+ cd "${WORKDIR}/pyg15daemon"
+
+ python_foreach_impl python_domodule g15daemon.py
+
+ docinto python
+ dodoc AUTHORS
+ fi
+}
+
+pkg_postinst() {
+ elog "To use g15daemon, you need to add g15daemon to the default runlevel."
+ elog "This can be done with:"
+ elog "# /sbin/rc-update add g15daemon default"
+ elog "You can edit some g15daemon options at /etc/conf.d/g15daemon"
+ elog ""
+ elog "To have all new keys working in X11, you'll need create a "
+ elog "specific xmodmap in your home directory or edit the existent one."
+ elog ""
+ elog "Create the xmodmap:"
+ elog "cp /usr/share/g15daemon/contrib/xmodmaprc ~/.Xmodmap"
+ elog ""
+ elog "Adding keycodes to an existing xmodmap:"
+ elog "cat /usr/share/g15daemon/contrib/xmodmaprc >> ~/.Xmodmap"
+}
diff --git a/app-misc/g15daemon/g15daemon-9999.ebuild b/app-misc/g15daemon/g15daemon-9999.ebuild
new file mode 100644
index 000000000000..7d4ce15ed275
--- /dev/null
+++ b/app-misc/g15daemon/g15daemon-9999.ebuild
@@ -0,0 +1,174 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+GENTOO_DEPEND_ON_PERL="no"
+ESVN_PROJECT=${PN}/trunk
+ESVN_REPO_URI="https://svn.code.sf.net/p/${PN}/code/trunk/${PN}-wip"
+
+inherit eutils linux-info perl-module python-r1 base subversion autotools
+
+DESCRIPTION="Takes control of the G15 keyboard, through the linux kernel uinput device driver"
+HOMEPAGE="http://g15daemon.sourceforge.net/"
+[[ ${PV} = *9999* ]] || SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS=""
+IUSE="perl python static-libs"
+
+DEPEND="virtual/libusb:0
+ >=dev-libs/libg15-9999
+ >=dev-libs/libg15render-9999
+ perl? (
+ dev-lang/perl
+ dev-perl/GDGraph
+ >=dev-perl/Inline-0.4
+ )
+ python? ( ${PYTHON_DEPS} )"
+RDEPEND="${DEPEND}"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-1.9.5.3-g510-keys.patch"
+)
+# "${FILESDIR}/${PN}-1.9.5.3-forgotten-open-mode.patch"
+# "${FILESDIR}/${PN}-1.9.5.3-overflow-fix.patch"
+
+uinput_check() {
+ ebegin "Checking for uinput support"
+ local rc=1
+ linux_config_exists && linux_chkconfig_present INPUT_UINPUT
+ rc=$?
+
+ if [[ $rc -ne 0 ]] ; then
+ eerror "To use g15daemon, you need to compile your kernel with uinput support."
+ eerror "Please enable uinput support in your kernel config, found at:"
+ eerror
+ eerror "Device Drivers -> Input Device ... -> Miscellaneous devices -> User level driver support."
+ eerror
+ eerror "Once enabled, you should have the /dev/input/uinput device."
+ eerror "g15daemon will not work without the uinput device."
+ fi
+}
+
+pkg_setup() {
+ linux-info_pkg_setup
+ uinput_check
+}
+
+src_unpack() {
+ if [[ ${PV} = *9999* ]]; then
+ subversion_src_unpack
+ else
+ unpack ${A}
+ fi
+ if use perl; then
+ unpack "./${P}/lang-bindings/perl-G15Daemon-0.2.tar.gz"
+ fi
+ if use python; then
+ unpack "./${P}/lang-bindings/pyg15daemon-0.0.tar.bz2"
+ fi
+}
+
+src_prepare() {
+ if [[ ${PV} = *9999* ]]; then
+ subversion_wc_info
+ fi
+ if use perl; then
+ perl-module_src_prepare
+ sed -i \
+ -e '1i#!/usr/bin/perl' \
+ "${S}"/contrib/testbindings.pl
+ else
+ # perl-module_src_prepare always calls base_src_prepare
+ base_src_prepare
+ fi
+ if [[ ${PV} = *9999* ]]; then
+ eautoreconf
+ fi
+}
+
+src_configure() {
+ econf \
+ --docdir="${EPREFIX}/usr/share/doc/${PF}" \
+ $(use_enable static-libs static)
+
+ if use perl; then
+ cd "${WORKDIR}/G15Daemon-0.2"
+ perl-module_src_configure
+ fi
+}
+
+src_compile() {
+ default
+
+ if use perl; then
+ cd "${WORKDIR}/G15Daemon-0.2"
+ perl-module_src_compile
+ fi
+}
+
+src_install() {
+ default
+
+ find "${ED}" -name '*.la' -exec rm -f {} +
+
+ # remove odd docs installed my make
+ rm "${ED}/usr/share/doc/${PF}/"{LICENSE,README.usage}
+
+ insinto /usr/share/${PN}/contrib
+ doins contrib/xmodmaprc
+ doins contrib/xmodmap.sh
+ if use perl; then
+ doins contrib/testbindings.pl
+ fi
+
+ newconfd "${FILESDIR}/${PN}-1.2.7.confd" ${PN}
+ newinitd "${FILESDIR}/${PN}-1.9.5.3.initd" ${PN}
+ dobin "${FILESDIR}/g15daemon-hotplug"
+ insinto /lib/udev/rules.d
+ doins "${FILESDIR}/99-g15daemon.rules"
+
+ insinto /etc
+ doins "${FILESDIR}"/g15daemon.conf
+
+ # Gentoo bug #301340, debian bug #611649
+ exeinto /usr/lib/pm-utils/sleep.d
+ doexe "${FILESDIR}"/20g15daemon
+
+ if use perl; then
+ ebegin "Installing Perl Bindings (G15Daemon.pm)"
+ cd "${WORKDIR}/G15Daemon-0.2"
+ docinto perl
+ perl-module_src_install
+ fi
+
+ if use python; then
+ ebegin "Installing Python Bindings (g15daemon.py)"
+ cd "${WORKDIR}/pyg15daemon"
+
+ python_foreach_impl python_domodule g15daemon.py
+
+ docinto python
+ dodoc AUTHORS
+ fi
+}
+
+pkg_postinst() {
+ elog "To use g15daemon, you need to add g15daemon to the default runlevel."
+ elog "This can be done with:"
+ elog "# /sbin/rc-update add g15daemon default"
+ elog "You can edit some g15daemon options at /etc/conf.d/g15daemon"
+ elog ""
+ elog "To have all new keys working in X11, you'll need create a "
+ elog "specific xmodmap in your home directory or edit the existent one."
+ elog ""
+ elog "Create the xmodmap:"
+ elog "cp /usr/share/g15daemon/contrib/xmodmaprc ~/.Xmodmap"
+ elog ""
+ elog "Adding keycodes to an existing xmodmap:"
+ elog "cat /usr/share/g15daemon/contrib/xmodmaprc >> ~/.Xmodmap"
+}
diff --git a/app-misc/g15daemon/metadata.xml b/app-misc/g15daemon/metadata.xml
new file mode 100644
index 000000000000..454edc63965e
--- /dev/null
+++ b/app-misc/g15daemon/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>robbat2@gentoo.org</email>
+ </maintainer>
+ <maintainer type="person">
+ <email>polynomial-c@gentoo.org</email>
+ <name>Lars Wendler</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">g15daemon</remote-id>
+ </upstream>
+</pkgmetadata>