diff options
6 files changed, 319 insertions, 18 deletions
diff --git a/sys-cluster/glusterfs/ChangeLog b/sys-cluster/glusterfs/ChangeLog index 2391ccdf9e70..20fc97c02f5c 100644 --- a/sys-cluster/glusterfs/ChangeLog +++ b/sys-cluster/glusterfs/ChangeLog @@ -1,6 +1,15 @@ # ChangeLog for sys-cluster/glusterfs # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-cluster/glusterfs/ChangeLog,v 1.47 2013/07/26 11:43:00 dev-zero Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/glusterfs/ChangeLog,v 1.48 2013/08/07 13:32:56 dev-zero Exp $ + +*glusterfs-3.4.0-r1 (07 Aug 2013) + + 07 Aug 2013; Tiziano Müller <dev-zero@gentoo.org> + +files/glusterfs-3.4.0-gfapi-handle-failures-in-graph-switches.patch, + +files/glusterfs-3.4.0-glusterfsd-Use-dynamic-volfile-buffer.patch, + +files/glusterfs-3.4.0-nfs-exit-when-all-volumes-are-disabled.patch, + +glusterfs-3.4.0-r1.ebuild: + Add some patches from upstream. *glusterfs-3.4.0 (26 Jul 2013) diff --git a/sys-cluster/glusterfs/Manifest b/sys-cluster/glusterfs/Manifest index f3601d208a65..7dec15671588 100644 --- a/sys-cluster/glusterfs/Manifest +++ b/sys-cluster/glusterfs/Manifest @@ -1,6 +1,3 @@ ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA256 - AUX 50glusterfs-mode-gentoo.el 169 SHA256 2467d044665d16dd95f78f7a7a104099ce00849cd0a2a86b110fe4c91b316a9d SHA512 f90b3f49f53c08db5596a6795df64a834b390602a79fb79b56f6cfb6191c7ca8ce2bedd2885d049575e26cc3b321f80e2786e99055c02682f4fbf454d5ed5804 WHIRLPOOL fb4abfc0c07ddc8805430446bd901b95a9951f53711da647e87ea8c26bece8ed9c7bb17b33cfa9b114ba2a64a055f275202d520cf37ee0c178d005d07ff80173 AUX glusterd-3.2.0-workdir.patch 1651 SHA256 019fd1418041b98bcb5d841d19ef90a7d63483b801843876d7c5fdf54189cc80 SHA512 052496bda60b70ae8b3bd7d44cbeae093b9de80f56d8373dce4ff18fc50250a17cfeb38a00a111c5d17fed64962f48bc6d12100c0cfe0fbb83ec594a3d98b7bb WHIRLPOOL 7dafc97a1c4b17a9c4e3626f0b67e963f01adca295074e4cf80e85cf0ec096bd78a65eebb140925e092c2c5af29e4cac7e31faa5b16cfa4945f0321d95eeb6d9 AUX glusterd-r1.initd 451 SHA256 de39e1118fa1bfcc517f711e819ec78e67c58270383372a17886ca7362a7064b SHA512 90ba1109d393df99d7cc3092862684fd9d9a84b8ff8d7c7b5c7bfdabacee6ee209aa13e7c8d6b9497967aa5b5c30e984adf231b394dfbebb5d4d1f15b9f70f28 WHIRLPOOL 630596cba4af48fcdfb94bedf7f6a609dce85ac8dda835b699fd2ad0c3af64bd0b014c6fb97fe9d6faff8fc9a9652a2636e85372384027ac013abedeb71287c1 @@ -12,6 +9,9 @@ AUX glusterfs-3.3.0-docdir.patch 756 SHA256 f1af7734b9b886a6de89dbc86deea4917ad8 AUX glusterfs-3.3.0-parallel-build.patch 618 SHA256 822f6c339541f7a10e01efcbb04214d4628a08e766e742d5891fb28975624e5e SHA512 697e5aca20f47813e7c6fa237e150eec0937135207e710edf1fda3ab3b90b8c116a32f970f22816074928ddcd1040977576e015cce9b42767c54abd8b75fade1 WHIRLPOOL 343ed65732137bca28ff1ed22825dcc617f298fbb2506cae79de3695534ea9ffce6e9880316f5d09ef33d13e42c6a298849ca49ddccf7060cca298e71a5311d1 AUX glusterfs-3.3.0-silent_rules.patch 611 SHA256 6795dce0036131827fb10da67912bc5d6a675697d7d2bbc135790917b9917cf2 SHA512 057c4ffbf8c229a57ae652b93e4c92e7e2a222c4d9dbdd1b44b5da1a47eb3462960698cb3a27ed5f83dcf75e7e9ed515ece3e82a10a41da02bcb5af63d6df63c WHIRLPOOL a2cf7ea041aa0a0ee8d398c7d75ae68e144389301dc1c4a243c0e2c1db332223f48b775f432d5468b1464770fe12ef0362d3178f771d2b4346dc864865a99a29 AUX glusterfs-3.4.0-build-shared-only.patch 22147 SHA256 d11a171ffbc7b8a1fbcac5c651b2ad889a80b80bb2104787d6fd4bf56a2c2379 SHA512 a7b9a21717dff9f884674ea8b2b35e55f15c80a3ef4489a3ee2599c3f6d00534acedd6cbe09005d01d80a1fd0fc2e123745daa5bc7ca4d2166faed4a2b9822fa WHIRLPOOL 2a080cdbacac269b88109df6f3cb45a33bcddd0dfaf65a09160e8e17a9ef78e760f80b6acb3f9166ae7d4494820ec6562b3be8527510f93638556e21e7ce27c1 +AUX glusterfs-3.4.0-gfapi-handle-failures-in-graph-switches.patch 1056 SHA256 47e3105efdebcdbed1ecfbd25cc7b296144b40ee1bc3cd9d67b9e86013d171b9 SHA512 8eab974945560c6fa19e47c35f4f88c5d981cdce4cee47e6e02a2ee6dd76d462fd405ba326fb4254eed27bb8d126616d5ee0f609b5f12f2ccc040575a92262ad WHIRLPOOL 65453d571db3f8a33371f667c63adf48c01608b7bd902b6f7acba745c1a1fe913f9586ad7fb3ef4b17174c7f2b8dbb1c3fe52ca84a1b4c276e614fdd99961d87 +AUX glusterfs-3.4.0-glusterfsd-Use-dynamic-volfile-buffer.patch 2861 SHA256 913ccc05906eba7433f261d3f34af77e9405d24d54d946c83cd8466a242ca4f0 SHA512 1a390befc63efac4c14d7fb0019ca088b888602ea0cfdf42134d80459e1f6680668add53d3d5e5ab1e0b7177e0c07e37e09b6855f66cd439eab446c05a39de94 WHIRLPOOL 9aa0070f4f37e93bece922f46f8cbbaf36e0f20a3ee436380ba11af087a8a809663840d65c8593a20a86e992611fe207bd3d12884e41396bef9d13512f316bcf +AUX glusterfs-3.4.0-nfs-exit-when-all-volumes-are-disabled.patch 1570 SHA256 feb911c892a594ecf75528fa5db90882225e1461d922a82ef0cc6b59d861e38a SHA512 ce50b1eeee82d2c1b46198be5729576a4b3d808618529dd72db31259a03993c1e2636cb52575c3f7c0276170f5292b1a62edb2d6960c28246ea52b9362a6de93 WHIRLPOOL 2a1c853c66fa6e2e799780347bcd863e4981dd835ab10cfd74e7673484860f37bff22bf51a878313293f1e6cb6d074888b665211e8e00c6242a7a0d051e54347 AUX glusterfs-3.4.0-parallel-build.patch 951 SHA256 d31f674c16f18ac609093eb68e3e58487fc287d0e613e67013a3817739482ade SHA512 f8ff51eaad6d858764c6c30e0e426d3a6d43b77b4eb674936aee9c43dc29a7dd4b6d80237d0bed3b4fab1478a6a5481ed8236f0ff61b910cbec7fc2073295a13 WHIRLPOOL e1238f4f2215e04e2fbc0ab12169b4c75791bae4d600337adb0d8984fab3f1e68e408630fe5339d524ce976790976b22f3b52898ae4cf832208f90e856a1ad0e AUX glusterfs-3.4.0-silent_rules.patch 553 SHA256 08a55b2f54050ad47dae1a953fc1f1410842556bf2464ab15e7df9019ab24de5 SHA512 67fe230a667084f30960d4ed79f58c7da93edde086ca8614cb3f7160901cb87da471cce932cfae470033c5dfc92b00ed69fd0e32238bc0e9af770e1946f511ce WHIRLPOOL e596ee4c6fae6cb7f843501b55e832791d612547f81d5e6adf4e96ea8cc4fc20fd71d5164f7fe42a74ed0b8e7036643cd5b684317f98bfd610b91dbe4c4c3684 AUX glusterfs-docdir.patch 1644 SHA256 d2922af3e15faae8ae06102a757b158b510b27cc11ad9ffe643ca67e2046ba07 SHA512 df942eb947c5568f78757a4629389cb5fc5b436ebf4f9ae15c95fb09549b20f939b4bbf5fc478ced803230f31f15373fad73cfc810f79f737cd0f4d7de3321e3 WHIRLPOOL 5ec4e6b02d0bd83632339f3889a2673bff027a116953ecf282b24ea26cb295a9ddbb489ee76788549ebeae262ae3bc7e36b8047b4ddeda0edeca37bb6126e317 @@ -28,19 +28,7 @@ EBUILD glusterfs-3.1.2.ebuild 3647 SHA256 e2835d83bf6e03f4b0bb9d4f7dd2749d045420 EBUILD glusterfs-3.2.7.ebuild 3702 SHA256 2a32929580fad41bf449a79bc4e5d195bbab6c8560f0a937b9bdadb790fe7ff3 SHA512 2a9530fb240f220d9e3581053edf4fe18f1545223386c03e2b4f1a36fe2832cd8abc33110d234160bfc4a07f2532e1f2a7f4c976253b5fb45ef3a71b99833dde WHIRLPOOL 5a3d7d1b6349a266d2bdeb9be3061610c99bf8338cc724dba70d9db55e37b2a1fb10e798ae13130f010cc88445f58aa3006b459bf502184898de3c36cd21c3c5 EBUILD glusterfs-3.3.0.ebuild 3796 SHA256 bc7ebd431067f8e8b8c7c15ab16a2701e6d5e1b45935ec48216c516c2c8ae7c6 SHA512 af2a53e1e3786e7366a88a1d9191e3fc66204163e25b497668bbbee7b96e64d28212362bcb9ab6807ee229f6469eeee70e10919f9453161ae4423fc62445bf30 WHIRLPOOL 851ffce2dce2dd372a0a5e1af9f147ec517e5ba2118fe2ea33ba6c013b3ae4ddb0e4fa3332c3a8e4f3dc629bb88a5faa540e479425366cb1780485558572fcd6 EBUILD glusterfs-3.3.1-r2.ebuild 4071 SHA256 688fac9b91eacff4ebde95f0e60ee48bd3e0c0063f3603186e6f902e85b81d3d SHA512 e510359e5ea465cc1c8b3545b88b204671ed0d4b0bf2739ed8a5a324c12a1b04855c5fee5c8f1153b2916eb180fc9d225282af4982b3ff831d997ce90e8f8896 WHIRLPOOL dc55997fc5b0d8d9f59bb54406bab2c5699f9ce4f244b0465899906235a95942cc2f502e174a694c5a42206939195712dcddd2c8750417f5a7a4d04881e19924 +EBUILD glusterfs-3.4.0-r1.ebuild 4787 SHA256 55bddf867edd8d9cd036e6868cd201bfda4a91403db13dcbfd8fe6d1bcc0b133 SHA512 31e491b9e02ac9c538f6b5b65504bb97203cb6a48094a4b24130553a746ea417eeba130012cd687c2274da0f8a67dc83bdd2efab4b2415a0c42ee61cef17dfe8 WHIRLPOOL c1ac55ae4bc8518c7e7730e902daa8952f1dcb2e1a94c63e18afb9f18c2d6a3e396568a88f5d81115ae1417fc6b7eb1ce0498f9b80771f4386b3e1f5663fb935 EBUILD glusterfs-3.4.0.ebuild 4596 SHA256 be89776c1efe47258810cae84a1618a4e1d92c2742031aa95360fc23fdbc4c78 SHA512 43a99433614bf414113fc42f99802e84654a20ed379207db8a9f53852218f95e5da594fb831894b5bcd8e373b4031bae7a8a2a80b61af314ac4feb85e38e536f WHIRLPOOL 134f6ab31f8972b91a60f4d133db33e46db9071526d5cf8073383ed4a1e70a2fb584a8b2e636b95ef8f7d00236af4373a88288ac8564613fe594cf33b8fec63a -MISC ChangeLog 9234 SHA256 08aae6d6fc9e8a41df04e693bbdf3eccbddcaf9e5fbf149626902a8714d14101 SHA512 f9a4647725c59a3d7c4c797716e2451de6eb9ed276490feb6e2f4ff7deeecd0cc485f2010507707e64b3e7e68215b2772e0a0b83a97932e89d72b8a4a05729ee WHIRLPOOL d63f2961cef405266332b299b8bbcd86767eeccb02e29b2c7e7606701b0b8d152474dbb1321cff2eb1211ba098c117cb0219e7e67cdc61d6b97afe58dd3399a5 +MISC ChangeLog 9600 SHA256 24b46a00f84010a92251250a107fb55f6fd32086865838423e7dd8060ddd950e SHA512 2ffc5ae1e08f00a0d1ddc0fb3f534bc1e948196d21aa2ef8b090f0da4cefd9de7ef5d45f9972432919f45b1e496d9f8f72f95e66cc67ab57e3f05caa4157049a WHIRLPOOL f6674658e58cb2bc178b102425b552b888e5672ced739e95db5374826a595f6327522dfbef806e7f2aae9f15906ab149e335621e24c2df2f52407f52e8e743f9 MISC metadata.xml 1037 SHA256 82d258e1fbfe283fdf38d31124dff45c25f0fd457952d3a06c46bbe14b3e21f3 SHA512 b25f18244e5d026360570769c64f547b2ccb94b7ee780190c800b83350a5ae8577e7a00413935abb84d3765b42b90edb9b4dee35bb8772ec97f1a9f8dca5c297 WHIRLPOOL 79c89cd1e212f341778d51db8144bab8fe144ef3ad6701312f3399cf55fd9c543bc4623b5c7827e6010f89e33b2661f42f127b7ec8e7ed39727c5987510cc631 ------BEGIN PGP SIGNATURE----- -Version: GnuPG v2.0.19 (GNU/Linux) - -iQF8BAEBCABmBQJR8mDJXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w -ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ1RjI0QTQ0MjI1OURBNzI4MEIyREExRkQx -RTdDRkM3NzFFMENBODVGAAoJEB58/HceDKhfu4cH/277v1V5XSbtJNv0rDpcblRs -nufTWcITWyfuG+/GjbQI0UdZ4GWmkknIBGQqKKxkGXZe0QZ2ANEZOUGo1K7/9Ry3 -7l6d5sBgrfP3HgLeieDwtXthFn+cgT2YeCc0hkQhcD2RD7EgQf67QQ4P6E/4elGq -2Nlz6L6LaWFsyJXnCFoJC28kZkAueTPddJVlVDFEekuDuxD1Oe69zpyFqgLYzgu3 -idnfsOJawYNrOfChpWkM+g87lS7Xjlke/OfwQlg06ooY4g4Knu3Tl+o+Shqd81B3 -MOn7Xfw++QZXSh/5NhnU/fifyO9FHx/Ad7hyNZNZVkIJOh+WHyoBrLGVTa0VrcU= -=OjVa ------END PGP SIGNATURE----- diff --git a/sys-cluster/glusterfs/files/glusterfs-3.4.0-gfapi-handle-failures-in-graph-switches.patch b/sys-cluster/glusterfs/files/glusterfs-3.4.0-gfapi-handle-failures-in-graph-switches.patch new file mode 100644 index 000000000000..91da4f0adecc --- /dev/null +++ b/sys-cluster/glusterfs/files/glusterfs-3.4.0-gfapi-handle-failures-in-graph-switches.patch @@ -0,0 +1,35 @@ +From ccb48ebfafba7ba50d3fb156ecd8ba9666577fd2 Mon Sep 17 00:00:00 2001 +From: Anand Avati <avati@redhat.com> +Date: Sun, 21 Jul 2013 00:43:18 -0700 +Subject: [PATCH] gfapi: handle failures in graph switches + +A graph switch failure can potentially result in NULL returned +for glfs_active_subvol(). Handle this gracefully in glfs_subvol_done() + +Change-Id: I6adbd878c354b9ed2314fc71cea4671792efa0a4 +BUG: 953694 +Signed-off-by: Anand Avati <avati@redhat.com> +Reviewed-on: http://review.gluster.org/5427 +Reviewed-by: Vijay Bellur <vbellur@redhat.com> +Tested-by: Gluster Build System <jenkins@build.gluster.com> +--- + api/src/glfs-resolve.c | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +diff --git a/api/src/glfs-resolve.c b/api/src/glfs-resolve.c +index 4a634df..beb2703 100644 +--- a/api/src/glfs-resolve.c ++++ b/api/src/glfs-resolve.c +@@ -797,6 +797,9 @@ glfs_subvol_done (struct glfs *fs, xlator_t *subvol) + int ref = 0; + xlator_t *active_subvol = NULL; + ++ if (!subvol) ++ return; ++ + glfs_lock (fs); + { + ref = (--subvol->winds); +-- +1.7.4.1 + diff --git a/sys-cluster/glusterfs/files/glusterfs-3.4.0-glusterfsd-Use-dynamic-volfile-buffer.patch b/sys-cluster/glusterfs/files/glusterfs-3.4.0-glusterfsd-Use-dynamic-volfile-buffer.patch new file mode 100644 index 000000000000..b293f136b6bf --- /dev/null +++ b/sys-cluster/glusterfs/files/glusterfs-3.4.0-glusterfsd-Use-dynamic-volfile-buffer.patch @@ -0,0 +1,79 @@ +From 1127d5143c27532c07c694a4088dbeae48a1504c Mon Sep 17 00:00:00 2001 +From: Kaushal M <kaushal@redhat.com> +Date: Mon, 22 Jul 2013 19:14:56 +0530 +Subject: [PATCH] glusterfsd: Use dynamic volfile buffer + +Backport of + fa78792 glusterfsd: Use dynamic volfile buffer +from the master branch. + +Glusterfsd used a fixed buffer to store volfiles fetched via getspec. +This caused problems with large volfiles. Changining this to a dynamic +buffer allows large volfiles to be loaded in memory. + +BUG: 986100 +Change-Id: I9ec86c09a00bc84fef7a0da05bbeb6b3e07d5146 +Signed-off-by: Kaushal M <kaushal@redhat.com> +Reviewed-on: http://review.gluster.org/5431 +Tested-by: Gluster Build System <jenkins@build.gluster.com> +Reviewed-by: Vijay Bellur <vbellur@redhat.com> +--- + glusterfsd/src/glusterfsd-mgmt.c | 21 ++++++++++++++++++++- + 1 files changed, 20 insertions(+), 1 deletions(-) + +diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c +index 8082ad3..d20303a 100644 +--- a/glusterfsd/src/glusterfsd-mgmt.c ++++ b/glusterfsd/src/glusterfsd-mgmt.c +@@ -1391,7 +1391,7 @@ out: + + + /* XXX: move these into @ctx */ +-static char oldvolfile[131072]; ++static char *oldvolfile = NULL; + static int oldvollen = 0; + + static int +@@ -1552,6 +1552,7 @@ mgmt_getspec_cbk (struct rpc_req *req, struct iovec *iov, int count, + int ret = 0; + ssize_t size = 0; + FILE *tmpfp = NULL; ++ char *volfilebuf = NULL; + + frame = myframe; + ctx = frame->this->ctx; +@@ -1609,6 +1610,15 @@ mgmt_getspec_cbk (struct rpc_req *req, struct iovec *iov, int count, + if (ret == 0) { + gf_log ("glusterfsd-mgmt", GF_LOG_DEBUG, + "No need to re-load volfile, reconfigure done"); ++ if (oldvolfile) ++ volfilebuf = GF_REALLOC (oldvolfile, size); ++ else ++ volfilebuf = GF_CALLOC (1, size, gf_common_mt_char); ++ if (!volfilebuf) { ++ ret = -1; ++ goto out; ++ } ++ oldvolfile = volfilebuf; + oldvollen = size; + memcpy (oldvolfile, rsp.spec, size); + goto out; +@@ -1625,6 +1635,15 @@ mgmt_getspec_cbk (struct rpc_req *req, struct iovec *iov, int count, + if (ret) + goto out; + ++ if (oldvolfile) ++ volfilebuf = GF_REALLOC (oldvolfile, size); ++ else ++ volfilebuf = GF_CALLOC (1, size, gf_common_mt_char); ++ if (!volfilebuf) { ++ ret = -1; ++ goto out; ++ } ++ oldvolfile = volfilebuf; + oldvollen = size; + memcpy (oldvolfile, rsp.spec, size); + if (!is_mgmt_rpc_reconnect) { +-- +1.7.4.1 + diff --git a/sys-cluster/glusterfs/files/glusterfs-3.4.0-nfs-exit-when-all-volumes-are-disabled.patch b/sys-cluster/glusterfs/files/glusterfs-3.4.0-nfs-exit-when-all-volumes-are-disabled.patch new file mode 100644 index 000000000000..5a1bdec89e62 --- /dev/null +++ b/sys-cluster/glusterfs/files/glusterfs-3.4.0-nfs-exit-when-all-volumes-are-disabled.patch @@ -0,0 +1,42 @@ +From fdc83183263e04bee56672e9d9922cc9457146cb Mon Sep 17 00:00:00 2001 +From: Rajesh Amaravathi <rajesh@redhat.com> +Date: Fri, 21 Jun 2013 14:58:23 +0530 +Subject: [PATCH 1/1] nfs: exit when all volumes are disabled + +Instead of triggering 4-5 error logs, when nfs is +disabled for all volumes, exit the process. + +Change-Id: Ib286f143c4f74ba22f502aca0e7dcd0907db6563 +BUG: 976750 +Signed-off-by: Rajesh Amaravathi <rajesh@redhat.com> +Reviewed-on: http://review.gluster.org/5245 +Reviewed-by: Santosh Pradhan <spradhan@redhat.com> +Tested-by: Gluster Build System <jenkins@build.gluster.com> +Reviewed-by: Vijay Bellur <vbellur@redhat.com> +--- + xlators/nfs/server/src/nfs.c | 9 +++++---- + 1 files changed, 5 insertions(+), 4 deletions(-) + +diff --git a/xlators/nfs/server/src/nfs.c b/xlators/nfs/server/src/nfs.c +index 6cd0594..c3a76c6 100644 +--- a/xlators/nfs/server/src/nfs.c ++++ b/xlators/nfs/server/src/nfs.c +@@ -533,10 +533,11 @@ nfs_init_state (xlator_t *this) + if (!this) + return NULL; + +- if ((!this->children) || (!this->children->xlator)) { +- gf_log (GF_NFS, GF_LOG_ERROR, "nfs must have at least one" +- " child subvolume"); +- return NULL; ++ if (!this->children) { ++ gf_log (GF_NFS, GF_LOG_INFO, ++ "NFS is manually disabled: Exiting"); ++ /* Nothing for nfs process to do, exit cleanly */ ++ kill (getpid (), SIGTERM); + } + + nfs = GF_CALLOC (1, sizeof (*nfs), gf_nfs_mt_nfs_state); +-- +1.7.4.1 + diff --git a/sys-cluster/glusterfs/glusterfs-3.4.0-r1.ebuild b/sys-cluster/glusterfs/glusterfs-3.4.0-r1.ebuild new file mode 100644 index 000000000000..be870ba492bb --- /dev/null +++ b/sys-cluster/glusterfs/glusterfs-3.4.0-r1.ebuild @@ -0,0 +1,148 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/glusterfs/glusterfs-3.4.0-r1.ebuild,v 1.1 2013/08/07 13:32:56 dev-zero Exp $ + +EAPI=5 + +PYTHON_COMPAT=( python{2_5,2_6,2_7} ) +AUTOTOOLS_AUTORECONF=1 + +inherit autotools-utils elisp-common eutils multilib python-single-r1 versionator + +DESCRIPTION="GlusterFS is a powerful network/cluster filesystem" +HOMEPAGE="http://www.gluster.org/" +SRC_URI="http://download.gluster.org/pub/gluster/${PN}/$(get_version_component_range '1-2')/${PV}/${P}.tar.gz" + +LICENSE="|| ( GPL-2 LGPL-3+ )" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="bd-xlator debug emacs extras +fuse +georeplication infiniband static-libs systemtap vim-syntax" + +REQUIRED_USE="georeplication? ( ${PYTHON_REQUIRED_USE} )" + +RDEPEND="bd-xlator? ( sys-fs/lvm2 ) + emacs? ( virtual/emacs ) + fuse? ( >=sys-fs/fuse-2.7.0 ) + georeplication? ( ${PYTHON_DEPS} ) + infiniband? ( sys-infiniband/libibverbs sys-infiniband/librdmacm ) + systemtap? ( dev-util/systemtap ) + sys-libs/readline + dev-libs/libaio + dev-libs/libxml2 + dev-libs/openssl + || ( sys-libs/glibc sys-libs/argp-standalone )" +DEPEND="${RDEPEND} + virtual/pkgconfig + sys-devel/bison + sys-devel/flex" + +SITEFILE="50${PN}-mode-gentoo.el" + +PATCHES=( + "${FILESDIR}/${PN}-3.4.0-silent_rules.patch" + "${FILESDIR}/${PN}-3.4.0-build-shared-only.patch" + "${FILESDIR}/${P}-parallel-build.patch" + "${FILESDIR}/${P}-gfapi-handle-failures-in-graph-switches.patch" + "${FILESDIR}/${P}-glusterfsd-Use-dynamic-volfile-buffer.patch" + "${FILESDIR}/${P}-nfs-exit-when-all-volumes-are-disabled.patch" +) + +DOCS=( AUTHORS ChangeLog NEWS README THANKS ) + +# Maintainer notes: +# * The build system will always configure & build argp-standalone but it'll never use it +# if the argp.h header is found in the system. Which should be the case with +# glibc or if argp-standalone is installed. + +pkg_setup() { + use georeplication && python-single-r1_pkg_setup +} + +src_configure() { + local myeconfargs=( + --disable-dependency-tracking + --disable-silent-rules + --disable-fusermount + $(use_enable debug) + $(use_enable bd-xlator ) + $(use_enable fuse fuse-client) + $(use_enable georeplication fuse-client) + $(use_enable infiniband ibverbs) + $(use_enable static-libs static) + $(use_enable systemtap) + --docdir=/usr/share/doc/${PF} + --localstatedir=/var + ) + autotools-utils_src_configure +} + +src_compile() { + autotools-utils_src_compile + + use emacs && elisp-compile extras/glusterfs-mode.el +} + +src_install() { + autotools-utils_src_install + + rm "${D}/etc/glusterfs/glusterfs-logrotate" || die "removing false logrotate failed" + insinto /etc/logrotate.d + newins extras/glusterfs-logrotate glusterfs + + if use emacs ; then + elisp-install ${PN} extras/glusterfs-mode.el* + elisp-site-file-install "${FILESDIR}/${SITEFILE}" + fi + + if use vim-syntax ; then + insinto /usr/share/vim/vimfiles/ftdetect; doins "${FILESDIR}"/${PN}.vim + insinto /usr/share/vim/vimfiles/syntax; doins extras/${PN}.vim + fi + + if use extras ; then + sed -i -e "s|quota-remove-xattr.sh|${PN}-quota-remove-xattr|" extras/quota-metadata-cleanup.sh || die "sed failed" + for e in backend-xattr-sanitize backend-cleanup migrate-unify-to-distribute quota-metadata-cleanup quota-remove-xattr ; do + newbin extras/${e}.sh ${PN}-${e} + done + newbin extras/disk_usage_sync.sh ${PN}-disk-usage-sync + fi + + newinitd "${FILESDIR}/${PN}-r1.initd" glusterfsd + newinitd "${FILESDIR}/glusterd-r1.initd" glusterd + newconfd "${FILESDIR}/${PN}.confd" glusterfsd + + keepdir /var/log/${PN} + keepdir /var/lib/glusterd + + python_fix_shebang "${ED}" +} + +pkg_postinst() { + elog "Starting with ${PN}-3.1.0, you can use the glusterd daemon to configure your" + elog "volumes dynamically. To do so, simply use the gluster CLI after running:" + elog " /etc/init.d/glusterd start" + elog + elog "For static configurations, the glusterfsd startup script can be multiplexed." + elog "The default startup script uses /etc/conf.d/glusterfsd to configure the" + elog "separate service. To create additional instances of the glusterfsd service" + elog "simply create a symlink to the glusterfsd startup script." + elog + elog "Example:" + elog " # ln -s glusterfsd /etc/init.d/glusterfsd2" + elog " # ${EDITOR} /etc/glusterfs/glusterfsd2.vol" + elog "You can now treat glusterfsd2 like any other service" + elog + ewarn "You need to use a ntp client to keep the clocks synchronized across all" + ewarn "of your servers. Setup a NTP synchronizing service before attempting to" + ewarn "run GlusterFS." + + elog + elog "If you are upgrading from a previous version of ${PN}, please read:" + elog " https://vbellur.wordpress.com/2013/07/15/upgrading-to-glusterfs-3-4/" + + use emacs && elisp-site-regen +} + +pkg_postrm() { + use emacs && elisp-site-regen +} |