summaryrefslogtreecommitdiff
path: root/app-backup/amanda
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-backup/amanda
reinit the tree, so we can have metadata
Diffstat (limited to 'app-backup/amanda')
-rw-r--r--app-backup/amanda/Manifest35
-rw-r--r--app-backup/amanda/amanda-3.3.9.ebuild475
-rw-r--r--app-backup/amanda/amanda-3.4.1.ebuild482
-rw-r--r--app-backup/amanda/amanda-3.4.2.ebuild479
-rw-r--r--app-backup/amanda/amanda-3.4.3.ebuild479
-rw-r--r--app-backup/amanda/amanda-3.4.4.ebuild479
-rw-r--r--app-backup/amanda/amanda-3.4.5.ebuild479
-rw-r--r--app-backup/amanda/amanda-3.5.ebuild480
-rw-r--r--app-backup/amanda/files/amanda-3.3.9-stuck.patch11
-rw-r--r--app-backup/amanda/files/amanda-3.4.1-labelstr.patch164
-rw-r--r--app-backup/amanda/files/amanda-3.4.1-slots.patch16
-rw-r--r--app-backup/amanda/files/amanda-amandahosts-client-2.5.1_p3-r18
-rw-r--r--app-backup/amanda/files/amanda-amandahosts-server-2.5.1_p3-r18
-rw-r--r--app-backup/amanda/files/amanda-cron13
-rw-r--r--app-backup/amanda/files/amanda-devfs7
-rw-r--r--app-backup/amanda/files/amanda-inetd.amanda.sample-2.6.0_p2-r23
-rw-r--r--app-backup/amanda/files/amanda-profile1
-rw-r--r--app-backup/amanda/files/amanda-xinetd-2.6.1_p1-client19
-rw-r--r--app-backup/amanda/files/amanda-xinetd-2.6.1_p1-server19
-rw-r--r--app-backup/amanda/files/amanda.service10
-rw-r--r--app-backup/amanda/files/amanda.service-r110
-rw-r--r--app-backup/amanda/files/amanda.socket7
-rw-r--r--app-backup/amanda/files/example_amanda.conf44
-rw-r--r--app-backup/amanda/files/example_disklist-2.5.1_p3-r14
-rw-r--r--app-backup/amanda/files/example_global.conf78
-rw-r--r--app-backup/amanda/files/local-amanda-perl5.20.patch205
-rw-r--r--app-backup/amanda/metadata.xml30
27 files changed, 4045 insertions, 0 deletions
diff --git a/app-backup/amanda/Manifest b/app-backup/amanda/Manifest
new file mode 100644
index 000000000000..c9e323848893
--- /dev/null
+++ b/app-backup/amanda/Manifest
@@ -0,0 +1,35 @@
+AUX amanda-3.3.9-stuck.patch 422 SHA256 f68e018db18bb18b7fde4b1a841d23854e91eeb17f05cbbfad58da5b1900cac9 SHA512 8028505fd3f1946f13dae631bfd6a74f6d7688c658148a250e473ed85fd1268fae18278ede5f0499200cd84a2bc5481edb2d0f4fec2bab7a57528b9957396c42 WHIRLPOOL 6d848989be9cf17e5e4d672db2bce3c548c9f1abe86c8b0a6ad4812684c1813e09d4d17437d2c3e10028b2714b2ecd5d99a650a7bae872a6ed2a96ad08876a49
+AUX amanda-3.4.1-labelstr.patch 6224 SHA256 5b677593244657209a254475a4ce7d92caf1423a78b40523cc2b2d5b7b144ff5 SHA512 337a5fd0eef9521932842248414f4402e8623122f4fb401e909750ec690019daf75b3018cc1c7b50a682bae7cd96187e1406fc7767a8b34297546abe70f0f035 WHIRLPOOL 5a686c96df6063d1e8114030f3a6833890607ff4f7ce5499cd2ddf1e9b14c69d565b3f25388502dd186c94615ec8157378395385da09b43631b347545c141f51
+AUX amanda-3.4.1-slots.patch 512 SHA256 3732ec4ec5ee6c6fb704a1429337c8363a71bff1445cb973bb6a92757dee4695 SHA512 ce4fb2184b58c303ce785d661c740dfe25160f2ac1d87283414f4b8bbe6a464e123eea663f5505a3edc9d1542551fe06b744460ce395a4de14b679817a8a74b4 WHIRLPOOL 5d44764300bf105bd76377fdfb4c0888f48a0d61cfb79f79e465b2bc4617e4b981210b46d6d4f7e7b9646c3c5286cf96a4877dab9761af32b8045fae87289c0b
+AUX amanda-amandahosts-client-2.5.1_p3-r1 343 SHA256 26a446ae74aafcb90a05bb66430b70e35c5536ee9e42137abc7925bf1175e84e SHA512 7c0c4fc6d18b37ee8c11e64f98074b93f52f1bdcb97949648ced82d83ada2ea688f79531efa4c3e596f7390770540f45a7b122bba862cbd5218f1b870594f751 WHIRLPOOL df1dcdd48d2b2bf9588f99ef450549c6bd7dcfaff113e2804b67444cb1a283c426000dde9cef48cd099e02ab68b16b10da346f3d5a90e50ab82c601dca8d7587
+AUX amanda-amandahosts-server-2.5.1_p3-r1 340 SHA256 9e07c28b344ff42c6a8f31af2d9dac780a00ff28e40850a0b115e26990ecc0e7 SHA512 b11076634608c16cec4350364d60bcf3d22c12f07c0d8fab53d854e4fb21197eb016fb7f75d8153295ef9f997a3850fcd56b9fe268fa8dde5fd39d9dcbabb08b WHIRLPOOL 670afb2158089ce633f992bc3fe93b104ed87ab9f2952323f6d5523e18913b40eed290974d7399a6132d5ec376ad3348fc2c443776d20e798c7df209141e6d23
+AUX amanda-cron 419 SHA256 17e1a36c21264a9b254e64e9b7529d70402acd40772d158795490ac5fc08b01a SHA512 93aa1a6bcc66bc5147210bd0dd52ae664064cc708cbe59969a5bc9e783e4972841ad7cb89f3ae111ac7695c42e1b91f727890b8e58c4f8757f08e5eae90fb505 WHIRLPOOL 72a1da31879e9589d2a55e87d85371ff67eb2d5b58a80906eaf2a1922ffbc9fa4b6978e5d0538c8e529e91f66a2ce00b5a897003f30dde1c59307e029d6b6f4b
+AUX amanda-devfs 349 SHA256 f21584bc65947e3ac671f89af04966aafd751360ef0465ce8ca1a249b0ee253a SHA512 44ff6ec5793f6a271e7315b4c45b894fd86e54b4cc6a063c79e69732db9347d45d9a30fb169759de124e568c19f281dba928c7b1696589d43aa83caad6e4836a WHIRLPOOL 15023cf20feee469f085b5259b36e64d0841b87557b12a1e2f83a1a8e1ed23001aa07c99778ecfff90d30b3dceb62052a2d128bfa653e1a427b8594dacfd5ed5
+AUX amanda-inetd.amanda.sample-2.6.0_p2-r2 326 SHA256 4056a53e1a6f3dd5527da9fd85e810e21ebab0fe9100043b2ac165743d5a9b79 SHA512 8d5c6896f05bb66c2c524d6a9b547008dc218ddd4866b6ce7d8e0e0099c8cd5e6b6f05c9fd7fa1035a2627200ef2becc2981c4d213c9695ffed76af4de82dfd1 WHIRLPOOL 3a9c4b9ce906b87d23453f6ac2a6c45424b192dabc03d1e331f25e71fce4839211fcd797b9873614eb2396aa2173b264bfb04ff6d33e20f9a0405415c99df892
+AUX amanda-profile 49 SHA256 5781459910f0f72b1bfe15d758f17e7d6c8e33b5856b62a8d5cedf64a2917e76 SHA512 a7125e77858f22ed7c27ef9a070314c174e15ae530f871b1cfa27f9dd5c1f9a97029b30a6265e825c5e0a05428a04d41d41afe557eb01fcd40fdc50df3799ca8 WHIRLPOOL 5bdf92ed2d4be69908be107f46443ec9a1c6cd09bf09948224bfa02662a9d79cc3524ae778a76d2d3b19d30dc633117248dbb0201f7a575b8b08e154179ad108
+AUX amanda-xinetd-2.6.1_p1-client 640 SHA256 1581e772a0c7fccc29bd4b19b3e1c8a04942c7d683dc269b4de16826a362a259 SHA512 1c8ad07bfe79a20cb17208255a327b0ceb0f47834ceeedc97df23a2987816169988f9df0432e7df70dc7ebccf35628c0b38f00a0ec210ddec558190df89b1191 WHIRLPOOL 7884ae5cbb7280aba695a932f08862dbd09b8df46e8f80e534fee4c1a4b245464362718c53ff510c907f564b5709f506d6ea2fda93818603ac76fd4529081e3b
+AUX amanda-xinetd-2.6.1_p1-server 660 SHA256 a43edca3dcd152cd886d13c4ceb963b1e450909bbec257c9e7ac4382de616ac8 SHA512 ae0bf03a446becb54e7cbe3e39db990125f2d67a91bb59deaccbb112a0855c45a7840ac68e5e1c6543c03890c7e3e929b0e94527686d678de78044fa0d316c26 WHIRLPOOL 8c244f31382823b1a9e2b18621b46802f5f30de76c64e0223eecc51c0fb597763b53e7a2a4da7fb9e503a0e7da79e9396c6343ae6a9c412c1aff345d0421cc95
+AUX amanda.service 199 SHA256 1091b9be5b0b48a543d360f308d8e50645546bbf63335cb96d635046d0dae7e6 SHA512 cc54f9423a6f88d2393c96c871d59e8e1f4bbc027ee3cf1cd865609fcf469f1aa3807a5e942efd5ffa77dc7d1d9b657698a8b9ed8c418cc40fd5267610606c0e WHIRLPOOL bf518fcb58967854b011ecc73f4d79d16be7b1caa9d9cdbae4c2c823ba2240c03f5924ddac7f6874957e47d464abed71cb467332eb5f388be4f77a7bec608fc2
+AUX amanda.service-r1 219 SHA256 e226993c391cceb27ef9b05984df49555ec7c03e18bec135ddf74cb0cc87be9b SHA512 81ebe6f7d1005533d459fde64f7d5f43b06da785c8983bb5a6ed0b9c1abfb4b5106e1050166cc8e34acdf9890df6a6afe605fa3cd0310964ce17b8db1eb8206c WHIRLPOOL 352d42752f45d8789344300c8d73d09c78bc3c07f553e6dc953cd8e84c34d02dd2a6ddab8e6fb03f9d768b6ed23191084b784033a54983b7869ffb3bc8eab30f
+AUX amanda.socket 107 SHA256 47df2b337c4726068a5bf5d3dfb9ad6dba5c36f5851a445a1ff601040dbb8b86 SHA512 4017590985a4e194174cf2ea16ccac5600aaee0d874144a9a28121bcf607d8a116d1f6fe50e10a54330777ccac39b703865b486c7d4e9cca363d8b53c715ee4f WHIRLPOOL 579871cdab024d12b9089f133bf446c1ac2560f807ff0a2e0b0a9a779df9b1e1e87a687b5b9c63f001c9dc342537e194d3c66fbc5772a9affaac423f9dcca1ea
+AUX example_amanda.conf 635 SHA256 a1b0520fb0fca0f4146c59589987fffa637a0ce643a91d6d71dde6f538faf325 SHA512 c025aeba89ae686a7bdc5211d9f9b52663cbf8d90fc293f8e3b7ec4b86810d0098e125f4d41bd76af4f3a451bf98b292aa062760c40efba226e15a06bb3a85a9 WHIRLPOOL 50d4e2bab918f54be0ffe6cba018bf468b55e5286d58b99f0d0d7ed0b69761f020c3c1224f8c00e4457acf068ecf54019283bdfb032a4b58931f4089f85258a9
+AUX example_disklist-2.5.1_p3-r1 177 SHA256 bc0388e7de0cc36888d3b27430b4a6b138dd39c77263fdc53dfee9f0b93142f8 SHA512 43fd73b55d48396e1863b23b20b84781aaa7e38200ee4fdbcb898c9a8c5479e24b8448a68ceac01bd6339202935bbf32f02e70a779ee989eeb368ec88d890ae3 WHIRLPOOL 8784e8944c67644e204160aa488486fd028b2f79333bae724d9fb5bf3cf66fb306e8d59e3d9172a0bf9d8639c41899a97d1aa9c7f8f4c1f38adbbc07e98bb8af
+AUX example_global.conf 1377 SHA256 5223d061cd160b241e0d1fad1e328d241387fecb753e797d2e216f77d97a8808 SHA512 c432bdfb97ceb1005bc004d12208f90b09d4c41c8562b8bba0f7b43bbe510672038ca1658a764cff7c6f8e56fa1439a7c15c69714773438e602a693a4f8195a5 WHIRLPOOL 778bdc964d4a7af1bf28775a4c0b46378ebb9812cfe4fb2bb96e4d85d42a96a5dfc60b93f5bfc6e760fcbe9d79477b902466c4a8c1478729568260a96d17a435
+AUX local-amanda-perl5.20.patch 4509 SHA256 58f88bc8aa469c9e62beda31003f5a257a67896e0941b6c3b6defdfab9551dc8 SHA512 222161f9e341232e1e9582ce02d02e6c80977f70c7a566b397023d623086cfddcd913e2e1c322d8dd2d02f4406aa41e523196bb82553c654e43e9217af4063cf WHIRLPOOL c7469768d0268e20358d68019054802e7adc802f52069ddcc07cd977e8678a3f4f3e03dff063e18583421a8ee83d8af92a2ef293c560da552b50271da0ee66b1
+DIST amanda-3.3.9.tar.gz 4673301 SHA256 2520b95ca96f1d521d582b7c94bd631486e7029eda1de8e1887d74b323549a41 SHA512 345670a20cff335453e8dcbf457d1fcdb9f266e4a03d729c2b1ba762f4fac323de4a87713d0fd54c11ca244a08dc97fb8c641625f7fa81cb241b3c17748b1b7e WHIRLPOOL e149ab7dbc30cf3585e41d9fb338dd96ab4dd440e31723be51b8ccc9e5841f8dda31d3b89418474e31c7c2498f40177c646f03713c256a4d9341152e2ce2c8e4
+DIST amanda-3.4.1.tar.gz 5338575 SHA256 1f69e9bdae774ac2394297dd9d7f98ccbce44ca9199317ada764ca173909d2ac SHA512 245bf334e36fe8b4361d9fc27ea7e7ef5bd2ecec74719caa16cc94d1ebb3abbef058e28d9afd85851654aaae0984531593a35c079d1ba4aed0fc5177e907ec16 WHIRLPOOL b9608456f28fb35137276f16ec24d79ae397a44450b42ec4fa28256763798dee623ab560ba0db147ff41d2abc57810e2318ae64741ea0a054a8ff853f4ad9c59
+DIST amanda-3.4.2.tar.gz 5353734 SHA256 175c6a2ef57fe480ddeeefc920a93c8d1cde4111eec76d76e088101a53eeafac SHA512 dea44ffa5eb30318336395ccbd582df2f83da9a4cf91def2834a2e65b2e0f36cafc1911f6b73c3afb63be256484a78b006bdeb1db5b3ecf87dc59d34754987fd WHIRLPOOL af08e2b7b42cead569b69edfa264c1439d21d455e36ba5d346a74631e037773f20cd0563c6cdf95eeea0ee0e1e45328e553a5490ef4c66545acc1a3bd85570d0
+DIST amanda-3.4.3.tar.gz 5355137 SHA256 8ebca59d7b5fc64179fee3d9de4289cd9e8dbb49558e0a21228b06e16105d688 SHA512 5fa7a8c59961f87568d3459e6b5368e50c6cf74e1a6c7599faf5f85d537e72668775acc11009d1d5699ab92d1c21553b5b86e06b804c6a1ae04500889726694a WHIRLPOOL e1c4cd778d5c71994d2c74fef07948476f367fff42e666fb1b516035746c1e9562b9bf4579875e922c44f8dd65924bf9fec5ca7d30bbee0998540c4c319d18b0
+DIST amanda-3.4.4.tar.gz 5363929 SHA256 467e44eccd47170cf8ec40e914a2fbc1e6d50966e6a71c46d96091183c54a3d3 SHA512 e73ee29a6074396a885b08d9b1160b1e379423596dde872a14a8c8cf5845c9fcf3ea08038007a99063169a863d8b9f3ca9c23b8f5609d463a5b1f2ddcd44be96 WHIRLPOOL 221848cd608fd3e45b4f172f56ab691dc2a1dd659f3a5f15df6a2e973daae0964d88fd359c9975147b358289feb77779342f26956b0e693f8683da8d621f04ea
+DIST amanda-3.4.5.tar.gz 5365381 SHA256 bf05ea512676c7520ccff8d711e17176ea2aec47f7c517669cee02e8ab201343 SHA512 441efef6a34a1cb645c8c5d1e909f25230322ceb38d1efa0a104de2d9051640f7032255c8d8c7391a918102aceeb5073048070471fb642e185a2a113c817e00c WHIRLPOOL c21b1cbf276d60fae48c9178b7ae56416c81af4729341e9251b95c50775a3fdaf147c8d1d0e7c33b9477cd215ea4c0c51ac22e16348d2dfd9af20587d53f4b32
+DIST amanda-3.5.tar.gz 5386719 SHA256 099eb36321b1360ebde6156fb1e75f3e0245520b6f886a0e8e0f31a7a6169be4 SHA512 31340eb250972b2d7b2ad5e51c4f3fafb9de15b9f51f688447214174c77ea89d344f50709ca51d6ba965f8ed6977608f22d7bc6811cc97b63207f7a7cec8219c WHIRLPOOL b6d12e046203f3f553e197215c1da8ed610f07a34ac6b8ca7e5b11846308d1ee490aaaaeee8daeae94b8b6b18fcb18bc26e434dc95042d08b443118ccb504801
+EBUILD amanda-3.3.9.ebuild 16036 SHA256 5b67f5d069e07a48107619859d5f2a7581ba1eb8f6cc169cec788b9b25627637 SHA512 bdad3638e00cd1dacea03f2d3bf65c3e4d0583d65e5a6225b7c662b15811a589f66a0efce3a0278437c86c3fee3b158d0f68df06d184898e1ed21f53290909ed WHIRLPOOL 4bf2fc533b6d913d324a037e11f2a2df65ab92c67e11e80426526426f3ba3ff6248125042fafda10ffce95fc6464d50b59fa8a454f511ed4d0c8a9e0cc7e78b7
+EBUILD amanda-3.4.1.ebuild 16498 SHA256 a2e11040f80fe04ebccb91b85646293cd70ceddedb25417fb4548258b310344c SHA512 bc02c4d64af086d84780ae834e3e3d908a2ea1d35d48566b546b1be64ea2d17c771715b88defb7ce7066717a6a6dd8a1b30255d4a71daeab51b00811814fff25 WHIRLPOOL 5bb42bf6f4335ec291aa8ddbe7caf79573cc8d69837fd5e1f37c47660eddbc1b175cefd460cfe17b2d3ef87091da020dd106592f813833bedfe9637e8fe1d37d
+EBUILD amanda-3.4.2.ebuild 16404 SHA256 0570908d57a2104337f4fd80bdbffda465f853841fe7e2b3d3c83c8a6b6934f7 SHA512 a515bcac574e1e372d1031bf62861229848db57b38b93636cba7d419b3df931261df2973c2a866ec76b865d6c51c18d2cd4e26506007ab5066f77b2ecf52fbe3 WHIRLPOOL a65376e768697bbf3320499dabd4b6f6dc06a4625cbbceed1292246426b46b8e0c0592e421b2d25bfbbee630cc2b92323e0290a741570049aa587c992d55947e
+EBUILD amanda-3.4.3.ebuild 16404 SHA256 0570908d57a2104337f4fd80bdbffda465f853841fe7e2b3d3c83c8a6b6934f7 SHA512 a515bcac574e1e372d1031bf62861229848db57b38b93636cba7d419b3df931261df2973c2a866ec76b865d6c51c18d2cd4e26506007ab5066f77b2ecf52fbe3 WHIRLPOOL a65376e768697bbf3320499dabd4b6f6dc06a4625cbbceed1292246426b46b8e0c0592e421b2d25bfbbee630cc2b92323e0290a741570049aa587c992d55947e
+EBUILD amanda-3.4.4.ebuild 16404 SHA256 0570908d57a2104337f4fd80bdbffda465f853841fe7e2b3d3c83c8a6b6934f7 SHA512 a515bcac574e1e372d1031bf62861229848db57b38b93636cba7d419b3df931261df2973c2a866ec76b865d6c51c18d2cd4e26506007ab5066f77b2ecf52fbe3 WHIRLPOOL a65376e768697bbf3320499dabd4b6f6dc06a4625cbbceed1292246426b46b8e0c0592e421b2d25bfbbee630cc2b92323e0290a741570049aa587c992d55947e
+EBUILD amanda-3.4.5.ebuild 16404 SHA256 0570908d57a2104337f4fd80bdbffda465f853841fe7e2b3d3c83c8a6b6934f7 SHA512 a515bcac574e1e372d1031bf62861229848db57b38b93636cba7d419b3df931261df2973c2a866ec76b865d6c51c18d2cd4e26506007ab5066f77b2ecf52fbe3 WHIRLPOOL a65376e768697bbf3320499dabd4b6f6dc06a4625cbbceed1292246426b46b8e0c0592e421b2d25bfbbee630cc2b92323e0290a741570049aa587c992d55947e
+EBUILD amanda-3.5.ebuild 16432 SHA256 ab391d4e7466344f16ca2742c08091c25a46e229e7b1ee61a0ef95e1dd64e573 SHA512 ea0f5f3b14756a6d7963676b5a900221c742602b804b65498d24ab99da7a4ade73eb257143dd671e6b9a8e7fb2adb2c0baed6155d884fc280e2704e01ff1c4cb WHIRLPOOL 70a316091f677df55b64863d978142fceff12fe51c6a807536ca6fe1a42ac3f4f27a4ad7c618db9d16510a741008caa6882958888beb686eac0ed963bfd33c17
+MISC ChangeLog 4708 SHA256 831e7eae515c8fec5369492b7860e85d80daccbbce108f436cbda0cc28b76854 SHA512 4479c9237de008ca99b7b0450b6355c73bcd818dc6a8ac9a6d697b0a318fbe3be461233cf9e0420cc0e19a9efc8e2bcc7b8ce4915438e84a06469e02ac96d605 WHIRLPOOL 9511a0c196f102ab373a8989d27d239bd92dd8ba9e1bfbbc2a020f6830448307438ffbfe7a7a334a4e93645db843f2b93ff7fca1116d268c316c271ad97b8e85
+MISC ChangeLog-2015 29730 SHA256 88035835a53c6f684fac73efcfcfab0b929f27fc9d31cba1cf0af35d94c3e5b7 SHA512 1b4e399131cd7254aa9810591b1f7995e090bf3d7158eb294f2026a9f6c8c9c6d4b0faeb467cda34897de2a3453449c4db5cf6a085c648cc368eeaa335a9c47a WHIRLPOOL 7805794488bc08ca51b19295ff968cee8b05740211323974dd8833f077f5d9b2ad0d7d6941d0a4e963df2056015db6f5765500474148d598b712f3a5bab2c8d5
+MISC metadata.xml 989 SHA256 cec6c3ecc560d78d2c4762e2de7d8af0ebe003126755c360480e7691fd8e3392 SHA512 4a11d8069a15404ef4e7e86ae0838937af6e5997ab654058e5e1c14baa9b9a8bb5768b0b8af663262d8c145a939ed8eaf7a771b7d03cfae0b4fcc31e0cb04c13 WHIRLPOOL 73d4da975102d9cd94cef785d9ef6acb3b2608789ace2a66394d1ab646450f2d55226fe418448335542f77492ef79ee79f6a5336989a5e4b2a4cae71ac011e3d
diff --git a/app-backup/amanda/amanda-3.3.9.ebuild b/app-backup/amanda/amanda-3.3.9.ebuild
new file mode 100644
index 000000000000..70ea0b2ba30e
--- /dev/null
+++ b/app-backup/amanda/amanda-3.3.9.ebuild
@@ -0,0 +1,475 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit autotools eutils perl-module user systemd
+
+DESCRIPTION="The Advanced Maryland Automatic Network Disk Archiver"
+HOMEPAGE="http://www.amanda.org/"
+SRC_URI="mirror://sourceforge/amanda/${P}.tar.gz"
+
+LICENSE="HPND BSD BSD-2 GPL-2+ GPL-3+"
+SLOT="0"
+IUSE="curl gnuplot ipv6 kerberos minimal nls readline s3 samba systemd xfs"
+
+KEYWORDS="amd64 ppc ppc64 ~sparc x86"
+RDEPEND="sys-libs/readline:=
+ virtual/awk
+ app-arch/tar
+ dev-lang/perl:=
+ app-arch/dump
+ net-misc/openssh
+ >=dev-libs/glib-2.26.0
+ nls? ( virtual/libintl )
+ s3? ( >=net-misc/curl-7.10.0 )
+ !s3? ( curl? ( >=net-misc/curl-7.10.0 ) )
+ samba? ( net-fs/samba:= )
+ kerberos? ( app-crypt/mit-krb5 )
+ xfs? ( sys-fs/xfsdump )
+ !minimal? (
+ dev-perl/XML-Simple
+ virtual/mailx
+ app-arch/mt-st:=
+ sys-block/mtx
+ gnuplot? ( sci-visualization/gnuplot )
+ app-crypt/aespipe
+ app-crypt/gnupg
+ )"
+
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ nls? ( sys-devel/gettext )
+ >=app-text/docbook-xsl-stylesheets-1.72.0
+ app-text/docbook-xml-dtd
+ dev-libs/libxslt
+ "
+
+MYFILESDIR="${T}/files"
+ENVDIR="/etc/env.d"
+ENVDFILE="97amanda"
+TMPENVFILE="${T}/${ENVDFILE}"
+
+# This is a complete list of Amanda settings that the ebuild takes from the
+# build environment. This allows users to alter the behavior of the package as
+# upstream intended, but keeping with Gentoo style. We store a copy of them in
+# /etc/env.d/97amanda during the install, so that they are preserved for future
+# installed. This variable name must not start with AMANDA_, as we do not want
+# it captured into the env file.
+ENV_SETTINGS_AMANDA="
+AMANDA_GROUP_GID AMANDA_GROUP_NAME
+AMANDA_USER_NAME AMANDA_USER_UID AMANDA_USER_SH AMANDA_USER_HOMEDIR AMANDA_USER_GROUPS
+AMANDA_SERVER AMANDA_SERVER_TAPE AMANDA_SERVER_INDEX
+AMANDA_TAR_LISTDIR AMANDA_TAR
+AMANDA_PORTS_UDP AMANDA_PORTS_TCP AMANDA_PORTS_BOTH AMANDA_PORTS
+AMANDA_CONFIG_NAME AMANDA_TMPDIR"
+
+amanda_variable_setup() {
+
+ # Setting vars
+ local currentamanda
+
+ # Grab the current settings
+ currentamanda="$(set | egrep "^AMANDA_" | grep -v '^AMANDA_ENV_SETTINGS' | xargs)"
+
+ # First we set the defaults
+ [ -z "${AMANDA_GROUP_GID}" ] && AMANDA_GROUP_GID=87
+ [ -z "${AMANDA_GROUP_NAME}" ] && AMANDA_GROUP_NAME=amanda
+ [ -z "${AMANDA_USER_NAME}" ] && AMANDA_USER_NAME=amanda
+ [ -z "${AMANDA_USER_UID}" ] && AMANDA_USER_UID=87
+ [ -z "${AMANDA_USER_SH}" ] && AMANDA_USER_SH=/bin/bash
+ [ -z "${AMANDA_USER_HOMEDIR}" ] && AMANDA_USER_HOMEDIR=/var/spool/amanda
+ [ -z "${AMANDA_USER_GROUPS}" ] && AMANDA_USER_GROUPS="${AMANDA_GROUP_NAME}"
+
+ # This installs Amanda, with the server. However, it could be a client,
+ # just specify an alternate server name in AMANDA_SERVER.
+ [ -z "${AMANDA_SERVER}" ] && AMANDA_SERVER="${HOSTNAME}"
+ [ -z "${AMANDA_SERVER_TAPE}" ] && AMANDA_SERVER_TAPE="${AMANDA_SERVER}"
+ [ -z "${AMANDA_SERVER_INDEX}" ] && AMANDA_SERVER_INDEX="${AMANDA_SERVER}"
+ [ -z "${AMANDA_TAR_LISTDIR}" ] && AMANDA_TAR_LISTDIR=${AMANDA_USER_HOMEDIR}/tar-lists
+ [ -z "${AMANDA_CONFIG_NAME}" ] && AMANDA_CONFIG_NAME=DailySet1
+ [ -z "${AMANDA_TMPDIR}" ] && AMANDA_TMPDIR=/var/tmp/amanda
+ [ -z "${AMANDA_DBGDIR}" ] && AMANDA_DBGDIR="$AMANDA_TMPDIR"
+ # These are left empty by default
+ [ -z "${AMANDA_PORTS_UDP}" ] && AMANDA_PORTS_UDP=
+ [ -z "${AMANDA_PORTS_TCP}" ] && AMANDA_PORTS_TCP=
+ [ -z "${AMANDA_PORTS_BOTH}" ] && AMANDA_PORTS_BOTH=
+ [ -z "${AMANDA_PORTS}" ] && AMANDA_PORTS=
+
+ # What tar to use
+ [ -z "${AMANDA_TAR}" ] && AMANDA_TAR=/bin/tar
+
+ # Now pull in the old stuff
+ if [ -f "${ROOT}${ENVDIR}/${ENVDFILE}" ]; then
+ # We don't just source it as we don't want everything in there.
+ eval $(egrep "^AMANDA_" "${ROOT}${ENVDIR}/${ENVDFILE}" | grep -v '^AMANDA_ENV_SETTINGS')
+ fi
+
+ # Re-apply the new settings if any
+ [ -n "${currentamanda}" ] && eval `echo "${currentamanda}"`
+
+}
+
+pkg_setup() {
+ amanda_variable_setup
+
+ # If USE=minimal, give out a warning, if AMANDA_SERVER is not set to
+ # another host than HOSTNAME.
+ if use minimal && [ "${AMANDA_SERVER}" = "${HOSTNAME}" ] ; then
+ elog "You are installing a client-only version of Amanda."
+ elog "You should set the variable \$AMANDA_SERVER to point at your"
+ elog "Amanda-tape-server, otherwise you will have to specify its name"
+ elog "when using amrecover on the client."
+ elog "For example: Use something like"
+ elog "AMANDA_SERVER=\"myserver\" emerge amanda"
+ elog
+ fi
+
+ enewgroup "${AMANDA_GROUP_NAME}" "${AMANDA_GROUP_GID}"
+ enewuser "${AMANDA_USER_NAME}" "${AMANDA_USER_UID}" "${AMANDA_USER_SH}" "${AMANDA_USER_HOMEDIR}" "${AMANDA_USER_GROUPS}"
+}
+
+src_unpack() {
+ # we do not want the perl src_unpack
+ default_src_unpack
+}
+
+src_prepare() {
+ # gentoo bug #331111
+ sed -i '/^check-local: check-perl$/d' "${S}"/config/automake/scripts.am
+ sed -i '/^check-local:/s,syntax-check,,g' "${S}"/perl/Makefile.am
+
+ # bug with glibc-2.16.0
+ sed -i -e '/gets is a security/d' "${S}"/gnulib/stdio.in.h
+
+ eautoreconf
+
+ # places for us to work in
+ mkdir -p "${MYFILESDIR}"
+ # Now we store the settings we just created
+ set | egrep "^AMANDA_" | grep -v '^AMANDA_ENV_SETTINGS' > "${TMPENVFILE}"
+
+ # Prepare our custom files
+ einfo "Building custom configuration files"
+ local i # our iterator
+ local sedexpr # var for sed expr
+ sedexpr=''
+ for i in ${ENV_SETTINGS_AMANDA} ; do
+ local val
+ eval "val=\"\${${i}}\""
+ sedexpr="${sedexpr}s|__${i}__|${val}|g;"
+ done
+
+ # now apply the sed expr
+ for i in "${FILESDIR}"/amanda-* ; do
+ sed -re "${sedexpr}" <"${i}" >"${MYFILESDIR}/`basename ${i}`"
+ done
+
+ (
+ cat "${MYFILESDIR}"/amanda-amandahosts-client-2.5.1_p3-r1
+ use minimal || cat "${MYFILESDIR}"/amanda-amandahosts-server-2.5.1_p3-r1
+ ) > "${T}"/amandahosts
+
+ if ! use minimal; then
+ sed -i -e 's:^\(my $amandahomedir\)=.*:\1 = $localstatedir;:' \
+ server-src/am{addclient,serverconfig}.pl || die
+ fi
+
+ epatch "${FILESDIR}"/${P}-stuck.patch
+}
+
+src_configure() {
+ # fix bug #36316
+ addpredict /var/cache/samba/gencache.tdb
+ # fix bug #376169
+ addpredict /run/blkid
+ addpredict /etc/blkid.tab
+
+ [ ! -f "${TMPENVFILE}" ] && die "Variable setting file (${TMPENVFILE}) should exist!"
+ source "${TMPENVFILE}"
+ local myconf
+
+ einfo "Using ${AMANDA_SERVER_TAPE} for tape server."
+ myconf="${myconf} --with-tape-server=${AMANDA_SERVER_TAPE}"
+ einfo "Using ${AMANDA_SERVER_INDEX} for index server."
+ myconf="${myconf} --with-index-server=${AMANDA_SERVER_INDEX}"
+ einfo "Using ${AMANDA_USER_NAME} for amanda user."
+ myconf="${myconf} --with-user=${AMANDA_USER_NAME}"
+ einfo "Using ${AMANDA_GROUP_NAME} for amanda group."
+ myconf="${myconf} --with-group=${AMANDA_GROUP_NAME}"
+ einfo "Using ${AMANDA_TAR} as Tar implementation."
+ myconf="${myconf} --with-gnutar=${AMANDA_TAR}"
+ einfo "Using ${AMANDA_TAR_LISTDIR} as tar listdir."
+ myconf="${myconf} --with-gnutar-listdir=${AMANDA_TAR_LISTDIR}"
+ einfo "Using ${AMANDA_CONFIG_NAME} as default config name."
+ myconf="${myconf} --with-config=${AMANDA_CONFIG_NAME}"
+ einfo "Using ${AMANDA_TMPDIR} as Amanda temporary directory."
+ myconf="${myconf} --with-tmpdir=${AMANDA_TMPDIR}"
+
+ if [ -n "${AMANDA_PORTS_UDP}" ] && [ -n "${AMANDA_PORTS_TCP}" ] && [ -z "${AMANDA_PORTS_BOTH}" ] ; then
+ eerror "If you want _both_ UDP and TCP ports, please use only the"
+ eerror "AMANDA_PORTS environment variable for identical ports, or set"
+ eerror "AMANDA_PORTS_BOTH."
+ die "Bad port setup!"
+ fi
+ if [ -n "${AMANDA_PORTS_UDP}" ]; then
+ einfo "Using UDP ports ${AMANDA_PORTS_UDP/,/-}"
+ myconf="${myconf} --with-udpportrange=${AMANDA_PORTS_UDP}"
+ fi
+ if [ -n "${AMANDA_PORTS_TCP}" ]; then
+ einfo "Using TCP ports ${AMANDA_PORTS_TCP/,/-}"
+ myconf="${myconf} --with-tcpportrange=${AMANDA_PORTS_TCP}"
+ fi
+ if [ -n "${AMANDA_PORTS}" ]; then
+ einfo "Using ports ${AMANDA_PORTS/,/-}"
+ myconf="${myconf} --with-portrange=${AMANDA_PORTS}"
+ fi
+
+ # Extras
+ # Speed option
+ myconf="${myconf} --with-buffered-dump"
+ # "debugging" in the configuration is NOT debug in the conventional sense.
+ # It is actually just useful output in the application, and should remain
+ # enabled. There are some cases of breakage with MTX tape changers as of
+ # 2.5.1p2 that it exposes when turned off as well.
+ myconf="${myconf} --with-debugging"
+ # Where to put our files
+ myconf="${myconf} --localstatedir=${AMANDA_USER_HOMEDIR}"
+
+ # Samba support
+ myconf="${myconf} `use_with samba smbclient /usr/bin/smbclient`"
+
+ # Support for BSD, SSH, BSDUDP, BSDTCP security methods all compiled in by
+ # default
+ myconf="${myconf} --with-bsd-security"
+ myconf="${myconf} --with-ssh-security"
+ myconf="${myconf} --with-bsdudp-security"
+ myconf="${myconf} --with-bsdtcp-security"
+
+ # kerberos-security mechanism version 5
+ myconf="${myconf} `use_with kerberos krb5-security`"
+
+ # Amazon S3 support
+ myconf="${myconf} `use_enable s3 s3-device`"
+
+ # libcurl is required for S3 but otherwise optional
+ if ! use s3; then
+ myconf="${myconf} $(use_with curl libcurl)"
+ fi
+
+ # Client only, as requested in bug #127725
+ if use minimal ; then
+ myconf="${myconf} --without-server"
+ else
+ # amplot
+ myconf="${myconf} $(use_with gnuplot)"
+ fi
+
+ # IPv6 fun.
+ myconf="${myconf} `use_with ipv6`"
+ # This is to prevent the IPv6-is-working test
+ # As the test fails on binpkg build hosts with no IPv6.
+ use ipv6 && export amanda_cv_working_ipv6=yes
+
+ # I18N
+ myconf="${myconf} `use_enable nls`"
+
+ # Bug #296634: Perl location
+ perl_set_version
+ myconf="${myconf} --with-amperldir=${VENDOR_LIB}"
+
+ # Bug 296633: --disable-syntax-checks
+ # Some tests are not safe for production systems
+ myconf="${myconf} --disable-syntax-checks"
+
+ # build manpages
+ myconf="${myconf} --enable-manpage-build"
+
+ # bug #483120
+ tc-export AR
+
+ econf \
+ $(use_with readline) \
+ ${myconf}
+}
+
+src_compile() {
+ # Again, do not want the perl-module src_compile
+ default_src_compile
+}
+
+src_install() {
+ [ ! -f "${TMPENVFILE}" ] && die "Variable setting file (${TMPENVFILE}) should exist!"
+ source ${TMPENVFILE}
+
+ einfo "Doing stock install"
+ emake DESTDIR="${D}" install || die
+
+ # Build the envdir file
+ # Don't forget this..
+ einfo "Building environment file"
+ (
+ echo "# These settings are what was present in the environment when this"
+ echo "# Amanda was compiled. Changing anything below this comment will"
+ echo "# have no effect on your application, but it merely exists to"
+ echo "# preserve them for your next emerge of Amanda"
+ cat "${TMPENVFILE}" | sed "s,=\$,='',g"
+ ) >> "${MYFILESDIR}/${ENVDFILE}"
+
+ # Env.d
+ einfo "Installing environment config file"
+ doenvd "${MYFILESDIR}/${ENVDFILE}"
+
+ # Lock down next section (up until docs).
+ insopts -m0640
+ # Installing Amanda Xinetd Services Definition
+ einfo "Installing xinetd service file"
+ insinto /etc/xinetd.d
+ if use minimal ; then
+ newins "${MYFILESDIR}"/amanda-xinetd-2.6.1_p1-client amanda
+ else
+ newins "${MYFILESDIR}"/amanda-xinetd-2.6.1_p1-server amanda
+ fi
+
+ if ! use minimal; then
+ einfo "Installing Sample Daily Cron Job for Amanda"
+ insinto /etc/cron.daily
+ newins "${MYFILESDIR}/amanda-cron" amanda
+ fi
+
+ einfo "Installing systemd service and socket files for Amanda"
+ systemd_dounit "${FILESDIR}"/amanda.socket || die
+ systemd_newunit "${FILESDIR}"/amanda.service-r1 'amanda@.service' || die
+
+ insinto /etc/amanda
+ einfo "Installing .amandahosts File for ${AMANDA_USER_NAME} user"
+ doins "${T}/amandahosts"
+ fperms 600 /etc/amanda/amandahosts
+
+ dosym /etc/amanda/amandahosts "${AMANDA_USER_HOMEDIR}/.amandahosts"
+ insinto "${AMANDA_USER_HOMEDIR}"
+ einfo "Installing .profile for ${AMANDA_USER_NAME} user"
+ newins "${MYFILESDIR}/amanda-profile" .profile
+
+ insinto /etc/amanda
+ doins "${S}/example/amanda-client.conf"
+ if ! use minimal ; then
+ insinto "/etc/amanda/${AMANDA_CONFIG_NAME}"
+ doins "${S}/example/amanda.conf"
+ doins "${S}/example/disklist"
+ keepdir "${AMANDA_USER_HOMEDIR}/${AMANDA_CONFIG_NAME}/index"
+ fi
+
+ keepdir "${AMANDA_TAR_LISTDIR}"
+ keepdir "${AMANDA_USER_HOMEDIR}/amanda"
+ keepdir "${AMANDA_TMPDIR}/dumps"
+ # Just make sure it exists for XFS to work...
+ use xfs && keepdir /var/xfsdump/inventory
+
+ local i
+ for i in "${AMANDA_USER_HOMEDIR}" "${AMANDA_TAR_LISTDIR}" \
+ "${AMANDA_TMPDIR}" /etc/amanda; do
+ einfo "Securing directory (${i})"
+ fowners -R ${AMANDA_USER_NAME}:${AMANDA_GROUP_NAME} ${i}
+ done
+ # Do NOT use -R
+ fperms 0700 \
+ "${AMANDA_USER_HOMEDIR}" "${AMANDA_TAR_LISTDIR}" \
+ "${AMANDA_TMPDIR}" "${AMANDA_TMPDIR}/dumps" \
+ "${AMANDA_USER_HOMEDIR}/amanda" \
+ /etc/amanda
+
+ if ! use minimal ; then
+ fperms 0700 \
+ "${AMANDA_USER_HOMEDIR}/${AMANDA_CONFIG_NAME}" \
+ /etc/amanda/${AMANDA_CONFIG_NAME}
+ fi
+
+ einfo "Setting setuid permissions"
+ amanda_permissions_fix "${D}"
+
+ # Relax permissions again
+ insopts -m0644
+
+ # docs
+ einfo "Installing documentation"
+ dodoc AUTHORS ChangeLog DEVELOPING NEWS README ReleaseNotes UPGRADING
+ # our inetd sample
+ einfo "Installing standard inetd sample"
+ newdoc "${MYFILESDIR}/amanda-inetd.amanda.sample-2.6.0_p2-r2" amanda-inetd.amanda.sample
+ # Amanda example configs
+ einfo "Installing example configurations"
+ rm "${D}"/usr/share/amanda/{COPYRIGHT,ChangeLog,NEWS,ReleaseNotes}
+ mv "${D}/usr/share/amanda/example" "${D}/usr/share/doc/${PF}/"
+ docinto example1
+ newdoc "${FILESDIR}/example_amanda.conf" amanda.conf
+ newdoc "${FILESDIR}/example_disklist-2.5.1_p3-r1" disklist
+ newdoc "${FILESDIR}/example_global.conf" global.conf
+
+ einfo "Cleaning up dud .la files"
+ perl_set_version
+ find "${D}"/"${VENDOR_LIB}" -name '*.la' -print0 |xargs -0 rm -f
+}
+
+pkg_postinst() {
+ [ ! -f "${TMPENVFILE}" -a "$MERGE_TYPE" == "binary" ] && \
+ TMPENVFILE="${ROOT}${ENVDIR}/${ENVDFILE}"
+ [ ! -f "${TMPENVFILE}" ] && die "Variable setting file (${TMPENVFILE}) should exist!"
+ source "${TMPENVFILE}"
+
+ # Migration of amandates from /etc to $localstatedir/amanda
+ if [ -f "${ROOT}/etc/amandates" -a \
+ ! -f "${ROOT}/${AMANDA_USER_HOMEDIR}/amanda/amandates" ]; then
+ einfo "Migrating amandates from /etc/ to ${AMANDA_USER_HOMEDIR}/amanda"
+ einfo "A backup is also placed at /etc/amandates.orig"
+ cp -dp "${ROOT}/etc/amandates" "${ROOT}/etc/amandates.orig"
+ mkdir -p "${ROOT}/${AMANDA_USER_HOMEDIR}/amanda/"
+ cp -dp "${ROOT}/etc/amandates" "${ROOT}/${AMANDA_USER_HOMEDIR}/amanda/amandates"
+ fi
+ if [ -f "${ROOT}/etc/amandates" ]; then
+ einfo "If you have migrated safely, please delete /etc/amandates"
+ fi
+
+ einfo "Checking setuid permissions"
+ amanda_permissions_fix "${ROOT}"
+
+ elog "You should configure Amanda in /etc/amanda now."
+ elog
+ elog "If you use xinetd, Don't forget to check /etc/xinetd.d/amanda"
+ elog "and restart xinetd afterwards!"
+ elog
+ elog "Otherwise, please look at /usr/share/doc/${PF}/inetd.amanda.sample"
+ elog "as an example of how to configure your inetd."
+ elog
+ elog "systemd-users: enable and start amanda.socket or the relevant services"
+ elog "regarding what auth method you use."
+ elog
+ elog "NOTICE: If you need raw access to partitions you need to add the"
+ elog "amanda user to the 'disk' group."
+ elog
+ elog "NOTICE: If you have a tape changer, you need to add the amanda user"
+ elog "to the 'tape' group."
+ elog
+ elog "If you use localhost in your disklist your restores may break."
+ elog "You should replace it with the actual hostname!"
+ elog "Please also see the syntax changes to amandahosts."
+ elog "The only exception is when you use the authentication method 'local'."
+
+ elog "Please note that this package no longer explicitly depends on"
+ elog "virtual/inetd, as it supports modes where an inetd is not needed"
+ elog "(see bug #506028 for details)."
+}
+
+# We have had reports of amanda file permissions getting screwed up.
+# Losing setuid, becoming too lax etc.
+# ONLY root and users in the amanda group should be able to run these binaries!
+amanda_permissions_fix() {
+ local root="$1"
+ [ -z "${root}" ] && die "Failed to pass root argument to amanda_permissions_fix!"
+ local le="/usr/libexec/amanda"
+ for i in /usr/sbin/amcheck "${le}"/calcsize "${le}"/killpgrp \
+ "${le}"/rundump "${le}"/runtar "${le}"/dumper \
+ "${le}"/planner ; do
+ chown root:${AMANDA_GROUP_NAME} "${root}"/${i}
+ chmod u=srwx,g=rx,o= "${root}"/${i}
+ done
+}
diff --git a/app-backup/amanda/amanda-3.4.1.ebuild b/app-backup/amanda/amanda-3.4.1.ebuild
new file mode 100644
index 000000000000..3171fd4f7c86
--- /dev/null
+++ b/app-backup/amanda/amanda-3.4.1.ebuild
@@ -0,0 +1,482 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit autotools perl-module user systemd
+
+DESCRIPTION="The Advanced Maryland Automatic Network Disk Archiver"
+HOMEPAGE="http://www.amanda.org/"
+SRC_URI="mirror://sourceforge/amanda/${P}.tar.gz"
+
+LICENSE="HPND BSD BSD-2 GPL-2+ GPL-3+"
+SLOT="0"
+IUSE="curl gnuplot ipv6 kerberos minimal nls readline s3 samba systemd xfs"
+
+KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86"
+RDEPEND="sys-libs/readline:=
+ virtual/awk
+ app-arch/tar
+ dev-lang/perl:=
+ app-arch/dump
+ net-misc/openssh
+ >=dev-libs/glib-2.26.0
+ dev-perl/JSON
+ dev-perl/Encode-Locale
+ nls? ( virtual/libintl )
+ s3? ( >=net-misc/curl-7.10.0 )
+ !s3? ( curl? ( >=net-misc/curl-7.10.0 ) )
+ samba? ( net-fs/samba:= )
+ kerberos? ( app-crypt/mit-krb5 )
+ xfs? ( sys-fs/xfsdump )
+ !minimal? (
+ dev-perl/XML-Simple
+ virtual/mailx
+ app-arch/mt-st:=
+ sys-block/mtx
+ gnuplot? ( sci-visualization/gnuplot )
+ app-crypt/aespipe
+ app-crypt/gnupg
+ )"
+
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ nls? ( sys-devel/gettext )
+ >=app-text/docbook-xsl-stylesheets-1.72.0
+ app-text/docbook-xml-dtd
+ dev-libs/libxslt
+ dev-lang/swig
+ "
+
+MYFILESDIR="${T}/files"
+ENVDIR="/etc/env.d"
+ENVDFILE="97amanda"
+TMPENVFILE="${T}/${ENVDFILE}"
+
+# This is a complete list of Amanda settings that the ebuild takes from the
+# build environment. This allows users to alter the behavior of the package as
+# upstream intended, but keeping with Gentoo style. We store a copy of them in
+# /etc/env.d/97amanda during the install, so that they are preserved for future
+# installed. This variable name must not start with AMANDA_, as we do not want
+# it captured into the env file.
+ENV_SETTINGS_AMANDA="
+AMANDA_GROUP_GID AMANDA_GROUP_NAME
+AMANDA_USER_NAME AMANDA_USER_UID AMANDA_USER_SH AMANDA_USER_HOMEDIR AMANDA_USER_GROUPS
+AMANDA_SERVER AMANDA_SERVER_TAPE AMANDA_SERVER_TAPE_DEVICE AMANDA_SERVER_INDEX
+AMANDA_TAR_LISTDIR AMANDA_TAR
+AMANDA_PORTS_UDP AMANDA_PORTS_TCP AMANDA_PORTS_BOTH AMANDA_PORTS
+AMANDA_CONFIG_NAME AMANDA_TMPDIR"
+
+amanda_variable_setup() {
+
+ # Setting vars
+ local currentamanda
+
+ # Grab the current settings
+ currentamanda="$(set | egrep "^AMANDA_" | grep -v '^AMANDA_ENV_SETTINGS' | xargs)"
+
+ # First we set the defaults
+ [[ -z "${AMANDA_GROUP_GID}" ]] && AMANDA_GROUP_GID=87
+ [[ -z "${AMANDA_GROUP_NAME}" ]] && AMANDA_GROUP_NAME=amanda
+ [[ -z "${AMANDA_USER_NAME}" ]] && AMANDA_USER_NAME=amanda
+ [[ -z "${AMANDA_USER_UID}" ]] && AMANDA_USER_UID=87
+ [[ -z "${AMANDA_USER_SH}" ]] && AMANDA_USER_SH=/bin/bash
+ [[ -z "${AMANDA_USER_HOMEDIR}" ]] && AMANDA_USER_HOMEDIR=/var/spool/amanda
+ [[ -z "${AMANDA_USER_GROUPS}" ]] && AMANDA_USER_GROUPS="${AMANDA_GROUP_NAME}"
+
+ # This installs Amanda, with the server. However, it could be a client,
+ # just specify an alternate server name in AMANDA_SERVER.
+ [[ -z "${AMANDA_SERVER}" ]] && AMANDA_SERVER="${HOSTNAME}"
+ [[ -z "${AMANDA_SERVER_TAPE}" ]] && AMANDA_SERVER_TAPE="${AMANDA_SERVER}"
+ [[ -z "${AMANDA_SERVER_TAPE_DEVICE}" ]] && AMANDA_SERVER_TAPE_DEVICE="/dev/nst0"
+ [[ -z "${AMANDA_SERVER_INDEX}" ]] && AMANDA_SERVER_INDEX="${AMANDA_SERVER}"
+ [[ -z "${AMANDA_TAR_LISTDIR}" ]] && AMANDA_TAR_LISTDIR=${AMANDA_USER_HOMEDIR}/tar-lists
+ [[ -z "${AMANDA_CONFIG_NAME}" ]] && AMANDA_CONFIG_NAME=DailySet1
+ [[ -z "${AMANDA_TMPDIR}" ]] && AMANDA_TMPDIR=/var/tmp/amanda
+ [[ -z "${AMANDA_DBGDIR}" ]] && AMANDA_DBGDIR="$AMANDA_TMPDIR"
+ # These are left empty by default
+ [[ -z "${AMANDA_PORTS_UDP}" ]] && AMANDA_PORTS_UDP=
+ [[ -z "${AMANDA_PORTS_TCP}" ]] && AMANDA_PORTS_TCP=
+ [[ -z "${AMANDA_PORTS_BOTH}" ]] && AMANDA_PORTS_BOTH=
+ [[ -z "${AMANDA_PORTS}" ]] && AMANDA_PORTS=
+
+ # What tar to use
+ [[ -z "${AMANDA_TAR}" ]] && AMANDA_TAR=/bin/tar
+
+ # Now pull in the old stuff
+ if [[ -f "${EROOT}${ENVDIR}/${ENVDFILE}" ]]; then
+ # We don't just source it as we don't want everything in there.
+ eval $(egrep "^AMANDA_" "${EROOT}${ENVDIR}/${ENVDFILE}" | grep -v '^AMANDA_ENV_SETTINGS')
+ fi
+
+ # Re-apply the new settings if any
+ [ -n "${currentamanda}" ] && eval $(echo "${currentamanda}")
+
+}
+
+pkg_setup() {
+ amanda_variable_setup
+
+ # If USE=minimal, give out a warning, if AMANDA_SERVER is not set to
+ # another host than HOSTNAME.
+ if use minimal && [ "${AMANDA_SERVER}" = "${HOSTNAME}" ] ; then
+ elog "You are installing a client-only version of Amanda."
+ elog "You should set the variable \$AMANDA_SERVER to point at your"
+ elog "Amanda-tape-server, otherwise you will have to specify its name"
+ elog "when using amrecover on the client."
+ elog "For example: Use something like"
+ elog "AMANDA_SERVER=\"myserver\" emerge amanda"
+ elog
+ fi
+
+ enewgroup "${AMANDA_GROUP_NAME}" "${AMANDA_GROUP_GID}"
+ enewuser "${AMANDA_USER_NAME}" "${AMANDA_USER_UID}" "${AMANDA_USER_SH}" "${AMANDA_USER_HOMEDIR}" "${AMANDA_USER_GROUPS}"
+}
+
+src_unpack() {
+ # we do not want the perl src_unpack
+ default_src_unpack
+}
+
+src_prepare() {
+ # gentoo bug #331111
+ sed -i '/^check-local: check-perl$/d' "${S}"/config/automake/scripts.am || die
+ sed -i '/^check-local:/s,syntax-check,,g' "${S}"/perl/Makefile.am || die
+
+ # bug with glibc-2.16.0
+ sed -i -e '/gets is a security/d' "${S}"/gnulib/stdio.in.h || die
+
+ eautoreconf
+
+ # places for us to work in
+ mkdir -p "${MYFILESDIR}" || die
+ # Now we store the settings we just created
+ set | egrep "^AMANDA_" | grep -v '^AMANDA_ENV_SETTINGS' > "${TMPENVFILE}" || die
+
+ # Prepare our custom files
+ einfo "Building custom configuration files"
+ local i # our iterator
+ local sedexpr # var for sed expr
+ sedexpr=''
+ for i in ${ENV_SETTINGS_AMANDA} ; do
+ local val
+ eval "val=\"\${${i}}\""
+ sedexpr="${sedexpr}s|__${i}__|${val}|g;"
+ done
+
+ # now apply the sed expr
+ for i in "${FILESDIR}"/amanda-* ; do
+ sed -re "${sedexpr}" <"${i}" >"${MYFILESDIR}/`basename ${i}`" || die
+ done
+
+ if use minimal; then
+ cat "${MYFILESDIR}"/amanda-amandahosts-server.5.1_p3-r1 > "${T}"/amandahosts || die
+ else
+ sed -i -e 's:^\(my $amandahomedir\)=.*:\1 = $localstatedir;:' \
+ server-src/am{addclient,serverconfig}.pl || die
+ cat "${MYFILESDIR}"/amanda-amandahosts-client-2.5.1_p3-r1 > "${T}"/amandahosts || die
+ fi
+
+ eapply "${FILESDIR}"/${P}-slots.patch || die
+ eapply "${FILESDIR}"/${P}-labelstr.patch || die
+
+ eapply_user
+}
+
+src_configure() {
+ # fix bug #36316
+ addpredict /var/cache/samba/gencache.tdb
+ # fix bug #376169
+ addpredict /run/blkid
+ addpredict /etc/blkid.tab
+
+ [ ! -f "${TMPENVFILE}" ] && die "Variable setting file (${TMPENVFILE}) should exist!"
+ source "${TMPENVFILE}"
+ local myconf
+
+ einfo "Using ${AMANDA_SERVER_TAPE} for tape server."
+ myconf="${myconf} --with-tape-server=${AMANDA_SERVER_TAPE}"
+ einfo "Using ${AMANDA_SERVER_TAPE_DEVICE} for tape server."
+ myconf="${myconf} --with-tape-device=${AMANDA_SERVER_TAPE_DEVICE}"
+ einfo "Using ${AMANDA_SERVER_INDEX} for index server."
+ myconf="${myconf} --with-index-server=${AMANDA_SERVER_INDEX}"
+ einfo "Using ${AMANDA_USER_NAME} for amanda user."
+ myconf="${myconf} --with-user=${AMANDA_USER_NAME}"
+ einfo "Using ${AMANDA_GROUP_NAME} for amanda group."
+ myconf="${myconf} --with-group=${AMANDA_GROUP_NAME}"
+ einfo "Using ${AMANDA_TAR} as Tar implementation."
+ myconf="${myconf} --with-gnutar=${AMANDA_TAR}"
+ einfo "Using ${AMANDA_TAR_LISTDIR} as tar listdir."
+ myconf="${myconf} --with-gnutar-listdir=${AMANDA_TAR_LISTDIR}"
+ einfo "Using ${AMANDA_CONFIG_NAME} as default config name."
+ myconf="${myconf} --with-config=${AMANDA_CONFIG_NAME}"
+ einfo "Using ${AMANDA_TMPDIR} as Amanda temporary directory."
+ myconf="${myconf} --with-tmpdir=${AMANDA_TMPDIR}"
+
+ if [ -n "${AMANDA_PORTS_UDP}" ] && [ -n "${AMANDA_PORTS_TCP}" ] && [ -z "${AMANDA_PORTS_BOTH}" ] ; then
+ eerror "If you want _both_ UDP and TCP ports, please use only the"
+ eerror "AMANDA_PORTS environment variable for identical ports, or set"
+ eerror "AMANDA_PORTS_BOTH."
+ die "Bad port setup!"
+ fi
+ if [ -n "${AMANDA_PORTS_UDP}" ]; then
+ einfo "Using UDP ports ${AMANDA_PORTS_UDP/,/-}"
+ myconf="${myconf} --with-udpportrange=${AMANDA_PORTS_UDP}"
+ fi
+ if [ -n "${AMANDA_PORTS_TCP}" ]; then
+ einfo "Using TCP ports ${AMANDA_PORTS_TCP/,/-}"
+ myconf="${myconf} --with-tcpportrange=${AMANDA_PORTS_TCP}"
+ fi
+ if [ -n "${AMANDA_PORTS}" ]; then
+ einfo "Using ports ${AMANDA_PORTS/,/-}"
+ myconf="${myconf} --with-portrange=${AMANDA_PORTS}"
+ fi
+
+ # Extras
+ # Speed option
+ myconf="${myconf} --with-buffered-dump"
+ # "debugging" in the configuration is NOT debug in the conventional sense.
+ # It is actually just useful output in the application, and should remain
+ # enabled. There are some cases of breakage with MTX tape changers as of
+ # 2.5.1p2 that it exposes when turned off as well.
+ myconf="${myconf} --with-debugging"
+ # Where to put our files
+ myconf="${myconf} --localstatedir=${AMANDA_USER_HOMEDIR}"
+
+ # Samba support
+ myconf="${myconf} $(use_with samba smbclient /usr/bin/smbclient)"
+
+ # Support for BSD, SSH, BSDUDP, BSDTCP security methods all compiled in by
+ # default
+ myconf="${myconf} --with-bsd-security"
+ myconf="${myconf} --with-ssh-security"
+ myconf="${myconf} --with-bsdudp-security"
+ myconf="${myconf} --with-bsdtcp-security"
+
+ # kerberos-security mechanism version 5
+ myconf="${myconf} $(use_with kerberos krb5-security)"
+
+ # Amazon S3 support
+ myconf="${myconf} `use_enable s3 s3-device`"
+
+ # libcurl is required for S3 but otherwise optional
+ if ! use s3; then
+ myconf="${myconf} $(use_with curl libcurl)"
+ fi
+
+ # Client only, as requested in bug #127725
+ if use minimal ; then
+ myconf="${myconf} --without-server"
+ else
+ # amplot
+ myconf="${myconf} $(use_with gnuplot)"
+ fi
+
+ # IPv6 fun.
+ myconf="${myconf} `use_with ipv6`"
+ # This is to prevent the IPv6-is-working test
+ # As the test fails on binpkg build hosts with no IPv6.
+ use ipv6 && export amanda_cv_working_ipv6=yes
+
+ # I18N
+ myconf="${myconf} `use_enable nls`"
+
+ # Bug #296634: Perl location
+ perl_set_version
+ myconf="${myconf} --with-amperldir=${VENDOR_LIB}"
+
+ # Bug 296633: --disable-syntax-checks
+ # Some tests are not safe for production systems
+ myconf="${myconf} --disable-syntax-checks"
+
+ # build manpages
+ myconf="${myconf} --enable-manpage-build"
+
+ # bug #483120
+ tc-export AR
+
+ econf \
+ $(use_with readline) \
+ ${myconf}
+}
+
+src_compile() {
+ # Again, do not want the perl-module src_compile
+ default_src_compile
+}
+
+src_install() {
+ [ ! -f "${TMPENVFILE}" ] && die "Variable setting file (${TMPENVFILE}) should exist!"
+ source ${TMPENVFILE}
+
+ einfo "Doing stock install"
+ emake DESTDIR="${D}" install || die
+
+ # Build the envdir file
+ # Don't forget this..
+ einfo "Building environment file"
+ (
+ echo "# These settings are what was present in the environment when this"
+ echo "# Amanda was compiled. Changing anything below this comment will"
+ echo "# have no effect on your application, but it merely exists to"
+ echo "# preserve them for your next emerge of Amanda"
+ cat "${TMPENVFILE}" | sed "s,=\$,='',g"
+ ) >> "${MYFILESDIR}/${ENVDFILE}"
+
+ # Env.d
+ einfo "Installing environment config file"
+ doenvd "${MYFILESDIR}/${ENVDFILE}"
+
+ # Lock down next section (up until docs).
+ insopts -m0640
+ # Installing Amanda Xinetd Services Definition
+ einfo "Installing xinetd service file"
+ insinto /etc/xinetd.d
+ if use minimal ; then
+ newins "${MYFILESDIR}"/amanda-xinetd-2.6.1_p1-client amanda
+ else
+ newins "${MYFILESDIR}"/amanda-xinetd-2.6.1_p1-server amanda
+ fi
+
+ if ! use minimal; then
+ einfo "Installing Sample Daily Cron Job for Amanda"
+ insinto /etc/cron.daily
+ newins "${MYFILESDIR}/amanda-cron" amanda
+ fi
+
+ einfo "Installing systemd service and socket files for Amanda"
+ systemd_dounit "${FILESDIR}"/amanda.socket || die
+ systemd_newunit "${FILESDIR}"/amanda.service 'amanda@.service' || die
+
+ insinto /etc/amanda
+ einfo "Installing .amandahosts File for ${AMANDA_USER_NAME} user"
+ doins "${T}/amandahosts"
+ fperms 600 /etc/amanda/amandahosts
+
+ dosym /etc/amanda/amandahosts "${AMANDA_USER_HOMEDIR}/.amandahosts"
+ insinto "${AMANDA_USER_HOMEDIR}"
+ einfo "Installing .profile for ${AMANDA_USER_NAME} user"
+ newins "${MYFILESDIR}/amanda-profile" .profile
+
+ insinto /etc/amanda
+ doins "${S}/example/amanda-client.conf"
+ if ! use minimal ; then
+ insinto "/etc/amanda/${AMANDA_CONFIG_NAME}"
+ doins "${S}/example/amanda.conf"
+ doins "${S}/example/disklist"
+ keepdir "${AMANDA_USER_HOMEDIR}/${AMANDA_CONFIG_NAME}/index"
+ fi
+
+ keepdir "${AMANDA_TAR_LISTDIR}"
+ keepdir "${AMANDA_USER_HOMEDIR}/amanda"
+ keepdir "${AMANDA_TMPDIR}/dumps"
+ # Just make sure it exists for XFS to work...
+ use xfs && keepdir /var/xfsdump/inventory
+
+ local i
+ for i in "${AMANDA_USER_HOMEDIR}" "${AMANDA_TAR_LISTDIR}" \
+ "${AMANDA_TMPDIR}" /etc/amanda; do
+ einfo "Securing directory (${i})"
+ fowners -R ${AMANDA_USER_NAME}:${AMANDA_GROUP_NAME} ${i}
+ done
+ # Do NOT use -R
+ fperms 0700 \
+ "${AMANDA_USER_HOMEDIR}" "${AMANDA_TAR_LISTDIR}" \
+ "${AMANDA_TMPDIR}" "${AMANDA_TMPDIR}/dumps" \
+ "${AMANDA_USER_HOMEDIR}/amanda" \
+ /etc/amanda
+
+ if ! use minimal ; then
+ fperms 0700 \
+ "${AMANDA_USER_HOMEDIR}/${AMANDA_CONFIG_NAME}" \
+ /etc/amanda/${AMANDA_CONFIG_NAME}
+ fi
+
+ einfo "Setting setuid permissions"
+ amanda_permissions_fix "${D}"
+
+ # Relax permissions again
+ insopts -m0644
+
+ # docs
+ einfo "Installing documentation"
+ dodoc AUTHORS ChangeLog DEVELOPING NEWS README ReleaseNotes UPGRADING
+ # our inetd sample
+ einfo "Installing standard inetd sample"
+ newdoc "${MYFILESDIR}/amanda-inetd.amanda.sample-2.6.0_p2-r2" amanda-inetd.amanda.sample
+ # Amanda example configs
+ einfo "Installing example configurations"
+ rm "${D}"/usr/share/amanda/{COPYRIGHT,ChangeLog,NEWS,ReleaseNotes}
+ mv "${D}/usr/share/amanda/example" "${D}/usr/share/doc/${PF}/"
+ docinto example1
+ newdoc "${FILESDIR}/example_amanda.conf" amanda.conf
+ newdoc "${FILESDIR}/example_disklist-2.5.1_p3-r1" disklist
+ newdoc "${FILESDIR}/example_global.conf" global.conf
+
+ einfo "Cleaning up dud .la files"
+ perl_set_version
+ find "${D}"/"${VENDOR_LIB}" -name '*.la' -print0 |xargs -0 rm -f
+}
+
+pkg_postinst() {
+ [ ! -f "${TMPENVFILE}" -a "$MERGE_TYPE" == "binary" ] && \
+ TMPENVFILE="${ROOT}${ENVDIR}/${ENVDFILE}"
+ [ ! -f "${TMPENVFILE}" ] && die "Variable setting file (${TMPENVFILE}) should exist!"
+ source "${TMPENVFILE}"
+
+ # Migration of amandates from /etc to $localstatedir/amanda
+ if [ -f "${ROOT}/etc/amandates" -a \
+ ! -f "${ROOT}/${AMANDA_USER_HOMEDIR}/amanda/amandates" ]; then
+ einfo "Migrating amandates from /etc/ to ${AMANDA_USER_HOMEDIR}/amanda"
+ einfo "A backup is also placed at /etc/amandates.orig"
+ cp -dp "${ROOT}/etc/amandates" "${ROOT}/etc/amandates.orig"
+ mkdir -p "${ROOT}/${AMANDA_USER_HOMEDIR}/amanda/"
+ cp -dp "${ROOT}/etc/amandates" "${ROOT}/${AMANDA_USER_HOMEDIR}/amanda/amandates"
+ fi
+ if [ -f "${ROOT}/etc/amandates" ]; then
+ einfo "If you have migrated safely, please delete /etc/amandates"
+ fi
+
+ einfo "Checking setuid permissions"
+ amanda_permissions_fix "${ROOT}"
+
+ elog "You should configure Amanda in /etc/amanda now."
+ elog
+ elog "If you use xinetd, Don't forget to check /etc/xinetd.d/amanda"
+ elog "and restart xinetd afterwards!"
+ elog
+ elog "Otherwise, please look at /usr/share/doc/${PF}/inetd.amanda.sample"
+ elog "as an example of how to configure your inetd."
+ elog
+ elog "systemd-users: enable and start amanda.socket or the relevant services"
+ elog "regarding what auth method you use."
+ elog
+ elog "NOTICE: If you need raw access to partitions you need to add the"
+ elog "amanda user to the 'disk' group."
+ elog
+ elog "NOTICE: If you have a tape changer, you need to add the amanda user"
+ elog "to the 'tape' group."
+ elog
+ elog "If you use localhost in your disklist your restores may break."
+ elog "You should replace it with the actual hostname!"
+ elog "Please also see the syntax changes to amandahosts."
+ elog "The only exception is when you use the authentication method 'local'."
+ elog
+ elog "Please note that this package no longer explicitly depends on"
+ elog "virtual/inetd, as it supports modes where an inetd is not needed"
+ elog "(see bug #506028 for details)."
+}
+
+# We have had reports of amanda file permissions getting screwed up.
+# Losing setuid, becoming too lax etc.
+# ONLY root and users in the amanda group should be able to run these binaries!
+amanda_permissions_fix() {
+ local root="$1"
+ [ -z "${root}" ] && die "Failed to pass root argument to amanda_permissions_fix!"
+ local le="/usr/libexec/amanda"
+ for i in /usr/sbin/amcheck "${le}"/calcsize "${le}"/killpgrp \
+ "${le}"/rundump "${le}"/runtar "${le}"/dumper \
+ "${le}"/planner ; do
+ chown root:${AMANDA_GROUP_NAME} "${root}"/${i}
+ chmod u=srwx,g=rx,o= "${root}"/${i}
+ done
+}
diff --git a/app-backup/amanda/amanda-3.4.2.ebuild b/app-backup/amanda/amanda-3.4.2.ebuild
new file mode 100644
index 000000000000..9e26503c1a4a
--- /dev/null
+++ b/app-backup/amanda/amanda-3.4.2.ebuild
@@ -0,0 +1,479 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit autotools perl-module user systemd
+
+DESCRIPTION="The Advanced Maryland Automatic Network Disk Archiver"
+HOMEPAGE="http://www.amanda.org/"
+SRC_URI="mirror://sourceforge/amanda/${P}.tar.gz"
+
+LICENSE="HPND BSD BSD-2 GPL-2+ GPL-3+"
+SLOT="0"
+IUSE="curl gnuplot ipv6 kerberos minimal nls readline s3 samba systemd xfs"
+
+KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86"
+RDEPEND="sys-libs/readline:=
+ virtual/awk
+ app-arch/tar
+ dev-lang/perl:=
+ app-arch/dump
+ net-misc/openssh
+ >=dev-libs/glib-2.26.0
+ dev-perl/JSON
+ dev-perl/Encode-Locale
+ nls? ( virtual/libintl )
+ s3? ( >=net-misc/curl-7.10.0 )
+ !s3? ( curl? ( >=net-misc/curl-7.10.0 ) )
+ samba? ( net-fs/samba:= )
+ kerberos? ( app-crypt/mit-krb5 )
+ xfs? ( sys-fs/xfsdump )
+ !minimal? (
+ dev-perl/XML-Simple
+ virtual/mailx
+ app-arch/mt-st:=
+ sys-block/mtx
+ gnuplot? ( sci-visualization/gnuplot )
+ app-crypt/aespipe
+ app-crypt/gnupg
+ )"
+
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ nls? ( sys-devel/gettext )
+ >=app-text/docbook-xsl-stylesheets-1.72.0
+ app-text/docbook-xml-dtd
+ dev-libs/libxslt
+ dev-lang/swig
+ "
+
+MYFILESDIR="${T}/files"
+ENVDIR="/etc/env.d"
+ENVDFILE="97amanda"
+TMPENVFILE="${T}/${ENVDFILE}"
+
+# This is a complete list of Amanda settings that the ebuild takes from the
+# build environment. This allows users to alter the behavior of the package as
+# upstream intended, but keeping with Gentoo style. We store a copy of them in
+# /etc/env.d/97amanda during the install, so that they are preserved for future
+# installed. This variable name must not start with AMANDA_, as we do not want
+# it captured into the env file.
+ENV_SETTINGS_AMANDA="
+AMANDA_GROUP_GID AMANDA_GROUP_NAME
+AMANDA_USER_NAME AMANDA_USER_UID AMANDA_USER_SH AMANDA_USER_HOMEDIR AMANDA_USER_GROUPS
+AMANDA_SERVER AMANDA_SERVER_TAPE AMANDA_SERVER_TAPE_DEVICE AMANDA_SERVER_INDEX
+AMANDA_TAR_LISTDIR AMANDA_TAR
+AMANDA_PORTS_UDP AMANDA_PORTS_TCP AMANDA_PORTS_BOTH AMANDA_PORTS
+AMANDA_CONFIG_NAME AMANDA_TMPDIR"
+
+amanda_variable_setup() {
+
+ # Setting vars
+ local currentamanda
+
+ # Grab the current settings
+ currentamanda="$(set | egrep "^AMANDA_" | grep -v '^AMANDA_ENV_SETTINGS' | xargs)"
+
+ # First we set the defaults
+ [[ -z "${AMANDA_GROUP_GID}" ]] && AMANDA_GROUP_GID=87
+ [[ -z "${AMANDA_GROUP_NAME}" ]] && AMANDA_GROUP_NAME=amanda
+ [[ -z "${AMANDA_USER_NAME}" ]] && AMANDA_USER_NAME=amanda
+ [[ -z "${AMANDA_USER_UID}" ]] && AMANDA_USER_UID=87
+ [[ -z "${AMANDA_USER_SH}" ]] && AMANDA_USER_SH=/bin/bash
+ [[ -z "${AMANDA_USER_HOMEDIR}" ]] && AMANDA_USER_HOMEDIR=/var/spool/amanda
+ [[ -z "${AMANDA_USER_GROUPS}" ]] && AMANDA_USER_GROUPS="${AMANDA_GROUP_NAME}"
+
+ # This installs Amanda, with the server. However, it could be a client,
+ # just specify an alternate server name in AMANDA_SERVER.
+ [[ -z "${AMANDA_SERVER}" ]] && AMANDA_SERVER="${HOSTNAME}"
+ [[ -z "${AMANDA_SERVER_TAPE}" ]] && AMANDA_SERVER_TAPE="${AMANDA_SERVER}"
+ [[ -z "${AMANDA_SERVER_TAPE_DEVICE}" ]] && AMANDA_SERVER_TAPE_DEVICE="/dev/nst0"
+ [[ -z "${AMANDA_SERVER_INDEX}" ]] && AMANDA_SERVER_INDEX="${AMANDA_SERVER}"
+ [[ -z "${AMANDA_TAR_LISTDIR}" ]] && AMANDA_TAR_LISTDIR=${AMANDA_USER_HOMEDIR}/tar-lists
+ [[ -z "${AMANDA_CONFIG_NAME}" ]] && AMANDA_CONFIG_NAME=DailySet1
+ [[ -z "${AMANDA_TMPDIR}" ]] && AMANDA_TMPDIR=/var/tmp/amanda
+ [[ -z "${AMANDA_DBGDIR}" ]] && AMANDA_DBGDIR="$AMANDA_TMPDIR"
+ # These are left empty by default
+ [[ -z "${AMANDA_PORTS_UDP}" ]] && AMANDA_PORTS_UDP=
+ [[ -z "${AMANDA_PORTS_TCP}" ]] && AMANDA_PORTS_TCP=
+ [[ -z "${AMANDA_PORTS_BOTH}" ]] && AMANDA_PORTS_BOTH=
+ [[ -z "${AMANDA_PORTS}" ]] && AMANDA_PORTS=
+
+ # What tar to use
+ [[ -z "${AMANDA_TAR}" ]] && AMANDA_TAR=/bin/tar
+
+ # Now pull in the old stuff
+ if [[ -f "${EROOT}${ENVDIR}/${ENVDFILE}" ]]; then
+ # We don't just source it as we don't want everything in there.
+ eval $(egrep "^AMANDA_" "${EROOT}${ENVDIR}/${ENVDFILE}" | grep -v '^AMANDA_ENV_SETTINGS')
+ fi
+
+ # Re-apply the new settings if any
+ [ -n "${currentamanda}" ] && eval $(echo "${currentamanda}")
+
+}
+
+pkg_setup() {
+ amanda_variable_setup
+
+ # If USE=minimal, give out a warning, if AMANDA_SERVER is not set to
+ # another host than HOSTNAME.
+ if use minimal && [ "${AMANDA_SERVER}" = "${HOSTNAME}" ] ; then
+ elog "You are installing a client-only version of Amanda."
+ elog "You should set the variable \$AMANDA_SERVER to point at your"
+ elog "Amanda-tape-server, otherwise you will have to specify its name"
+ elog "when using amrecover on the client."
+ elog "For example: Use something like"
+ elog "AMANDA_SERVER=\"myserver\" emerge amanda"
+ elog
+ fi
+
+ enewgroup "${AMANDA_GROUP_NAME}" "${AMANDA_GROUP_GID}"
+ enewuser "${AMANDA_USER_NAME}" "${AMANDA_USER_UID}" "${AMANDA_USER_SH}" "${AMANDA_USER_HOMEDIR}" "${AMANDA_USER_GROUPS}"
+}
+
+src_unpack() {
+ # we do not want the perl src_unpack
+ default_src_unpack
+}
+
+src_prepare() {
+ # gentoo bug #331111
+ sed -i '/^check-local: check-perl$/d' "${S}"/config/automake/scripts.am || die
+ sed -i '/^check-local:/s,syntax-check,,g' "${S}"/perl/Makefile.am || die
+
+ # bug with glibc-2.16.0
+ sed -i -e '/gets is a security/d' "${S}"/gnulib/stdio.in.h || die
+
+ eautoreconf
+
+ # places for us to work in
+ mkdir -p "${MYFILESDIR}" || die
+ # Now we store the settings we just created
+ set | egrep "^AMANDA_" | grep -v '^AMANDA_ENV_SETTINGS' > "${TMPENVFILE}" || die
+
+ # Prepare our custom files
+ einfo "Building custom configuration files"
+ local i # our iterator
+ local sedexpr # var for sed expr
+ sedexpr=''
+ for i in ${ENV_SETTINGS_AMANDA} ; do
+ local val
+ eval "val=\"\${${i}}\""
+ sedexpr="${sedexpr}s|__${i}__|${val}|g;"
+ done
+
+ # now apply the sed expr
+ for i in "${FILESDIR}"/amanda-* ; do
+ sed -re "${sedexpr}" <"${i}" >"${MYFILESDIR}/`basename ${i}`" || die
+ done
+
+ if use minimal; then
+ cat "${MYFILESDIR}"/amanda-amandahosts-server-2.5.1_p3-r1 > "${T}"/amandahosts || die
+ else
+ sed -i -e 's:^\(my $amandahomedir\)=.*:\1 = $localstatedir;:' \
+ server-src/am{addclient,serverconfig}.pl || die
+ cat "${MYFILESDIR}"/amanda-amandahosts-client-2.5.1_p3-r1 > "${T}"/amandahosts || die
+ fi
+
+ eapply_user
+}
+
+src_configure() {
+ # fix bug #36316
+ addpredict /var/cache/samba/gencache.tdb
+ # fix bug #376169
+ addpredict /run/blkid
+ addpredict /etc/blkid.tab
+
+ [ ! -f "${TMPENVFILE}" ] && die "Variable setting file (${TMPENVFILE}) should exist!"
+ source "${TMPENVFILE}"
+ local myconf
+
+ einfo "Using ${AMANDA_SERVER_TAPE} for tape server."
+ myconf="${myconf} --with-tape-server=${AMANDA_SERVER_TAPE}"
+ einfo "Using ${AMANDA_SERVER_TAPE_DEVICE} for tape server."
+ myconf="${myconf} --with-tape-device=${AMANDA_SERVER_TAPE_DEVICE}"
+ einfo "Using ${AMANDA_SERVER_INDEX} for index server."
+ myconf="${myconf} --with-index-server=${AMANDA_SERVER_INDEX}"
+ einfo "Using ${AMANDA_USER_NAME} for amanda user."
+ myconf="${myconf} --with-user=${AMANDA_USER_NAME}"
+ einfo "Using ${AMANDA_GROUP_NAME} for amanda group."
+ myconf="${myconf} --with-group=${AMANDA_GROUP_NAME}"
+ einfo "Using ${AMANDA_TAR} as Tar implementation."
+ myconf="${myconf} --with-gnutar=${AMANDA_TAR}"
+ einfo "Using ${AMANDA_TAR_LISTDIR} as tar listdir."
+ myconf="${myconf} --with-gnutar-listdir=${AMANDA_TAR_LISTDIR}"
+ einfo "Using ${AMANDA_CONFIG_NAME} as default config name."
+ myconf="${myconf} --with-config=${AMANDA_CONFIG_NAME}"
+ einfo "Using ${AMANDA_TMPDIR} as Amanda temporary directory."
+ myconf="${myconf} --with-tmpdir=${AMANDA_TMPDIR}"
+
+ if [ -n "${AMANDA_PORTS_UDP}" ] && [ -n "${AMANDA_PORTS_TCP}" ] && [ -z "${AMANDA_PORTS_BOTH}" ] ; then
+ eerror "If you want _both_ UDP and TCP ports, please use only the"
+ eerror "AMANDA_PORTS environment variable for identical ports, or set"
+ eerror "AMANDA_PORTS_BOTH."
+ die "Bad port setup!"
+ fi
+ if [ -n "${AMANDA_PORTS_UDP}" ]; then
+ einfo "Using UDP ports ${AMANDA_PORTS_UDP/,/-}"
+ myconf="${myconf} --with-udpportrange=${AMANDA_PORTS_UDP}"
+ fi
+ if [ -n "${AMANDA_PORTS_TCP}" ]; then
+ einfo "Using TCP ports ${AMANDA_PORTS_TCP/,/-}"
+ myconf="${myconf} --with-tcpportrange=${AMANDA_PORTS_TCP}"
+ fi
+ if [ -n "${AMANDA_PORTS}" ]; then
+ einfo "Using ports ${AMANDA_PORTS/,/-}"
+ myconf="${myconf} --with-portrange=${AMANDA_PORTS}"
+ fi
+
+ # Extras
+ # Speed option
+ myconf="${myconf} --with-buffered-dump"
+ # "debugging" in the configuration is NOT debug in the conventional sense.
+ # It is actually just useful output in the application, and should remain
+ # enabled. There are some cases of breakage with MTX tape changers as of
+ # 2.5.1p2 that it exposes when turned off as well.
+ myconf="${myconf} --with-debugging"
+ # Where to put our files
+ myconf="${myconf} --localstatedir=${AMANDA_USER_HOMEDIR}"
+
+ # Samba support
+ myconf="${myconf} $(use_with samba smbclient /usr/bin/smbclient)"
+
+ # Support for BSD, SSH, BSDUDP, BSDTCP security methods all compiled in by
+ # default
+ myconf="${myconf} --with-bsd-security"
+ myconf="${myconf} --with-ssh-security"
+ myconf="${myconf} --with-bsdudp-security"
+ myconf="${myconf} --with-bsdtcp-security"
+
+ # kerberos-security mechanism version 5
+ myconf="${myconf} $(use_with kerberos krb5-security)"
+
+ # Amazon S3 support
+ myconf="${myconf} `use_enable s3 s3-device`"
+
+ # libcurl is required for S3 but otherwise optional
+ if ! use s3; then
+ myconf="${myconf} $(use_with curl libcurl)"
+ fi
+
+ # Client only, as requested in bug #127725
+ if use minimal ; then
+ myconf="${myconf} --without-server"
+ else
+ # amplot
+ myconf="${myconf} $(use_with gnuplot)"
+ fi
+
+ # IPv6 fun.
+ myconf="${myconf} `use_with ipv6`"
+ # This is to prevent the IPv6-is-working test
+ # As the test fails on binpkg build hosts with no IPv6.
+ use ipv6 && export amanda_cv_working_ipv6=yes
+
+ # I18N
+ myconf="${myconf} `use_enable nls`"
+
+ # Bug #296634: Perl location
+ perl_set_version
+ myconf="${myconf} --with-amperldir=${VENDOR_LIB}"
+
+ # Bug 296633: --disable-syntax-checks
+ # Some tests are not safe for production systems
+ myconf="${myconf} --disable-syntax-checks"
+
+ # build manpages
+ myconf="${myconf} --enable-manpage-build"
+
+ # bug #483120
+ tc-export AR
+
+ econf \
+ $(use_with readline) \
+ ${myconf}
+}
+
+src_compile() {
+ # Again, do not want the perl-module src_compile
+ default_src_compile
+}
+
+src_install() {
+ [ ! -f "${TMPENVFILE}" ] && die "Variable setting file (${TMPENVFILE}) should exist!"
+ source ${TMPENVFILE}
+
+ einfo "Doing stock install"
+ emake DESTDIR="${D}" install || die
+
+ # Build the envdir file
+ # Don't forget this..
+ einfo "Building environment file"
+ (
+ echo "# These settings are what was present in the environment when this"
+ echo "# Amanda was compiled. Changing anything below this comment will"
+ echo "# have no effect on your application, but it merely exists to"
+ echo "# preserve them for your next emerge of Amanda"
+ cat "${TMPENVFILE}" | sed "s,=\$,='',g"
+ ) >> "${MYFILESDIR}/${ENVDFILE}"
+
+ # Env.d
+ einfo "Installing environment config file"
+ doenvd "${MYFILESDIR}/${ENVDFILE}"
+
+ # Lock down next section (up until docs).
+ insopts -m0640
+ # Installing Amanda Xinetd Services Definition
+ einfo "Installing xinetd service file"
+ insinto /etc/xinetd.d
+ if use minimal ; then
+ newins "${MYFILESDIR}"/amanda-xinetd-2.6.1_p1-client amanda
+ else
+ newins "${MYFILESDIR}"/amanda-xinetd-2.6.1_p1-server amanda
+ fi
+
+ if ! use minimal; then
+ einfo "Installing Sample Daily Cron Job for Amanda"
+ insinto /etc/cron.daily
+ newins "${MYFILESDIR}/amanda-cron" amanda
+ fi
+
+ einfo "Installing systemd service and socket files for Amanda"
+ systemd_dounit "${FILESDIR}"/amanda.socket || die
+ systemd_newunit "${FILESDIR}"/amanda.service 'amanda@.service' || die
+
+ insinto /etc/amanda
+ einfo "Installing .amandahosts File for ${AMANDA_USER_NAME} user"
+ doins "${T}/amandahosts"
+ fperms 600 /etc/amanda/amandahosts
+
+ dosym /etc/amanda/amandahosts "${AMANDA_USER_HOMEDIR}/.amandahosts"
+ insinto "${AMANDA_USER_HOMEDIR}"
+ einfo "Installing .profile for ${AMANDA_USER_NAME} user"
+ newins "${MYFILESDIR}/amanda-profile" .profile
+
+ insinto /etc/amanda
+ doins "${S}/example/amanda-client.conf"
+ if ! use minimal ; then
+ insinto "/etc/amanda/${AMANDA_CONFIG_NAME}"
+ doins "${S}/example/amanda.conf"
+ doins "${S}/example/disklist"
+ keepdir "${AMANDA_USER_HOMEDIR}/${AMANDA_CONFIG_NAME}/index"
+ fi
+
+ keepdir "${AMANDA_TAR_LISTDIR}"
+ keepdir "${AMANDA_USER_HOMEDIR}/amanda"
+ keepdir "${AMANDA_TMPDIR}/dumps"
+ # Just make sure it exists for XFS to work...
+ use xfs && keepdir /var/xfsdump/inventory
+
+ local i
+ for i in "${AMANDA_USER_HOMEDIR}" "${AMANDA_TAR_LISTDIR}" \
+ "${AMANDA_TMPDIR}" /etc/amanda; do
+ einfo "Securing directory (${i})"
+ fowners -R ${AMANDA_USER_NAME}:${AMANDA_GROUP_NAME} ${i}
+ done
+ # Do NOT use -R
+ fperms 0700 \
+ "${AMANDA_USER_HOMEDIR}" "${AMANDA_TAR_LISTDIR}" \
+ "${AMANDA_TMPDIR}" "${AMANDA_TMPDIR}/dumps" \
+ "${AMANDA_USER_HOMEDIR}/amanda" \
+ /etc/amanda
+
+ if ! use minimal ; then
+ fperms 0700 \
+ "${AMANDA_USER_HOMEDIR}/${AMANDA_CONFIG_NAME}" \
+ /etc/amanda/${AMANDA_CONFIG_NAME}
+ fi
+
+ einfo "Setting setuid permissions"
+ amanda_permissions_fix "${D}"
+
+ # Relax permissions again
+ insopts -m0644
+
+ # docs
+ einfo "Installing documentation"
+ dodoc AUTHORS ChangeLog DEVELOPING NEWS README ReleaseNotes UPGRADING
+ # our inetd sample
+ einfo "Installing standard inetd sample"
+ newdoc "${MYFILESDIR}/amanda-inetd.amanda.sample-2.6.0_p2-r2" amanda-inetd.amanda.sample
+ # Amanda example configs
+ einfo "Installing example configurations"
+ rm "${D}"/usr/share/amanda/{COPYRIGHT,ChangeLog,NEWS,ReleaseNotes}
+ mv "${D}/usr/share/amanda/example" "${D}/usr/share/doc/${PF}/"
+ docinto example1
+ newdoc "${FILESDIR}/example_amanda.conf" amanda.conf
+ newdoc "${FILESDIR}/example_disklist-2.5.1_p3-r1" disklist
+ newdoc "${FILESDIR}/example_global.conf" global.conf
+
+ einfo "Cleaning up dud .la files"
+ perl_set_version
+ find "${D}"/"${VENDOR_LIB}" -name '*.la' -print0 |xargs -0 rm -f
+}
+
+pkg_postinst() {
+ [ ! -f "${TMPENVFILE}" -a "$MERGE_TYPE" == "binary" ] && \
+ TMPENVFILE="${ROOT}${ENVDIR}/${ENVDFILE}"
+ [ ! -f "${TMPENVFILE}" ] && die "Variable setting file (${TMPENVFILE}) should exist!"
+ source "${TMPENVFILE}"
+
+ # Migration of amandates from /etc to $localstatedir/amanda
+ if [ -f "${ROOT}/etc/amandates" -a \
+ ! -f "${ROOT}/${AMANDA_USER_HOMEDIR}/amanda/amandates" ]; then
+ einfo "Migrating amandates from /etc/ to ${AMANDA_USER_HOMEDIR}/amanda"
+ einfo "A backup is also placed at /etc/amandates.orig"
+ cp -dp "${ROOT}/etc/amandates" "${ROOT}/etc/amandates.orig"
+ mkdir -p "${ROOT}/${AMANDA_USER_HOMEDIR}/amanda/"
+ cp -dp "${ROOT}/etc/amandates" "${ROOT}/${AMANDA_USER_HOMEDIR}/amanda/amandates"
+ fi
+ if [ -f "${ROOT}/etc/amandates" ]; then
+ einfo "If you have migrated safely, please delete /etc/amandates"
+ fi
+
+ einfo "Checking setuid permissions"
+ amanda_permissions_fix "${ROOT}"
+
+ elog "You should configure Amanda in /etc/amanda now."
+ elog
+ elog "If you use xinetd, Don't forget to check /etc/xinetd.d/amanda"
+ elog "and restart xinetd afterwards!"
+ elog
+ elog "Otherwise, please look at /usr/share/doc/${PF}/inetd.amanda.sample"
+ elog "as an example of how to configure your inetd."
+ elog
+ elog "systemd-users: enable and start amanda.socket or the relevant services"
+ elog "regarding what auth method you use."
+ elog
+ elog "NOTICE: If you need raw access to partitions you need to add the"
+ elog "amanda user to the 'disk' group."
+ elog
+ elog "NOTICE: If you have a tape changer, you need to add the amanda user"
+ elog "to the 'tape' group."
+ elog
+ elog "If you use localhost in your disklist your restores may break."
+ elog "You should replace it with the actual hostname!"
+ elog "Please also see the syntax changes to amandahosts."
+ elog "The only exception is when you use the authentication method 'local'."
+ elog
+ elog "Please note that this package no longer explicitly depends on"
+ elog "virtual/inetd, as it supports modes where an inetd is not needed"
+ elog "(see bug #506028 for details)."
+}
+
+# We have had reports of amanda file permissions getting screwed up.
+# Losing setuid, becoming too lax etc.
+# ONLY root and users in the amanda group should be able to run these binaries!
+amanda_permissions_fix() {
+ local root="$1"
+ [ -z "${root}" ] && die "Failed to pass root argument to amanda_permissions_fix!"
+ local le="/usr/libexec/amanda"
+ for i in /usr/sbin/amcheck "${le}"/calcsize "${le}"/killpgrp \
+ "${le}"/rundump "${le}"/runtar "${le}"/dumper \
+ "${le}"/planner ; do
+ chown root:${AMANDA_GROUP_NAME} "${root}"/${i}
+ chmod u=srwx,g=rx,o= "${root}"/${i}
+ done
+}
diff --git a/app-backup/amanda/amanda-3.4.3.ebuild b/app-backup/amanda/amanda-3.4.3.ebuild
new file mode 100644
index 000000000000..9e26503c1a4a
--- /dev/null
+++ b/app-backup/amanda/amanda-3.4.3.ebuild
@@ -0,0 +1,479 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit autotools perl-module user systemd
+
+DESCRIPTION="The Advanced Maryland Automatic Network Disk Archiver"
+HOMEPAGE="http://www.amanda.org/"
+SRC_URI="mirror://sourceforge/amanda/${P}.tar.gz"
+
+LICENSE="HPND BSD BSD-2 GPL-2+ GPL-3+"
+SLOT="0"
+IUSE="curl gnuplot ipv6 kerberos minimal nls readline s3 samba systemd xfs"
+
+KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86"
+RDEPEND="sys-libs/readline:=
+ virtual/awk
+ app-arch/tar
+ dev-lang/perl:=
+ app-arch/dump
+ net-misc/openssh
+ >=dev-libs/glib-2.26.0
+ dev-perl/JSON
+ dev-perl/Encode-Locale
+ nls? ( virtual/libintl )
+ s3? ( >=net-misc/curl-7.10.0 )
+ !s3? ( curl? ( >=net-misc/curl-7.10.0 ) )
+ samba? ( net-fs/samba:= )
+ kerberos? ( app-crypt/mit-krb5 )
+ xfs? ( sys-fs/xfsdump )
+ !minimal? (
+ dev-perl/XML-Simple
+ virtual/mailx
+ app-arch/mt-st:=
+ sys-block/mtx
+ gnuplot? ( sci-visualization/gnuplot )
+ app-crypt/aespipe
+ app-crypt/gnupg
+ )"
+
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ nls? ( sys-devel/gettext )
+ >=app-text/docbook-xsl-stylesheets-1.72.0
+ app-text/docbook-xml-dtd
+ dev-libs/libxslt
+ dev-lang/swig
+ "
+
+MYFILESDIR="${T}/files"
+ENVDIR="/etc/env.d"
+ENVDFILE="97amanda"
+TMPENVFILE="${T}/${ENVDFILE}"
+
+# This is a complete list of Amanda settings that the ebuild takes from the
+# build environment. This allows users to alter the behavior of the package as
+# upstream intended, but keeping with Gentoo style. We store a copy of them in
+# /etc/env.d/97amanda during the install, so that they are preserved for future
+# installed. This variable name must not start with AMANDA_, as we do not want
+# it captured into the env file.
+ENV_SETTINGS_AMANDA="
+AMANDA_GROUP_GID AMANDA_GROUP_NAME
+AMANDA_USER_NAME AMANDA_USER_UID AMANDA_USER_SH AMANDA_USER_HOMEDIR AMANDA_USER_GROUPS
+AMANDA_SERVER AMANDA_SERVER_TAPE AMANDA_SERVER_TAPE_DEVICE AMANDA_SERVER_INDEX
+AMANDA_TAR_LISTDIR AMANDA_TAR
+AMANDA_PORTS_UDP AMANDA_PORTS_TCP AMANDA_PORTS_BOTH AMANDA_PORTS
+AMANDA_CONFIG_NAME AMANDA_TMPDIR"
+
+amanda_variable_setup() {
+
+ # Setting vars
+ local currentamanda
+
+ # Grab the current settings
+ currentamanda="$(set | egrep "^AMANDA_" | grep -v '^AMANDA_ENV_SETTINGS' | xargs)"
+
+ # First we set the defaults
+ [[ -z "${AMANDA_GROUP_GID}" ]] && AMANDA_GROUP_GID=87
+ [[ -z "${AMANDA_GROUP_NAME}" ]] && AMANDA_GROUP_NAME=amanda
+ [[ -z "${AMANDA_USER_NAME}" ]] && AMANDA_USER_NAME=amanda
+ [[ -z "${AMANDA_USER_UID}" ]] && AMANDA_USER_UID=87
+ [[ -z "${AMANDA_USER_SH}" ]] && AMANDA_USER_SH=/bin/bash
+ [[ -z "${AMANDA_USER_HOMEDIR}" ]] && AMANDA_USER_HOMEDIR=/var/spool/amanda
+ [[ -z "${AMANDA_USER_GROUPS}" ]] && AMANDA_USER_GROUPS="${AMANDA_GROUP_NAME}"
+
+ # This installs Amanda, with the server. However, it could be a client,
+ # just specify an alternate server name in AMANDA_SERVER.
+ [[ -z "${AMANDA_SERVER}" ]] && AMANDA_SERVER="${HOSTNAME}"
+ [[ -z "${AMANDA_SERVER_TAPE}" ]] && AMANDA_SERVER_TAPE="${AMANDA_SERVER}"
+ [[ -z "${AMANDA_SERVER_TAPE_DEVICE}" ]] && AMANDA_SERVER_TAPE_DEVICE="/dev/nst0"
+ [[ -z "${AMANDA_SERVER_INDEX}" ]] && AMANDA_SERVER_INDEX="${AMANDA_SERVER}"
+ [[ -z "${AMANDA_TAR_LISTDIR}" ]] && AMANDA_TAR_LISTDIR=${AMANDA_USER_HOMEDIR}/tar-lists
+ [[ -z "${AMANDA_CONFIG_NAME}" ]] && AMANDA_CONFIG_NAME=DailySet1
+ [[ -z "${AMANDA_TMPDIR}" ]] && AMANDA_TMPDIR=/var/tmp/amanda
+ [[ -z "${AMANDA_DBGDIR}" ]] && AMANDA_DBGDIR="$AMANDA_TMPDIR"
+ # These are left empty by default
+ [[ -z "${AMANDA_PORTS_UDP}" ]] && AMANDA_PORTS_UDP=
+ [[ -z "${AMANDA_PORTS_TCP}" ]] && AMANDA_PORTS_TCP=
+ [[ -z "${AMANDA_PORTS_BOTH}" ]] && AMANDA_PORTS_BOTH=
+ [[ -z "${AMANDA_PORTS}" ]] && AMANDA_PORTS=
+
+ # What tar to use
+ [[ -z "${AMANDA_TAR}" ]] && AMANDA_TAR=/bin/tar
+
+ # Now pull in the old stuff
+ if [[ -f "${EROOT}${ENVDIR}/${ENVDFILE}" ]]; then
+ # We don't just source it as we don't want everything in there.
+ eval $(egrep "^AMANDA_" "${EROOT}${ENVDIR}/${ENVDFILE}" | grep -v '^AMANDA_ENV_SETTINGS')
+ fi
+
+ # Re-apply the new settings if any
+ [ -n "${currentamanda}" ] && eval $(echo "${currentamanda}")
+
+}
+
+pkg_setup() {
+ amanda_variable_setup
+
+ # If USE=minimal, give out a warning, if AMANDA_SERVER is not set to
+ # another host than HOSTNAME.
+ if use minimal && [ "${AMANDA_SERVER}" = "${HOSTNAME}" ] ; then
+ elog "You are installing a client-only version of Amanda."
+ elog "You should set the variable \$AMANDA_SERVER to point at your"
+ elog "Amanda-tape-server, otherwise you will have to specify its name"
+ elog "when using amrecover on the client."
+ elog "For example: Use something like"
+ elog "AMANDA_SERVER=\"myserver\" emerge amanda"
+ elog
+ fi
+
+ enewgroup "${AMANDA_GROUP_NAME}" "${AMANDA_GROUP_GID}"
+ enewuser "${AMANDA_USER_NAME}" "${AMANDA_USER_UID}" "${AMANDA_USER_SH}" "${AMANDA_USER_HOMEDIR}" "${AMANDA_USER_GROUPS}"
+}
+
+src_unpack() {
+ # we do not want the perl src_unpack
+ default_src_unpack
+}
+
+src_prepare() {
+ # gentoo bug #331111
+ sed -i '/^check-local: check-perl$/d' "${S}"/config/automake/scripts.am || die
+ sed -i '/^check-local:/s,syntax-check,,g' "${S}"/perl/Makefile.am || die
+
+ # bug with glibc-2.16.0
+ sed -i -e '/gets is a security/d' "${S}"/gnulib/stdio.in.h || die
+
+ eautoreconf
+
+ # places for us to work in
+ mkdir -p "${MYFILESDIR}" || die
+ # Now we store the settings we just created
+ set | egrep "^AMANDA_" | grep -v '^AMANDA_ENV_SETTINGS' > "${TMPENVFILE}" || die
+
+ # Prepare our custom files
+ einfo "Building custom configuration files"
+ local i # our iterator
+ local sedexpr # var for sed expr
+ sedexpr=''
+ for i in ${ENV_SETTINGS_AMANDA} ; do
+ local val
+ eval "val=\"\${${i}}\""
+ sedexpr="${sedexpr}s|__${i}__|${val}|g;"
+ done
+
+ # now apply the sed expr
+ for i in "${FILESDIR}"/amanda-* ; do
+ sed -re "${sedexpr}" <"${i}" >"${MYFILESDIR}/`basename ${i}`" || die
+ done
+
+ if use minimal; then
+ cat "${MYFILESDIR}"/amanda-amandahosts-server-2.5.1_p3-r1 > "${T}"/amandahosts || die
+ else
+ sed -i -e 's:^\(my $amandahomedir\)=.*:\1 = $localstatedir;:' \
+ server-src/am{addclient,serverconfig}.pl || die
+ cat "${MYFILESDIR}"/amanda-amandahosts-client-2.5.1_p3-r1 > "${T}"/amandahosts || die
+ fi
+
+ eapply_user
+}
+
+src_configure() {
+ # fix bug #36316
+ addpredict /var/cache/samba/gencache.tdb
+ # fix bug #376169
+ addpredict /run/blkid
+ addpredict /etc/blkid.tab
+
+ [ ! -f "${TMPENVFILE}" ] && die "Variable setting file (${TMPENVFILE}) should exist!"
+ source "${TMPENVFILE}"
+ local myconf
+
+ einfo "Using ${AMANDA_SERVER_TAPE} for tape server."
+ myconf="${myconf} --with-tape-server=${AMANDA_SERVER_TAPE}"
+ einfo "Using ${AMANDA_SERVER_TAPE_DEVICE} for tape server."
+ myconf="${myconf} --with-tape-device=${AMANDA_SERVER_TAPE_DEVICE}"
+ einfo "Using ${AMANDA_SERVER_INDEX} for index server."
+ myconf="${myconf} --with-index-server=${AMANDA_SERVER_INDEX}"
+ einfo "Using ${AMANDA_USER_NAME} for amanda user."
+ myconf="${myconf} --with-user=${AMANDA_USER_NAME}"
+ einfo "Using ${AMANDA_GROUP_NAME} for amanda group."
+ myconf="${myconf} --with-group=${AMANDA_GROUP_NAME}"
+ einfo "Using ${AMANDA_TAR} as Tar implementation."
+ myconf="${myconf} --with-gnutar=${AMANDA_TAR}"
+ einfo "Using ${AMANDA_TAR_LISTDIR} as tar listdir."
+ myconf="${myconf} --with-gnutar-listdir=${AMANDA_TAR_LISTDIR}"
+ einfo "Using ${AMANDA_CONFIG_NAME} as default config name."
+ myconf="${myconf} --with-config=${AMANDA_CONFIG_NAME}"
+ einfo "Using ${AMANDA_TMPDIR} as Amanda temporary directory."
+ myconf="${myconf} --with-tmpdir=${AMANDA_TMPDIR}"
+
+ if [ -n "${AMANDA_PORTS_UDP}" ] && [ -n "${AMANDA_PORTS_TCP}" ] && [ -z "${AMANDA_PORTS_BOTH}" ] ; then
+ eerror "If you want _both_ UDP and TCP ports, please use only the"
+ eerror "AMANDA_PORTS environment variable for identical ports, or set"
+ eerror "AMANDA_PORTS_BOTH."
+ die "Bad port setup!"
+ fi
+ if [ -n "${AMANDA_PORTS_UDP}" ]; then
+ einfo "Using UDP ports ${AMANDA_PORTS_UDP/,/-}"
+ myconf="${myconf} --with-udpportrange=${AMANDA_PORTS_UDP}"
+ fi
+ if [ -n "${AMANDA_PORTS_TCP}" ]; then
+ einfo "Using TCP ports ${AMANDA_PORTS_TCP/,/-}"
+ myconf="${myconf} --with-tcpportrange=${AMANDA_PORTS_TCP}"
+ fi
+ if [ -n "${AMANDA_PORTS}" ]; then
+ einfo "Using ports ${AMANDA_PORTS/,/-}"
+ myconf="${myconf} --with-portrange=${AMANDA_PORTS}"
+ fi
+
+ # Extras
+ # Speed option
+ myconf="${myconf} --with-buffered-dump"
+ # "debugging" in the configuration is NOT debug in the conventional sense.
+ # It is actually just useful output in the application, and should remain
+ # enabled. There are some cases of breakage with MTX tape changers as of
+ # 2.5.1p2 that it exposes when turned off as well.
+ myconf="${myconf} --with-debugging"
+ # Where to put our files
+ myconf="${myconf} --localstatedir=${AMANDA_USER_HOMEDIR}"
+
+ # Samba support
+ myconf="${myconf} $(use_with samba smbclient /usr/bin/smbclient)"
+
+ # Support for BSD, SSH, BSDUDP, BSDTCP security methods all compiled in by
+ # default
+ myconf="${myconf} --with-bsd-security"
+ myconf="${myconf} --with-ssh-security"
+ myconf="${myconf} --with-bsdudp-security"
+ myconf="${myconf} --with-bsdtcp-security"
+
+ # kerberos-security mechanism version 5
+ myconf="${myconf} $(use_with kerberos krb5-security)"
+
+ # Amazon S3 support
+ myconf="${myconf} `use_enable s3 s3-device`"
+
+ # libcurl is required for S3 but otherwise optional
+ if ! use s3; then
+ myconf="${myconf} $(use_with curl libcurl)"
+ fi
+
+ # Client only, as requested in bug #127725
+ if use minimal ; then
+ myconf="${myconf} --without-server"
+ else
+ # amplot
+ myconf="${myconf} $(use_with gnuplot)"
+ fi
+
+ # IPv6 fun.
+ myconf="${myconf} `use_with ipv6`"
+ # This is to prevent the IPv6-is-working test
+ # As the test fails on binpkg build hosts with no IPv6.
+ use ipv6 && export amanda_cv_working_ipv6=yes
+
+ # I18N
+ myconf="${myconf} `use_enable nls`"
+
+ # Bug #296634: Perl location
+ perl_set_version
+ myconf="${myconf} --with-amperldir=${VENDOR_LIB}"
+
+ # Bug 296633: --disable-syntax-checks
+ # Some tests are not safe for production systems
+ myconf="${myconf} --disable-syntax-checks"
+
+ # build manpages
+ myconf="${myconf} --enable-manpage-build"
+
+ # bug #483120
+ tc-export AR
+
+ econf \
+ $(use_with readline) \
+ ${myconf}
+}
+
+src_compile() {
+ # Again, do not want the perl-module src_compile
+ default_src_compile
+}
+
+src_install() {
+ [ ! -f "${TMPENVFILE}" ] && die "Variable setting file (${TMPENVFILE}) should exist!"
+ source ${TMPENVFILE}
+
+ einfo "Doing stock install"
+ emake DESTDIR="${D}" install || die
+
+ # Build the envdir file
+ # Don't forget this..
+ einfo "Building environment file"
+ (
+ echo "# These settings are what was present in the environment when this"
+ echo "# Amanda was compiled. Changing anything below this comment will"
+ echo "# have no effect on your application, but it merely exists to"
+ echo "# preserve them for your next emerge of Amanda"
+ cat "${TMPENVFILE}" | sed "s,=\$,='',g"
+ ) >> "${MYFILESDIR}/${ENVDFILE}"
+
+ # Env.d
+ einfo "Installing environment config file"
+ doenvd "${MYFILESDIR}/${ENVDFILE}"
+
+ # Lock down next section (up until docs).
+ insopts -m0640
+ # Installing Amanda Xinetd Services Definition
+ einfo "Installing xinetd service file"
+ insinto /etc/xinetd.d
+ if use minimal ; then
+ newins "${MYFILESDIR}"/amanda-xinetd-2.6.1_p1-client amanda
+ else
+ newins "${MYFILESDIR}"/amanda-xinetd-2.6.1_p1-server amanda
+ fi
+
+ if ! use minimal; then
+ einfo "Installing Sample Daily Cron Job for Amanda"
+ insinto /etc/cron.daily
+ newins "${MYFILESDIR}/amanda-cron" amanda
+ fi
+
+ einfo "Installing systemd service and socket files for Amanda"
+ systemd_dounit "${FILESDIR}"/amanda.socket || die
+ systemd_newunit "${FILESDIR}"/amanda.service 'amanda@.service' || die
+
+ insinto /etc/amanda
+ einfo "Installing .amandahosts File for ${AMANDA_USER_NAME} user"
+ doins "${T}/amandahosts"
+ fperms 600 /etc/amanda/amandahosts
+
+ dosym /etc/amanda/amandahosts "${AMANDA_USER_HOMEDIR}/.amandahosts"
+ insinto "${AMANDA_USER_HOMEDIR}"
+ einfo "Installing .profile for ${AMANDA_USER_NAME} user"
+ newins "${MYFILESDIR}/amanda-profile" .profile
+
+ insinto /etc/amanda
+ doins "${S}/example/amanda-client.conf"
+ if ! use minimal ; then
+ insinto "/etc/amanda/${AMANDA_CONFIG_NAME}"
+ doins "${S}/example/amanda.conf"
+ doins "${S}/example/disklist"
+ keepdir "${AMANDA_USER_HOMEDIR}/${AMANDA_CONFIG_NAME}/index"
+ fi
+
+ keepdir "${AMANDA_TAR_LISTDIR}"
+ keepdir "${AMANDA_USER_HOMEDIR}/amanda"
+ keepdir "${AMANDA_TMPDIR}/dumps"
+ # Just make sure it exists for XFS to work...
+ use xfs && keepdir /var/xfsdump/inventory
+
+ local i
+ for i in "${AMANDA_USER_HOMEDIR}" "${AMANDA_TAR_LISTDIR}" \
+ "${AMANDA_TMPDIR}" /etc/amanda; do
+ einfo "Securing directory (${i})"
+ fowners -R ${AMANDA_USER_NAME}:${AMANDA_GROUP_NAME} ${i}
+ done
+ # Do NOT use -R
+ fperms 0700 \
+ "${AMANDA_USER_HOMEDIR}" "${AMANDA_TAR_LISTDIR}" \
+ "${AMANDA_TMPDIR}" "${AMANDA_TMPDIR}/dumps" \
+ "${AMANDA_USER_HOMEDIR}/amanda" \
+ /etc/amanda
+
+ if ! use minimal ; then
+ fperms 0700 \
+ "${AMANDA_USER_HOMEDIR}/${AMANDA_CONFIG_NAME}" \
+ /etc/amanda/${AMANDA_CONFIG_NAME}
+ fi
+
+ einfo "Setting setuid permissions"
+ amanda_permissions_fix "${D}"
+
+ # Relax permissions again
+ insopts -m0644
+
+ # docs
+ einfo "Installing documentation"
+ dodoc AUTHORS ChangeLog DEVELOPING NEWS README ReleaseNotes UPGRADING
+ # our inetd sample
+ einfo "Installing standard inetd sample"
+ newdoc "${MYFILESDIR}/amanda-inetd.amanda.sample-2.6.0_p2-r2" amanda-inetd.amanda.sample
+ # Amanda example configs
+ einfo "Installing example configurations"
+ rm "${D}"/usr/share/amanda/{COPYRIGHT,ChangeLog,NEWS,ReleaseNotes}
+ mv "${D}/usr/share/amanda/example" "${D}/usr/share/doc/${PF}/"
+ docinto example1
+ newdoc "${FILESDIR}/example_amanda.conf" amanda.conf
+ newdoc "${FILESDIR}/example_disklist-2.5.1_p3-r1" disklist
+ newdoc "${FILESDIR}/example_global.conf" global.conf
+
+ einfo "Cleaning up dud .la files"
+ perl_set_version
+ find "${D}"/"${VENDOR_LIB}" -name '*.la' -print0 |xargs -0 rm -f
+}
+
+pkg_postinst() {
+ [ ! -f "${TMPENVFILE}" -a "$MERGE_TYPE" == "binary" ] && \
+ TMPENVFILE="${ROOT}${ENVDIR}/${ENVDFILE}"
+ [ ! -f "${TMPENVFILE}" ] && die "Variable setting file (${TMPENVFILE}) should exist!"
+ source "${TMPENVFILE}"
+
+ # Migration of amandates from /etc to $localstatedir/amanda
+ if [ -f "${ROOT}/etc/amandates" -a \
+ ! -f "${ROOT}/${AMANDA_USER_HOMEDIR}/amanda/amandates" ]; then
+ einfo "Migrating amandates from /etc/ to ${AMANDA_USER_HOMEDIR}/amanda"
+ einfo "A backup is also placed at /etc/amandates.orig"
+ cp -dp "${ROOT}/etc/amandates" "${ROOT}/etc/amandates.orig"
+ mkdir -p "${ROOT}/${AMANDA_USER_HOMEDIR}/amanda/"
+ cp -dp "${ROOT}/etc/amandates" "${ROOT}/${AMANDA_USER_HOMEDIR}/amanda/amandates"
+ fi
+ if [ -f "${ROOT}/etc/amandates" ]; then
+ einfo "If you have migrated safely, please delete /etc/amandates"
+ fi
+
+ einfo "Checking setuid permissions"
+ amanda_permissions_fix "${ROOT}"
+
+ elog "You should configure Amanda in /etc/amanda now."
+ elog
+ elog "If you use xinetd, Don't forget to check /etc/xinetd.d/amanda"
+ elog "and restart xinetd afterwards!"
+ elog
+ elog "Otherwise, please look at /usr/share/doc/${PF}/inetd.amanda.sample"
+ elog "as an example of how to configure your inetd."
+ elog
+ elog "systemd-users: enable and start amanda.socket or the relevant services"
+ elog "regarding what auth method you use."
+ elog
+ elog "NOTICE: If you need raw access to partitions you need to add the"
+ elog "amanda user to the 'disk' group."
+ elog
+ elog "NOTICE: If you have a tape changer, you need to add the amanda user"
+ elog "to the 'tape' group."
+ elog
+ elog "If you use localhost in your disklist your restores may break."
+ elog "You should replace it with the actual hostname!"
+ elog "Please also see the syntax changes to amandahosts."
+ elog "The only exception is when you use the authentication method 'local'."
+ elog
+ elog "Please note that this package no longer explicitly depends on"
+ elog "virtual/inetd, as it supports modes where an inetd is not needed"
+ elog "(see bug #506028 for details)."
+}
+
+# We have had reports of amanda file permissions getting screwed up.
+# Losing setuid, becoming too lax etc.
+# ONLY root and users in the amanda group should be able to run these binaries!
+amanda_permissions_fix() {
+ local root="$1"
+ [ -z "${root}" ] && die "Failed to pass root argument to amanda_permissions_fix!"
+ local le="/usr/libexec/amanda"
+ for i in /usr/sbin/amcheck "${le}"/calcsize "${le}"/killpgrp \
+ "${le}"/rundump "${le}"/runtar "${le}"/dumper \
+ "${le}"/planner ; do
+ chown root:${AMANDA_GROUP_NAME} "${root}"/${i}
+ chmod u=srwx,g=rx,o= "${root}"/${i}
+ done
+}
diff --git a/app-backup/amanda/amanda-3.4.4.ebuild b/app-backup/amanda/amanda-3.4.4.ebuild
new file mode 100644
index 000000000000..9e26503c1a4a
--- /dev/null
+++ b/app-backup/amanda/amanda-3.4.4.ebuild
@@ -0,0 +1,479 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit autotools perl-module user systemd
+
+DESCRIPTION="The Advanced Maryland Automatic Network Disk Archiver"
+HOMEPAGE="http://www.amanda.org/"
+SRC_URI="mirror://sourceforge/amanda/${P}.tar.gz"
+
+LICENSE="HPND BSD BSD-2 GPL-2+ GPL-3+"
+SLOT="0"
+IUSE="curl gnuplot ipv6 kerberos minimal nls readline s3 samba systemd xfs"
+
+KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86"
+RDEPEND="sys-libs/readline:=
+ virtual/awk
+ app-arch/tar
+ dev-lang/perl:=
+ app-arch/dump
+ net-misc/openssh
+ >=dev-libs/glib-2.26.0
+ dev-perl/JSON
+ dev-perl/Encode-Locale
+ nls? ( virtual/libintl )
+ s3? ( >=net-misc/curl-7.10.0 )
+ !s3? ( curl? ( >=net-misc/curl-7.10.0 ) )
+ samba? ( net-fs/samba:= )
+ kerberos? ( app-crypt/mit-krb5 )
+ xfs? ( sys-fs/xfsdump )
+ !minimal? (
+ dev-perl/XML-Simple
+ virtual/mailx
+ app-arch/mt-st:=
+ sys-block/mtx
+ gnuplot? ( sci-visualization/gnuplot )
+ app-crypt/aespipe
+ app-crypt/gnupg
+ )"
+
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ nls? ( sys-devel/gettext )
+ >=app-text/docbook-xsl-stylesheets-1.72.0
+ app-text/docbook-xml-dtd
+ dev-libs/libxslt
+ dev-lang/swig
+ "
+
+MYFILESDIR="${T}/files"
+ENVDIR="/etc/env.d"
+ENVDFILE="97amanda"
+TMPENVFILE="${T}/${ENVDFILE}"
+
+# This is a complete list of Amanda settings that the ebuild takes from the
+# build environment. This allows users to alter the behavior of the package as
+# upstream intended, but keeping with Gentoo style. We store a copy of them in
+# /etc/env.d/97amanda during the install, so that they are preserved for future
+# installed. This variable name must not start with AMANDA_, as we do not want
+# it captured into the env file.
+ENV_SETTINGS_AMANDA="
+AMANDA_GROUP_GID AMANDA_GROUP_NAME
+AMANDA_USER_NAME AMANDA_USER_UID AMANDA_USER_SH AMANDA_USER_HOMEDIR AMANDA_USER_GROUPS
+AMANDA_SERVER AMANDA_SERVER_TAPE AMANDA_SERVER_TAPE_DEVICE AMANDA_SERVER_INDEX
+AMANDA_TAR_LISTDIR AMANDA_TAR
+AMANDA_PORTS_UDP AMANDA_PORTS_TCP AMANDA_PORTS_BOTH AMANDA_PORTS
+AMANDA_CONFIG_NAME AMANDA_TMPDIR"
+
+amanda_variable_setup() {
+
+ # Setting vars
+ local currentamanda
+
+ # Grab the current settings
+ currentamanda="$(set | egrep "^AMANDA_" | grep -v '^AMANDA_ENV_SETTINGS' | xargs)"
+
+ # First we set the defaults
+ [[ -z "${AMANDA_GROUP_GID}" ]] && AMANDA_GROUP_GID=87
+ [[ -z "${AMANDA_GROUP_NAME}" ]] && AMANDA_GROUP_NAME=amanda
+ [[ -z "${AMANDA_USER_NAME}" ]] && AMANDA_USER_NAME=amanda
+ [[ -z "${AMANDA_USER_UID}" ]] && AMANDA_USER_UID=87
+ [[ -z "${AMANDA_USER_SH}" ]] && AMANDA_USER_SH=/bin/bash
+ [[ -z "${AMANDA_USER_HOMEDIR}" ]] && AMANDA_USER_HOMEDIR=/var/spool/amanda
+ [[ -z "${AMANDA_USER_GROUPS}" ]] && AMANDA_USER_GROUPS="${AMANDA_GROUP_NAME}"
+
+ # This installs Amanda, with the server. However, it could be a client,
+ # just specify an alternate server name in AMANDA_SERVER.
+ [[ -z "${AMANDA_SERVER}" ]] && AMANDA_SERVER="${HOSTNAME}"
+ [[ -z "${AMANDA_SERVER_TAPE}" ]] && AMANDA_SERVER_TAPE="${AMANDA_SERVER}"
+ [[ -z "${AMANDA_SERVER_TAPE_DEVICE}" ]] && AMANDA_SERVER_TAPE_DEVICE="/dev/nst0"
+ [[ -z "${AMANDA_SERVER_INDEX}" ]] && AMANDA_SERVER_INDEX="${AMANDA_SERVER}"
+ [[ -z "${AMANDA_TAR_LISTDIR}" ]] && AMANDA_TAR_LISTDIR=${AMANDA_USER_HOMEDIR}/tar-lists
+ [[ -z "${AMANDA_CONFIG_NAME}" ]] && AMANDA_CONFIG_NAME=DailySet1
+ [[ -z "${AMANDA_TMPDIR}" ]] && AMANDA_TMPDIR=/var/tmp/amanda
+ [[ -z "${AMANDA_DBGDIR}" ]] && AMANDA_DBGDIR="$AMANDA_TMPDIR"
+ # These are left empty by default
+ [[ -z "${AMANDA_PORTS_UDP}" ]] && AMANDA_PORTS_UDP=
+ [[ -z "${AMANDA_PORTS_TCP}" ]] && AMANDA_PORTS_TCP=
+ [[ -z "${AMANDA_PORTS_BOTH}" ]] && AMANDA_PORTS_BOTH=
+ [[ -z "${AMANDA_PORTS}" ]] && AMANDA_PORTS=
+
+ # What tar to use
+ [[ -z "${AMANDA_TAR}" ]] && AMANDA_TAR=/bin/tar
+
+ # Now pull in the old stuff
+ if [[ -f "${EROOT}${ENVDIR}/${ENVDFILE}" ]]; then
+ # We don't just source it as we don't want everything in there.
+ eval $(egrep "^AMANDA_" "${EROOT}${ENVDIR}/${ENVDFILE}" | grep -v '^AMANDA_ENV_SETTINGS')
+ fi
+
+ # Re-apply the new settings if any
+ [ -n "${currentamanda}" ] && eval $(echo "${currentamanda}")
+
+}
+
+pkg_setup() {
+ amanda_variable_setup
+
+ # If USE=minimal, give out a warning, if AMANDA_SERVER is not set to
+ # another host than HOSTNAME.
+ if use minimal && [ "${AMANDA_SERVER}" = "${HOSTNAME}" ] ; then
+ elog "You are installing a client-only version of Amanda."
+ elog "You should set the variable \$AMANDA_SERVER to point at your"
+ elog "Amanda-tape-server, otherwise you will have to specify its name"
+ elog "when using amrecover on the client."
+ elog "For example: Use something like"
+ elog "AMANDA_SERVER=\"myserver\" emerge amanda"
+ elog
+ fi
+
+ enewgroup "${AMANDA_GROUP_NAME}" "${AMANDA_GROUP_GID}"
+ enewuser "${AMANDA_USER_NAME}" "${AMANDA_USER_UID}" "${AMANDA_USER_SH}" "${AMANDA_USER_HOMEDIR}" "${AMANDA_USER_GROUPS}"
+}
+
+src_unpack() {
+ # we do not want the perl src_unpack
+ default_src_unpack
+}
+
+src_prepare() {
+ # gentoo bug #331111
+ sed -i '/^check-local: check-perl$/d' "${S}"/config/automake/scripts.am || die
+ sed -i '/^check-local:/s,syntax-check,,g' "${S}"/perl/Makefile.am || die
+
+ # bug with glibc-2.16.0
+ sed -i -e '/gets is a security/d' "${S}"/gnulib/stdio.in.h || die
+
+ eautoreconf
+
+ # places for us to work in
+ mkdir -p "${MYFILESDIR}" || die
+ # Now we store the settings we just created
+ set | egrep "^AMANDA_" | grep -v '^AMANDA_ENV_SETTINGS' > "${TMPENVFILE}" || die
+
+ # Prepare our custom files
+ einfo "Building custom configuration files"
+ local i # our iterator
+ local sedexpr # var for sed expr
+ sedexpr=''
+ for i in ${ENV_SETTINGS_AMANDA} ; do
+ local val
+ eval "val=\"\${${i}}\""
+ sedexpr="${sedexpr}s|__${i}__|${val}|g;"
+ done
+
+ # now apply the sed expr
+ for i in "${FILESDIR}"/amanda-* ; do
+ sed -re "${sedexpr}" <"${i}" >"${MYFILESDIR}/`basename ${i}`" || die
+ done
+
+ if use minimal; then
+ cat "${MYFILESDIR}"/amanda-amandahosts-server-2.5.1_p3-r1 > "${T}"/amandahosts || die
+ else
+ sed -i -e 's:^\(my $amandahomedir\)=.*:\1 = $localstatedir;:' \
+ server-src/am{addclient,serverconfig}.pl || die
+ cat "${MYFILESDIR}"/amanda-amandahosts-client-2.5.1_p3-r1 > "${T}"/amandahosts || die
+ fi
+
+ eapply_user
+}
+
+src_configure() {
+ # fix bug #36316
+ addpredict /var/cache/samba/gencache.tdb
+ # fix bug #376169
+ addpredict /run/blkid
+ addpredict /etc/blkid.tab
+
+ [ ! -f "${TMPENVFILE}" ] && die "Variable setting file (${TMPENVFILE}) should exist!"
+ source "${TMPENVFILE}"
+ local myconf
+
+ einfo "Using ${AMANDA_SERVER_TAPE} for tape server."
+ myconf="${myconf} --with-tape-server=${AMANDA_SERVER_TAPE}"
+ einfo "Using ${AMANDA_SERVER_TAPE_DEVICE} for tape server."
+ myconf="${myconf} --with-tape-device=${AMANDA_SERVER_TAPE_DEVICE}"
+ einfo "Using ${AMANDA_SERVER_INDEX} for index server."
+ myconf="${myconf} --with-index-server=${AMANDA_SERVER_INDEX}"
+ einfo "Using ${AMANDA_USER_NAME} for amanda user."
+ myconf="${myconf} --with-user=${AMANDA_USER_NAME}"
+ einfo "Using ${AMANDA_GROUP_NAME} for amanda group."
+ myconf="${myconf} --with-group=${AMANDA_GROUP_NAME}"
+ einfo "Using ${AMANDA_TAR} as Tar implementation."
+ myconf="${myconf} --with-gnutar=${AMANDA_TAR}"
+ einfo "Using ${AMANDA_TAR_LISTDIR} as tar listdir."
+ myconf="${myconf} --with-gnutar-listdir=${AMANDA_TAR_LISTDIR}"
+ einfo "Using ${AMANDA_CONFIG_NAME} as default config name."
+ myconf="${myconf} --with-config=${AMANDA_CONFIG_NAME}"
+ einfo "Using ${AMANDA_TMPDIR} as Amanda temporary directory."
+ myconf="${myconf} --with-tmpdir=${AMANDA_TMPDIR}"
+
+ if [ -n "${AMANDA_PORTS_UDP}" ] && [ -n "${AMANDA_PORTS_TCP}" ] && [ -z "${AMANDA_PORTS_BOTH}" ] ; then
+ eerror "If you want _both_ UDP and TCP ports, please use only the"
+ eerror "AMANDA_PORTS environment variable for identical ports, or set"
+ eerror "AMANDA_PORTS_BOTH."
+ die "Bad port setup!"
+ fi
+ if [ -n "${AMANDA_PORTS_UDP}" ]; then
+ einfo "Using UDP ports ${AMANDA_PORTS_UDP/,/-}"
+ myconf="${myconf} --with-udpportrange=${AMANDA_PORTS_UDP}"
+ fi
+ if [ -n "${AMANDA_PORTS_TCP}" ]; then
+ einfo "Using TCP ports ${AMANDA_PORTS_TCP/,/-}"
+ myconf="${myconf} --with-tcpportrange=${AMANDA_PORTS_TCP}"
+ fi
+ if [ -n "${AMANDA_PORTS}" ]; then
+ einfo "Using ports ${AMANDA_PORTS/,/-}"
+ myconf="${myconf} --with-portrange=${AMANDA_PORTS}"
+ fi
+
+ # Extras
+ # Speed option
+ myconf="${myconf} --with-buffered-dump"
+ # "debugging" in the configuration is NOT debug in the conventional sense.
+ # It is actually just useful output in the application, and should remain
+ # enabled. There are some cases of breakage with MTX tape changers as of
+ # 2.5.1p2 that it exposes when turned off as well.
+ myconf="${myconf} --with-debugging"
+ # Where to put our files
+ myconf="${myconf} --localstatedir=${AMANDA_USER_HOMEDIR}"
+
+ # Samba support
+ myconf="${myconf} $(use_with samba smbclient /usr/bin/smbclient)"
+
+ # Support for BSD, SSH, BSDUDP, BSDTCP security methods all compiled in by
+ # default
+ myconf="${myconf} --with-bsd-security"
+ myconf="${myconf} --with-ssh-security"
+ myconf="${myconf} --with-bsdudp-security"
+ myconf="${myconf} --with-bsdtcp-security"
+
+ # kerberos-security mechanism version 5
+ myconf="${myconf} $(use_with kerberos krb5-security)"
+
+ # Amazon S3 support
+ myconf="${myconf} `use_enable s3 s3-device`"
+
+ # libcurl is required for S3 but otherwise optional
+ if ! use s3; then
+ myconf="${myconf} $(use_with curl libcurl)"
+ fi
+
+ # Client only, as requested in bug #127725
+ if use minimal ; then
+ myconf="${myconf} --without-server"
+ else
+ # amplot
+ myconf="${myconf} $(use_with gnuplot)"
+ fi
+
+ # IPv6 fun.
+ myconf="${myconf} `use_with ipv6`"
+ # This is to prevent the IPv6-is-working test
+ # As the test fails on binpkg build hosts with no IPv6.
+ use ipv6 && export amanda_cv_working_ipv6=yes
+
+ # I18N
+ myconf="${myconf} `use_enable nls`"
+
+ # Bug #296634: Perl location
+ perl_set_version
+ myconf="${myconf} --with-amperldir=${VENDOR_LIB}"
+
+ # Bug 296633: --disable-syntax-checks
+ # Some tests are not safe for production systems
+ myconf="${myconf} --disable-syntax-checks"
+
+ # build manpages
+ myconf="${myconf} --enable-manpage-build"
+
+ # bug #483120
+ tc-export AR
+
+ econf \
+ $(use_with readline) \
+ ${myconf}
+}
+
+src_compile() {
+ # Again, do not want the perl-module src_compile
+ default_src_compile
+}
+
+src_install() {
+ [ ! -f "${TMPENVFILE}" ] && die "Variable setting file (${TMPENVFILE}) should exist!"
+ source ${TMPENVFILE}
+
+ einfo "Doing stock install"
+ emake DESTDIR="${D}" install || die
+
+ # Build the envdir file
+ # Don't forget this..
+ einfo "Building environment file"
+ (
+ echo "# These settings are what was present in the environment when this"
+ echo "# Amanda was compiled. Changing anything below this comment will"
+ echo "# have no effect on your application, but it merely exists to"
+ echo "# preserve them for your next emerge of Amanda"
+ cat "${TMPENVFILE}" | sed "s,=\$,='',g"
+ ) >> "${MYFILESDIR}/${ENVDFILE}"
+
+ # Env.d
+ einfo "Installing environment config file"
+ doenvd "${MYFILESDIR}/${ENVDFILE}"
+
+ # Lock down next section (up until docs).
+ insopts -m0640
+ # Installing Amanda Xinetd Services Definition
+ einfo "Installing xinetd service file"
+ insinto /etc/xinetd.d
+ if use minimal ; then
+ newins "${MYFILESDIR}"/amanda-xinetd-2.6.1_p1-client amanda
+ else
+ newins "${MYFILESDIR}"/amanda-xinetd-2.6.1_p1-server amanda
+ fi
+
+ if ! use minimal; then
+ einfo "Installing Sample Daily Cron Job for Amanda"
+ insinto /etc/cron.daily
+ newins "${MYFILESDIR}/amanda-cron" amanda
+ fi
+
+ einfo "Installing systemd service and socket files for Amanda"
+ systemd_dounit "${FILESDIR}"/amanda.socket || die
+ systemd_newunit "${FILESDIR}"/amanda.service 'amanda@.service' || die
+
+ insinto /etc/amanda
+ einfo "Installing .amandahosts File for ${AMANDA_USER_NAME} user"
+ doins "${T}/amandahosts"
+ fperms 600 /etc/amanda/amandahosts
+
+ dosym /etc/amanda/amandahosts "${AMANDA_USER_HOMEDIR}/.amandahosts"
+ insinto "${AMANDA_USER_HOMEDIR}"
+ einfo "Installing .profile for ${AMANDA_USER_NAME} user"
+ newins "${MYFILESDIR}/amanda-profile" .profile
+
+ insinto /etc/amanda
+ doins "${S}/example/amanda-client.conf"
+ if ! use minimal ; then
+ insinto "/etc/amanda/${AMANDA_CONFIG_NAME}"
+ doins "${S}/example/amanda.conf"
+ doins "${S}/example/disklist"
+ keepdir "${AMANDA_USER_HOMEDIR}/${AMANDA_CONFIG_NAME}/index"
+ fi
+
+ keepdir "${AMANDA_TAR_LISTDIR}"
+ keepdir "${AMANDA_USER_HOMEDIR}/amanda"
+ keepdir "${AMANDA_TMPDIR}/dumps"
+ # Just make sure it exists for XFS to work...
+ use xfs && keepdir /var/xfsdump/inventory
+
+ local i
+ for i in "${AMANDA_USER_HOMEDIR}" "${AMANDA_TAR_LISTDIR}" \
+ "${AMANDA_TMPDIR}" /etc/amanda; do
+ einfo "Securing directory (${i})"
+ fowners -R ${AMANDA_USER_NAME}:${AMANDA_GROUP_NAME} ${i}
+ done
+ # Do NOT use -R
+ fperms 0700 \
+ "${AMANDA_USER_HOMEDIR}" "${AMANDA_TAR_LISTDIR}" \
+ "${AMANDA_TMPDIR}" "${AMANDA_TMPDIR}/dumps" \
+ "${AMANDA_USER_HOMEDIR}/amanda" \
+ /etc/amanda
+
+ if ! use minimal ; then
+ fperms 0700 \
+ "${AMANDA_USER_HOMEDIR}/${AMANDA_CONFIG_NAME}" \
+ /etc/amanda/${AMANDA_CONFIG_NAME}
+ fi
+
+ einfo "Setting setuid permissions"
+ amanda_permissions_fix "${D}"
+
+ # Relax permissions again
+ insopts -m0644
+
+ # docs
+ einfo "Installing documentation"
+ dodoc AUTHORS ChangeLog DEVELOPING NEWS README ReleaseNotes UPGRADING
+ # our inetd sample
+ einfo "Installing standard inetd sample"
+ newdoc "${MYFILESDIR}/amanda-inetd.amanda.sample-2.6.0_p2-r2" amanda-inetd.amanda.sample
+ # Amanda example configs
+ einfo "Installing example configurations"
+ rm "${D}"/usr/share/amanda/{COPYRIGHT,ChangeLog,NEWS,ReleaseNotes}
+ mv "${D}/usr/share/amanda/example" "${D}/usr/share/doc/${PF}/"
+ docinto example1
+ newdoc "${FILESDIR}/example_amanda.conf" amanda.conf
+ newdoc "${FILESDIR}/example_disklist-2.5.1_p3-r1" disklist
+ newdoc "${FILESDIR}/example_global.conf" global.conf
+
+ einfo "Cleaning up dud .la files"
+ perl_set_version
+ find "${D}"/"${VENDOR_LIB}" -name '*.la' -print0 |xargs -0 rm -f
+}
+
+pkg_postinst() {
+ [ ! -f "${TMPENVFILE}" -a "$MERGE_TYPE" == "binary" ] && \
+ TMPENVFILE="${ROOT}${ENVDIR}/${ENVDFILE}"
+ [ ! -f "${TMPENVFILE}" ] && die "Variable setting file (${TMPENVFILE}) should exist!"
+ source "${TMPENVFILE}"
+
+ # Migration of amandates from /etc to $localstatedir/amanda
+ if [ -f "${ROOT}/etc/amandates" -a \
+ ! -f "${ROOT}/${AMANDA_USER_HOMEDIR}/amanda/amandates" ]; then
+ einfo "Migrating amandates from /etc/ to ${AMANDA_USER_HOMEDIR}/amanda"
+ einfo "A backup is also placed at /etc/amandates.orig"
+ cp -dp "${ROOT}/etc/amandates" "${ROOT}/etc/amandates.orig"
+ mkdir -p "${ROOT}/${AMANDA_USER_HOMEDIR}/amanda/"
+ cp -dp "${ROOT}/etc/amandates" "${ROOT}/${AMANDA_USER_HOMEDIR}/amanda/amandates"
+ fi
+ if [ -f "${ROOT}/etc/amandates" ]; then
+ einfo "If you have migrated safely, please delete /etc/amandates"
+ fi
+
+ einfo "Checking setuid permissions"
+ amanda_permissions_fix "${ROOT}"
+
+ elog "You should configure Amanda in /etc/amanda now."
+ elog
+ elog "If you use xinetd, Don't forget to check /etc/xinetd.d/amanda"
+ elog "and restart xinetd afterwards!"
+ elog
+ elog "Otherwise, please look at /usr/share/doc/${PF}/inetd.amanda.sample"
+ elog "as an example of how to configure your inetd."
+ elog
+ elog "systemd-users: enable and start amanda.socket or the relevant services"
+ elog "regarding what auth method you use."
+ elog
+ elog "NOTICE: If you need raw access to partitions you need to add the"
+ elog "amanda user to the 'disk' group."
+ elog
+ elog "NOTICE: If you have a tape changer, you need to add the amanda user"
+ elog "to the 'tape' group."
+ elog
+ elog "If you use localhost in your disklist your restores may break."
+ elog "You should replace it with the actual hostname!"
+ elog "Please also see the syntax changes to amandahosts."
+ elog "The only exception is when you use the authentication method 'local'."
+ elog
+ elog "Please note that this package no longer explicitly depends on"
+ elog "virtual/inetd, as it supports modes where an inetd is not needed"
+ elog "(see bug #506028 for details)."
+}
+
+# We have had reports of amanda file permissions getting screwed up.
+# Losing setuid, becoming too lax etc.
+# ONLY root and users in the amanda group should be able to run these binaries!
+amanda_permissions_fix() {
+ local root="$1"
+ [ -z "${root}" ] && die "Failed to pass root argument to amanda_permissions_fix!"
+ local le="/usr/libexec/amanda"
+ for i in /usr/sbin/amcheck "${le}"/calcsize "${le}"/killpgrp \
+ "${le}"/rundump "${le}"/runtar "${le}"/dumper \
+ "${le}"/planner ; do
+ chown root:${AMANDA_GROUP_NAME} "${root}"/${i}
+ chmod u=srwx,g=rx,o= "${root}"/${i}
+ done
+}
diff --git a/app-backup/amanda/amanda-3.4.5.ebuild b/app-backup/amanda/amanda-3.4.5.ebuild
new file mode 100644
index 000000000000..9e26503c1a4a
--- /dev/null
+++ b/app-backup/amanda/amanda-3.4.5.ebuild
@@ -0,0 +1,479 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit autotools perl-module user systemd
+
+DESCRIPTION="The Advanced Maryland Automatic Network Disk Archiver"
+HOMEPAGE="http://www.amanda.org/"
+SRC_URI="mirror://sourceforge/amanda/${P}.tar.gz"
+
+LICENSE="HPND BSD BSD-2 GPL-2+ GPL-3+"
+SLOT="0"
+IUSE="curl gnuplot ipv6 kerberos minimal nls readline s3 samba systemd xfs"
+
+KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86"
+RDEPEND="sys-libs/readline:=
+ virtual/awk
+ app-arch/tar
+ dev-lang/perl:=
+ app-arch/dump
+ net-misc/openssh
+ >=dev-libs/glib-2.26.0
+ dev-perl/JSON
+ dev-perl/Encode-Locale
+ nls? ( virtual/libintl )
+ s3? ( >=net-misc/curl-7.10.0 )
+ !s3? ( curl? ( >=net-misc/curl-7.10.0 ) )
+ samba? ( net-fs/samba:= )
+ kerberos? ( app-crypt/mit-krb5 )
+ xfs? ( sys-fs/xfsdump )
+ !minimal? (
+ dev-perl/XML-Simple
+ virtual/mailx
+ app-arch/mt-st:=
+ sys-block/mtx
+ gnuplot? ( sci-visualization/gnuplot )
+ app-crypt/aespipe
+ app-crypt/gnupg
+ )"
+
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ nls? ( sys-devel/gettext )
+ >=app-text/docbook-xsl-stylesheets-1.72.0
+ app-text/docbook-xml-dtd
+ dev-libs/libxslt
+ dev-lang/swig
+ "
+
+MYFILESDIR="${T}/files"
+ENVDIR="/etc/env.d"
+ENVDFILE="97amanda"
+TMPENVFILE="${T}/${ENVDFILE}"
+
+# This is a complete list of Amanda settings that the ebuild takes from the
+# build environment. This allows users to alter the behavior of the package as
+# upstream intended, but keeping with Gentoo style. We store a copy of them in
+# /etc/env.d/97amanda during the install, so that they are preserved for future
+# installed. This variable name must not start with AMANDA_, as we do not want
+# it captured into the env file.
+ENV_SETTINGS_AMANDA="
+AMANDA_GROUP_GID AMANDA_GROUP_NAME
+AMANDA_USER_NAME AMANDA_USER_UID AMANDA_USER_SH AMANDA_USER_HOMEDIR AMANDA_USER_GROUPS
+AMANDA_SERVER AMANDA_SERVER_TAPE AMANDA_SERVER_TAPE_DEVICE AMANDA_SERVER_INDEX
+AMANDA_TAR_LISTDIR AMANDA_TAR
+AMANDA_PORTS_UDP AMANDA_PORTS_TCP AMANDA_PORTS_BOTH AMANDA_PORTS
+AMANDA_CONFIG_NAME AMANDA_TMPDIR"
+
+amanda_variable_setup() {
+
+ # Setting vars
+ local currentamanda
+
+ # Grab the current settings
+ currentamanda="$(set | egrep "^AMANDA_" | grep -v '^AMANDA_ENV_SETTINGS' | xargs)"
+
+ # First we set the defaults
+ [[ -z "${AMANDA_GROUP_GID}" ]] && AMANDA_GROUP_GID=87
+ [[ -z "${AMANDA_GROUP_NAME}" ]] && AMANDA_GROUP_NAME=amanda
+ [[ -z "${AMANDA_USER_NAME}" ]] && AMANDA_USER_NAME=amanda
+ [[ -z "${AMANDA_USER_UID}" ]] && AMANDA_USER_UID=87
+ [[ -z "${AMANDA_USER_SH}" ]] && AMANDA_USER_SH=/bin/bash
+ [[ -z "${AMANDA_USER_HOMEDIR}" ]] && AMANDA_USER_HOMEDIR=/var/spool/amanda
+ [[ -z "${AMANDA_USER_GROUPS}" ]] && AMANDA_USER_GROUPS="${AMANDA_GROUP_NAME}"
+
+ # This installs Amanda, with the server. However, it could be a client,
+ # just specify an alternate server name in AMANDA_SERVER.
+ [[ -z "${AMANDA_SERVER}" ]] && AMANDA_SERVER="${HOSTNAME}"
+ [[ -z "${AMANDA_SERVER_TAPE}" ]] && AMANDA_SERVER_TAPE="${AMANDA_SERVER}"
+ [[ -z "${AMANDA_SERVER_TAPE_DEVICE}" ]] && AMANDA_SERVER_TAPE_DEVICE="/dev/nst0"
+ [[ -z "${AMANDA_SERVER_INDEX}" ]] && AMANDA_SERVER_INDEX="${AMANDA_SERVER}"
+ [[ -z "${AMANDA_TAR_LISTDIR}" ]] && AMANDA_TAR_LISTDIR=${AMANDA_USER_HOMEDIR}/tar-lists
+ [[ -z "${AMANDA_CONFIG_NAME}" ]] && AMANDA_CONFIG_NAME=DailySet1
+ [[ -z "${AMANDA_TMPDIR}" ]] && AMANDA_TMPDIR=/var/tmp/amanda
+ [[ -z "${AMANDA_DBGDIR}" ]] && AMANDA_DBGDIR="$AMANDA_TMPDIR"
+ # These are left empty by default
+ [[ -z "${AMANDA_PORTS_UDP}" ]] && AMANDA_PORTS_UDP=
+ [[ -z "${AMANDA_PORTS_TCP}" ]] && AMANDA_PORTS_TCP=
+ [[ -z "${AMANDA_PORTS_BOTH}" ]] && AMANDA_PORTS_BOTH=
+ [[ -z "${AMANDA_PORTS}" ]] && AMANDA_PORTS=
+
+ # What tar to use
+ [[ -z "${AMANDA_TAR}" ]] && AMANDA_TAR=/bin/tar
+
+ # Now pull in the old stuff
+ if [[ -f "${EROOT}${ENVDIR}/${ENVDFILE}" ]]; then
+ # We don't just source it as we don't want everything in there.
+ eval $(egrep "^AMANDA_" "${EROOT}${ENVDIR}/${ENVDFILE}" | grep -v '^AMANDA_ENV_SETTINGS')
+ fi
+
+ # Re-apply the new settings if any
+ [ -n "${currentamanda}" ] && eval $(echo "${currentamanda}")
+
+}
+
+pkg_setup() {
+ amanda_variable_setup
+
+ # If USE=minimal, give out a warning, if AMANDA_SERVER is not set to
+ # another host than HOSTNAME.
+ if use minimal && [ "${AMANDA_SERVER}" = "${HOSTNAME}" ] ; then
+ elog "You are installing a client-only version of Amanda."
+ elog "You should set the variable \$AMANDA_SERVER to point at your"
+ elog "Amanda-tape-server, otherwise you will have to specify its name"
+ elog "when using amrecover on the client."
+ elog "For example: Use something like"
+ elog "AMANDA_SERVER=\"myserver\" emerge amanda"
+ elog
+ fi
+
+ enewgroup "${AMANDA_GROUP_NAME}" "${AMANDA_GROUP_GID}"
+ enewuser "${AMANDA_USER_NAME}" "${AMANDA_USER_UID}" "${AMANDA_USER_SH}" "${AMANDA_USER_HOMEDIR}" "${AMANDA_USER_GROUPS}"
+}
+
+src_unpack() {
+ # we do not want the perl src_unpack
+ default_src_unpack
+}
+
+src_prepare() {
+ # gentoo bug #331111
+ sed -i '/^check-local: check-perl$/d' "${S}"/config/automake/scripts.am || die
+ sed -i '/^check-local:/s,syntax-check,,g' "${S}"/perl/Makefile.am || die
+
+ # bug with glibc-2.16.0
+ sed -i -e '/gets is a security/d' "${S}"/gnulib/stdio.in.h || die
+
+ eautoreconf
+
+ # places for us to work in
+ mkdir -p "${MYFILESDIR}" || die
+ # Now we store the settings we just created
+ set | egrep "^AMANDA_" | grep -v '^AMANDA_ENV_SETTINGS' > "${TMPENVFILE}" || die
+
+ # Prepare our custom files
+ einfo "Building custom configuration files"
+ local i # our iterator
+ local sedexpr # var for sed expr
+ sedexpr=''
+ for i in ${ENV_SETTINGS_AMANDA} ; do
+ local val
+ eval "val=\"\${${i}}\""
+ sedexpr="${sedexpr}s|__${i}__|${val}|g;"
+ done
+
+ # now apply the sed expr
+ for i in "${FILESDIR}"/amanda-* ; do
+ sed -re "${sedexpr}" <"${i}" >"${MYFILESDIR}/`basename ${i}`" || die
+ done
+
+ if use minimal; then
+ cat "${MYFILESDIR}"/amanda-amandahosts-server-2.5.1_p3-r1 > "${T}"/amandahosts || die
+ else
+ sed -i -e 's:^\(my $amandahomedir\)=.*:\1 = $localstatedir;:' \
+ server-src/am{addclient,serverconfig}.pl || die
+ cat "${MYFILESDIR}"/amanda-amandahosts-client-2.5.1_p3-r1 > "${T}"/amandahosts || die
+ fi
+
+ eapply_user
+}
+
+src_configure() {
+ # fix bug #36316
+ addpredict /var/cache/samba/gencache.tdb
+ # fix bug #376169
+ addpredict /run/blkid
+ addpredict /etc/blkid.tab
+
+ [ ! -f "${TMPENVFILE}" ] && die "Variable setting file (${TMPENVFILE}) should exist!"
+ source "${TMPENVFILE}"
+ local myconf
+
+ einfo "Using ${AMANDA_SERVER_TAPE} for tape server."
+ myconf="${myconf} --with-tape-server=${AMANDA_SERVER_TAPE}"
+ einfo "Using ${AMANDA_SERVER_TAPE_DEVICE} for tape server."
+ myconf="${myconf} --with-tape-device=${AMANDA_SERVER_TAPE_DEVICE}"
+ einfo "Using ${AMANDA_SERVER_INDEX} for index server."
+ myconf="${myconf} --with-index-server=${AMANDA_SERVER_INDEX}"
+ einfo "Using ${AMANDA_USER_NAME} for amanda user."
+ myconf="${myconf} --with-user=${AMANDA_USER_NAME}"
+ einfo "Using ${AMANDA_GROUP_NAME} for amanda group."
+ myconf="${myconf} --with-group=${AMANDA_GROUP_NAME}"
+ einfo "Using ${AMANDA_TAR} as Tar implementation."
+ myconf="${myconf} --with-gnutar=${AMANDA_TAR}"
+ einfo "Using ${AMANDA_TAR_LISTDIR} as tar listdir."
+ myconf="${myconf} --with-gnutar-listdir=${AMANDA_TAR_LISTDIR}"
+ einfo "Using ${AMANDA_CONFIG_NAME} as default config name."
+ myconf="${myconf} --with-config=${AMANDA_CONFIG_NAME}"
+ einfo "Using ${AMANDA_TMPDIR} as Amanda temporary directory."
+ myconf="${myconf} --with-tmpdir=${AMANDA_TMPDIR}"
+
+ if [ -n "${AMANDA_PORTS_UDP}" ] && [ -n "${AMANDA_PORTS_TCP}" ] && [ -z "${AMANDA_PORTS_BOTH}" ] ; then
+ eerror "If you want _both_ UDP and TCP ports, please use only the"
+ eerror "AMANDA_PORTS environment variable for identical ports, or set"
+ eerror "AMANDA_PORTS_BOTH."
+ die "Bad port setup!"
+ fi
+ if [ -n "${AMANDA_PORTS_UDP}" ]; then
+ einfo "Using UDP ports ${AMANDA_PORTS_UDP/,/-}"
+ myconf="${myconf} --with-udpportrange=${AMANDA_PORTS_UDP}"
+ fi
+ if [ -n "${AMANDA_PORTS_TCP}" ]; then
+ einfo "Using TCP ports ${AMANDA_PORTS_TCP/,/-}"
+ myconf="${myconf} --with-tcpportrange=${AMANDA_PORTS_TCP}"
+ fi
+ if [ -n "${AMANDA_PORTS}" ]; then
+ einfo "Using ports ${AMANDA_PORTS/,/-}"
+ myconf="${myconf} --with-portrange=${AMANDA_PORTS}"
+ fi
+
+ # Extras
+ # Speed option
+ myconf="${myconf} --with-buffered-dump"
+ # "debugging" in the configuration is NOT debug in the conventional sense.
+ # It is actually just useful output in the application, and should remain
+ # enabled. There are some cases of breakage with MTX tape changers as of
+ # 2.5.1p2 that it exposes when turned off as well.
+ myconf="${myconf} --with-debugging"
+ # Where to put our files
+ myconf="${myconf} --localstatedir=${AMANDA_USER_HOMEDIR}"
+
+ # Samba support
+ myconf="${myconf} $(use_with samba smbclient /usr/bin/smbclient)"
+
+ # Support for BSD, SSH, BSDUDP, BSDTCP security methods all compiled in by
+ # default
+ myconf="${myconf} --with-bsd-security"
+ myconf="${myconf} --with-ssh-security"
+ myconf="${myconf} --with-bsdudp-security"
+ myconf="${myconf} --with-bsdtcp-security"
+
+ # kerberos-security mechanism version 5
+ myconf="${myconf} $(use_with kerberos krb5-security)"
+
+ # Amazon S3 support
+ myconf="${myconf} `use_enable s3 s3-device`"
+
+ # libcurl is required for S3 but otherwise optional
+ if ! use s3; then
+ myconf="${myconf} $(use_with curl libcurl)"
+ fi
+
+ # Client only, as requested in bug #127725
+ if use minimal ; then
+ myconf="${myconf} --without-server"
+ else
+ # amplot
+ myconf="${myconf} $(use_with gnuplot)"
+ fi
+
+ # IPv6 fun.
+ myconf="${myconf} `use_with ipv6`"
+ # This is to prevent the IPv6-is-working test
+ # As the test fails on binpkg build hosts with no IPv6.
+ use ipv6 && export amanda_cv_working_ipv6=yes
+
+ # I18N
+ myconf="${myconf} `use_enable nls`"
+
+ # Bug #296634: Perl location
+ perl_set_version
+ myconf="${myconf} --with-amperldir=${VENDOR_LIB}"
+
+ # Bug 296633: --disable-syntax-checks
+ # Some tests are not safe for production systems
+ myconf="${myconf} --disable-syntax-checks"
+
+ # build manpages
+ myconf="${myconf} --enable-manpage-build"
+
+ # bug #483120
+ tc-export AR
+
+ econf \
+ $(use_with readline) \
+ ${myconf}
+}
+
+src_compile() {
+ # Again, do not want the perl-module src_compile
+ default_src_compile
+}
+
+src_install() {
+ [ ! -f "${TMPENVFILE}" ] && die "Variable setting file (${TMPENVFILE}) should exist!"
+ source ${TMPENVFILE}
+
+ einfo "Doing stock install"
+ emake DESTDIR="${D}" install || die
+
+ # Build the envdir file
+ # Don't forget this..
+ einfo "Building environment file"
+ (
+ echo "# These settings are what was present in the environment when this"
+ echo "# Amanda was compiled. Changing anything below this comment will"
+ echo "# have no effect on your application, but it merely exists to"
+ echo "# preserve them for your next emerge of Amanda"
+ cat "${TMPENVFILE}" | sed "s,=\$,='',g"
+ ) >> "${MYFILESDIR}/${ENVDFILE}"
+
+ # Env.d
+ einfo "Installing environment config file"
+ doenvd "${MYFILESDIR}/${ENVDFILE}"
+
+ # Lock down next section (up until docs).
+ insopts -m0640
+ # Installing Amanda Xinetd Services Definition
+ einfo "Installing xinetd service file"
+ insinto /etc/xinetd.d
+ if use minimal ; then
+ newins "${MYFILESDIR}"/amanda-xinetd-2.6.1_p1-client amanda
+ else
+ newins "${MYFILESDIR}"/amanda-xinetd-2.6.1_p1-server amanda
+ fi
+
+ if ! use minimal; then
+ einfo "Installing Sample Daily Cron Job for Amanda"
+ insinto /etc/cron.daily
+ newins "${MYFILESDIR}/amanda-cron" amanda
+ fi
+
+ einfo "Installing systemd service and socket files for Amanda"
+ systemd_dounit "${FILESDIR}"/amanda.socket || die
+ systemd_newunit "${FILESDIR}"/amanda.service 'amanda@.service' || die
+
+ insinto /etc/amanda
+ einfo "Installing .amandahosts File for ${AMANDA_USER_NAME} user"
+ doins "${T}/amandahosts"
+ fperms 600 /etc/amanda/amandahosts
+
+ dosym /etc/amanda/amandahosts "${AMANDA_USER_HOMEDIR}/.amandahosts"
+ insinto "${AMANDA_USER_HOMEDIR}"
+ einfo "Installing .profile for ${AMANDA_USER_NAME} user"
+ newins "${MYFILESDIR}/amanda-profile" .profile
+
+ insinto /etc/amanda
+ doins "${S}/example/amanda-client.conf"
+ if ! use minimal ; then
+ insinto "/etc/amanda/${AMANDA_CONFIG_NAME}"
+ doins "${S}/example/amanda.conf"
+ doins "${S}/example/disklist"
+ keepdir "${AMANDA_USER_HOMEDIR}/${AMANDA_CONFIG_NAME}/index"
+ fi
+
+ keepdir "${AMANDA_TAR_LISTDIR}"
+ keepdir "${AMANDA_USER_HOMEDIR}/amanda"
+ keepdir "${AMANDA_TMPDIR}/dumps"
+ # Just make sure it exists for XFS to work...
+ use xfs && keepdir /var/xfsdump/inventory
+
+ local i
+ for i in "${AMANDA_USER_HOMEDIR}" "${AMANDA_TAR_LISTDIR}" \
+ "${AMANDA_TMPDIR}" /etc/amanda; do
+ einfo "Securing directory (${i})"
+ fowners -R ${AMANDA_USER_NAME}:${AMANDA_GROUP_NAME} ${i}
+ done
+ # Do NOT use -R
+ fperms 0700 \
+ "${AMANDA_USER_HOMEDIR}" "${AMANDA_TAR_LISTDIR}" \
+ "${AMANDA_TMPDIR}" "${AMANDA_TMPDIR}/dumps" \
+ "${AMANDA_USER_HOMEDIR}/amanda" \
+ /etc/amanda
+
+ if ! use minimal ; then
+ fperms 0700 \
+ "${AMANDA_USER_HOMEDIR}/${AMANDA_CONFIG_NAME}" \
+ /etc/amanda/${AMANDA_CONFIG_NAME}
+ fi
+
+ einfo "Setting setuid permissions"
+ amanda_permissions_fix "${D}"
+
+ # Relax permissions again
+ insopts -m0644
+
+ # docs
+ einfo "Installing documentation"
+ dodoc AUTHORS ChangeLog DEVELOPING NEWS README ReleaseNotes UPGRADING
+ # our inetd sample
+ einfo "Installing standard inetd sample"
+ newdoc "${MYFILESDIR}/amanda-inetd.amanda.sample-2.6.0_p2-r2" amanda-inetd.amanda.sample
+ # Amanda example configs
+ einfo "Installing example configurations"
+ rm "${D}"/usr/share/amanda/{COPYRIGHT,ChangeLog,NEWS,ReleaseNotes}
+ mv "${D}/usr/share/amanda/example" "${D}/usr/share/doc/${PF}/"
+ docinto example1
+ newdoc "${FILESDIR}/example_amanda.conf" amanda.conf
+ newdoc "${FILESDIR}/example_disklist-2.5.1_p3-r1" disklist
+ newdoc "${FILESDIR}/example_global.conf" global.conf
+
+ einfo "Cleaning up dud .la files"
+ perl_set_version
+ find "${D}"/"${VENDOR_LIB}" -name '*.la' -print0 |xargs -0 rm -f
+}
+
+pkg_postinst() {
+ [ ! -f "${TMPENVFILE}" -a "$MERGE_TYPE" == "binary" ] && \
+ TMPENVFILE="${ROOT}${ENVDIR}/${ENVDFILE}"
+ [ ! -f "${TMPENVFILE}" ] && die "Variable setting file (${TMPENVFILE}) should exist!"
+ source "${TMPENVFILE}"
+
+ # Migration of amandates from /etc to $localstatedir/amanda
+ if [ -f "${ROOT}/etc/amandates" -a \
+ ! -f "${ROOT}/${AMANDA_USER_HOMEDIR}/amanda/amandates" ]; then
+ einfo "Migrating amandates from /etc/ to ${AMANDA_USER_HOMEDIR}/amanda"
+ einfo "A backup is also placed at /etc/amandates.orig"
+ cp -dp "${ROOT}/etc/amandates" "${ROOT}/etc/amandates.orig"
+ mkdir -p "${ROOT}/${AMANDA_USER_HOMEDIR}/amanda/"
+ cp -dp "${ROOT}/etc/amandates" "${ROOT}/${AMANDA_USER_HOMEDIR}/amanda/amandates"
+ fi
+ if [ -f "${ROOT}/etc/amandates" ]; then
+ einfo "If you have migrated safely, please delete /etc/amandates"
+ fi
+
+ einfo "Checking setuid permissions"
+ amanda_permissions_fix "${ROOT}"
+
+ elog "You should configure Amanda in /etc/amanda now."
+ elog
+ elog "If you use xinetd, Don't forget to check /etc/xinetd.d/amanda"
+ elog "and restart xinetd afterwards!"
+ elog
+ elog "Otherwise, please look at /usr/share/doc/${PF}/inetd.amanda.sample"
+ elog "as an example of how to configure your inetd."
+ elog
+ elog "systemd-users: enable and start amanda.socket or the relevant services"
+ elog "regarding what auth method you use."
+ elog
+ elog "NOTICE: If you need raw access to partitions you need to add the"
+ elog "amanda user to the 'disk' group."
+ elog
+ elog "NOTICE: If you have a tape changer, you need to add the amanda user"
+ elog "to the 'tape' group."
+ elog
+ elog "If you use localhost in your disklist your restores may break."
+ elog "You should replace it with the actual hostname!"
+ elog "Please also see the syntax changes to amandahosts."
+ elog "The only exception is when you use the authentication method 'local'."
+ elog
+ elog "Please note that this package no longer explicitly depends on"
+ elog "virtual/inetd, as it supports modes where an inetd is not needed"
+ elog "(see bug #506028 for details)."
+}
+
+# We have had reports of amanda file permissions getting screwed up.
+# Losing setuid, becoming too lax etc.
+# ONLY root and users in the amanda group should be able to run these binaries!
+amanda_permissions_fix() {
+ local root="$1"
+ [ -z "${root}" ] && die "Failed to pass root argument to amanda_permissions_fix!"
+ local le="/usr/libexec/amanda"
+ for i in /usr/sbin/amcheck "${le}"/calcsize "${le}"/killpgrp \
+ "${le}"/rundump "${le}"/runtar "${le}"/dumper \
+ "${le}"/planner ; do
+ chown root:${AMANDA_GROUP_NAME} "${root}"/${i}
+ chmod u=srwx,g=rx,o= "${root}"/${i}
+ done
+}
diff --git a/app-backup/amanda/amanda-3.5.ebuild b/app-backup/amanda/amanda-3.5.ebuild
new file mode 100644
index 000000000000..797dbc7a0265
--- /dev/null
+++ b/app-backup/amanda/amanda-3.5.ebuild
@@ -0,0 +1,480 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit autotools perl-module user systemd
+
+DESCRIPTION="The Advanced Maryland Automatic Network Disk Archiver"
+HOMEPAGE="http://www.amanda.org/"
+SRC_URI="mirror://sourceforge/amanda/${P}.tar.gz"
+
+LICENSE="HPND BSD BSD-2 GPL-2+ GPL-3+"
+SLOT="0"
+IUSE="curl gnuplot ipv6 kerberos minimal nls readline s3 samba systemd xfs"
+
+KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86"
+RDEPEND="sys-libs/readline:=
+ virtual/awk
+ app-arch/tar
+ dev-lang/perl:=
+ app-arch/dump
+ net-misc/openssh
+ >=dev-libs/glib-2.26.0
+ dev-perl/JSON
+ dev-perl/Encode-Locale
+ nls? ( virtual/libintl )
+ s3? ( >=net-misc/curl-7.10.0 )
+ !s3? ( curl? ( >=net-misc/curl-7.10.0 ) )
+ samba? ( net-fs/samba:= )
+ kerberos? ( app-crypt/mit-krb5 )
+ xfs? ( sys-fs/xfsdump )
+ !minimal? (
+ dev-perl/XML-Simple
+ virtual/mailx
+ app-arch/mt-st:=
+ sys-block/mtx
+ gnuplot? ( sci-visualization/gnuplot )
+ app-crypt/aespipe
+ app-crypt/gnupg
+ )"
+
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ nls? ( sys-devel/gettext )
+ >=app-text/docbook-xsl-stylesheets-1.72.0
+ app-text/docbook-xml-dtd
+ dev-libs/libxslt
+ dev-lang/swig
+ "
+
+MYFILESDIR="${T}/files"
+ENVDIR="/etc/env.d"
+ENVDFILE="97amanda"
+TMPENVFILE="${T}/${ENVDFILE}"
+
+# This is a complete list of Amanda settings that the ebuild takes from the
+# build environment. This allows users to alter the behavior of the package as
+# upstream intended, but keeping with Gentoo style. We store a copy of them in
+# /etc/env.d/97amanda during the install, so that they are preserved for future
+# installed. This variable name must not start with AMANDA_, as we do not want
+# it captured into the env file.
+ENV_SETTINGS_AMANDA="
+AMANDA_GROUP_GID AMANDA_GROUP_NAME
+AMANDA_USER_NAME AMANDA_USER_UID AMANDA_USER_SH AMANDA_USER_HOMEDIR AMANDA_USER_GROUPS
+AMANDA_SERVER AMANDA_SERVER_TAPE AMANDA_SERVER_TAPE_DEVICE AMANDA_SERVER_INDEX
+AMANDA_TAR_LISTDIR AMANDA_TAR
+AMANDA_PORTS_UDP AMANDA_PORTS_TCP AMANDA_PORTS_BOTH AMANDA_PORTS
+AMANDA_CONFIG_NAME AMANDA_TMPDIR"
+
+amanda_variable_setup() {
+
+ # Setting vars
+ local currentamanda
+
+ # Grab the current settings
+ currentamanda="$(set | egrep "^AMANDA_" | grep -v '^AMANDA_ENV_SETTINGS' | xargs)"
+
+ # First we set the defaults
+ [[ -z "${AMANDA_GROUP_GID}" ]] && AMANDA_GROUP_GID=87
+ [[ -z "${AMANDA_GROUP_NAME}" ]] && AMANDA_GROUP_NAME=amanda
+ [[ -z "${AMANDA_USER_NAME}" ]] && AMANDA_USER_NAME=amanda
+ [[ -z "${AMANDA_USER_UID}" ]] && AMANDA_USER_UID=87
+ [[ -z "${AMANDA_USER_SH}" ]] && AMANDA_USER_SH=/bin/bash
+ [[ -z "${AMANDA_USER_HOMEDIR}" ]] && AMANDA_USER_HOMEDIR=/var/spool/amanda
+ [[ -z "${AMANDA_USER_GROUPS}" ]] && AMANDA_USER_GROUPS="${AMANDA_GROUP_NAME}"
+
+ # This installs Amanda, with the server. However, it could be a client,
+ # just specify an alternate server name in AMANDA_SERVER.
+ [[ -z "${AMANDA_SERVER}" ]] && AMANDA_SERVER="${HOSTNAME}"
+ [[ -z "${AMANDA_SERVER_TAPE}" ]] && AMANDA_SERVER_TAPE="${AMANDA_SERVER}"
+ [[ -z "${AMANDA_SERVER_TAPE_DEVICE}" ]] && AMANDA_SERVER_TAPE_DEVICE="/dev/nst0"
+ [[ -z "${AMANDA_SERVER_INDEX}" ]] && AMANDA_SERVER_INDEX="${AMANDA_SERVER}"
+ [[ -z "${AMANDA_TAR_LISTDIR}" ]] && AMANDA_TAR_LISTDIR=${AMANDA_USER_HOMEDIR}/tar-lists
+ [[ -z "${AMANDA_CONFIG_NAME}" ]] && AMANDA_CONFIG_NAME=DailySet1
+ [[ -z "${AMANDA_TMPDIR}" ]] && AMANDA_TMPDIR=/var/tmp/amanda
+ [[ -z "${AMANDA_DBGDIR}" ]] && AMANDA_DBGDIR="$AMANDA_TMPDIR"
+ # These are left empty by default
+ [[ -z "${AMANDA_PORTS_UDP}" ]] && AMANDA_PORTS_UDP=
+ [[ -z "${AMANDA_PORTS_TCP}" ]] && AMANDA_PORTS_TCP=
+ [[ -z "${AMANDA_PORTS_BOTH}" ]] && AMANDA_PORTS_BOTH=
+ [[ -z "${AMANDA_PORTS}" ]] && AMANDA_PORTS=
+
+ # What tar to use
+ [[ -z "${AMANDA_TAR}" ]] && AMANDA_TAR=/bin/tar
+
+ # Now pull in the old stuff
+ if [[ -f "${EROOT}${ENVDIR}/${ENVDFILE}" ]]; then
+ # We don't just source it as we don't want everything in there.
+ eval $(egrep "^AMANDA_" "${EROOT}${ENVDIR}/${ENVDFILE}" | grep -v '^AMANDA_ENV_SETTINGS')
+ fi
+
+ # Re-apply the new settings if any
+ [ -n "${currentamanda}" ] && eval $(echo "${currentamanda}")
+
+}
+
+pkg_setup() {
+ amanda_variable_setup
+
+ # If USE=minimal, give out a warning, if AMANDA_SERVER is not set to
+ # another host than HOSTNAME.
+ if use minimal && [ "${AMANDA_SERVER}" = "${HOSTNAME}" ] ; then
+ elog "You are installing a client-only version of Amanda."
+ elog "You should set the variable \$AMANDA_SERVER to point at your"
+ elog "Amanda-tape-server, otherwise you will have to specify its name"
+ elog "when using amrecover on the client."
+ elog "For example: Use something like"
+ elog "AMANDA_SERVER=\"myserver\" emerge amanda"
+ elog
+ fi
+
+ enewgroup "${AMANDA_GROUP_NAME}" "${AMANDA_GROUP_GID}"
+ enewuser "${AMANDA_USER_NAME}" "${AMANDA_USER_UID}" "${AMANDA_USER_SH}" "${AMANDA_USER_HOMEDIR}" "${AMANDA_USER_GROUPS}"
+}
+
+src_unpack() {
+ # we do not want the perl src_unpack
+ default_src_unpack
+}
+
+src_prepare() {
+ # gentoo bug #331111
+ sed -i '/^check-local: check-perl$/d' "${S}"/config/automake/scripts.am || die
+ sed -i '/^check-local:/s,syntax-check,,g' "${S}"/perl/Makefile.am || die
+
+ # bug with glibc-2.16.0
+ sed -i -e '/gets is a security/d' "${S}"/gnulib/stdio.in.h || die
+
+ eautoreconf
+
+ # places for us to work in
+ mkdir -p "${MYFILESDIR}" || die
+ # Now we store the settings we just created
+ set | egrep "^AMANDA_" | grep -v '^AMANDA_ENV_SETTINGS' > "${TMPENVFILE}" || die
+
+ # Prepare our custom files
+ einfo "Building custom configuration files"
+ local i # our iterator
+ local sedexpr # var for sed expr
+ sedexpr=''
+ for i in ${ENV_SETTINGS_AMANDA} ; do
+ local val
+ eval "val=\"\${${i}}\""
+ sedexpr="${sedexpr}s|__${i}__|${val}|g;"
+ done
+
+ # now apply the sed expr
+ for i in "${FILESDIR}"/amanda-* ; do
+ sed -re "${sedexpr}" <"${i}" >"${MYFILESDIR}/`basename ${i}`" || die
+ done
+
+ if use minimal; then
+ cat "${MYFILESDIR}"/amanda-amandahosts-server-2.5.1_p3-r1 > "${T}"/amandahosts || die
+ else
+ sed -i -e 's:^\(my $amandahomedir\)=.*:\1 = $localstatedir;:' \
+ server-src/am{addclient,serverconfig}.pl || die
+ cat "${MYFILESDIR}"/amanda-amandahosts-client-2.5.1_p3-r1 > "${T}"/amandahosts || die
+ fi
+
+ eapply_user
+}
+
+src_configure() {
+ # fix bug #36316
+ addpredict /var/cache/samba/gencache.tdb
+ # fix bug #376169
+ addpredict /run/blkid
+ addpredict /etc/blkid.tab
+
+ [ ! -f "${TMPENVFILE}" ] && die "Variable setting file (${TMPENVFILE}) should exist!"
+ source "${TMPENVFILE}"
+ local myconf
+
+ einfo "Using ${AMANDA_SERVER_TAPE} for tape server."
+ myconf="${myconf} --with-tape-server=${AMANDA_SERVER_TAPE}"
+ einfo "Using ${AMANDA_SERVER_TAPE_DEVICE} for tape server."
+ myconf="${myconf} --with-tape-device=${AMANDA_SERVER_TAPE_DEVICE}"
+ einfo "Using ${AMANDA_SERVER_INDEX} for index server."
+ myconf="${myconf} --with-index-server=${AMANDA_SERVER_INDEX}"
+ einfo "Using ${AMANDA_USER_NAME} for amanda user."
+ myconf="${myconf} --with-user=${AMANDA_USER_NAME}"
+ einfo "Using ${AMANDA_GROUP_NAME} for amanda group."
+ myconf="${myconf} --with-group=${AMANDA_GROUP_NAME}"
+ einfo "Using ${AMANDA_TAR} as Tar implementation."
+ myconf="${myconf} --with-gnutar=${AMANDA_TAR}"
+ einfo "Using ${AMANDA_TAR_LISTDIR} as tar listdir."
+ myconf="${myconf} --with-gnutar-listdir=${AMANDA_TAR_LISTDIR}"
+ einfo "Using ${AMANDA_CONFIG_NAME} as default config name."
+ myconf="${myconf} --with-config=${AMANDA_CONFIG_NAME}"
+ einfo "Using ${AMANDA_TMPDIR} as Amanda temporary directory."
+ myconf="${myconf} --with-tmpdir=${AMANDA_TMPDIR}"
+
+ if [ -n "${AMANDA_PORTS_UDP}" ] && [ -n "${AMANDA_PORTS_TCP}" ] && [ -z "${AMANDA_PORTS_BOTH}" ] ; then
+ eerror "If you want _both_ UDP and TCP ports, please use only the"
+ eerror "AMANDA_PORTS environment variable for identical ports, or set"
+ eerror "AMANDA_PORTS_BOTH."
+ die "Bad port setup!"
+ fi
+ if [ -n "${AMANDA_PORTS_UDP}" ]; then
+ einfo "Using UDP ports ${AMANDA_PORTS_UDP/,/-}"
+ myconf="${myconf} --with-udpportrange=${AMANDA_PORTS_UDP}"
+ fi
+ if [ -n "${AMANDA_PORTS_TCP}" ]; then
+ einfo "Using TCP ports ${AMANDA_PORTS_TCP/,/-}"
+ myconf="${myconf} --with-tcpportrange=${AMANDA_PORTS_TCP}"
+ fi
+ if [ -n "${AMANDA_PORTS}" ]; then
+ einfo "Using ports ${AMANDA_PORTS/,/-}"
+ myconf="${myconf} --with-portrange=${AMANDA_PORTS}"
+ fi
+
+ # Extras
+ # Speed option
+ myconf="${myconf} --with-buffered-dump"
+ # "debugging" in the configuration is NOT debug in the conventional sense.
+ # It is actually just useful output in the application, and should remain
+ # enabled. There are some cases of breakage with MTX tape changers as of
+ # 2.5.1p2 that it exposes when turned off as well.
+ myconf="${myconf} --with-debugging"
+ # Where to put our files
+ myconf="${myconf} --localstatedir=${AMANDA_USER_HOMEDIR}"
+
+ # Samba support
+ myconf="${myconf} $(use_with samba smbclient /usr/bin/smbclient)"
+
+ # Support for BSD, SSH, BSDUDP, BSDTCP security methods all compiled in by
+ # default
+ myconf="${myconf} --with-bsd-security"
+ myconf="${myconf} --with-ssh-security"
+ myconf="${myconf} --with-bsdudp-security"
+ myconf="${myconf} --with-bsdtcp-security"
+
+ # kerberos-security mechanism version 5
+ myconf="${myconf} $(use_with kerberos krb5-security)"
+
+ # Amazon S3 support
+ myconf="${myconf} `use_enable s3 s3-device`"
+
+ # libcurl is required for S3 but otherwise optional
+ if ! use s3; then
+ myconf="${myconf} $(use_with curl libcurl)"
+ fi
+
+ # Client only, as requested in bug #127725
+ if use minimal ; then
+ myconf="${myconf} --without-server"
+ else
+ # amplot
+ myconf="${myconf} $(use_with gnuplot)"
+ fi
+
+ # IPv6 fun.
+ myconf="${myconf} `use_with ipv6`"
+ # This is to prevent the IPv6-is-working test
+ # As the test fails on binpkg build hosts with no IPv6.
+ use ipv6 && export amanda_cv_working_ipv6=yes
+
+ # I18N
+ myconf="${myconf} `use_enable nls`"
+
+ # Bug #296634: Perl location
+ perl_set_version
+ myconf="${myconf} --with-amperldir=${VENDOR_LIB}"
+
+ # Bug 296633: --disable-syntax-checks
+ # Some tests are not safe for production systems
+ myconf="${myconf} --disable-syntax-checks"
+
+ # build manpages
+ myconf="${myconf} --enable-manpage-build"
+
+ # bug #483120
+ tc-export AR
+
+ econf \
+ $(use_with readline) \
+ ${myconf}
+}
+
+src_compile() {
+ # Again, do not want the perl-module src_compile
+ default_src_compile
+}
+
+src_install() {
+ [ ! -f "${TMPENVFILE}" ] && die "Variable setting file (${TMPENVFILE}) should exist!"
+ source ${TMPENVFILE}
+
+ einfo "Doing stock install"
+ emake DESTDIR="${D}" install
+
+ # Build the envdir file
+ # Don't forget this..
+ einfo "Building environment file"
+ (
+ echo "# These settings are what was present in the environment when this"
+ echo "# Amanda was compiled. Changing anything below this comment will"
+ echo "# have no effect on your application, but it merely exists to"
+ echo "# preserve them for your next emerge of Amanda"
+ cat "${TMPENVFILE}" | sed "s,=\$,='',g"
+ ) >> "${MYFILESDIR}/${ENVDFILE}"
+
+ # Env.d
+ einfo "Installing environment config file"
+ doenvd "${MYFILESDIR}/${ENVDFILE}"
+
+ # Lock down next section (up until docs).
+ insopts -m0640
+ # Installing Amanda Xinetd Services Definition
+ einfo "Installing xinetd service file"
+ insinto /etc/xinetd.d
+ if use minimal ; then
+ newins "${MYFILESDIR}"/amanda-xinetd-2.6.1_p1-client amanda
+ else
+ newins "${MYFILESDIR}"/amanda-xinetd-2.6.1_p1-server amanda
+ fi
+
+ if ! use minimal; then
+ einfo "Installing Sample Daily Cron Job for Amanda"
+ insinto /etc/cron.daily
+ newins "${MYFILESDIR}/amanda-cron" amanda
+ fi
+
+ einfo "Installing systemd service and socket files for Amanda"
+ systemd_dounit "${FILESDIR}"/amanda.socket
+ systemd_newunit "${FILESDIR}"/amanda.service 'amanda@.service'
+
+ insinto /etc/amanda
+ einfo "Installing .amandahosts File for ${AMANDA_USER_NAME} user"
+ doins "${T}/amandahosts"
+ fperms 600 /etc/amanda/amandahosts
+
+ dosym /etc/amanda/amandahosts "${AMANDA_USER_HOMEDIR}/.amandahosts"
+ insinto "${AMANDA_USER_HOMEDIR}"
+ einfo "Installing .profile for ${AMANDA_USER_NAME} user"
+ newins "${MYFILESDIR}/amanda-profile" .profile
+
+ insinto /etc/amanda
+ doins "${S}/example/amanda-client.conf"
+ if ! use minimal ; then
+ insinto "/etc/amanda/${AMANDA_CONFIG_NAME}"
+ doins "${S}/example/amanda.conf"
+ doins "${S}/example/disklist"
+ keepdir "${AMANDA_USER_HOMEDIR}/${AMANDA_CONFIG_NAME}/index"
+ fi
+
+ keepdir "${AMANDA_TAR_LISTDIR}"
+ keepdir "${AMANDA_USER_HOMEDIR}/amanda"
+ keepdir "${AMANDA_TMPDIR}/dumps"
+ # Just make sure it exists for XFS to work...
+ use xfs && keepdir /var/xfsdump/inventory
+
+ local i
+ for i in "${AMANDA_USER_HOMEDIR}" "${AMANDA_TAR_LISTDIR}" \
+ "${AMANDA_TMPDIR}" /etc/amanda; do
+ einfo "Securing directory (${i})"
+ fowners -R ${AMANDA_USER_NAME}:${AMANDA_GROUP_NAME} ${i}
+ done
+ # Do NOT use -R
+ fperms 0700 \
+ "${AMANDA_USER_HOMEDIR}" "${AMANDA_TAR_LISTDIR}" \
+ "${AMANDA_TMPDIR}" "${AMANDA_TMPDIR}/dumps" \
+ "${AMANDA_USER_HOMEDIR}/amanda" \
+ /etc/amanda
+
+ if ! use minimal ; then
+ fperms 0700 \
+ "${AMANDA_USER_HOMEDIR}/${AMANDA_CONFIG_NAME}" \
+ /etc/amanda/${AMANDA_CONFIG_NAME}
+ fi
+
+ einfo "Setting setuid permissions"
+ amanda_permissions_fix "${D}"
+
+ # Relax permissions again
+ insopts -m0644
+
+ # docs
+ einfo "Installing documentation"
+ dodoc AUTHORS ChangeLog DEVELOPING NEWS README ReleaseNotes UPGRADING
+ # our inetd sample
+ einfo "Installing standard inetd sample"
+ newdoc "${MYFILESDIR}/amanda-inetd.amanda.sample-2.6.0_p2-r2" amanda-inetd.amanda.sample
+ # Amanda example configs
+ einfo "Installing example configurations"
+ rm "${D}"/usr/share/amanda/{COPYRIGHT,ChangeLog,NEWS,ReleaseNotes} || die
+ mv "${D}/usr/share/amanda/example" "${D}/usr/share/doc/${PF}/" || die
+ docinto example1
+ newdoc "${FILESDIR}/example_amanda.conf" amanda.conf
+ newdoc "${FILESDIR}/example_disklist-2.5.1_p3-r1" disklist
+ newdoc "${FILESDIR}/example_global.conf" global.conf
+
+ einfo "Cleaning up dud .la files"
+ perl_set_version
+ find "${D}"/"${VENDOR_LIB}" -name '*.la' -delete || die
+}
+
+pkg_postinst() {
+ [ ! -f "${TMPENVFILE}" -a "$MERGE_TYPE" == "binary" ] && \
+ TMPENVFILE="${ROOT}${ENVDIR}/${ENVDFILE}"
+ [ ! -f "${TMPENVFILE}" ] && die "Variable setting file (${TMPENVFILE}) should exist!"
+ source "${TMPENVFILE}"
+
+ # Migration of amandates from /etc to $localstatedir/amanda
+ if [ -f "${ROOT}/etc/amandates" -a \
+ ! -f "${ROOT}/${AMANDA_USER_HOMEDIR}/amanda/amandates" ]; then
+ einfo "Migrating amandates from /etc/ to ${AMANDA_USER_HOMEDIR}/amanda"
+ einfo "A backup is also placed at /etc/amandates.orig"
+ cp -dp "${ROOT}/etc/amandates" "${ROOT}/etc/amandates.orig" || die
+ mkdir -p "${ROOT}/${AMANDA_USER_HOMEDIR}/amanda/" || die
+ cp -dp "${ROOT}/etc/amandates" "${ROOT}/${AMANDA_USER_HOMEDIR}/amanda/amandates" || die
+ fi
+ if [ -f "${ROOT}/etc/amandates" ]; then
+ einfo "If you have migrated safely, please delete /etc/amandates"
+ fi
+
+ einfo "Checking setuid permissions"
+ amanda_permissions_fix "${ROOT}"
+
+ elog "You should configure Amanda in /etc/amanda now."
+ elog
+ elog "If you use xinetd, Don't forget to check /etc/xinetd.d/amanda"
+ elog "and restart xinetd afterwards!"
+ elog
+ elog "Otherwise, please look at /usr/share/doc/${PF}/inetd.amanda.sample"
+ elog "as an example of how to configure your inetd."
+ elog
+ elog "systemd-users: enable and start amanda.socket or the relevant services"
+ elog "regarding what auth method you use."
+ elog
+ elog "NOTICE: If you need raw access to partitions you need to add the"
+ elog "amanda user to the 'disk' group."
+ elog
+ elog "NOTICE: If you have a tape changer, you need to add the amanda user"
+ elog "to the 'tape' group."
+ elog
+ elog "If you use localhost in your disklist your restores may break."
+ elog "You should replace it with the actual hostname!"
+ elog "Please also see the syntax changes to amandahosts."
+ elog "The only exception is when you use the authentication method 'local'."
+ elog
+ elog "Please note that this package no longer explicitly depends on"
+ elog "virtual/inetd, as it supports modes where an inetd is not needed"
+ elog "(see bug #506028 for details)."
+}
+
+# We have had reports of amanda file permissions getting screwed up.
+# Losing setuid, becoming too lax etc.
+# ONLY root and users in the amanda group should be able to run these binaries!
+amanda_permissions_fix() {
+ local root="$1"
+ [ -z "${root}" ] && die "Failed to pass root argument to amanda_permissions_fix!"
+ local le="/usr/libexec/amanda"
+ local i
+ for i in /usr/sbin/amcheck "${le}"/calcsize "${le}"/killpgrp \
+ "${le}"/rundump "${le}"/runtar "${le}"/dumper \
+ "${le}"/planner ; do
+ chown root:${AMANDA_GROUP_NAME} "${root}"/${i} || die
+ chmod u=srwx,g=rx,o= "${root}"/${i} || die
+ done
+}
diff --git a/app-backup/amanda/files/amanda-3.3.9-stuck.patch b/app-backup/amanda/files/amanda-3.3.9-stuck.patch
new file mode 100644
index 000000000000..88892e41be3b
--- /dev/null
+++ b/app-backup/amanda/files/amanda-3.3.9-stuck.patch
@@ -0,0 +1,11 @@
+--- a/amanda/server-src/driver.c
++++ b/amanda/server-src/driver.c
+@@ -3957,6 +3957,8 @@
+ driver_debug(2, _("new_data: %lld\n"), (long long)new_data);
+ driver_debug(2, _("data_free: %lld\n"), (long long)data_free);
+ ;
++ tapeq_size -= data_free;
++ tapeq_size += new_data;
+ driver_debug(2, _("tapeq_size: %lld\n"), (long long)tapeq_size);
+
+ sched_size = runq_size + tapeq_size + dumpers_size; \ No newline at end of file
diff --git a/app-backup/amanda/files/amanda-3.4.1-labelstr.patch b/app-backup/amanda/files/amanda-3.4.1-labelstr.patch
new file mode 100644
index 000000000000..b169c8ae6472
--- /dev/null
+++ b/app-backup/amanda/files/amanda-3.4.1-labelstr.patch
@@ -0,0 +1,164 @@
+diff --git a/installcheck/Amanda_Rest_Storages.pl b/installcheck/Amanda_Rest_Storages.pl
+index f3c699b..3e4e889 100644
+--- a/installcheck/Amanda_Rest_Storages.pl
++++ b/installcheck/Amanda_Rest_Storages.pl
+@@ -308,6 +308,7 @@ is_deeply (Installcheck::Rest::remove_source_line($reply),
+ 'inventory' => [
+ {'current' => 1,
+ 'label' => "DISKFLAT-001",
++ 'label_match' => '1',
+ 'device_status' => '0',
+ 'reserved' => 0,
+ 'f_type' => '1',
+@@ -467,6 +468,7 @@ is_deeply (Installcheck::Rest::remove_source_line($reply),
+ 'label' => 'DISKFLAT-001',
+ 'datestamp' => '20140509113436',
+ 'write_protected' => '',
++ 'label_match' => '1',
+ 'process' => 'Amanda::Rest::Storages',
+ 'running_on' => 'amanda-server',
+ 'component' => 'rest-server',
+diff --git a/installcheck/amtape.pl b/installcheck/amtape.pl
+index 1a3527f..700c5a2 100644
+--- a/installcheck/amtape.pl
++++ b/installcheck/amtape.pl
+@@ -177,13 +177,13 @@ like($Installcheck::Run::stderr,
+ ok(run('amtape', 'TESTCONF', 'show'),
+ "'amtape TESTCONF show'");
+ like($Installcheck::Run::stderr,
+- qr/slot +2:.*label MyTape\nslot +3/,
++ qr/slot +2:.*label MyTape \(label do not match labelstr\)\nslot +3/,
+ "'amtape TESTCONF show' ..result correct");
+
+ ok(run('amtape', 'TESTCONF', 'show', '2'),
+ "'amtape TESTCONF show'");
+ like($Installcheck::Run::stderr,
+- qr/^slot +2:.*label MyTape$/,
++ qr/^slot +2:.*label MyTape \(label do not match labelstr\)$/,
+ "'amtape TESTCONF show 2' ..result correct");
+
+ ok(run('amtape', 'TESTCONF', 'show', '1,3'),
+@@ -252,13 +252,13 @@ like(run_err('amtape', 'TESTCONF', 'update'),
+ ok(run('amtape', 'TESTCONF', 'show'),
+ "'amtape TESTCONF show'");
+ like($Installcheck::Run::stderr,
+- qr/slot +2:.*label MyTape\nslot +3/,
++ qr/slot +2:.*label MyTape \(label do not match labelstr\)\nslot +3/,
+ "..result correct");
+
+ ok(run('amtape', 'TESTCONF', 'inventory'),
+ "'amtape TESTCONF inventory'");
+ like($Installcheck::Run::stdout,
+- qr/slot +1: blank\nslot +2: label MyTape \(current\)\nslot +3/,
++ qr/slot +1: blank\nslot +2: label MyTape \(current\) \(label do not match labelstr\)\nslot +3/,
+ "..result correct");
+
+ ok(run('amtape', 'TESTCONF', 'taper'),
+diff --git a/perl/Amanda/Changer.pm b/perl/Amanda/Changer.pm
+index 92ed9b6..4b4aad4 100644
+--- a/perl/Amanda/Changer.pm
++++ b/perl/Amanda/Changer.pm
+@@ -60,9 +60,10 @@ sub local_message {
+ } elsif ($self->{'code'} == 1100014) {
+ return "$self->{'err'}";
+ } elsif ($self->{'code'} == 1100015) {
+- return sprintf("slot %3s: date %-14s label %s%s", $self->{'slot'},
++ return sprintf("slot %3s: date %-14s label %s%s%s", $self->{'slot'},
+ $self->{'datestamp'}, $self->{'label'},
+- $self->{'write_protected'}?" (Write protected)":"");
++ $self->{'write_protected'}?" (Write protected)":"",
++ $self->{'label_match'}?"":" (label do not match labelstr)");
+ } elsif ($self->{'code'} == 1100016) {
+ return sprintf("slot %3s: unlabeled volume%s", $self->{'slot'},
+ $self->{'write_protected'}?" (Write protected)":"");
+@@ -2014,6 +2015,13 @@ sub show {
+ my $st = $dev->read_label();
+ my $write_protected = !$dev->check_writable();
+ if ($st == $DEVICE_STATUS_SUCCESS) {
++ my $label_match = match_labelstr(
++ $self->{'storage'}->{'labelstr'},
++ $self->{'storage'}->{'autolabel'},
++ $dev->volume_label(),
++ $res->{'barcode'},
++ $res->{'meta'},
++ $self->{'storage'}->{'storage_name'});
+ $params{'user_msg'}->(Amanda::Changer::Message->new(
+ source_filename => __FILE__,
+ source_line => __LINE__,
+@@ -2022,7 +2030,8 @@ sub show {
+ slot => $last_slot,
+ datestamp => $dev->volume_time(),
+ label => $dev->volume_label(),
+- write_protected => $write_protected));
++ write_protected => $write_protected,
++ label_match => $label_match));
+ } elsif ($st == $DEVICE_STATUS_VOLUME_UNLABELED) {
+ $params{'user_msg'}->(Amanda::Changer::Message->new(
+ source_filename => __FILE__,
+diff --git a/perl/Amanda/Rest/Storages.pm b/perl/Amanda/Rest/Storages.pm
+index 680115b..b1b59d2 100644
+--- a/perl/Amanda/Rest/Storages.pm
++++ b/perl/Amanda/Rest/Storages.pm
+@@ -436,6 +436,17 @@ sub inventory {
+ $inv->{'retention_type'} = $tl->get_retention_name($retention_type);
+ }
+ }
++ for my $inv (@$inventory) {
++ if ($inv->{label}) {
++ $inv->{'label_match'} = Amanda::Util::match_labelstr(
++ $storage->{'labelstr'},
++ $storage->{'autolabel'},
++ $inv->{'label'},
++ $inv->{'barcode'},
++ $inv->{'metae'},
++ $storage->{'storage_name'});
++ }
++ }
+ push @result_messages, Amanda::Changer::Message->new(
+ source_filename => __FILE__,
+ source_line => __LINE__,
+diff --git a/server-src/amtape.pl b/server-src/amtape.pl
+index b63607e..d06eefe 100644
+--- a/server-src/amtape.pl
++++ b/server-src/amtape.pl
+@@ -30,7 +30,7 @@ use Text::Wrap;
+ use Amanda::Device qw( :constants );
+ use Amanda::Debug qw( :logging );
+ use Amanda::Config qw( :init :getconf config_dir_relative );
+-use Amanda::Util qw( :constants );
++use Amanda::Util qw( :constants match_labelstr );
+ use Amanda::Storage;
+ use Amanda::Changer;
+ use Amanda::Constants;
+@@ -219,6 +219,7 @@ sub {
+ for my $sl (@$inv) {
+ my $line = "slot $sl->{slot}:";
+ my $tle;
++ my $meta;
+ if ($sl->{'state'} == Amanda::Changer::SLOT_EMPTY) {
+ $line .= " empty";
+ } elsif (!defined($sl->{device_status}) && !defined($sl->{label})) {
+@@ -230,6 +231,7 @@ sub {
+ if (defined $tle) {
+ if ($tle->{'meta'}) {
+ $line .= " ($tle->{'meta'})";
++ $meta = $tle->{'meta'};
+ }
+ }
+ } elsif ($sl->{'device_status'} == $DEVICE_STATUS_VOLUME_UNLABELED) {
+@@ -263,6 +265,15 @@ sub {
+ $line .= " [device error]";
+ }
+ }
++ if ($sl->{'label'}) {
++ if (!match_labelstr($storage->{'labelstr'},
++ $storage->{'autolabel'},
++ $sl->{label},
++ $sl->{'barcode'}, $meta,
++ $storage->{'storage_name'})) {
++ $line .= " (label do not match labelstr)";
++ }
++ }
+ if (defined $tle) {
+ my $retention_type = Amanda::Tapelist::get_retention_type($tle->{pool}, $tle->{label});
+ $line .= " [" . $tl->get_retention_name($retention_type) . "]";
diff --git a/app-backup/amanda/files/amanda-3.4.1-slots.patch b/app-backup/amanda/files/amanda-3.4.1-slots.patch
new file mode 100644
index 000000000000..1e4e583ecc26
--- /dev/null
+++ b/app-backup/amanda/files/amanda-3.4.1-slots.patch
@@ -0,0 +1,16 @@
+diff --git a/perl/Amanda/Changer/aggregate.pm b/perl/Amanda/Changer/aggregate.pm
+index a2bd962..ecf9d28 100644
+--- a/perl/Amanda/Changer/aggregate.pm
++++ b/perl/Amanda/Changer/aggregate.pm
+@@ -391,7 +391,10 @@ sub info_key {
+ my $kid = 0;
+ for (@$kid_results) {
+ my ($err, %kid_info) = @$_;
+- next unless exists($kid_info{'slots'});
++ if (!exists($kid_info{'slots'})){
++ $kid++;
++ next;
++ }
+ my $kid_slots = $kid_info{'slots'};
+ push @slots, map "$kid:$_", @{$kid_slots};
+ $kid++;
diff --git a/app-backup/amanda/files/amanda-amandahosts-client-2.5.1_p3-r1 b/app-backup/amanda/files/amanda-amandahosts-client-2.5.1_p3-r1
new file mode 100644
index 000000000000..570a71056b47
--- /dev/null
+++ b/app-backup/amanda/files/amanda-amandahosts-client-2.5.1_p3-r1
@@ -0,0 +1,8 @@
+# vim: ts=4 sts=4 sw=4 noexpandtab:
+# Machine-name for those hosts which are permitted to back up (fully-qualified
+# is best). An entry in /etc/hosts adds fail-safe against DNS death :-)
+# |
+# | permitted user-name
+# | |
+
+__AMANDA_SERVER__ __AMANDA_USER_NAME__ amdump
diff --git a/app-backup/amanda/files/amanda-amandahosts-server-2.5.1_p3-r1 b/app-backup/amanda/files/amanda-amandahosts-server-2.5.1_p3-r1
new file mode 100644
index 000000000000..4951d4a9bf7d
--- /dev/null
+++ b/app-backup/amanda/files/amanda-amandahosts-server-2.5.1_p3-r1
@@ -0,0 +1,8 @@
+# vim: ts=4 sts=4 sw=4 noexpandtab:
+# Machine-name for those hosts which are permitted to back up (fully-qualified
+# is best). An entry in /etc/hosts adds fail-safe against DNS death :-)
+# |
+# | permitted user-name
+# | |
+
+__AMANDA_SERVER__ root amindexd amidxtaped
diff --git a/app-backup/amanda/files/amanda-cron b/app-backup/amanda/files/amanda-cron
new file mode 100644
index 000000000000..a5524dc2e3a1
--- /dev/null
+++ b/app-backup/amanda/files/amanda-cron
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+# This is a sample cron job to kick off backups with amanda.
+
+# Run the tape tests on DailySet first, and if ok, then kick off backups
+# Mail error reports to root
+
+# Ensure TAPE is set to your tape drive for mt to work, ie. TAPE="/dev/st0"
+
+ADMIN_EMAIL="root@localhost"
+
+/usr/sbin/amcheck -t -m -M"${ADMIN_EMAIL}" __AMANDA_CONFIG_NAME__ && \
+( /usr/sbin/amdump __AMANDA_CONFIG_NAME__ ; /usr/sbin/mt eject )
diff --git a/app-backup/amanda/files/amanda-devfs b/app-backup/amanda/files/amanda-devfs
new file mode 100644
index 000000000000..f02eb3ffc477
--- /dev/null
+++ b/app-backup/amanda/files/amanda-devfs
@@ -0,0 +1,7 @@
+# raw access to partitions for amanda
+#REGISTER ^scsi/host.*/bus.*/target.*/lun.*/part[0-9] PERMISSIONS root.disk 660"
+#REGISTER ^ide/host.*/bus.*/target.*/lun.*/part[0-9] PERMISSIONS root.disk 660"
+
+# allow amanda to have access to tape changers
+#REGISTER ^scsi/host.*/bus.*/target.*/lun.*/generic PERMISSIONS root.disk 660
+
diff --git a/app-backup/amanda/files/amanda-inetd.amanda.sample-2.6.0_p2-r2 b/app-backup/amanda/files/amanda-inetd.amanda.sample-2.6.0_p2-r2
new file mode 100644
index 000000000000..e2aa3429d4a4
--- /dev/null
+++ b/app-backup/amanda/files/amanda-inetd.amanda.sample-2.6.0_p2-r2
@@ -0,0 +1,3 @@
+amanda dgram udp wait amanda /usr/libexec/amanda/amandad amandad -auth=bsd amdump amindexd amidxtaped
+amandaidx stream tcp nowait amanda /usr/libexec/amanda/amindexd amindexd -auth=bsd amdump amindexd amidxtaped
+amidxtape stream tcp nowait amanda /usr/libexec/amanda/amidxtaped amidxtaped -auth=bsd amdump amindexd amidxtaped
diff --git a/app-backup/amanda/files/amanda-profile b/app-backup/amanda/files/amanda-profile
new file mode 100644
index 000000000000..d8e132bf10f8
--- /dev/null
+++ b/app-backup/amanda/files/amanda-profile
@@ -0,0 +1 @@
+export PATH=/sbin:/usr/sbin:/usr/libexec:${PATH}
diff --git a/app-backup/amanda/files/amanda-xinetd-2.6.1_p1-client b/app-backup/amanda/files/amanda-xinetd-2.6.1_p1-client
new file mode 100644
index 000000000000..ed73c03cd14f
--- /dev/null
+++ b/app-backup/amanda/files/amanda-xinetd-2.6.1_p1-client
@@ -0,0 +1,19 @@
+# These are the services needed for amanda.
+# Default is to talk to localhost only unless
+# AMANDA_SERVER was specified at build time.
+
+service amanda
+{
+ socket_type = dgram
+ protocol = udp
+ wait = yes
+ user = __AMANDA_USER_NAME__
+ group = __AMANDA_GROUP_NAME__
+ groups = yes
+ server = /usr/libexec/amanda/amandad
+ server_args = -auth=bsd amdump
+ # You need to ensure this points to your Amanda server!
+ # Don't just remove it!
+ only_from = __AMANDA_SERVER__
+ disable = yes
+}
diff --git a/app-backup/amanda/files/amanda-xinetd-2.6.1_p1-server b/app-backup/amanda/files/amanda-xinetd-2.6.1_p1-server
new file mode 100644
index 000000000000..269198e0379b
--- /dev/null
+++ b/app-backup/amanda/files/amanda-xinetd-2.6.1_p1-server
@@ -0,0 +1,19 @@
+# These are the services needed for amanda.
+# Default is to talk to localhost only unless
+# AMANDA_SERVER was specified at build time.
+
+service amanda
+{
+ socket_type = dgram
+ protocol = udp
+ wait = yes
+ user = __AMANDA_USER_NAME__
+ group = __AMANDA_GROUP_NAME__
+ groups = yes
+ server = /usr/libexec/amanda/amandad
+ server_args = -auth=bsd amdump amindexd amidxtaped
+ # You need to ensure this points to your Amanda server!
+ # Don't just remove it!
+ only_from = __AMANDA_SERVER__
+ disable = yes
+}
diff --git a/app-backup/amanda/files/amanda.service b/app-backup/amanda/files/amanda.service
new file mode 100644
index 000000000000..b1f67dbc5d63
--- /dev/null
+++ b/app-backup/amanda/files/amanda.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Amanda Backup System
+After=local-fs.target
+
+[Service]
+User=amanda
+Group=amanda
+ExecStart=/usr/libexec/amanda/amandad -auth=bsdtcp amdump
+StandardInput=socket
+StandardOutput=socket
diff --git a/app-backup/amanda/files/amanda.service-r1 b/app-backup/amanda/files/amanda.service-r1
new file mode 100644
index 000000000000..a605eb487bf0
--- /dev/null
+++ b/app-backup/amanda/files/amanda.service-r1
@@ -0,0 +1,10 @@
+[Unit]
+Description=Amanda Backup System
+After=local-fs.target
+
+[Service]
+User=amanda
+Group=amanda
+ExecStart=/usr/libexec/amanda/amandad -auth=bsdtcp amdump amindexd amidxtaped
+StandardInput=socket
+StandardOutput=socket
diff --git a/app-backup/amanda/files/amanda.socket b/app-backup/amanda/files/amanda.socket
new file mode 100644
index 000000000000..baf807915c0d
--- /dev/null
+++ b/app-backup/amanda/files/amanda.socket
@@ -0,0 +1,7 @@
+[Unit]
+Description=Amanda Socket
+[Socket]
+ListenStream=10080
+Accept=true
+[Install]
+WantedBy=sockets.target
diff --git a/app-backup/amanda/files/example_amanda.conf b/app-backup/amanda/files/example_amanda.conf
new file mode 100644
index 000000000000..947625e8ebbc
--- /dev/null
+++ b/app-backup/amanda/files/example_amanda.conf
@@ -0,0 +1,44 @@
+# type "man amanda"
+
+org "example"
+mailto "root@localhost"
+
+dumpcycle 7
+runspercycle -1
+tapecycle 7
+
+dumpuser "amanda"
+printer "lp"
+
+#tpchanger "chg-manual"
+tapedev "/dev/nst0"
+
+runtapes 1
+labelstr "^EXAMPLE-[0-9][0-9]*$"
+tapetype DDS4-PRINT
+
+ctimeout 60
+dtimeout 3600
+etimeout 600
+
+netusage 2000
+inparallel 10
+
+dumporder "tttTTTTTTT"
+maxdumps 10
+bumpsize 10
+bumpmult 1.5
+bumpdays 1
+
+diskfile "/etc/amanda/example/disklist"
+infofile "/etc/amanda/example/curinfo"
+logdir "/etc/amanda/example"
+indexdir "/etc/amanda/example/index"
+tapelist "tapelist"
+
+tapebufs 20
+reserve 100
+autoflush off
+
+includefile "/etc/amanda/global.conf"
+
diff --git a/app-backup/amanda/files/example_disklist-2.5.1_p3-r1 b/app-backup/amanda/files/example_disklist-2.5.1_p3-r1
new file mode 100644
index 000000000000..73bf0174ee23
--- /dev/null
+++ b/app-backup/amanda/files/example_disklist-2.5.1_p3-r1
@@ -0,0 +1,4 @@
+# Substitute <HOSTNAME> with the FQDN of your Amanda-client here.
+# The usage of localhost will *break* your restores.
+<HOSTNAME> hda1 normal local
+<HOSTNAME> hda3 normal local
diff --git a/app-backup/amanda/files/example_global.conf b/app-backup/amanda/files/example_global.conf
new file mode 100644
index 000000000000..728739850940
--- /dev/null
+++ b/app-backup/amanda/files/example_global.conf
@@ -0,0 +1,78 @@
+holdingdisk hd1 {
+ comment "main holding disk"
+ directory "/tmp/amanda/dumps"
+ use -1 Gb
+ chunksize 500 Mb
+}
+
+define dumptype normal {
+ auth BSD
+ comment "Normal backup, compression"
+ comprate 0.50, 0.50
+ compress client best
+ index yes
+ priority high
+ program "GNUTAR"
+ record yes
+ strategy STANDARD
+ holdingdisk yes
+}
+
+define dumptype compress-server {
+ auth BSD
+ comment "Normal backup, compression"
+ comprate 0.50, 0.50
+ compress server best
+ index yes
+ priority high
+ program "GNUTAR"
+ record yes
+ strategy STANDARD
+ holdingdisk yes
+}
+
+define dumptype normal-no_hold {
+ normal
+ holdingdisk no
+}
+
+define tapetype DDS4 {
+ comment "Seagate Scorpion 40"
+ length 16432 mbytes
+ filemark 0 kbytes
+ speed 2267 kps
+}
+
+define tapetype DDS4-PRINT {
+ comment "Seagate Scorpion 40 with printer"
+ length 16432 mbytes
+ filemark 0 kbytes
+ speed 2267 kps
+ lbl-templ "/etc/amanda/lbl/DIN-A4.ps"
+}
+
+define tapetype DDS2 {
+ comment "HP DAT C1533A"
+ length 1845 mbytes
+ filemark 0 kbytes
+ speed 480 kps
+}
+
+define tapetype DDS1 {
+ comment "HP DAT HP35480A"
+ length 1845 mbytes
+ filemark 32 kbytes
+ speed 174 kps
+}
+
+define interface local {
+ comment "local disk"
+ use 4000 kbps
+}
+
+define interface eth1 {
+ comment "100 Mbps ethernet"
+ use 1000 kbps
+}
+
+
diff --git a/app-backup/amanda/files/local-amanda-perl5.20.patch b/app-backup/amanda/files/local-amanda-perl5.20.patch
new file mode 100644
index 000000000000..b62df65647a8
--- /dev/null
+++ b/app-backup/amanda/files/local-amanda-perl5.20.patch
@@ -0,0 +1,205 @@
+https://bz-attachments.freebsd.org/attachment.cgi?id=149027&action=diff&collapsed=&context=patch&format=raw&headers=1
+--- perl/Amanda/Application.c.orig 2012-07-25 17:59:54.000000000 +0200
++++ perl/Amanda/Application.c 2014-10-27 08:48:58.000000000 +0100
+@@ -1450,9 +1450,6 @@
+ #ifdef eof
+ #undef eof
+ #endif
+-#ifdef bool
+- #undef bool
+-#endif
+ #ifdef close
+ #undef close
+ #endif
+--- perl/Amanda/Archive.c.orig 2012-07-25 17:59:54.000000000 +0200
++++ perl/Amanda/Archive.c 2014-10-27 08:49:05.000000000 +0100
+@@ -1450,9 +1450,6 @@
+ #ifdef eof
+ #undef eof
+ #endif
+-#ifdef bool
+- #undef bool
+-#endif
+ #ifdef close
+ #undef close
+ #endif
+--- perl/Amanda/Cmdline.c.orig 2012-07-25 17:59:54.000000000 +0200
++++ perl/Amanda/Cmdline.c 2014-10-27 08:49:13.000000000 +0100
+@@ -1450,9 +1450,6 @@
+ #ifdef eof
+ #undef eof
+ #endif
+-#ifdef bool
+- #undef bool
+-#endif
+ #ifdef close
+ #undef close
+ #endif
+--- perl/Amanda/Config.c.orig 2012-07-25 17:59:54.000000000 +0200
++++ perl/Amanda/Config.c 2014-10-27 08:49:19.000000000 +0100
+@@ -1450,9 +1450,6 @@
+ #ifdef eof
+ #undef eof
+ #endif
+-#ifdef bool
+- #undef bool
+-#endif
+ #ifdef close
+ #undef close
+ #endif
+--- perl/Amanda/Debug.c.orig 2012-07-25 17:59:54.000000000 +0200
++++ perl/Amanda/Debug.c 2014-10-27 08:49:25.000000000 +0100
+@@ -1450,9 +1450,6 @@
+ #ifdef eof
+ #undef eof
+ #endif
+-#ifdef bool
+- #undef bool
+-#endif
+ #ifdef close
+ #undef close
+ #endif
+--- perl/Amanda/Device.c.orig 2012-07-25 17:59:54.000000000 +0200
++++ perl/Amanda/Device.c 2014-10-27 08:49:30.000000000 +0100
+@@ -1450,9 +1450,6 @@
+ #ifdef eof
+ #undef eof
+ #endif
+-#ifdef bool
+- #undef bool
+-#endif
+ #ifdef close
+ #undef close
+ #endif
+--- perl/Amanda/Disklist.c.orig 2012-07-25 17:59:54.000000000 +0200
++++ perl/Amanda/Disklist.c 2014-10-27 08:49:36.000000000 +0100
+@@ -1450,9 +1450,6 @@
+ #ifdef eof
+ #undef eof
+ #endif
+-#ifdef bool
+- #undef bool
+-#endif
+ #ifdef close
+ #undef close
+ #endif
+--- perl/Amanda/Feature.c.orig 2012-07-25 17:59:54.000000000 +0200
++++ perl/Amanda/Feature.c 2014-10-27 08:49:41.000000000 +0100
+@@ -1450,9 +1450,6 @@
+ #ifdef eof
+ #undef eof
+ #endif
+-#ifdef bool
+- #undef bool
+-#endif
+ #ifdef close
+ #undef close
+ #endif
+--- perl/Amanda/Header.c.orig 2012-07-25 17:59:54.000000000 +0200
++++ perl/Amanda/Header.c 2014-10-27 08:49:48.000000000 +0100
+@@ -1450,9 +1450,6 @@
+ #ifdef eof
+ #undef eof
+ #endif
+-#ifdef bool
+- #undef bool
+-#endif
+ #ifdef close
+ #undef close
+ #endif
+--- perl/Amanda/Logfile.c.orig 2012-07-25 17:59:54.000000000 +0200
++++ perl/Amanda/Logfile.c 2014-10-27 08:49:53.000000000 +0100
+@@ -1450,9 +1450,6 @@
+ #ifdef eof
+ #undef eof
+ #endif
+-#ifdef bool
+- #undef bool
+-#endif
+ #ifdef close
+ #undef close
+ #endif
+--- perl/Amanda/MainLoop.c.orig 2012-07-25 17:59:54.000000000 +0200
++++ perl/Amanda/MainLoop.c 2014-10-27 08:49:59.000000000 +0100
+@@ -1450,9 +1450,6 @@
+ #ifdef eof
+ #undef eof
+ #endif
+-#ifdef bool
+- #undef bool
+-#endif
+ #ifdef close
+ #undef close
+ #endif
+--- perl/Amanda/NDMP.c.orig 2012-07-25 17:59:54.000000000 +0200
++++ perl/Amanda/NDMP.c 2014-10-27 08:50:19.000000000 +0100
+@@ -1450,9 +1450,6 @@
+ #ifdef eof
+ #undef eof
+ #endif
+-#ifdef bool
+- #undef bool
+-#endif
+ #ifdef close
+ #undef close
+ #endif
+--- perl/Amanda/Tapelist.c.orig 2012-07-25 17:59:54.000000000 +0200
++++ perl/Amanda/Tapelist.c 2014-10-27 08:50:24.000000000 +0100
+@@ -1450,9 +1450,6 @@
+ #ifdef eof
+ #undef eof
+ #endif
+-#ifdef bool
+- #undef bool
+-#endif
+ #ifdef close
+ #undef close
+ #endif
+--- perl/Amanda/Tests.c.orig 2012-07-25 17:59:54.000000000 +0200
++++ perl/Amanda/Tests.c 2014-10-27 09:01:12.000000000 +0100
+@@ -1450,9 +1450,6 @@
+ #ifdef eof
+ #undef eof
+ #endif
+-#ifdef bool
+- #undef bool
+-#endif
+ #ifdef close
+ #undef close
+ #endif
+--- perl/Amanda/Util.c.orig 2012-07-25 17:59:54.000000000 +0200
++++ perl/Amanda/Util.c 2014-10-27 09:01:17.000000000 +0100
+@@ -1450,9 +1450,6 @@
+ #ifdef eof
+ #undef eof
+ #endif
+-#ifdef bool
+- #undef bool
+-#endif
+ #ifdef close
+ #undef close
+ #endif
+--- perl/Amanda/Xfer.c.orig 2012-07-25 17:59:54.000000000 +0200
++++ perl/Amanda/Xfer.c 2014-10-27 09:01:22.000000000 +0100
+@@ -1450,9 +1450,6 @@
+ #ifdef eof
+ #undef eof
+ #endif
+-#ifdef bool
+- #undef bool
+-#endif
+ #ifdef close
+ #undef close
+ #endif
+--- perl/Amanda/XferServer.c.orig 2012-07-25 17:59:55.000000000 +0200
++++ perl/Amanda/XferServer.c 2014-10-27 09:01:29.000000000 +0100
+@@ -1450,9 +1450,6 @@
+ #ifdef eof
+ #undef eof
+ #endif
+-#ifdef bool
+- #undef bool
+-#endif
+ #ifdef close
+ #undef close
+ #endif
diff --git a/app-backup/amanda/metadata.xml b/app-backup/amanda/metadata.xml
new file mode 100644
index 000000000000..e191fc902dcf
--- /dev/null
+++ b/app-backup/amanda/metadata.xml
@@ -0,0 +1,30 @@
+<?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>
+ <description>Primary maintainer</description>
+ <name>Robin H. Johnson</name>
+ </maintainer>
+ <maintainer type="person">
+ <email>lists@xunil.at</email>
+ <name>Stefan G. Weichinger</name>
+ <description>Proxied developer</description>
+ </maintainer>
+ <maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <maintainer type="person">
+ <email>dustin@v.igoro.us</email>
+ <description>Upstream. Please CC on bugs.</description>
+ <name>Dustin J. Mitchell</name>
+ </maintainer>
+ <use>
+ <flag name="xfs">Support for backing up raw XFS filesystems using xfsdump</flag>
+ <flag name="s3">Support for backing up to the Amazon S3 system</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">amanda</remote-id>
+ </upstream>
+</pkgmetadata>