summaryrefslogtreecommitdiff
path: root/net-ftp/vsftpd
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 /net-ftp/vsftpd
reinit the tree, so we can have metadata
Diffstat (limited to 'net-ftp/vsftpd')
-rw-r--r--net-ftp/vsftpd/Manifest31
-rw-r--r--net-ftp/vsftpd/files/vsftpd-2.1.0-caps.patch15
-rw-r--r--net-ftp/vsftpd/files/vsftpd-2.2.0-dont-link-caps.patch21
-rw-r--r--net-ftp/vsftpd/files/vsftpd-2.3.2-as-needed.patch13
-rw-r--r--net-ftp/vsftpd/files/vsftpd-2.3.2-kerberos.patch20
-rw-r--r--net-ftp/vsftpd/files/vsftpd-2.3.5-gentoo.patch207
-rw-r--r--net-ftp/vsftpd/files/vsftpd-3.0.0-Makefile.patch34
-rw-r--r--net-ftp/vsftpd/files/vsftpd-3.0.2-alpha.patch16
-rw-r--r--net-ftp/vsftpd/files/vsftpd-3.0.2-aslim.patch13
-rw-r--r--net-ftp/vsftpd/files/vsftpd-3.0.2-remove-legacy-cap.patch57
-rw-r--r--net-ftp/vsftpd/files/vsftpd-checkconfig.sh29
-rw-r--r--net-ftp/vsftpd/files/vsftpd.conf104
-rw-r--r--net-ftp/vsftpd/files/vsftpd.init50
-rw-r--r--net-ftp/vsftpd/files/vsftpd.logrotate4
-rw-r--r--net-ftp/vsftpd/files/vsftpd.service11
-rw-r--r--net-ftp/vsftpd/files/vsftpd.socket9
-rw-r--r--net-ftp/vsftpd/files/vsftpd.xinetd14
-rw-r--r--net-ftp/vsftpd/files/vsftpd_at.service10
-rw-r--r--net-ftp/vsftpd/metadata.xml12
-rw-r--r--net-ftp/vsftpd/vsftpd-2.3.5.ebuild114
-rw-r--r--net-ftp/vsftpd/vsftpd-3.0.2-r1.ebuild121
-rw-r--r--net-ftp/vsftpd/vsftpd-3.0.2-r2.ebuild131
-rw-r--r--net-ftp/vsftpd/vsftpd-3.0.2-r3.ebuild134
-rw-r--r--net-ftp/vsftpd/vsftpd-3.0.2-r4.ebuild134
-rw-r--r--net-ftp/vsftpd/vsftpd-3.0.2.ebuild117
-rw-r--r--net-ftp/vsftpd/vsftpd-3.0.3-r1.ebuild134
-rw-r--r--net-ftp/vsftpd/vsftpd-3.0.3.ebuild131
27 files changed, 1686 insertions, 0 deletions
diff --git a/net-ftp/vsftpd/Manifest b/net-ftp/vsftpd/Manifest
new file mode 100644
index 000000000000..1438cd919500
--- /dev/null
+++ b/net-ftp/vsftpd/Manifest
@@ -0,0 +1,31 @@
+AUX vsftpd-2.1.0-caps.patch 575 SHA256 4888021a25625041746b91025af0c2a2cb1fde758eda1d6c94098d4de0c1e370 SHA512 aeb407d9d0cf3940bc0fb1ef76c23cd19f68293e64d8a6a64e2a271b624a237fa3721b6a3476d59f0c6fabf69a418f9577fde351aba0e9aa96dc1362c02e1524 WHIRLPOOL bfad7367797f0fd0da502d9ebdcf13364123742642d384fb44220c0af2370997c5fbf9e72bf9eaabf47a449650702b1b73ac165a49ebc8687cb624e0caccbf99
+AUX vsftpd-2.2.0-dont-link-caps.patch 806 SHA256 fd164d4702ae866cb06ad245653b4f25c73d1d701a211b1f972b45b98ab55dd2 SHA512 b162f3afcc135bdecea63ef24a1f321e6723a1218a96a8897b3db67338f5cdceb6178c7cd0a155dee80af3e7b9198610562de7cff6986e7dfc93df79b5ee501c WHIRLPOOL cd7c6a94cc094af32097031aeca93873604d86f1d2ddaeb4980a18c82ab0061e95ca36484f157b68db9f81456e71fa02a6d01520f7ca9487bd2a266458c5a4cd
+AUX vsftpd-2.3.2-as-needed.patch 423 SHA256 ad393655b30887294dfcf46fe63ea24e3339f027a84fe7de03364500829496d9 SHA512 25ebf85e565f384a480e55d8811f81cfc22cf466359b82ab109f86323956aae892e6ae93176ef31d9222cf4e0b9ea62ec68b8a05fb489c566192944086fb4cd3 WHIRLPOOL e82348a4d34113ffce86d5dd9bd61db049091dd6064825ad37c92d41768bdd60cb19f8d13683fb89b879d22594b1113c29a6fabe1f122bce53f978fb2571b32b
+AUX vsftpd-2.3.2-kerberos.patch 842 SHA256 d86bed62c0fd22372f4704a12d7f75ce42fc15765ceec802b4b0c5680bc9c200 SHA512 94c743b4f78f41aba4427b6e75b8d85d57a1eec6eb89e0ca93f47c0e5ccdb31a80eb28cfeb3c50cce5cbf5909646150aec762d8b250650dcfbaa6ad190271af8 WHIRLPOOL 53ff6a29d84e23584f7ca873cb715369e636f0d1739fd1a591cc400f6ebe59aa28547a1a6d9b9681822d678e007750c81189c8ed296199eb56d9e77ddd4c7fcf
+AUX vsftpd-2.3.5-gentoo.patch 8560 SHA256 227fc60234c002d756d6a4f0867b6f7cf63315cb53dda78a1ef62ea5ccc61bdd SHA512 dbe8a022b9dd4bfdf5c0138aa0ad13311d4a52e7671888fc2018992e7906c2aab53355d2ab24cc4e1f19c358a5202eb9965bf3ca9180d6b9d369d451c7c656b3 WHIRLPOOL 40aaeeab47b1775d3b035a91810bc8e67d573d2d51de886d80aa44c96ac92c21154a3e214faf6f7d890b8e18626cdd8e3b28df5b203df3817929c40aeb9400ec
+AUX vsftpd-3.0.0-Makefile.patch 1093 SHA256 e654f707a4c1da2433b28e35a05e1dd92fee35f4582e458e64066f30b75db7de SHA512 66217e5be8e5a7b819c0a38ee8ac9e84ea5937c7285843d1de5b8361211ea86816551b440bf9d5c89c9f874e867c9f50590a2e8a50dbd313fcde1d5d4ea6ab4e WHIRLPOOL 1b031f17fd4176e1d42f2b955b7656d2d281db46fc768f52063e009028224e20dc50b82f93f8c21842cffad82cba3492dfd8ff740ec72d3ad07caad825be73b0
+AUX vsftpd-3.0.2-alpha.patch 525 SHA256 e544547b4f665e40e5a55e411946e37c2493dfe0391ba9ef6760ba889f7a9c98 SHA512 5d9639bf7fa08bfce5cbbc79c59445e099c42adec6dc1a3e14e6a9586c53a082e0c712625a3de62418fd0f0bd253b6b673a700157be07ab114770707739a6c38 WHIRLPOOL c08ddd9fb7aa60c4e1a84a95c3f390cff279d060c6d63464b5defbf4aa9765bf35c717506cb404cc937d4b6b7307d63ed906c796e4409ff7d5494fc2c1ee3b85
+AUX vsftpd-3.0.2-aslim.patch 512 SHA256 29563dc497b3845c753abd451aebe55a3c9618073ddf0a76997e5a58b2f51cf8 SHA512 ca444fa86279711942e30ef2d756193f9aeb318c2c52dda822c70085c250a09fa182187ecf99d45b64364fde12db8ce818ea50d71fcb73145fc64f5e2d66f263 WHIRLPOOL 423fc960ce6513c195933e8bfd03c5bdaa80d0288189d907998a37cc0d3a2a2a6a475bccf60229f769bd0111b1d371632b2ed1064bb90ab99c7cb9251d139c0b
+AUX vsftpd-3.0.2-remove-legacy-cap.patch 1739 SHA256 c18a5b1092d07c5ff5380553345d4cdf06e0b8968cf90499d3dd1751f889a438 SHA512 b0c2b91f0ba3b73706c352ac391e35b048b544fbab1ab3cd223be7f5ca33516143a775456871ded354a05bf74f0403436f4659d06ae9345e8d6a6d1b21addd42 WHIRLPOOL 253453c1696cfe1e5330055410d5e7e080f0c27ea8ba2158e5667f692067f73c070b8bd7ed56d7aa77c2dcadbe10f62442f31ceef4a7cfdcf8578895525c84d1
+AUX vsftpd-checkconfig.sh 785 SHA256 2de7c7c1edfe3ae0480e22d988a564db3bb873050929ebb6e8361d7a1288ddda SHA512 541702557231c79413ae77cf26c28398fea3cb332375f8d22e0c0a45706b04db954d268addd76fecbb8b0ab3109f1009c18b0599394ed33c4a6fc8dc647d889e WHIRLPOOL ac2d38c646a440edc093f8458cc2395c6da465d9719c10464ded9cba2c480b9398f8ece2d25920d10893dca0fc16ba8b3a583c55724f5a5b5de46eab671bab63
+AUX vsftpd.conf 3733 SHA256 c32d6ef426f3e4b508506e95a37969b12b026ad0773efb7f8aa40235c589fdf1 SHA512 417b2ebdffe41073d7ee8a1f414ba5bfe4b15411e37b99444443c240fa540c97b0c247f9151ef306f84775dd78370f5985121417267bf25a76f87d259d843719 WHIRLPOOL 194cfc3102aac641a4c6fc69068c4cedb0480c70a811344833652443604955fb8ea0e446357a6ee0f0ad8d32d735b18d6734f88a0ddf1bce0be889ac7760956d
+AUX vsftpd.init 1319 SHA256 46dba1df0fb5d575d6d37ed54aa887d9a5fa8853bc46b2b0bd18f9fab2a27640 SHA512 b367c412f2aebdfa90fae912467ebf227b39be04b45f686c5ea5f66df6addc81a2f130dd616dae932a55108337169e19ef53012f27127eb1970852ed5ea697c0 WHIRLPOOL 5e998abb31f8a3181b8c4f9f6c9acb2f48382c3b651ff3e7a9fe86980672cc49b6f36157c3317393fce65354b9beb84c5de8594917dd96ee9780703828d9cabe
+AUX vsftpd.logrotate 54 SHA256 2037b22eee79bf20b7047ca291af4e73fce63db303a3682fcf0d9d601029e3bf SHA512 cee63caaf5e3db620e57132dc1a531cfd39ce790ac64e22b649cf3fac8b825cf188425bdf19cd376aa3f31ea114c8889ee307b6e7f9a2cbd155324f64084d5fc WHIRLPOOL 3930bf8f67b5d0bd843c69a587ab089df7c34f861252337c46a1424f127d84ba894df79b839e585661e33777aadb066e6f6b5f680d2b9fb96d0f6ec54e8f61e6
+AUX vsftpd.service 218 SHA256 5c93a836c0be34d785197ba01541b6cd9db6f8992c4ea081c07a6111cc98290d SHA512 f032f64ed5fab15b1c9543579090cdca007d0a759073e7c4aa0f0ef0f852f6787610f776ce63d0d922ccfbadd480df81ed9a62e6e0f399327d770f9b70c34df9 WHIRLPOOL c91aabb3b89dc3faa002cd998329d44677f756ee2901492324e37b3f7dbcc29b83c53032891ef1d802ea70d01b060f091970c20a06b36d2cae9358269df6f4e4
+AUX vsftpd.socket 104 SHA256 9fdbfd2ec0207170371ca3cf2b0ddca2dc2fe3d062e5792e0d3e51474c3198c9 SHA512 4c56607dde0ccc4773edf905c1d52b66fff774e6aa8b20a23f9443a04838a9ad8a1df535a0bb27660e9a4528d1d7c90b53fd6dd1fa3d4862e87ed06a1a8a87b7 WHIRLPOOL 435e23297ff200ab68cb2813d2024279ed7d21e7d03f1c732c8ef06baf4b92c330edd496798c197078f07b08c4680c9c70e8dcc8aa4d35872d0cc556298b9fc9
+AUX vsftpd.xinetd 321 SHA256 bd5f4808a809ac6eb374128201a2fab6cf67a96d250f2fa5181621ac6b778912 SHA512 30fb4ae07f55011b9b29625db072062a0f1df4f1c7578041231f35febfb90ad2d2dfe1deb964e34fde5c660f0e3ffc3df3d77af1b2f3a1f724176f691a53a182 WHIRLPOOL e78021421576022d0a693c650273e2a3452730b6ddfed1f3d8db5708e92fdd630d446cc38002d7e233e755a0998d8f91b8f79518ca029f1ac3f598825b546c3c
+AUX vsftpd_at.service 328 SHA256 5239d00bafe9686b5ee454365e32ea383ea85af70434037fd3812245dc50e8cd SHA512 5a39e853405bd5028f2c52183eb91ad559fb8edbaacfff5d5146e686417c208bb894bd86d5830a61720a1aaa9ba901160c75ed2bf47eec459b2a49ed217b9cb1 WHIRLPOOL cac14417d2c47a7491653c5835e913f980a09934a00b08eeb47f40f15ba3927639ab1ec8efc8d5c28ea49c34391b30946dcb04771b3eefcea5a7b2429b33f6a8
+DIST vsftpd-2.3.5.tar.gz 187691 SHA256 d87ee2987df8f03e1dbe294905f7907b2798deb89c67ca965f6e2f60879e54f1 SHA512 7d58d601c4a14cf16c074f238d557fd28e080d7573a1257f742e43bf97cff455b6bf083d8e3594cc7f8865f9485b307b692e91c17426c7fed11af9e4b41a0643 WHIRLPOOL 2dba4ae125bbd66522f58ce4ffc9d5be8ea2a84876fe6751593b82aa2c3e5fe1e1ed076c1c09268054f7ea6831683a2be0dd4e269e321d572d859d0ae2535406
+DIST vsftpd-3.0.2.tar.gz 192808 SHA256 be46f0e2c5528fe021fafc8dab1ecfea0c1f183063a06977f8537fcd0b195e56 SHA512 d5b978e07d8b0a623b79a531824666fb9b970ad5989a8c34c21b545b62ba07cde4bfe3d77b40a8b6e92d17890c37cae209231af8f106da3404f6548e217bd023 WHIRLPOOL 7a74ab478880d021f7a82ffc6ec3989617003234e30d97063760bc06baeee2ab207861b440896b926b95eed7b3d902ab96c05c1bbd23d494d9ff168f98d3404a
+DIST vsftpd-3.0.3.tar.gz 196649 SHA256 9d4d2bf6e6e2884852ba4e69e157a2cecd68c5a7635d66a3a8cf8d898c955ef7 SHA512 5a4410a88e72ecf6f60a60a89771bcec300c9f63c2ea83b219bdf65fd9749b9853f9579f7257205b55659aefcd5dab243eba878dbbd4f0ff8532dd6e60884df7 WHIRLPOOL 014b13a1031d89a12412fb1abc808c8d62f474b84e9d1699ec789e99c9b9ec7f4538e7504caa810c6b77dcccea8fc0e32e9bb3ac5ffc8e2e9a29f67b69ddc3cb
+EBUILD vsftpd-2.3.5.ebuild 3072 SHA256 3bf5b0a4fd57320d398e785499938d0fa9df1476457ceecbf942ffdc07164ecd SHA512 7844fa436d40d81d1ee709ff04597750415923da1cf4426c89983dda0c90bfe0f104bafad5b60507b98c09b34555c7feae98602245780a3d0a7d89b96a19cbf3 WHIRLPOOL 7bd98762c9351a3d3b33316d102a80442d058bee7359599c44cc664b9f6bdd2726f9f45ecdd474215e09bd508825fe6dfd31d51c163d6f3f1c95f8a0c45b915d
+EBUILD vsftpd-3.0.2-r1.ebuild 3268 SHA256 ec87d81648c755b46e8b505bcb664e5ac2bd7716c7b6908303a3f416a503c033 SHA512 af224ef28c06ce2467fc1f346bce7870763fd5115567baf221e52a8fa2b6de2c99b82ba0230bd3ca39e136f3c32d0240356ece1a4ae4529bfc5e6108406fc675 WHIRLPOOL b4b9c6d77cc34923bd819a5b28e9353aa88cb3c3b79a0ff5e02cb13661a1e3786663199a4715e4a5c2f220134a1c7cbd3176f733c2aa5bcdd8835a80175f1f11
+EBUILD vsftpd-3.0.2-r2.ebuild 3587 SHA256 fa03cf925d00a7458a1c9dc7a45b3e3ebb61834dbfe29a4d1118d6206b0425c2 SHA512 c80e3aa7a7433170e79c7cea387c7ae18c8eb45e69e86b8e7c765ddd053e08df66dcddeaaf15dd85d7db7cfcfecca092d11004f98d9187fe7d51a2b05104e5cd WHIRLPOOL 5566dc6f455a326b9acd49f5dcb1e335fd5b1369671312ce7d498a1fec7ce68235d11a40f36012c551b1bc1afa5c3c9e7015d2c806442d394aa00013bde21963
+EBUILD vsftpd-3.0.2-r3.ebuild 3661 SHA256 2d911a3d9dd7e0968be4ae59d3da119ef8b0b430b67a8fc516f1dfdb3bad3d4e SHA512 d666a9552127d28266912e0589c417f96f47378518b5eb2923db58b4dfe61a12b310a70479039d71738bfd078e53425632346ca4d0baf2770e1b5a966a9d3ed1 WHIRLPOOL 95d3a651c8cbb1b70784d5f24018d4e0f1917a9b1a8c7d8b7af78de136082b96dee5ef8147ca2eb9f1a436a5e68d1e542eff99fb532938463dd43708179094e9
+EBUILD vsftpd-3.0.2-r4.ebuild 3661 SHA256 8ca68dc2a490b223b723e2a1fb6f05d37c55f1b6cdf45f055c259f2288e516ad SHA512 7c08ecd9613820e3ddc97c39f10cd07b26b501881cebf2097d7fb2fb86682545dae6347e3551bb31cec1b9ac0045792435856bc8437cd556205d952d64f537d6 WHIRLPOOL 6f22964a5a04000cf7158440f8714eba6a7c76f91e2b1d7dacb881b51cd4ac813fdcfbff188219997ea4b0c1f4210248825b925d44a4cd74c84c36c8cddcb799
+EBUILD vsftpd-3.0.2.ebuild 3149 SHA256 e1ce82acbec4c4fcf44e026496dcb07af21465f39707ce0f86bdd978950e83c6 SHA512 b34f37765dbce220c4416ac509e38c04b8770d280d4f05ed414a87940671b35f4b8959a2b3b551b9059993ef8f8e6f0163f628f087afcf166802f15c299ea2de WHIRLPOOL 18f56279dc8f65687db2010d90953c319ebeb7e497e4cb9190d1476314ea4957c67eaada105f8530f105386b02d5d75aa4113e504ed182727d20beb7f1c5e7d3
+EBUILD vsftpd-3.0.3-r1.ebuild 3652 SHA256 332bde1641d029d580298f6ce0e6a7c0f32848b1cce92cb508026e8addfc6c14 SHA512 55b936fc31fe73981d89f5b87f8042e3824faaa1414df6403a9b4c7251d455b615e1cb548f88c05aa622c76f07757326ba95dc8e81ad1f1d270dcd763d500c33 WHIRLPOOL e55090c963aada5a53e6466311eda8de994ddf9d58d034d4a86c2be0952a3d4e484bb28a0f6ca3c7b3acc8437cdf291539e3bdb8ed8299b1c2f63407a0a878f8
+EBUILD vsftpd-3.0.3.ebuild 3594 SHA256 66dee0597e285294625c057c75ec8ee3c39e77106a1d5a137c9cb09556cd0c88 SHA512 967e258a7e72cab67c5adc433658687593fecd89894845e58999d0f40aa13ff39aef8a1eee53751b7b2fa623faa085830c7c6f0c75723c72ff68cd8611138649 WHIRLPOOL 01e612aee15c777c43e40bd42911f4bd1f9f9848f62757d4b512377e36e5abe43f8a8a64d6583755d92480551309e1a0e15d009fdf4c2ae587028821122b9ed9
+MISC ChangeLog 4013 SHA256 61df7da52264bb6ba0c00447ad4bc015bfe46d9bba9e20344d75d9ce876f827f SHA512 1b8b17f1bad2b3a6beab3fe927c442db01baeffa72e7c84f97d927bc0c6cffaa3b39cda434acc9c6d4e4c61f068e34bbbdbc285bbe14f962387f326fe75dbc96 WHIRLPOOL 86d9f3bb1f789fc3c01433c1ac0f3ecae5f0e115567bc6381e79c68cdb0c1786f1ad722f83d02d4f551fd523f0edef793f06fe0f45127c4694d2c835ba41ae2a
+MISC ChangeLog-2015 26159 SHA256 53608c6d2d96acbce4c07ae9132408b4d3aefc849038107dae44fde136237a5d SHA512 7d197cfab0e5645a7a2b3e25bb381472a666ae288fc9d3e95c54ee2b5cb89d49a9968d5610a6b7d472bc48af7f740ceb941af86ac50f3705988e06a1d4ab8027 WHIRLPOOL 68b8d437d9416b7de49d8645f76e1ba6212a77c13c8ede810793b0d347fb29a1c37e3c959196a2c51697b3a4028fbeb7d0294ac13d6a383cd588e5a89f27887e
+MISC metadata.xml 372 SHA256 0f8b5c0b9c0ed7e4aba85643713e5e524c1deead733f758234757beda832a3ec SHA512 d673dfbc265acd4e0231111adcd9d099b6a465a508f64b031edd12601ac45cded8994eab8b3bd912ab00858197c9d68c4f83d461cd19a488e67daa055c2db334 WHIRLPOOL 51219cd9223a81436dc7d85ed2fc19107c314fa80d9d568d17e7bff118dd11e9903ed5d41029b4a7a2d4b50c17afe1f63c102be2d8831451b3ec901b0f8c9c40
diff --git a/net-ftp/vsftpd/files/vsftpd-2.1.0-caps.patch b/net-ftp/vsftpd/files/vsftpd-2.1.0-caps.patch
new file mode 100644
index 000000000000..bd29762e9f48
--- /dev/null
+++ b/net-ftp/vsftpd/files/vsftpd-2.1.0-caps.patch
@@ -0,0 +1,15 @@
+diff -ur vsftpd-2.1.0.orig/sysdeputil.c vsftpd-2.1.0/sysdeputil.c
+--- vsftpd-2.1.0.orig/sysdeputil.c 2009-02-23 18:23:26.000000000 +0100
++++ vsftpd-2.1.0/sysdeputil.c 2009-02-23 18:23:51.000000000 +0100
+@@ -160,10 +160,8 @@
+ #include <sys/capability.h>
+
+ #if defined(VSF_SYSDEP_HAVE_CAPABILITIES) && !defined(VSF_SYSDEP_HAVE_LIBCAP)
+-#include <linux/unistd.h>
+ #include <linux/capability.h>
+-#include <errno.h>
+-#include <syscall.h>
++#include <sys/syscall.h>
+ int capset(cap_user_header_t header, const cap_user_data_t data)
+ {
+ return syscall(__NR_capset, header, data);
diff --git a/net-ftp/vsftpd/files/vsftpd-2.2.0-dont-link-caps.patch b/net-ftp/vsftpd/files/vsftpd-2.2.0-dont-link-caps.patch
new file mode 100644
index 000000000000..debcf06279e3
--- /dev/null
+++ b/net-ftp/vsftpd/files/vsftpd-2.2.0-dont-link-caps.patch
@@ -0,0 +1,21 @@
+diff -ur vsftpd-2.2.0.orig/vsf_findlibs.sh vsftpd-2.2.0/vsf_findlibs.sh
+--- vsftpd-2.2.0.orig/vsf_findlibs.sh 2009-08-23 22:15:39.000000000 -0700
++++ vsftpd-2.2.0/vsf_findlibs.sh 2009-08-23 22:16:31.000000000 -0700
+@@ -44,17 +44,6 @@
+ # For older HP-UX...
+ locate_library /usr/lib/libsec.sl && echo "-lsec";
+
+-# Look for libcap (capabilities)
+-if locate_library /lib/libcap.so.1; then
+- echo "/lib/libcap.so.1";
+-elif locate_library /lib/libcap.so.2; then
+- echo "/lib/libcap.so.2";
+-else
+- locate_library /usr/lib/libcap.so && echo "-lcap";
+- locate_library /lib/libcap.so && echo "-lcap";
+- locate_library /lib64/libcap.so && echo "-lcap";
+-fi
+-
+ # Solaris needs this for nanosleep()..
+ locate_library /lib/libposix4.so && echo "-lposix4";
+ locate_library /usr/lib/libposix4.so && echo "-lposix4";
diff --git a/net-ftp/vsftpd/files/vsftpd-2.3.2-as-needed.patch b/net-ftp/vsftpd/files/vsftpd-2.3.2-as-needed.patch
new file mode 100644
index 000000000000..330026e47e94
--- /dev/null
+++ b/net-ftp/vsftpd/files/vsftpd-2.3.2-as-needed.patch
@@ -0,0 +1,13 @@
+Index: vsftpd-2.3.2/Makefile
+===================================================================
+--- vsftpd-2.3.2.orig/Makefile
++++ vsftpd-2.3.2/Makefile
+@@ -21,7 +21,7 @@ OBJS = main.o utility.o prelogin.o ftpcm
+ $(CC) -c $*.c $(CFLAGS) $(IFLAGS)
+
+ vsftpd: $(OBJS)
+- $(CC) -o vsftpd $(OBJS) $(LINK) $(LIBS) $(LDFLAGS)
++ $(CC) -o vsftpd $(LDFLAGS) $(OBJS) $(LINK) $(LIBS)
+
+ install:
+ if [ -x /usr/local/sbin ]; then \
diff --git a/net-ftp/vsftpd/files/vsftpd-2.3.2-kerberos.patch b/net-ftp/vsftpd/files/vsftpd-2.3.2-kerberos.patch
new file mode 100644
index 000000000000..702363ee472b
--- /dev/null
+++ b/net-ftp/vsftpd/files/vsftpd-2.3.2-kerberos.patch
@@ -0,0 +1,20 @@
+Index: vsftpd-2.3.2/twoprocess.c
+===================================================================
+--- vsftpd-2.3.2.orig/twoprocess.c
++++ vsftpd-2.3.2/twoprocess.c
+@@ -284,6 +284,7 @@ process_login_req(struct vsf_session* p_
+ {
+ enum EVSFPrivopLoginResult e_login_result = kVSFLoginNull;
+ char cmd;
++ vsf_sysutil_install_null_sighandler(kVSFSysUtilSigCHLD);
+ /* Blocks */
+ cmd = priv_sock_get_cmd(p_sess->parent_fd);
+ if (cmd != PRIV_SOCK_LOGIN)
+@@ -363,7 +364,6 @@ common_do_login(struct vsf_session* p_se
+ int was_anon = anon;
+ const struct mystr* p_orig_user_str = p_user_str;
+ int newpid;
+- vsf_sysutil_install_null_sighandler(kVSFSysUtilSigCHLD);
+ /* Tells the pre-login child all is OK (it may exit in response) */
+ priv_sock_send_result(p_sess->parent_fd, PRIV_SOCK_RESULT_OK);
+ if (!p_sess->control_use_ssl)
diff --git a/net-ftp/vsftpd/files/vsftpd-2.3.5-gentoo.patch b/net-ftp/vsftpd/files/vsftpd-2.3.5-gentoo.patch
new file mode 100644
index 000000000000..7f1af4beb8c7
--- /dev/null
+++ b/net-ftp/vsftpd/files/vsftpd-2.3.5-gentoo.patch
@@ -0,0 +1,207 @@
+Index: vsftpd-2.3.5/defs.h
+===================================================================
+--- vsftpd-2.3.5.orig/defs.h
++++ vsftpd-2.3.5/defs.h
+@@ -1,7 +1,7 @@
+ #ifndef VSF_DEFS_H
+ #define VSF_DEFS_H
+
+-#define VSFTP_DEFAULT_CONFIG "/etc/vsftpd.conf"
++#define VSFTP_DEFAULT_CONFIG "/etc/vsftpd/vsftpd.conf"
+
+ #define VSFTP_COMMAND_FD 0
+
+Index: vsftpd-2.3.5/tunables.c
+===================================================================
+--- vsftpd-2.3.5.orig/tunables.c
++++ vsftpd-2.3.5/tunables.c
+@@ -250,7 +250,7 @@ tunables_load_defaults()
+ /* -rw------- */
+ tunable_chown_upload_mode = 0600;
+
+- install_str_setting("/usr/share/empty", &tunable_secure_chroot_dir);
++ install_str_setting("/usr/share/vsftpd/empty", &tunable_secure_chroot_dir);
+ install_str_setting("ftp", &tunable_ftp_username);
+ install_str_setting("root", &tunable_chown_username);
+ install_str_setting("/var/log/xferlog", &tunable_xferlog_file);
+@@ -258,11 +258,11 @@ tunables_load_defaults()
+ install_str_setting(".message", &tunable_message_file);
+ install_str_setting("nobody", &tunable_nopriv_user);
+ install_str_setting(0, &tunable_ftpd_banner);
+- install_str_setting("/etc/vsftpd.banned_emails", &tunable_banned_email_file);
+- install_str_setting("/etc/vsftpd.chroot_list", &tunable_chroot_list_file);
++ install_str_setting("/etc/vsftpd/vsftpd.banned_emails", &tunable_banned_email_file);
++ install_str_setting("/etc/vsftpd/vsftpd.chroot_list", &tunable_chroot_list_file);
+ install_str_setting("ftp", &tunable_pam_service_name);
+ install_str_setting("ftp", &tunable_guest_username);
+- install_str_setting("/etc/vsftpd.user_list", &tunable_userlist_file);
++ install_str_setting("/etc/vsftpd/vsftpd.user_list", &tunable_userlist_file);
+ install_str_setting(0, &tunable_anon_root);
+ install_str_setting(0, &tunable_local_root);
+ install_str_setting(0, &tunable_banner_file);
+@@ -275,7 +275,7 @@ tunables_load_defaults()
+ install_str_setting(0, &tunable_hide_file);
+ install_str_setting(0, &tunable_deny_file);
+ install_str_setting(0, &tunable_user_sub_token);
+- install_str_setting("/etc/vsftpd.email_passwords",
++ install_str_setting("/etc/vsftpd/vsftpd.email_passwords",
+ &tunable_email_password_file);
+ install_str_setting("/usr/share/ssl/certs/vsftpd.pem",
+ &tunable_rsa_cert_file);
+Index: vsftpd-2.3.5/vsftpd.8
+===================================================================
+--- vsftpd-2.3.5.orig/vsftpd.8
++++ vsftpd-2.3.5/vsftpd.8
+@@ -21,7 +21,7 @@ itself will listen on the network. This
+ recommended. It is activated by setting
+ .Pa listen=YES
+ in
+-.Pa /etc/vsftpd.conf .
++.Pa /etc/vsftpd/vsftpd.conf .
+ Direct execution of the
+ .Nm vsftpd
+ binary will then launch the FTP service ready for immediate client connections.
+@@ -33,7 +33,7 @@ as root. Any command line option not sta
+ as a config file that will be loaded. Note that config files are loaded in the
+ strict order that they are encountered on the command line.
+ If no config files are specified, the default configuration file of
+-.Pa /etc/vsftpd.conf
++.Pa /etc/vsftpd/vsftpd.conf
+ will be loaded, after all other command line options are processed.
+ .Pp
+ Supported options are:
+@@ -47,14 +47,14 @@ their appearance on the command line, in
+ config files.
+ .El
+ .Sh EXAMPLES
+-vsftpd -olisten=NO /etc/vsftpd.conf -oftpd_banner=blah
++vsftpd -olisten=NO /etc/vsftpd/vsftpd.conf -oftpd_banner=blah
+ .Pp
+ That example overrides vsftpd's built-in default for the "listen" option to be
+-NO, but then loads /etc/vsftpd.conf which may override that setting. Finally,
++NO, but then loads /etc/vsftpd/vsftpd.conf which may override that setting. Finally,
+ the "ftpd_banner" setting is set to "blah", which overrides any default vsftpd
+ setting and any identical setting that was in the config file.
+ .Sh FILES
+-.Pa /etc/vsftpd.conf
++.Pa /etc/vsftpd/vsftpd.conf
+ .Sh SEE ALSO
+ .Xr vsftpd.conf 5
+ .end
+Index: vsftpd-2.3.5/vsftpd.conf
+===================================================================
+--- vsftpd-2.3.5.orig/vsftpd.conf
++++ vsftpd-2.3.5/vsftpd.conf
+@@ -1,4 +1,4 @@
+-# Example config file /etc/vsftpd.conf
++# Example config file /etc/vsftpd/vsftpd.conf
+ #
+ # The default compiled in settings are fairly paranoid. This sample file
+ # loosens things up a bit, to make the ftp daemon more usable.
+@@ -87,7 +87,7 @@ connect_from_port_20=YES
+ # useful for combatting certain DoS attacks.
+ #deny_email_enable=YES
+ # (default follows)
+-#banned_email_file=/etc/vsftpd.banned_emails
++#banned_email_file=/etc/vsftpd/vsftpd.banned_emails
+ #
+ # You may specify an explicit list of local users to chroot() to their home
+ # directory. If chroot_local_user is YES, then this list becomes a list of
+@@ -98,7 +98,7 @@ connect_from_port_20=YES
+ #chroot_local_user=YES
+ #chroot_list_enable=YES
+ # (default follows)
+-#chroot_list_file=/etc/vsftpd.chroot_list
++#chroot_list_file=/etc/vsftpd/vsftpd.chroot_list
+ #
+ # You may activate the "-R" option to the builtin ls. This is disabled by
+ # default to avoid remote users being able to cause excessive I/O on large
+Index: vsftpd-2.3.5/vsftpd.conf.5
+===================================================================
+--- vsftpd-2.3.5.orig/vsftpd.conf.5
++++ vsftpd-2.3.5/vsftpd.conf.5
+@@ -4,7 +4,7 @@ vsftpd.conf \- config file for vsftpd
+ .SH DESCRIPTION
+ vsftpd.conf may be used to control various aspects of vsftpd's behaviour. By
+ default, vsftpd looks for this file at the location
+-.BR /etc/vsftpd.conf .
++.BR /etc/vsftpd/vsftpd.conf .
+ However, you may override this by specifying a command line argument to
+ vsftpd. The command line argument is the pathname of the configuration file
+ for vsftpd. This behaviour is useful because you may wish to use an advanced
+@@ -138,7 +138,7 @@ chroot() jail in their home directory up
+ different if chroot_local_user is set to YES. In this case, the list becomes
+ a list of users which are NOT to be placed in a chroot() jail.
+ By default, the file containing this list is
+-/etc/vsftpd.chroot_list, but you may override this with the
++/etc/vsftpd/vsftpd.chroot_list, but you may override this with the
+ .BR chroot_list_file
+ setting.
+
+@@ -177,7 +177,7 @@ Default: NO
+ .B deny_email_enable
+ If activated, you may provide a list of anonymous password e-mail responses
+ which cause login to be denied. By default, the file containing this list is
+-/etc/vsftpd.banned_emails, but you may override this with the
++/etc/vsftpd/vsftpd.banned_emails, but you may override this with the
+ .BR banned_email_file
+ setting.
+
+@@ -433,7 +433,7 @@ anonymous logins are prevented unless th
+ file specified by the
+ .BR email_password_file
+ setting. The file format is one password per line, no extra whitespace. The
+-default filename is /etc/vsftpd.email_passwords.
++default filename is /etc/vsftpd/vsftpd.email_passwords.
+
+ Default: NO
+ .TP
+@@ -764,7 +764,7 @@ passwords which are not permitted. This
+ .BR deny_email_enable
+ is enabled.
+
+-Default: /etc/vsftpd.banned_emails
++Default: /etc/vsftpd/vsftpd.banned_emails
+ .TP
+ .B banner_file
+ This option is the name of a file containing text to display when someone
+@@ -803,7 +803,7 @@ is enabled. If the option
+ is enabled, then the list file becomes a list of users to NOT place in a
+ chroot() jail.
+
+-Default: /etc/vsftpd.chroot_list
++Default: /etc/vsftpd/vsftpd.chroot_list
+ .TP
+ .B cmds_allowed
+ This options specifies a comma separated list of allowed FTP commands (post
+@@ -864,7 +864,7 @@ This option can be used to provide an al
+ .BR secure_email_list_enable
+ setting.
+
+-Default: /etc/vsftpd.email_passwords
++Default: /etc/vsftpd/vsftpd.email_passwords
+ .TP
+ .B ftp_username
+ This is the name of the user we use for handling anonymous FTP. The home
+@@ -987,10 +987,10 @@ the manual page, on a per-user basis. Us
+ with an example. If you set
+ .BR user_config_dir
+ to be
+-.BR /etc/vsftpd_user_conf
++.BR /etc/vsftpd/vsftpd_user_conf
+ and then log on as the user "chris", then vsftpd will apply the settings in
+ the file
+-.BR /etc/vsftpd_user_conf/chris
++.BR /etc/vsftpd/vsftpd_user_conf/chris
+ for the duration of the session. The format of this file is as detailed in
+ this manual page! PLEASE NOTE that not all settings are effective on a
+ per-user basis. For example, many settings only prior to the user's session
+@@ -1026,7 +1026,7 @@ This option is the name of the file load
+ .BR userlist_enable
+ option is active.
+
+-Default: /etc/vsftpd.user_list
++Default: /etc/vsftpd/vsftpd.user_list
+ .TP
+ .B vsftpd_log_file
+ This option is the name of the file to which we write the vsftpd style
diff --git a/net-ftp/vsftpd/files/vsftpd-3.0.0-Makefile.patch b/net-ftp/vsftpd/files/vsftpd-3.0.0-Makefile.patch
new file mode 100644
index 000000000000..5df3b03f3fa9
--- /dev/null
+++ b/net-ftp/vsftpd/files/vsftpd-3.0.0-Makefile.patch
@@ -0,0 +1,34 @@
+Index: vsftpd-3.0.0/Makefile
+===================================================================
+--- vsftpd-3.0.0.orig/Makefile
++++ vsftpd-3.0.0/Makefile
+@@ -1,16 +1,16 @@
+ # Makefile for systems with GNU tools
+-CC = gcc
++CC ?= gcc
+ INSTALL = install
+ IFLAGS = -idirafter dummyinc
+ #CFLAGS = -g
+-CFLAGS = -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 \
+- -Wall -W -Wshadow -Werror -Wformat-security \
++CFLAGS += -fPIE -fstack-protector --param=ssp-buffer-size=4 \
++ -Wall -W -Wshadow -Wformat-security \
+ -D_FORTIFY_SOURCE=2 \
+ #-pedantic -Wconversion
+
+ LIBS = `./vsf_findlibs.sh`
+ LINK =
+-LDFLAGS = -fPIE -pie -Wl,-z,relro -Wl,-z,now
++LDFLAGS += -fPIE -pie -Wl,-z,relro -Wl,-z,now
+
+ OBJS = main.o utility.o prelogin.o ftpcmdio.o postlogin.o privsock.o \
+ tunables.o ftpdataio.o secbuf.o ls.o \
+@@ -26,7 +26,7 @@ OBJS = main.o utility.o prelogin.o ftpcm
+ $(CC) -c $*.c $(CFLAGS) $(IFLAGS)
+
+ vsftpd: $(OBJS)
+- $(CC) -o vsftpd $(OBJS) $(LINK) $(LDFLAGS) $(LIBS)
++ $(CC) -o vsftpd $(LDFLAGS) $(OBJS) $(LINK) $(LDFLAGS) $(LIBS)
+
+ install:
+ if [ -x /usr/local/sbin ]; then \
diff --git a/net-ftp/vsftpd/files/vsftpd-3.0.2-alpha.patch b/net-ftp/vsftpd/files/vsftpd-3.0.2-alpha.patch
new file mode 100644
index 000000000000..2445bb54467c
--- /dev/null
+++ b/net-ftp/vsftpd/files/vsftpd-3.0.2-alpha.patch
@@ -0,0 +1,16 @@
+Author: Michael Cree <mcree@orcon.net.nz>
+Description: Fixing FTBFS on alpha (Closes: #656182).
+
+diff -Naurp vsftpd.orig/sysdeputil.c vsftpd/sysdeputil.c
+--- vsftpd.orig/sysdeputil.c 2010-03-26 04:25:33.000000000 +0100
++++ vsftpd/sysdeputil.c 2012-01-21 10:53:37.353802546 +0100
+@@ -81,6 +81,9 @@
+ #include <linux/unistd.h>
+ #include <errno.h>
+ #include <syscall.h>
++ #if defined(__alpha__)
++ #define __NR_getpid __NR_getxpid
++ #endif
+ #endif
+
+ #if defined(__linux__) && !defined(__ia64__) && !defined(__s390__)
diff --git a/net-ftp/vsftpd/files/vsftpd-3.0.2-aslim.patch b/net-ftp/vsftpd/files/vsftpd-3.0.2-aslim.patch
new file mode 100644
index 000000000000..9a8f8ea0e254
--- /dev/null
+++ b/net-ftp/vsftpd/files/vsftpd-3.0.2-aslim.patch
@@ -0,0 +1,13 @@
+https://bugs.gentoo.org/show_bug.cgi?id=522412
+https://bugzilla.redhat.com/show_bug.cgi?id=913519
+--- a/defs.h 2014-09-13 12:04:15.953079704 +0200
++++ b/defs.h 2014-09-13 12:04:48.677080716 +0200
+@@ -19,7 +19,7 @@
+ /* Must be at least the size of VSFTP_MAX_COMMAND_LINE, VSFTP_DIR_BUFSIZE and
+ VSFTP_DATA_BUFSIZE*2 */
+ #define VSFTP_PRIVSOCK_MAXSTR VSFTP_DATA_BUFSIZE * 2
+-#define VSFTP_AS_LIMIT 100UL * 1024 * 1024
++#define VSFTP_AS_LIMIT 400UL * 1024 * 1024
+
+ #endif /* VSF_DEFS_H */
+
diff --git a/net-ftp/vsftpd/files/vsftpd-3.0.2-remove-legacy-cap.patch b/net-ftp/vsftpd/files/vsftpd-3.0.2-remove-legacy-cap.patch
new file mode 100644
index 000000000000..2401f37c7e88
--- /dev/null
+++ b/net-ftp/vsftpd/files/vsftpd-3.0.2-remove-legacy-cap.patch
@@ -0,0 +1,57 @@
+https://bugs.gentoo.org/show_bug.cgi?id=450536
+Patch by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
+
+Probe the preferred version
+--- vsftpd-3.0.2/sysdeputil.c.org 2013-01-05 18:32:13.241288839 +0100
++++ vsftpd-3.0.2/sysdeputil.c 2013-01-05 19:41:53.038148078 +0100
+@@ -561,11 +561,17 @@
+ }
+
+ #ifndef VSF_SYSDEP_HAVE_LIBCAP
++static struct __user_cap_header_struct sys_cap_head;
+ static int
+ do_checkcap(void)
+ {
++ int retval;
++
++ /* Store preferred version in sys_cap_head */
++ vsf_sysutil_memclr(&sys_cap_head, sizeof(sys_cap_head));
+ /* EFAULT (EINVAL if page 0 mapped) vs. ENOSYS */
+- int retval = capset(0, 0);
++ retval = capset(&sys_cap_head, 0);
++
+ if (!vsf_sysutil_retval_is_error(retval) ||
+ vsf_sysutil_get_error() != kVSFSysUtilErrNOSYS)
+ {
+@@ -579,17 +585,13 @@
+ {
+ /* n.b. yes I know I should be using libcap!! */
+ int retval;
+- struct __user_cap_header_struct cap_head;
+- struct __user_cap_data_struct cap_data;
++ struct __user_cap_data_struct cap_data[2];
+ __u32 cap_mask = 0;
+ if (!caps)
+ {
+ bug("asked to adopt no capabilities");
+ }
+- vsf_sysutil_memclr(&cap_head, sizeof(cap_head));
+ vsf_sysutil_memclr(&cap_data, sizeof(cap_data));
+- cap_head.version = _LINUX_CAPABILITY_VERSION;
+- cap_head.pid = 0;
+ if (caps & kCapabilityCAP_CHOWN)
+ {
+ cap_mask |= (1 << CAP_CHOWN);
+@@ -598,9 +600,9 @@
+ {
+ cap_mask |= (1 << CAP_NET_BIND_SERVICE);
+ }
+- cap_data.effective = cap_data.permitted = cap_mask;
+- cap_data.inheritable = 0;
+- retval = capset(&cap_head, &cap_data);
++ cap_data[0].effective = cap_data[0].permitted = cap_mask;
++ cap_data[0].inheritable = 0;
++ retval = capset(&sys_cap_head, &cap_data[0]);
+ if (retval != 0)
+ {
+ die("capset");
diff --git a/net-ftp/vsftpd/files/vsftpd-checkconfig.sh b/net-ftp/vsftpd/files/vsftpd-checkconfig.sh
new file mode 100644
index 000000000000..e1d1e5231b67
--- /dev/null
+++ b/net-ftp/vsftpd/files/vsftpd-checkconfig.sh
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+VSFTPD_CONF="${VSFTPD_CONF:-/etc/vsftpd/vsftpd.conf}"
+
+if [ ! -e ${VSFTPD_CONF} ] ; then
+ echo "Please setup ${VSFTPD_CONF} before starting vsftpd" >&2
+ echo "There are sample configurations in /usr/share/doc/vsftpd" >&2
+ exit 1
+fi
+
+if egrep -iq "^ *background *= *yes" "${VSFTPD_CONF}" ; then
+ echo "${VSFTPD_CONF} must not set background=YES" >&2
+ exit 1
+fi
+
+has_ip=false has_ipv6=false ip_error=true
+egrep -iq "^ *listen *= *yes" "${VSFTPD_CONF}" && has_ip=true
+egrep -iq "^ *listen_ipv6 *= *yes" "${VSFTPD_CONF}" && has_ipv6=true
+if ${has_ip} && ! ${has_ipv6} ; then
+ ip_error=false
+elif ! ${has_ip} && ${has_ipv6} ; then
+ ip_error=false
+fi
+if ${ip_error} ; then
+ echo "${VSFTPD_CONF} must contain listen=YES or listen_ipv6=YES" >&2
+ echo "but not both" >&2
+ exit 1
+fi
+
diff --git a/net-ftp/vsftpd/files/vsftpd.conf b/net-ftp/vsftpd/files/vsftpd.conf
new file mode 100644
index 000000000000..3f2658e772ab
--- /dev/null
+++ b/net-ftp/vsftpd/files/vsftpd.conf
@@ -0,0 +1,104 @@
+#
+# Example vsftpd config file
+#
+# See man 5 vsftpd.conf for more information.
+#
+
+# Enable vsftpd to run as a standalone daemon
+# Comment these two out to run under inetd or xinetd
+background=YES
+listen=YES
+
+# Allow anonymous FTP?
+anonymous_enable=YES
+
+# Uncomment this to allow local users to log in.
+#local_enable=YES
+
+# Uncomment this to enable any form of FTP write command.
+#write_enable=YES
+
+# Default umask for local users is 077. You may wish to change this to 022,
+# if your users expect that (022 is used by most other ftpd's)
+#local_umask=022
+
+# Uncomment this to allow the anonymous FTP user to upload files. This only
+# has an effect if the above global write enable is activated. Also, you will
+# obviously need to create a directory writable by the FTP user.
+#anon_upload_enable=YES
+
+# Uncomment this if you want the anonymous FTP user to be able to create
+# new directories.
+#anon_mkdir_write_enable=YES
+
+# Activate directory messages - messages given to remote users when they
+# go into a certain directory.
+dirmessage_enable=YES
+
+# Make sure PORT transfer connections originate from port 20 (ftp-data).
+connect_from_port_20=YES
+
+# If you want, you can arrange for uploaded anonymous files to be owned by
+# a different user. Note! Using "root" for uploaded files is not
+# recommended!
+#chown_uploads=YES
+#chown_username=whoever
+
+# Activate logging of uploads/downloads.
+xferlog_enable=YES
+
+# If you want, you can have your log file in standard ftpd xferlog format
+#xferlog_std_format=YES
+
+# You may override where the log file goes if you like.
+xferlog_file=/var/log/vsftpd.log
+
+# You may change the default value for timing out an idle session.
+#idle_session_timeout=600
+
+# You may change the default value for timing out a data connection.
+#data_connection_timeout=120
+
+# It is recommended that you define on your system a unique user which the
+# ftp server can use as a totally isolated and unprivileged user.
+nopriv_user=nobody
+
+# Enable this and the server will recognise asynchronous ABOR requests. Not
+# recommended for security (the code is non-trivial). Not enabling it,
+# however, may confuse older FTP clients.
+#async_abor_enable=YES
+
+# By default the server will pretend to allow ASCII mode but in fact ignore
+# the request. Turn on the below options to have the server actually do ASCII
+# mangling on files when in ASCII mode.
+# Beware that turning on ascii_download_enable enables malicious remote parties
+# to consume your I/O resources, by issuing the command "SIZE /big/file" in
+# ASCII mode.
+# These ASCII options are split into upload and download because you may wish
+# to enable ASCII uploads (to prevent uploaded scripts etc. from breaking),
+# without the DoS risk of SIZE and ASCII downloads. ASCII mangling should be
+# on the client anyway..
+#ascii_upload_enable=YES
+#ascii_download_enable=YES
+
+# You may fully customise the login banner string:
+#ftpd_banner=Welcome to blah FTP service.
+
+# You may specify a file of disallowed anonymous e-mail addresses. Apparently
+# useful for combatting certain DoS attacks.
+#deny_email_enable=YES
+# (default follows)
+#banned_email_file=/etc/vsftpd/banned_emails
+
+# You may specify an explicit list of local users to chroot() to their home
+# directory. If chroot_local_user is YES, then this list becomes a list of
+# users to NOT chroot().
+#chroot_list_enable=YES
+# (default follows)
+#chroot_list_file=/etc/vsftpd/chroot_list
+
+# You may activate the "-R" option to the builtin ls. This is disabled by
+# default to avoid remote users being able to cause excessive I/O on large
+# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
+# the presence of the "-R" option, so there is a strong case for enabling it.
+#ls_recurse_enable=YES
diff --git a/net-ftp/vsftpd/files/vsftpd.init b/net-ftp/vsftpd/files/vsftpd.init
new file mode 100644
index 000000000000..d49dc001404e
--- /dev/null
+++ b/net-ftp/vsftpd/files/vsftpd.init
@@ -0,0 +1,50 @@
+#!/sbin/openrc-run
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2
+
+VSFTPD_NAME=${SVCNAME##*.}
+if [ -n "${VSFTPD_NAME}" -a "${SVCNAME}" != "vsftpd" ]; then
+ VSFTPD_PID="/var/run/vsftpd.${VSFTPD_NAME}.pid"
+ VSFTPD_CONF_DEFAULT="/etc/vsftpd/${VSFTPD_NAME}.conf"
+else
+ VSFTPD_PID="/var/run/vsftpd.pid"
+ VSFTPD_CONF_DEFAULT="/etc/vsftpd/vsftpd.conf"
+fi
+VSFTPD_CONF=${VSFTPD_CONF:-${VSFTPD_CONF_DEFAULT}}
+VSFTPD_EXEC=${VSFTPD_EXEC:-/usr/sbin/vsftpd}
+
+depend() {
+ need net
+ use dns logger
+}
+
+checkconfig() {
+ VSFTPD_CONF="${VSFTPD_CONF}" \
+ /usr/libexec/vsftpd-checkconfig.sh || return 1
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --exec ${VSFTPD_EXEC} \
+ --background --make-pidfile --pidfile "${VSFTPD_PID}" \
+ -- "${VSFTPD_CONF}"
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ local retval=0
+ if [ -f ${VSFTPD_PID} ]; then
+ start-stop-daemon --stop --pidfile ${VSFTPD_PID} || retval=1
+ pkill --full ${VSFTPD_CONF}
+ else
+ ewarn "Couldn't find ${VSFTPD_PID} trying to stop using the config filename ${VSFTPD_CONF}"
+ pgrep --full ${VSFTPD_CONF} > ${VSFTPD_PID}
+ start-stop-daemon --stop --pidfile ${VSFTPD_PID} || retval=1
+ pkill --full ${VSFTPD_CONF}
+ fi
+ eend ${retval}
+}
+
+# vim: ts=4
diff --git a/net-ftp/vsftpd/files/vsftpd.logrotate b/net-ftp/vsftpd/files/vsftpd.logrotate
new file mode 100644
index 000000000000..b28a2a42628c
--- /dev/null
+++ b/net-ftp/vsftpd/files/vsftpd.logrotate
@@ -0,0 +1,4 @@
+/var/log/vsftpd*.log {
+ missingok
+ notifempty
+}
diff --git a/net-ftp/vsftpd/files/vsftpd.service b/net-ftp/vsftpd/files/vsftpd.service
new file mode 100644
index 000000000000..1445f2769861
--- /dev/null
+++ b/net-ftp/vsftpd/files/vsftpd.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Vsftpd ftp daemon
+After=network.target
+
+[Service]
+Type=simple
+ExecStartPre=/usr/libexec/vsftpd-checkconfig.sh
+ExecStart=/usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-ftp/vsftpd/files/vsftpd.socket b/net-ftp/vsftpd/files/vsftpd.socket
new file mode 100644
index 000000000000..cdc0d337efeb
--- /dev/null
+++ b/net-ftp/vsftpd/files/vsftpd.socket
@@ -0,0 +1,9 @@
+[Unit]
+Conflicts=vsftpd.service
+
+[Socket]
+ListenStream=21
+Accept=yes
+
+[Install]
+WantedBy=sockets.target
diff --git a/net-ftp/vsftpd/files/vsftpd.xinetd b/net-ftp/vsftpd/files/vsftpd.xinetd
new file mode 100644
index 000000000000..efa4ff2feee8
--- /dev/null
+++ b/net-ftp/vsftpd/files/vsftpd.xinetd
@@ -0,0 +1,14 @@
+# default: off
+# description: Vsftpd is an FTP server, designed to be secure.
+
+service ftp
+{
+ socket_type = stream
+ wait = no
+ user = root
+ server = /usr/sbin/vsftpd
+ server_args = /etc/vsftpd/vsftpd.conf
+ log_on_success += DURATION
+ nice = 10
+ disable = yes
+}
diff --git a/net-ftp/vsftpd/files/vsftpd_at.service b/net-ftp/vsftpd/files/vsftpd_at.service
new file mode 100644
index 000000000000..5380b83ffcfe
--- /dev/null
+++ b/net-ftp/vsftpd/files/vsftpd_at.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Very Secure FTP Daemon
+
+[Service]
+Type=simple
+# Note: Do not use ExecStartPre=/usr/libexec/vsftpd-checkconfig.sh, as it
+# requires one of the listen options to be enabled.
+ExecStart=/usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf -obackground=NO -olisten=NO -olisten_ipv6=NO
+StandardInput=socket
+SuccessExitStatus=2
diff --git a/net-ftp/vsftpd/metadata.xml b/net-ftp/vsftpd/metadata.xml
new file mode 100644
index 000000000000..6b6ef604ceaa
--- /dev/null
+++ b/net-ftp/vsftpd/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>hwoarang@gentoo.org</email>
+ <name>Markos Chandras</name>
+ </maintainer>
+ <longdescription lang="en">
+ Very Secure FTP Daemon written with speed, size and security
+ in mind
+ </longdescription>
+</pkgmetadata>
diff --git a/net-ftp/vsftpd/vsftpd-2.3.5.ebuild b/net-ftp/vsftpd/vsftpd-2.3.5.ebuild
new file mode 100644
index 000000000000..8b404d579dfb
--- /dev/null
+++ b/net-ftp/vsftpd/vsftpd-2.3.5.ebuild
@@ -0,0 +1,114 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Very Secure FTP Daemon written with speed, size and security in mind"
+HOMEPAGE="http://vsftpd.beasts.org/"
+SRC_URI="http://security.appspot.com/downloads/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ~hppa ia64 ppc ppc64 s390 sh sparc x86 ~x86-fbsd"
+IUSE="caps pam tcpd ssl selinux xinetd"
+
+DEPEND="caps? ( >=sys-libs/libcap-2 )
+ pam? ( virtual/pam )
+ tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
+ ssl? ( >=dev-libs/openssl-0.9.7d )"
+RDEPEND="${DEPEND}
+ net-ftp/ftpbase
+ selinux? ( sec-policy/selinux-ftp )
+ xinetd? ( sys-apps/xinetd )"
+
+src_prepare() {
+
+ # as-needed patch. Bug #335977
+ epatch "${FILESDIR}/${PN}-2.3.2-as-needed.patch"
+
+ # kerberos patch. bug #335980
+ epatch "${FILESDIR}/${PN}-2.3.2-kerberos.patch"
+
+ # Patch the source, config and the manpage to use /etc/vsftpd/
+ epatch "${FILESDIR}/${P}-gentoo.patch"
+
+ # Fix building without the libcap
+ epatch "${FILESDIR}/${PN}-2.1.0-caps.patch"
+
+ # Configure vsftpd build defaults
+ use tcpd && echo "#define VSF_BUILD_TCPWRAPPERS" >> builddefs.h
+ use ssl && echo "#define VSF_BUILD_SSL" >> builddefs.h
+ use pam || echo "#undef VSF_BUILD_PAM" >> builddefs.h
+
+ # Ensure that we don't link against libcap unless asked
+ if ! use caps ; then
+ sed -i '/^#define VSF_SYSDEP_HAVE_LIBCAP$/ d' sysdeputil.c || die
+ epatch "${FILESDIR}"/${PN}-2.2.0-dont-link-caps.patch
+ fi
+
+ # Let portage control stripping
+ sed -i '/^LINK[[:space:]]*=[[:space:]]*/ s/-Wl,-s//' Makefile || die
+}
+
+src_compile() {
+ emake \
+ CFLAGS="${CFLAGS}" \
+ CC="$(tc-getCC)"
+}
+
+src_install() {
+ into /usr
+ doman ${PN}.conf.5 ${PN}.8
+ dosbin ${PN} || die "disbin failed"
+
+ dodoc AUDIT BENCHMARKS BUGS Changelog FAQ \
+ README README.security REWARD SIZE \
+ SPEED TODO TUNING || die "dodoc failed"
+ newdoc ${PN}.conf ${PN}.conf.example
+
+ docinto security
+ dodoc SECURITY/* || die "dodoc failed"
+
+ insinto "/usr/share/doc/${PF}/examples"
+ doins -r EXAMPLE/* || die "doins faileD"
+
+ insinto /etc/${PN}
+ newins ${PN}.conf{,.example}
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/${PN}.logrotate" ${PN}
+
+ if use xinetd ; then
+ insinto /etc/xinetd.d
+ newins "${FILESDIR}/${PN}.xinetd" ${PN}
+ fi
+
+ newinitd "${FILESDIR}/${PN}.init" ${PN}
+
+ keepdir /usr/share/${PN}/empty
+
+ exeinto /usr/libexec
+ doexe "${FILESDIR}/vsftpd-checkconfig.sh"
+}
+
+pkg_preinst() {
+ # If we use xinetd, then we set listen=NO
+ # so that our default config works under xinetd - fixes #78347
+ if use xinetd ; then
+ sed -i 's/listen=YES/listen=NO/g' "${D}"/etc/${PN}/${PN}.conf.example
+ fi
+}
+
+pkg_postinst() {
+ einfo "vsftpd init script can now be multiplexed."
+ einfo "The default init script forces /etc/vsftpd/vsftpd.conf to exist."
+ einfo "If you symlink the init script to another one, say vsftpd.foo"
+ einfo "then that uses /etc/vsftpd/foo.conf instead."
+ einfo
+ einfo "Example:"
+ einfo " cd /etc/init.d"
+ einfo " ln -s vsftpd vsftpd.foo"
+ einfo "You can now treat vsftpd.foo like any other service"
+}
diff --git a/net-ftp/vsftpd/vsftpd-3.0.2-r1.ebuild b/net-ftp/vsftpd/vsftpd-3.0.2-r1.ebuild
new file mode 100644
index 000000000000..f362ee2595e4
--- /dev/null
+++ b/net-ftp/vsftpd/vsftpd-3.0.2-r1.ebuild
@@ -0,0 +1,121 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils systemd toolchain-funcs
+
+DESCRIPTION="Very Secure FTP Daemon written with speed, size and security in mind"
+HOMEPAGE="http://vsftpd.beasts.org/"
+SRC_URI="http://security.appspot.com/downloads/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 ~s390 ~sh sparc x86 ~x86-fbsd"
+IUSE="caps pam tcpd ssl selinux xinetd"
+
+DEPEND="caps? ( >=sys-libs/libcap-2 )
+ pam? ( virtual/pam )
+ tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
+ ssl? ( >=dev-libs/openssl-0.9.7d )"
+RDEPEND="${DEPEND}
+ net-ftp/ftpbase
+ selinux? ( sec-policy/selinux-ftp )
+ xinetd? ( sys-apps/xinetd )"
+
+src_prepare() {
+
+ # kerberos patch. bug #335980
+ epatch "${FILESDIR}/${PN}-2.3.2-kerberos.patch"
+
+ # Patch the source, config and the manpage to use /etc/vsftpd/
+ epatch "${FILESDIR}/${PN}-2.3.5-gentoo.patch"
+
+ # Fix building without the libcap
+ epatch "${FILESDIR}/${PN}-2.1.0-caps.patch"
+
+ # Fix building on alpha. Bug #405829
+ epatch "${FILESDIR}/${PN}-3.0.2-alpha.patch"
+
+ # Configure vsftpd build defaults
+ use tcpd && echo "#define VSF_BUILD_TCPWRAPPERS" >> builddefs.h
+ use ssl && echo "#define VSF_BUILD_SSL" >> builddefs.h
+ use pam || echo "#undef VSF_BUILD_PAM" >> builddefs.h
+
+ # Ensure that we don't link against libcap unless asked
+ if ! use caps ; then
+ sed -i '/^#define VSF_SYSDEP_HAVE_LIBCAP$/ d' sysdeputil.c || die
+ epatch "${FILESDIR}"/${PN}-2.2.0-dont-link-caps.patch
+ fi
+
+ # Let portage control stripping
+ sed -i '/^LINK[[:space:]]*=[[:space:]]*/ s/-Wl,-s//' Makefile || die
+
+ #Bug #335977
+ epatch "${FILESDIR}"/${PN}-3.0.0-Makefile.patch
+
+ #Bug #450536
+ epatch "${FILESDIR}"/${P}-remove-legacy-cap.patch
+}
+
+src_compile() {
+ CFLAGS="${CFLAGS}" \
+ CC="$(tc-getCC)" \
+ emake
+}
+
+src_install() {
+ into /usr
+ doman ${PN}.conf.5 ${PN}.8
+ dosbin ${PN} || die "disbin failed"
+
+ dodoc AUDIT BENCHMARKS BUGS Changelog FAQ \
+ README README.security REWARD SIZE \
+ SPEED TODO TUNING || die "dodoc failed"
+ newdoc ${PN}.conf ${PN}.conf.example
+
+ docinto security
+ dodoc SECURITY/* || die "dodoc failed"
+
+ insinto "/usr/share/doc/${PF}/examples"
+ doins -r EXAMPLE/* || die "doins faileD"
+
+ insinto /etc/${PN}
+ newins ${PN}.conf{,.example}
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/${PN}.logrotate" ${PN}
+
+ if use xinetd ; then
+ insinto /etc/xinetd.d
+ newins "${FILESDIR}/${PN}.xinetd" ${PN}
+ fi
+
+ newinitd "${FILESDIR}/${PN}.init" ${PN}
+
+ keepdir /usr/share/${PN}/empty
+
+ exeinto /usr/libexec
+ doexe "${FILESDIR}/vsftpd-checkconfig.sh"
+ systemd_dounit "${FILESDIR}/${PN}.service"
+}
+
+pkg_preinst() {
+ # If we use xinetd, then we set listen=NO
+ # so that our default config works under xinetd - fixes #78347
+ if use xinetd ; then
+ sed -i 's/listen=YES/listen=NO/g' "${D}"/etc/${PN}/${PN}.conf.example
+ fi
+}
+
+pkg_postinst() {
+ einfo "vsftpd init script can now be multiplexed."
+ einfo "The default init script forces /etc/vsftpd/vsftpd.conf to exist."
+ einfo "If you symlink the init script to another one, say vsftpd.foo"
+ einfo "then that uses /etc/vsftpd/foo.conf instead."
+ einfo
+ einfo "Example:"
+ einfo " cd /etc/init.d"
+ einfo " ln -s vsftpd vsftpd.foo"
+ einfo "You can now treat vsftpd.foo like any other service"
+}
diff --git a/net-ftp/vsftpd/vsftpd-3.0.2-r2.ebuild b/net-ftp/vsftpd/vsftpd-3.0.2-r2.ebuild
new file mode 100644
index 000000000000..787c26639af9
--- /dev/null
+++ b/net-ftp/vsftpd/vsftpd-3.0.2-r2.ebuild
@@ -0,0 +1,131 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils systemd toolchain-funcs
+
+DESCRIPTION="Very Secure FTP Daemon written with speed, size and security in mind"
+HOMEPAGE="http://vsftpd.beasts.org/"
+SRC_URI="http://security.appspot.com/downloads/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
+IUSE="caps pam tcpd ssl selinux xinetd"
+
+DEPEND="caps? ( >=sys-libs/libcap-2 )
+ pam? ( virtual/pam )
+ tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
+ ssl? ( >=dev-libs/openssl-0.9.7d )"
+RDEPEND="${DEPEND}
+ net-ftp/ftpbase
+ selinux? ( sec-policy/selinux-ftp )
+ xinetd? ( sys-apps/xinetd )"
+
+src_prepare() {
+ # kerberos patch. bug #335980
+ epatch "${FILESDIR}/${PN}-2.3.2-kerberos.patch"
+
+ # Patch the source, config and the manpage to use /etc/vsftpd/
+ epatch "${FILESDIR}/${PN}-2.3.5-gentoo.patch"
+
+ # Fix building without the libcap
+ epatch "${FILESDIR}/${PN}-2.1.0-caps.patch"
+
+ # Fix building on alpha. Bug #405829
+ epatch "${FILESDIR}/${PN}-3.0.2-alpha.patch"
+
+ # Configure vsftpd build defaults
+ use tcpd && echo "#define VSF_BUILD_TCPWRAPPERS" >> builddefs.h
+ use ssl && echo "#define VSF_BUILD_SSL" >> builddefs.h
+ use pam || echo "#undef VSF_BUILD_PAM" >> builddefs.h
+
+ # Ensure that we don't link against libcap unless asked
+ if ! use caps ; then
+ sed -i '/^#define VSF_SYSDEP_HAVE_LIBCAP$/ d' sysdeputil.c || die
+ epatch "${FILESDIR}"/${PN}-2.2.0-dont-link-caps.patch
+ fi
+
+ # Let portage control stripping
+ sed -i '/^LINK[[:space:]]*=[[:space:]]*/ s/-Wl,-s//' Makefile || die
+
+ #Bug #335977
+ epatch "${FILESDIR}"/${PN}-3.0.0-Makefile.patch
+
+ #Bug #450536
+ epatch "${FILESDIR}"/${P}-remove-legacy-cap.patch
+
+ epatch_user
+}
+
+src_compile() {
+ # Override LIBS variable. Bug #508192
+ LIBS=
+ use caps && LIBS+=" -lcap"
+ use pam && LIBS+=" -lpam"
+ use tcpd && LIBS+=" -lwrap"
+ use ssl && LIBS+=" -lssl -lcrypto"
+
+ CFLAGS="${CFLAGS}" \
+ CC="$(tc-getCC)" \
+ emake LIBS="${LIBS}"
+}
+
+src_install() {
+ into /usr
+ doman ${PN}.conf.5 ${PN}.8
+ dosbin ${PN} || die "disbin failed"
+
+ dodoc AUDIT BENCHMARKS BUGS Changelog FAQ \
+ README README.security REWARD SIZE \
+ SPEED TODO TUNING || die "dodoc failed"
+ newdoc ${PN}.conf ${PN}.conf.example
+
+ docinto security
+ dodoc SECURITY/* || die "dodoc failed"
+
+ insinto "/usr/share/doc/${PF}/examples"
+ doins -r EXAMPLE/* || die "doins faileD"
+
+ insinto /etc/${PN}
+ newins ${PN}.conf{,.example}
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/${PN}.logrotate" ${PN}
+
+ if use xinetd ; then
+ insinto /etc/xinetd.d
+ newins "${FILESDIR}/${PN}.xinetd" ${PN}
+ fi
+
+ newinitd "${FILESDIR}/${PN}.init" ${PN}
+
+ keepdir /usr/share/${PN}/empty
+
+ exeinto /usr/libexec
+ doexe "${FILESDIR}/vsftpd-checkconfig.sh"
+ systemd_dounit "${FILESDIR}/${PN}.service"
+ systemd_newunit "${FILESDIR}/${PN}_at.service" "${PN}@.service"
+ systemd_dounit "${FILESDIR}/${PN}.socket"
+}
+
+pkg_preinst() {
+ # If we use xinetd, then we set listen=NO
+ # so that our default config works under xinetd - fixes #78347
+ if use xinetd ; then
+ sed -i 's/listen=YES/listen=NO/g' "${D}"/etc/${PN}/${PN}.conf.example
+ fi
+}
+
+pkg_postinst() {
+ einfo "vsftpd openRC init script can now be multiplexed."
+ einfo "The default init script forces /etc/vsftpd/vsftpd.conf to exist."
+ einfo "If you symlink the init script to another one, say vsftpd.foo"
+ einfo "then that uses /etc/vsftpd/foo.conf instead."
+ einfo
+ einfo "Example:"
+ einfo " cd /etc/init.d"
+ einfo " ln -s vsftpd vsftpd.foo"
+ einfo "You can now treat vsftpd.foo like any other service"
+}
diff --git a/net-ftp/vsftpd/vsftpd-3.0.2-r3.ebuild b/net-ftp/vsftpd/vsftpd-3.0.2-r3.ebuild
new file mode 100644
index 000000000000..ea672ac8b5fe
--- /dev/null
+++ b/net-ftp/vsftpd/vsftpd-3.0.2-r3.ebuild
@@ -0,0 +1,134 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils systemd toolchain-funcs
+
+DESCRIPTION="Very Secure FTP Daemon written with speed, size and security in mind"
+HOMEPAGE="http://vsftpd.beasts.org/"
+SRC_URI="http://security.appspot.com/downloads/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
+IUSE="caps pam tcpd ssl selinux xinetd"
+
+DEPEND="caps? ( >=sys-libs/libcap-2 )
+ pam? ( virtual/pam )
+ tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
+ ssl? ( >=dev-libs/openssl-0.9.7d )"
+RDEPEND="${DEPEND}
+ net-ftp/ftpbase
+ selinux? ( sec-policy/selinux-ftp )
+ xinetd? ( sys-apps/xinetd )"
+
+src_prepare() {
+ # kerberos patch. bug #335980
+ epatch "${FILESDIR}/${PN}-2.3.2-kerberos.patch"
+
+ # Patch the source, config and the manpage to use /etc/vsftpd/
+ epatch "${FILESDIR}/${PN}-2.3.5-gentoo.patch"
+
+ # Fix building without the libcap
+ epatch "${FILESDIR}/${PN}-2.1.0-caps.patch"
+
+ # Fix building on alpha. Bug #405829
+ epatch "${FILESDIR}/${PN}-3.0.2-alpha.patch"
+
+ # Increase AS_LIMIT. Bug #522412
+ epatch "${FILESDIR}/${P}-aslim.patch"
+
+ # Configure vsftpd build defaults
+ use tcpd && echo "#define VSF_BUILD_TCPWRAPPERS" >> builddefs.h
+ use ssl && echo "#define VSF_BUILD_SSL" >> builddefs.h
+ use pam || echo "#undef VSF_BUILD_PAM" >> builddefs.h
+
+ # Ensure that we don't link against libcap unless asked
+ if ! use caps ; then
+ sed -i '/^#define VSF_SYSDEP_HAVE_LIBCAP$/ d' sysdeputil.c || die
+ epatch "${FILESDIR}"/${PN}-2.2.0-dont-link-caps.patch
+ fi
+
+ # Let portage control stripping
+ sed -i '/^LINK[[:space:]]*=[[:space:]]*/ s/-Wl,-s//' Makefile || die
+
+ #Bug #335977
+ epatch "${FILESDIR}"/${PN}-3.0.0-Makefile.patch
+
+ #Bug #450536
+ epatch "${FILESDIR}"/${P}-remove-legacy-cap.patch
+
+ epatch_user
+}
+
+src_compile() {
+ # Override LIBS variable. Bug #508192
+ LIBS=
+ use caps && LIBS+=" -lcap"
+ use pam && LIBS+=" -lpam"
+ use tcpd && LIBS+=" -lwrap"
+ use ssl && LIBS+=" -lssl -lcrypto"
+
+ CFLAGS="${CFLAGS}" \
+ CC="$(tc-getCC)" \
+ emake LIBS="${LIBS}"
+}
+
+src_install() {
+ into /usr
+ doman ${PN}.conf.5 ${PN}.8
+ dosbin ${PN} || die "disbin failed"
+
+ dodoc AUDIT BENCHMARKS BUGS Changelog FAQ \
+ README README.security REWARD SIZE \
+ SPEED TODO TUNING || die "dodoc failed"
+ newdoc ${PN}.conf ${PN}.conf.example
+
+ docinto security
+ dodoc SECURITY/* || die "dodoc failed"
+
+ insinto "/usr/share/doc/${PF}/examples"
+ doins -r EXAMPLE/* || die "doins faileD"
+
+ insinto /etc/${PN}
+ newins ${PN}.conf{,.example}
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/${PN}.logrotate" ${PN}
+
+ if use xinetd ; then
+ insinto /etc/xinetd.d
+ newins "${FILESDIR}/${PN}.xinetd" ${PN}
+ fi
+
+ newinitd "${FILESDIR}/${PN}.init" ${PN}
+
+ keepdir /usr/share/${PN}/empty
+
+ exeinto /usr/libexec
+ doexe "${FILESDIR}/vsftpd-checkconfig.sh"
+ systemd_dounit "${FILESDIR}/${PN}.service"
+ systemd_newunit "${FILESDIR}/${PN}_at.service" "${PN}@.service"
+ systemd_dounit "${FILESDIR}/${PN}.socket"
+}
+
+pkg_preinst() {
+ # If we use xinetd, then we set listen=NO
+ # so that our default config works under xinetd - fixes #78347
+ if use xinetd ; then
+ sed -i 's/listen=YES/listen=NO/g' "${D}"/etc/${PN}/${PN}.conf.example
+ fi
+}
+
+pkg_postinst() {
+ einfo "vsftpd openRC init script can now be multiplexed."
+ einfo "The default init script forces /etc/vsftpd/vsftpd.conf to exist."
+ einfo "If you symlink the init script to another one, say vsftpd.foo"
+ einfo "then that uses /etc/vsftpd/foo.conf instead."
+ einfo
+ einfo "Example:"
+ einfo " cd /etc/init.d"
+ einfo " ln -s vsftpd vsftpd.foo"
+ einfo "You can now treat vsftpd.foo like any other service"
+}
diff --git a/net-ftp/vsftpd/vsftpd-3.0.2-r4.ebuild b/net-ftp/vsftpd/vsftpd-3.0.2-r4.ebuild
new file mode 100644
index 000000000000..9f5b84c96837
--- /dev/null
+++ b/net-ftp/vsftpd/vsftpd-3.0.2-r4.ebuild
@@ -0,0 +1,134 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils systemd toolchain-funcs
+
+DESCRIPTION="Very Secure FTP Daemon written with speed, size and security in mind"
+HOMEPAGE="http://vsftpd.beasts.org/"
+SRC_URI="http://security.appspot.com/downloads/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
+IUSE="caps pam tcpd ssl selinux xinetd"
+
+DEPEND="caps? ( >=sys-libs/libcap-2 )
+ pam? ( virtual/pam )
+ tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
+ ssl? ( >=dev-libs/openssl-0.9.7d )"
+RDEPEND="${DEPEND}
+ net-ftp/ftpbase
+ selinux? ( sec-policy/selinux-ftp )
+ xinetd? ( sys-apps/xinetd )"
+
+src_prepare() {
+ # kerberos patch. bug #335980
+ epatch "${FILESDIR}/${PN}-2.3.2-kerberos.patch"
+
+ # Patch the source, config and the manpage to use /etc/vsftpd/
+ epatch "${FILESDIR}/${PN}-2.3.5-gentoo.patch"
+
+ # Fix building without the libcap
+ epatch "${FILESDIR}/${PN}-2.1.0-caps.patch"
+
+ # Fix building on alpha. Bug #405829
+ epatch "${FILESDIR}/${PN}-3.0.2-alpha.patch"
+
+ # Increase AS_LIMIT. Bug #522412
+ epatch "${FILESDIR}/${P}-aslim.patch"
+
+ # Configure vsftpd build defaults
+ use tcpd && echo "#define VSF_BUILD_TCPWRAPPERS" >> builddefs.h
+ use ssl && echo "#define VSF_BUILD_SSL" >> builddefs.h
+ use pam || echo "#undef VSF_BUILD_PAM" >> builddefs.h
+
+ # Ensure that we don't link against libcap unless asked
+ if ! use caps ; then
+ sed -i '/^#define VSF_SYSDEP_HAVE_LIBCAP$/ d' sysdeputil.c || die
+ epatch "${FILESDIR}"/${PN}-2.2.0-dont-link-caps.patch
+ fi
+
+ # Let portage control stripping
+ sed -i '/^LINK[[:space:]]*=[[:space:]]*/ s/-Wl,-s//' Makefile || die
+
+ #Bug #335977
+ epatch "${FILESDIR}"/${PN}-3.0.0-Makefile.patch
+
+ #Bug #450536
+ epatch "${FILESDIR}"/${P}-remove-legacy-cap.patch
+
+ epatch_user
+}
+
+src_compile() {
+ # Override LIBS variable. Bug #508192
+ LIBS=
+ use caps && LIBS+=" -lcap"
+ use pam && LIBS+=" -lpam"
+ use tcpd && LIBS+=" -lwrap"
+ use ssl && LIBS+=" -lssl -lcrypto"
+
+ CFLAGS="${CFLAGS}" \
+ CC="$(tc-getCC)" \
+ emake LIBS="${LIBS}"
+}
+
+src_install() {
+ into /usr
+ doman ${PN}.conf.5 ${PN}.8
+ dosbin ${PN} || die "disbin failed"
+
+ dodoc AUDIT BENCHMARKS BUGS Changelog FAQ \
+ README README.security REWARD SIZE \
+ SPEED TODO TUNING || die "dodoc failed"
+ newdoc ${PN}.conf ${PN}.conf.example
+
+ docinto security
+ dodoc SECURITY/* || die "dodoc failed"
+
+ insinto "/usr/share/doc/${PF}/examples"
+ doins -r EXAMPLE/* || die "doins faileD"
+
+ insinto /etc/${PN}
+ newins ${PN}.conf{,.example}
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/${PN}.logrotate" ${PN}
+
+ if use xinetd ; then
+ insinto /etc/xinetd.d
+ newins "${FILESDIR}/${PN}.xinetd" ${PN}
+ fi
+
+ newinitd "${FILESDIR}/${PN}.init" ${PN}
+
+ keepdir /usr/share/${PN}/empty
+
+ exeinto /usr/libexec
+ doexe "${FILESDIR}/vsftpd-checkconfig.sh"
+ systemd_dounit "${FILESDIR}/${PN}.service"
+ systemd_newunit "${FILESDIR}/${PN}_at.service" "${PN}@.service"
+ systemd_dounit "${FILESDIR}/${PN}.socket"
+}
+
+pkg_preinst() {
+ # If we use xinetd, then we set listen=NO
+ # so that our default config works under xinetd - fixes #78347
+ if use xinetd ; then
+ sed -i 's/listen=YES/listen=NO/g' "${D}"/etc/${PN}/${PN}.conf.example
+ fi
+}
+
+pkg_postinst() {
+ einfo "vsftpd openRC init script can now be multiplexed."
+ einfo "The default init script forces /etc/vsftpd/vsftpd.conf to exist."
+ einfo "If you symlink the init script to another one, say vsftpd.foo"
+ einfo "then that uses /etc/vsftpd/foo.conf instead."
+ einfo
+ einfo "Example:"
+ einfo " cd /etc/init.d"
+ einfo " ln -s vsftpd vsftpd.foo"
+ einfo "You can now treat vsftpd.foo like any other service"
+}
diff --git a/net-ftp/vsftpd/vsftpd-3.0.2.ebuild b/net-ftp/vsftpd/vsftpd-3.0.2.ebuild
new file mode 100644
index 000000000000..2e9ae68e6509
--- /dev/null
+++ b/net-ftp/vsftpd/vsftpd-3.0.2.ebuild
@@ -0,0 +1,117 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Very Secure FTP Daemon written with speed, size and security in mind"
+HOMEPAGE="http://vsftpd.beasts.org/"
+SRC_URI="http://security.appspot.com/downloads/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~hppa ia64 ppc ppc64 s390 sh sparc x86 ~x86-fbsd"
+IUSE="caps pam tcpd ssl selinux xinetd"
+
+DEPEND="caps? ( >=sys-libs/libcap-2 )
+ pam? ( virtual/pam )
+ tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
+ ssl? ( >=dev-libs/openssl-0.9.7d )"
+RDEPEND="${DEPEND}
+ net-ftp/ftpbase
+ selinux? ( sec-policy/selinux-ftp )
+ xinetd? ( sys-apps/xinetd )"
+
+src_prepare() {
+
+ # kerberos patch. bug #335980
+ epatch "${FILESDIR}/${PN}-2.3.2-kerberos.patch"
+
+ # Patch the source, config and the manpage to use /etc/vsftpd/
+ epatch "${FILESDIR}/${PN}-2.3.5-gentoo.patch"
+
+ # Fix building without the libcap
+ epatch "${FILESDIR}/${PN}-2.1.0-caps.patch"
+
+ # Fix building on alpha. Bug #405829
+ epatch "${FILESDIR}/${PN}-3.0.2-alpha.patch"
+
+ # Configure vsftpd build defaults
+ use tcpd && echo "#define VSF_BUILD_TCPWRAPPERS" >> builddefs.h
+ use ssl && echo "#define VSF_BUILD_SSL" >> builddefs.h
+ use pam || echo "#undef VSF_BUILD_PAM" >> builddefs.h
+
+ # Ensure that we don't link against libcap unless asked
+ if ! use caps ; then
+ sed -i '/^#define VSF_SYSDEP_HAVE_LIBCAP$/ d' sysdeputil.c || die
+ epatch "${FILESDIR}"/${PN}-2.2.0-dont-link-caps.patch
+ fi
+
+ # Let portage control stripping
+ sed -i '/^LINK[[:space:]]*=[[:space:]]*/ s/-Wl,-s//' Makefile || die
+
+ #Bug #335977
+ epatch "${FILESDIR}"/${PN}-3.0.0-Makefile.patch
+}
+
+src_compile() {
+ CFLAGS="${CFLAGS}" \
+ CC="$(tc-getCC)" \
+ emake
+}
+
+src_install() {
+ into /usr
+ doman ${PN}.conf.5 ${PN}.8
+ dosbin ${PN} || die "disbin failed"
+
+ dodoc AUDIT BENCHMARKS BUGS Changelog FAQ \
+ README README.security REWARD SIZE \
+ SPEED TODO TUNING || die "dodoc failed"
+ newdoc ${PN}.conf ${PN}.conf.example
+
+ docinto security
+ dodoc SECURITY/* || die "dodoc failed"
+
+ insinto "/usr/share/doc/${PF}/examples"
+ doins -r EXAMPLE/* || die "doins faileD"
+
+ insinto /etc/${PN}
+ newins ${PN}.conf{,.example}
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/${PN}.logrotate" ${PN}
+
+ if use xinetd ; then
+ insinto /etc/xinetd.d
+ newins "${FILESDIR}/${PN}.xinetd" ${PN}
+ fi
+
+ newinitd "${FILESDIR}/${PN}.init" ${PN}
+
+ keepdir /usr/share/${PN}/empty
+
+ exeinto /usr/libexec
+ doexe "${FILESDIR}/vsftpd-checkconfig.sh"
+}
+
+pkg_preinst() {
+ # If we use xinetd, then we set listen=NO
+ # so that our default config works under xinetd - fixes #78347
+ if use xinetd ; then
+ sed -i 's/listen=YES/listen=NO/g' "${D}"/etc/${PN}/${PN}.conf.example
+ fi
+}
+
+pkg_postinst() {
+ einfo "vsftpd init script can now be multiplexed."
+ einfo "The default init script forces /etc/vsftpd/vsftpd.conf to exist."
+ einfo "If you symlink the init script to another one, say vsftpd.foo"
+ einfo "then that uses /etc/vsftpd/foo.conf instead."
+ einfo
+ einfo "Example:"
+ einfo " cd /etc/init.d"
+ einfo " ln -s vsftpd vsftpd.foo"
+ einfo "You can now treat vsftpd.foo like any other service"
+}
diff --git a/net-ftp/vsftpd/vsftpd-3.0.3-r1.ebuild b/net-ftp/vsftpd/vsftpd-3.0.3-r1.ebuild
new file mode 100644
index 000000000000..a61b38e5a2c8
--- /dev/null
+++ b/net-ftp/vsftpd/vsftpd-3.0.3-r1.ebuild
@@ -0,0 +1,134 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit eutils systemd toolchain-funcs
+
+DESCRIPTION="Very Secure FTP Daemon written with speed, size and security in mind"
+HOMEPAGE="http://vsftpd.beasts.org/"
+SRC_URI="http://security.appspot.com/downloads/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
+IUSE="caps libressl pam tcpd ssl selinux xinetd"
+
+DEPEND="caps? ( >=sys-libs/libcap-2 )
+ pam? ( virtual/pam )
+ tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
+ ssl? (
+ !libressl? ( dev-libs/openssl:0= )
+ libressl? ( dev-libs/libressl:0= )
+ )"
+RDEPEND="${DEPEND}
+ net-ftp/ftpbase
+ selinux? ( sec-policy/selinux-ftp )
+ xinetd? ( sys-apps/xinetd )"
+
+src_prepare() {
+ # kerberos patch. bug #335980
+ epatch "${FILESDIR}/${PN}-2.3.2-kerberos.patch"
+
+ # Patch the source, config and the manpage to use /etc/vsftpd/
+ epatch "${FILESDIR}/${PN}-2.3.5-gentoo.patch"
+
+ # Fix building without the libcap
+ epatch "${FILESDIR}/${PN}-2.1.0-caps.patch"
+
+ # Fix building on alpha. Bug #405829
+ epatch "${FILESDIR}/${PN}-3.0.2-alpha.patch"
+
+ # Configure vsftpd build defaults
+ use tcpd && echo "#define VSF_BUILD_TCPWRAPPERS" >> builddefs.h
+ use ssl && echo "#define VSF_BUILD_SSL" >> builddefs.h
+ use pam || echo "#undef VSF_BUILD_PAM" >> builddefs.h
+
+ # Ensure that we don't link against libcap unless asked
+ if ! use caps ; then
+ sed -i '/^#define VSF_SYSDEP_HAVE_LIBCAP$/ d' sysdeputil.c || die
+ epatch "${FILESDIR}"/${PN}-2.2.0-dont-link-caps.patch
+ fi
+
+ # Let portage control stripping
+ sed -i '/^LINK[[:space:]]*=[[:space:]]*/ s/-Wl,-s//' Makefile || die
+
+ #Bug #335977
+ epatch "${FILESDIR}"/${PN}-3.0.0-Makefile.patch
+
+ #Bug #450536
+ epatch "${FILESDIR}"/${PN}-3.0.2-remove-legacy-cap.patch
+
+ eapply_user
+}
+
+src_compile() {
+ # Override LIBS variable. Bug #508192
+ LIBS=
+ use caps && LIBS+=" -lcap"
+ use pam && LIBS+=" -lpam"
+ use tcpd && LIBS+=" -lwrap"
+ use ssl && LIBS+=" -lssl -lcrypto"
+
+ CFLAGS="${CFLAGS}" \
+ CC="$(tc-getCC)" \
+ emake LIBS="${LIBS}"
+}
+
+src_install() {
+ into /usr
+ doman ${PN}.conf.5 ${PN}.8
+ dosbin ${PN} || die "disbin failed"
+
+ dodoc AUDIT BENCHMARKS BUGS Changelog FAQ \
+ README README.security REWARD SIZE \
+ SPEED TODO TUNING || die "dodoc failed"
+ newdoc ${PN}.conf ${PN}.conf.example
+
+ docinto security
+ dodoc SECURITY/* || die "dodoc failed"
+
+ insinto "/usr/share/doc/${PF}/examples"
+ doins -r EXAMPLE/* || die "doins faileD"
+
+ insinto /etc/${PN}
+ newins ${PN}.conf{,.example}
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/${PN}.logrotate" ${PN}
+
+ if use xinetd ; then
+ insinto /etc/xinetd.d
+ newins "${FILESDIR}/${PN}.xinetd" ${PN}
+ fi
+
+ newinitd "${FILESDIR}/${PN}.init" ${PN}
+
+ keepdir /usr/share/${PN}/empty
+
+ exeinto /usr/libexec
+ doexe "${FILESDIR}/vsftpd-checkconfig.sh"
+ systemd_dounit "${FILESDIR}/${PN}.service"
+ systemd_newunit "${FILESDIR}/${PN}_at.service" "${PN}@.service"
+ systemd_dounit "${FILESDIR}/${PN}.socket"
+}
+
+pkg_preinst() {
+ # If we use xinetd, then we set listen=NO
+ # so that our default config works under xinetd - fixes #78347
+ if use xinetd ; then
+ sed -i 's/listen=YES/listen=NO/g' "${D}"/etc/${PN}/${PN}.conf.example
+ fi
+}
+
+pkg_postinst() {
+ einfo "vsftpd openRC init script can now be multiplexed."
+ einfo "The default init script forces /etc/vsftpd/vsftpd.conf to exist."
+ einfo "If you symlink the init script to another one, say vsftpd.foo"
+ einfo "then that uses /etc/vsftpd/foo.conf instead."
+ einfo
+ einfo "Example:"
+ einfo " cd /etc/init.d"
+ einfo " ln -s vsftpd vsftpd.foo"
+ einfo "You can now treat vsftpd.foo like any other service"
+}
diff --git a/net-ftp/vsftpd/vsftpd-3.0.3.ebuild b/net-ftp/vsftpd/vsftpd-3.0.3.ebuild
new file mode 100644
index 000000000000..48d8e8795fde
--- /dev/null
+++ b/net-ftp/vsftpd/vsftpd-3.0.3.ebuild
@@ -0,0 +1,131 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils systemd toolchain-funcs
+
+DESCRIPTION="Very Secure FTP Daemon written with speed, size and security in mind"
+HOMEPAGE="http://vsftpd.beasts.org/"
+SRC_URI="http://security.appspot.com/downloads/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
+IUSE="caps pam tcpd ssl selinux xinetd"
+
+DEPEND="caps? ( >=sys-libs/libcap-2 )
+ pam? ( virtual/pam )
+ tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
+ ssl? ( >=dev-libs/openssl-0.9.7d )"
+RDEPEND="${DEPEND}
+ net-ftp/ftpbase
+ selinux? ( sec-policy/selinux-ftp )
+ xinetd? ( sys-apps/xinetd )"
+
+src_prepare() {
+ # kerberos patch. bug #335980
+ epatch "${FILESDIR}/${PN}-2.3.2-kerberos.patch"
+
+ # Patch the source, config and the manpage to use /etc/vsftpd/
+ epatch "${FILESDIR}/${PN}-2.3.5-gentoo.patch"
+
+ # Fix building without the libcap
+ epatch "${FILESDIR}/${PN}-2.1.0-caps.patch"
+
+ # Fix building on alpha. Bug #405829
+ epatch "${FILESDIR}/${PN}-3.0.2-alpha.patch"
+
+ # Configure vsftpd build defaults
+ use tcpd && echo "#define VSF_BUILD_TCPWRAPPERS" >> builddefs.h
+ use ssl && echo "#define VSF_BUILD_SSL" >> builddefs.h
+ use pam || echo "#undef VSF_BUILD_PAM" >> builddefs.h
+
+ # Ensure that we don't link against libcap unless asked
+ if ! use caps ; then
+ sed -i '/^#define VSF_SYSDEP_HAVE_LIBCAP$/ d' sysdeputil.c || die
+ epatch "${FILESDIR}"/${PN}-2.2.0-dont-link-caps.patch
+ fi
+
+ # Let portage control stripping
+ sed -i '/^LINK[[:space:]]*=[[:space:]]*/ s/-Wl,-s//' Makefile || die
+
+ #Bug #335977
+ epatch "${FILESDIR}"/${PN}-3.0.0-Makefile.patch
+
+ #Bug #450536
+ epatch "${FILESDIR}"/${PN}-3.0.2-remove-legacy-cap.patch
+
+ epatch_user
+}
+
+src_compile() {
+ # Override LIBS variable. Bug #508192
+ LIBS=
+ use caps && LIBS+=" -lcap"
+ use pam && LIBS+=" -lpam"
+ use tcpd && LIBS+=" -lwrap"
+ use ssl && LIBS+=" -lssl -lcrypto"
+
+ CFLAGS="${CFLAGS}" \
+ CC="$(tc-getCC)" \
+ emake LIBS="${LIBS}"
+}
+
+src_install() {
+ into /usr
+ doman ${PN}.conf.5 ${PN}.8
+ dosbin ${PN} || die "disbin failed"
+
+ dodoc AUDIT BENCHMARKS BUGS Changelog FAQ \
+ README README.security REWARD SIZE \
+ SPEED TODO TUNING || die "dodoc failed"
+ newdoc ${PN}.conf ${PN}.conf.example
+
+ docinto security
+ dodoc SECURITY/* || die "dodoc failed"
+
+ insinto "/usr/share/doc/${PF}/examples"
+ doins -r EXAMPLE/* || die "doins faileD"
+
+ insinto /etc/${PN}
+ newins ${PN}.conf{,.example}
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/${PN}.logrotate" ${PN}
+
+ if use xinetd ; then
+ insinto /etc/xinetd.d
+ newins "${FILESDIR}/${PN}.xinetd" ${PN}
+ fi
+
+ newinitd "${FILESDIR}/${PN}.init" ${PN}
+
+ keepdir /usr/share/${PN}/empty
+
+ exeinto /usr/libexec
+ doexe "${FILESDIR}/vsftpd-checkconfig.sh"
+ systemd_dounit "${FILESDIR}/${PN}.service"
+ systemd_newunit "${FILESDIR}/${PN}_at.service" "${PN}@.service"
+ systemd_dounit "${FILESDIR}/${PN}.socket"
+}
+
+pkg_preinst() {
+ # If we use xinetd, then we set listen=NO
+ # so that our default config works under xinetd - fixes #78347
+ if use xinetd ; then
+ sed -i 's/listen=YES/listen=NO/g' "${D}"/etc/${PN}/${PN}.conf.example
+ fi
+}
+
+pkg_postinst() {
+ einfo "vsftpd openRC init script can now be multiplexed."
+ einfo "The default init script forces /etc/vsftpd/vsftpd.conf to exist."
+ einfo "If you symlink the init script to another one, say vsftpd.foo"
+ einfo "then that uses /etc/vsftpd/foo.conf instead."
+ einfo
+ einfo "Example:"
+ einfo " cd /etc/init.d"
+ einfo " ln -s vsftpd vsftpd.foo"
+ einfo "You can now treat vsftpd.foo like any other service"
+}