cleaned up gitlab-ce
This commit is contained in:
		
							parent
							
								
									bfb5c8c9ff
								
							
						
					
					
						commit
						4b59ae35b6
					
				
					 12 changed files with 7 additions and 2631 deletions
				
			
		|  | @ -1,6 +1,5 @@ | ||||||
| AUX 01-gitlab-ce-8.7.5-fix-sendmail-config.patch 705 SHA256 cfc4ffd896e03cc763601aca5cdd5ac43f85152705cbf5a4e9144a6156d6f77e SHA512 a92659db8cab022185d87f321b037b1731612bf5f89b9df4552dd49b843bb49b6019f8ddda96a6fd6cb6544664a1c3d52ca5fee2c11be8b33698cc713219510f WHIRLPOOL 81a6504a8583bc46ea4005d9f8a2113802439161c40f11d3da46332b8980fc6b9520d81d9e32a6555bcdc893245448ba9151a271c511ae87f6468f588d4804b0 | AUX 01-gitlab-ce-8.7.5-fix-sendmail-config.patch 705 SHA256 cfc4ffd896e03cc763601aca5cdd5ac43f85152705cbf5a4e9144a6156d6f77e SHA512 a92659db8cab022185d87f321b037b1731612bf5f89b9df4552dd49b843bb49b6019f8ddda96a6fd6cb6544664a1c3d52ca5fee2c11be8b33698cc713219510f WHIRLPOOL 81a6504a8583bc46ea4005d9f8a2113802439161c40f11d3da46332b8980fc6b9520d81d9e32a6555bcdc893245448ba9151a271c511ae87f6468f588d4804b0 | ||||||
| AUX 02-gitlab-ce-8.11.0-fix-redis-config-path.patch 423 SHA256 4878d37082c7e5c0aba239d4432ddec23c083230b816cf1ed6792bfd8f6c56fa SHA512 81a543af308bcd11a93a73368aedc89604078f60c0cacf4f614ff18dc5975b2c0d030ad6565fbb134188c8f6fceb74f2767f706d6f5701092252513f5e18de11 WHIRLPOOL 81f6258f03d234c6298b7bfe2982bdfd5f86dea3405ce03d4391b484a4802f7cbe33606ce4561ca67c16a5826dec131a185fa3189c2115b4a9ec8a3b87a2ee16 | AUX 02-gitlab-ce-8.11.0-fix-redis-config-path.patch 423 SHA256 4878d37082c7e5c0aba239d4432ddec23c083230b816cf1ed6792bfd8f6c56fa SHA512 81a543af308bcd11a93a73368aedc89604078f60c0cacf4f614ff18dc5975b2c0d030ad6565fbb134188c8f6fceb74f2767f706d6f5701092252513f5e18de11 WHIRLPOOL 81f6258f03d234c6298b7bfe2982bdfd5f86dea3405ce03d4391b484a4802f7cbe33606ce4561ca67c16a5826dec131a185fa3189c2115b4a9ec8a3b87a2ee16 | ||||||
| AUX 03-gitlab-ce-8.12.7-database.yml.patch 2154 SHA256 6daf34a6be5038e0108169a1a23901d9f235e8d9e1e3dcc0d5113fa1b34b0698 SHA512 d43b6cf7b8c1729944482c4e8abf91ec326b38112de93caba67c37af7e9aa3b86e18d1080a92a4bac096f40c8e0c5e7d28926ed019ef052e186c3aa3ee72c9b7 WHIRLPOOL 93393c879eb120712a7ae0b50a35032752ba41ab65d20b86ff4e737fb6df8fefd4663dc171ded2bd771c1663e728d9cdc201fe4024671b9a2d5d0f01748ecd89 |  | ||||||
| AUX 03-gitlab-ce-8.14.0-database.yml.patch 2172 SHA256 8435bf632aab03057342d5d6d75f016b006da00157c0cce2661416b752f8b75d SHA512 048aa5877ef30e702727b917cf7fb6bd534c497a7c24ab55640635598af293b0567bb9f356c4b91d55291341ced50847909f117f46d3fc9962c2f7a0f7b6bfb9 WHIRLPOOL 87b62f5e326211c2ff9001742a04b71bd94b21f4851778a513f7e1981da193dc16718559be42a0ba21aaa0c2f5b65a2571bc20174c063aa13e6436f0b422f057 | AUX 03-gitlab-ce-8.14.0-database.yml.patch 2172 SHA256 8435bf632aab03057342d5d6d75f016b006da00157c0cce2661416b752f8b75d SHA512 048aa5877ef30e702727b917cf7fb6bd534c497a7c24ab55640635598af293b0567bb9f356c4b91d55291341ced50847909f117f46d3fc9962c2f7a0f7b6bfb9 WHIRLPOOL 87b62f5e326211c2ff9001742a04b71bd94b21f4851778a513f7e1981da193dc16718559be42a0ba21aaa0c2f5b65a2571bc20174c063aa13e6436f0b422f057 | ||||||
| AUX 04-gitlab-ce-8.12.7-fix-check-task.patch 917 SHA256 e1adffbd59a418d5e14cbd51ae14d5c1f0364af759c77b6cb485079e0233e90f SHA512 226c3892768dc526dbc9f109aaecdee1eb27c0acb5060ba6db8222410c500336ebcf7184437228480da04ce5de149a14bbb5c1471aed853a280d7f371f271d88 WHIRLPOOL 3ec22dc4d12b5025bddfccdea27a816aca1f818d5138b3dc9a6362e56ec4cd14e5c38c76b64b468f3797e0d2718d38aad4f910abf3f3328a7983832babb7f231 | AUX 04-gitlab-ce-8.12.7-fix-check-task.patch 917 SHA256 e1adffbd59a418d5e14cbd51ae14d5c1f0364af759c77b6cb485079e0233e90f SHA512 226c3892768dc526dbc9f109aaecdee1eb27c0acb5060ba6db8222410c500336ebcf7184437228480da04ce5de149a14bbb5c1471aed853a280d7f371f271d88 WHIRLPOOL 3ec22dc4d12b5025bddfccdea27a816aca1f818d5138b3dc9a6362e56ec4cd14e5c38c76b64b468f3797e0d2718d38aad4f910abf3f3328a7983832babb7f231 | ||||||
| AUX 05-gitlab-ce-8.12.7-replace-sys-filesystem.patch 2387 SHA256 dd0e9987ed4bb3a9c73c6aee1d89434afc51ff663fef2ee4ac93adf1b73b944a SHA512 afa82fb8c8d57633c99373f31678760fa6ecca5e459a9059f5b460b458d1dbf3230108a6b4f394780c26a697881c9b2319f15804cb8d04ad3139127e7c0f4ff8 WHIRLPOOL 90ce708f8cde0a4bcaef9fc002ca00b97a1211559bcabf5481ec71c608bc5b772ecd518ff07a8d626a27e4b21c0f0f51fa37a65503e79664ececd78d5f19e87b | AUX 05-gitlab-ce-8.12.7-replace-sys-filesystem.patch 2387 SHA256 dd0e9987ed4bb3a9c73c6aee1d89434afc51ff663fef2ee4ac93adf1b73b944a SHA512 afa82fb8c8d57633c99373f31678760fa6ecca5e459a9059f5b460b458d1dbf3230108a6b4f394780c26a697881c9b2319f15804cb8d04ad3139127e7c0f4ff8 WHIRLPOOL 90ce708f8cde0a4bcaef9fc002ca00b97a1211559bcabf5481ec71c608bc5b772ecd518ff07a8d626a27e4b21c0f0f51fa37a65503e79664ececd78d5f19e87b | ||||||
|  | @ -8,29 +7,15 @@ AUX gitlab-8.13.0-sidekiq.service 990 SHA256 183ccbdb19a3dcc74cf1f1f865bf396466e | ||||||
| AUX gitlab-8.13.3-sidekiq.init 1459 SHA256 fdf808f9c0a92d7a77ae8be27c8fc11cec571ec6b5b94e31639028eec19546f1 SHA512 ec2130483b603f2be423c288fd0d55615c831ce995a8a5509f0240f149b3464d8f0a75cade1c736d085fb5f898d109368af62d8fdfb280aa00c4df8c06abb1e9 WHIRLPOOL d3493ac268257386e22c677337c8f9b1050212fce4aa855119b2ccd5f56850a5288d0cdd74e3c2f34552f59f9431c9ab5080e372766b88de003cad5dab015100 | AUX gitlab-8.13.3-sidekiq.init 1459 SHA256 fdf808f9c0a92d7a77ae8be27c8fc11cec571ec6b5b94e31639028eec19546f1 SHA512 ec2130483b603f2be423c288fd0d55615c831ce995a8a5509f0240f149b3464d8f0a75cade1c736d085fb5f898d109368af62d8fdfb280aa00c4df8c06abb1e9 WHIRLPOOL d3493ac268257386e22c677337c8f9b1050212fce4aa855119b2ccd5f56850a5288d0cdd74e3c2f34552f59f9431c9ab5080e372766b88de003cad5dab015100 | ||||||
| AUX gitlab-8.13.3-unicorn.init 3562 SHA256 f4ae5b785d61fb2c463b2405533d5e9a2209bbff7a085106b463f59505123287 SHA512 4af87415da7e482725a6f97f5e2ffafe0d16784cdcf3f877c99b5f646832c14dd1b3e875ec00e57560060bf3c049dd7fd0aeb7452db1100740e6b17dc29fdfb6 WHIRLPOOL a63d236a76bcbbd6e39268c76a7fbb75f4b9e5488d0cbc0bb2973ae09753f11d1863e477fe88f6c652370c19c3a0f037f99cc681b91679eb4da992db5e2eff20 | AUX gitlab-8.13.3-unicorn.init 3562 SHA256 f4ae5b785d61fb2c463b2405533d5e9a2209bbff7a085106b463f59505123287 SHA512 4af87415da7e482725a6f97f5e2ffafe0d16784cdcf3f877c99b5f646832c14dd1b3e875ec00e57560060bf3c049dd7fd0aeb7452db1100740e6b17dc29fdfb6 WHIRLPOOL a63d236a76bcbbd6e39268c76a7fbb75f4b9e5488d0cbc0bb2973ae09753f11d1863e477fe88f6c652370c19c3a0f037f99cc681b91679eb4da992db5e2eff20 | ||||||
| AUX gitlab-mailroom.service 773 SHA256 39cea460db7fc505b136a2106902d0515890180e74913bf364aa499368fc5f2e SHA512 f82c63a180add1103e2bd115e67826ad7362a844991ef16f1de7fc6c78bf1955155ecf278fc0d759e674ab85736f3ba2a6650d00e9b3ce683316875efd9efa3c WHIRLPOOL 683c67b12f9666d1c1df5ec61e0072acaecd3aff43d0ff475037e178bc58fd9036ae6d8cd45e922098c842abd057231afd4767ce229d4581356f153b48a06208 | AUX gitlab-mailroom.service 773 SHA256 39cea460db7fc505b136a2106902d0515890180e74913bf364aa499368fc5f2e SHA512 f82c63a180add1103e2bd115e67826ad7362a844991ef16f1de7fc6c78bf1955155ecf278fc0d759e674ab85736f3ba2a6650d00e9b3ce683316875efd9efa3c WHIRLPOOL 683c67b12f9666d1c1df5ec61e0072acaecd3aff43d0ff475037e178bc58fd9036ae6d8cd45e922098c842abd057231afd4767ce229d4581356f153b48a06208 | ||||||
| AUX gitlab-sidekiq.init 990 SHA256 cc996184ae4c1b64fc5ee9325bf3f4bc30753896f6608a2f04112d8552359c38 SHA512 9064b5a2fb1280c7fd674c613e19893b5b4f21cc48967cad1c3ff6caef2d4cdbf077359c453e5bb97226c26348475a97fb055df2bac991a7260811cb933361af WHIRLPOOL f2a298a91318ee067451e90f8b52b45c2dcf7e621bd7014917f8fadfd92949c967b45c59434eac3813fd1acd1dc96b8b481f9d9c324627580f29c0f438bf99db |  | ||||||
| AUX gitlab-unicorn.init 3127 SHA256 de2f5861bec58eaac284e74baabe25288a520bc4f7da089a2c53a9494bbea884 SHA512 ae63cc6ef11eb1d3ed155c77dab413d8f7d281ac9c6362dfda12e0fafe23eb9a907a0275d14298c642ba7568119b483b1c520b322dc791f3a9ce64fbffb600f3 WHIRLPOOL de69ab338278e73637b6b1d346bb882d51c4468e71d89932718f394fb9f44725c79897eba8b0230069584ae7d8b92239bb2247c7ff8b46a99383739939a13088 |  | ||||||
| AUX gitlab-unicorn.service 773 SHA256 010c9e223a30400d9155b39499eb0d7efad23b66baab9fcd9e365c689086b9bd SHA512 0bf9630aa91ed8f590a7bfa42d09b7ba33f6342b43b3d191c792c11157f8926c2a2ac2390eebd8179637e29b5bf68233d4699d62463497a0fd45b9bdbdd9167b WHIRLPOOL fbc709a5550dcc548a35c22c812dafe52ee507f5678b57c22c709ee89a399ae9109e2f56b7a13135d4140f1e024ebc4effe4aa4de13e0f36691da2a0737d9792 | AUX gitlab-unicorn.service 773 SHA256 010c9e223a30400d9155b39499eb0d7efad23b66baab9fcd9e365c689086b9bd SHA512 0bf9630aa91ed8f590a7bfa42d09b7ba33f6342b43b3d191c792c11157f8926c2a2ac2390eebd8179637e29b5bf68233d4699d62463497a0fd45b9bdbdd9167b WHIRLPOOL fbc709a5550dcc548a35c22c812dafe52ee507f5678b57c22c709ee89a399ae9109e2f56b7a13135d4140f1e024ebc4effe4aa4de13e0f36691da2a0737d9792 | ||||||
| AUX gitlab-workhorse.service 930 SHA256 09348a52fec333b4b19828752e0484400c1efa9dfb644723fcf8e80537e294b6 SHA512 6332024fe0049287899cf482b6e4439e9dd90da14e489d08aa8e5e79cb7872efcc517d99b69fa23b011b382acb1e5926496a78f08af5d2d64daa515b869a0c6a WHIRLPOOL 3749c6719b2a35c7de29763cd616e1e9cc30a85aa1630ffc46440334459b5922503d52629556c125a6dd6574bdc5f23f1b2a7f2a85e2270a415b22246e0b6bae | AUX gitlab-workhorse.service 930 SHA256 09348a52fec333b4b19828752e0484400c1efa9dfb644723fcf8e80537e294b6 SHA512 6332024fe0049287899cf482b6e4439e9dd90da14e489d08aa8e5e79cb7872efcc517d99b69fa23b011b382acb1e5926496a78f08af5d2d64daa515b869a0c6a WHIRLPOOL 3749c6719b2a35c7de29763cd616e1e9cc30a85aa1630ffc46440334459b5922503d52629556c125a6dd6574bdc5f23f1b2a7f2a85e2270a415b22246e0b6bae | ||||||
| AUX gitlab.conf 27 SHA256 cd9be088bbb67a5400407fc6f63c061eb224f16748b7d0812ff2c101f43ca263 SHA512 909c49fee6d050c1e94b2559ff2a9d54c5c346492be0e2920b50d56d69eaddbed67e3ac12e012d2a9601b5596640ebf33c8dc68fc588a03ca370d963294be37f WHIRLPOOL fa436e8d7d2643d450259d26b6e7b24dae69df47ed22e5ef2a567f37aa785fbf3b0eb1129ae7c8bf8986c29559fc3b744a34064375e5245dce2b10053cd715d9 | AUX gitlab.conf 27 SHA256 cd9be088bbb67a5400407fc6f63c061eb224f16748b7d0812ff2c101f43ca263 SHA512 909c49fee6d050c1e94b2559ff2a9d54c5c346492be0e2920b50d56d69eaddbed67e3ac12e012d2a9601b5596640ebf33c8dc68fc588a03ca370d963294be37f WHIRLPOOL fa436e8d7d2643d450259d26b6e7b24dae69df47ed22e5ef2a567f37aa785fbf3b0eb1129ae7c8bf8986c29559fc3b744a34064375e5245dce2b10053cd715d9 | ||||||
| DIST gitlab-ce-8.13.6.tar.gz 27816283 SHA256 48f29ab3c33123898502563c764fbbfcc3a3146bccc6793f7129656360f277a5 SHA512 b2928b22431eb974b679b464d0a7ec85d9325b584371f884b174678943a17f8ac8db34a3e1992f0f8cbc4cbf4d3000344aa7513edc2c683fb3a8940375a5ea5f WHIRLPOOL f5c7ea34fa4b659d7c0405983b3fc797c4c7641daf027f9f3d06b6d5b3f9bb9435f200456cace9813584ad6256d6d389fbbd08b7f28a9c29aacdabb5b7dc0c2e |  | ||||||
| DIST gitlab-ce-8.14.0.tar.gz 29710909 SHA256 817f4d5dbb5a59d204f71954d0549f99b91746563d190f73346427a0130051e8 SHA512 4428fd6cecadd613dee705107a69bdbc87db0a80a85b431b26575c6e00ad6802d5240bb3c4a7b67b75f7dcb6926a230a845f329004ae8c60d484dd96cb79ef1f WHIRLPOOL 7aaf718229ebb99f42a4f1462cdc5da4de1f23d90e28fee20f25d93e3f8959e21c5275d4116bba16ed41450609ea1d28dcf5c150c80313a5776ed00b47bee7fc |  | ||||||
| DIST gitlab-ce-8.14.1.tar.gz 29715000 SHA256 81c5b9019fba31546ce414424a567a999783be0d5ab0ae865c5576073e864bae SHA512 780040ea9764dbadddcd9c8cbbb743e4b101d5da3fdbd792b6da3dced26179884bb348323c75888040b45231f091605246ccaa6af17f79e2aefb0931bbf32a47 WHIRLPOOL dd23ae35a67f1cdca76f671b96ab6dd8f5b7782e3e43da0e63872a0842098da8e2dbcf6515a8c43a1f1fdb0949a8ce19d31148b50b198fb4054f32285f914690 |  | ||||||
| DIST gitlab-ce-8.14.2.tar.gz 29715506 SHA256 9d45a0a86c6b01e0c48e7fe2fc442fe774f062b8b149f1d697c38aa29f6c3a25 SHA512 f65d12eafc397c5146264615ae384721165bd11498adf02f34c3fa65e55ac0b20d16d14d78455d46454c14bd0f075dedd627d5940853bfb99143c52d4d8c4194 WHIRLPOOL 44a9daf2dc4aea80e84a44fe45d085600ef463b5346417f36c4fd550749bba4599e328f43485317dadbbdab2fca6fef56c91cc41ea6156eeb797671e7416bc7f |  | ||||||
| DIST gitlab-ce-8.14.3.tar.gz 29717697 SHA256 df0b57646af534a874128d6e1903cee215c093a3c6302315cc53a9bddf62582e SHA512 9c7c58d0c6c7df447b0f723c550cb95530e781cf75b915b49e098dc0742cc18dc47e665cfa228dc2867ac5cc4dc40d62b6544d0160738a596d2331628c80304c WHIRLPOOL d96e9cbcbee48ce5f6ceff88756ad7493c0b5a3111ff072996541e5b650f0feb727eceab5e0859873b68d6248d790c4dacb8bc9e2d1f288936fc102de1410052 |  | ||||||
| DIST gitlab-ce-8.14.4.tar.gz 29719940 SHA256 32c8e66e3c5f820874548c0ceab0215a567ca7b58a9ea604adc63878f50f8307 SHA512 426faaa4a4f18e9462d2153f031db8394465581638d259e6e0282a2bfe6c72c8738ca0dc084969f414e61a362bc5792656a07b33592a7f880307613fc152f8ae WHIRLPOOL f3f3a012f26a5a3dcdc5214b039128280e75ddf885b71fdacec13119cc6229dd771db0186b8fb04c5f761e62cf5962867570c6c4bfd47eecca57f1665521b220 |  | ||||||
| DIST gitlab-ce-8.14.5.tar.gz 29722006 SHA256 8e03214c1f741cf813453e7764a0da1d8f0ec957b5395d2e359b9f24bb5f3c8e SHA512 afdc8bcd3022f1b1e5f14c76a5ee696eda462ffeeba94411f3f82ba0b2e0647d017982f0357fe66a1272929569eb0f24e5d18bfda78b88599e91c9486438aaa9 WHIRLPOOL 1eba1abf2543bb8203349fe03e6debf5e837effcf7a23d1f4e7e49900db7d1bc77c62ca6f95c5b26b7c00c396499f3cc8c2ec2d0e5f209bc2d7da99d2f7a4668 | DIST gitlab-ce-8.14.5.tar.gz 29722006 SHA256 8e03214c1f741cf813453e7764a0da1d8f0ec957b5395d2e359b9f24bb5f3c8e SHA512 afdc8bcd3022f1b1e5f14c76a5ee696eda462ffeeba94411f3f82ba0b2e0647d017982f0357fe66a1272929569eb0f24e5d18bfda78b88599e91c9486438aaa9 WHIRLPOOL 1eba1abf2543bb8203349fe03e6debf5e837effcf7a23d1f4e7e49900db7d1bc77c62ca6f95c5b26b7c00c396499f3cc8c2ec2d0e5f209bc2d7da99d2f7a4668 | ||||||
| DIST gitlab-ce-8.15.0_rc6.tar.gz 19877630 SHA256 dea41bc8eeca350b359a7a7fadab2798fdbd0767bf22eb32c16197aa44164e24 SHA512 573eec3d9476d9e0765c91e558b6604e003b6dff27debc55dfc3cb583a4dc8b67ad710ae15b90e32a862987f512275a37ab5fe30da1a34a4244921e32e5f962a WHIRLPOOL aea5e6add4eefeefbf4ed75db81a105faf03612ee4f24429569bd3d7a032202d47021b377d35e8815f00595265048a3c31cd77b40a4aacb2eb6589cb4f87a927 | DIST gitlab-ce-8.15.0_rc6.tar.gz 19877630 SHA256 dea41bc8eeca350b359a7a7fadab2798fdbd0767bf22eb32c16197aa44164e24 SHA512 573eec3d9476d9e0765c91e558b6604e003b6dff27debc55dfc3cb583a4dc8b67ad710ae15b90e32a862987f512275a37ab5fe30da1a34a4244921e32e5f962a WHIRLPOOL aea5e6add4eefeefbf4ed75db81a105faf03612ee4f24429569bd3d7a032202d47021b377d35e8815f00595265048a3c31cd77b40a4aacb2eb6589cb4f87a927 | ||||||
| DIST gitlab-ce-8.15.4.tar.gz 20029958 SHA256 5d9df84b82e8b453f61f822fce44afb9603d03b3de23d73c855ce12f7629a33a SHA512 1e2315343ba2efb521bc5dc197b63f7b3af895327de76d1823345d6d39921d9a995b65f6211b572c07cf4a4583bcaf7e6f1ef159b38a7b7b1aa731e2f653c3ff WHIRLPOOL c85e4a389dec2d8807a158447eafb1062b2e1c70eb243f898c5155a26af92c99dba7bcf60217a51c26afbcb3e04ce996177b6e90cd4a0199f8fdc2c79c575ed8 | DIST gitlab-ce-8.15.4.tar.gz 20029958 SHA256 5d9df84b82e8b453f61f822fce44afb9603d03b3de23d73c855ce12f7629a33a SHA512 1e2315343ba2efb521bc5dc197b63f7b3af895327de76d1823345d6d39921d9a995b65f6211b572c07cf4a4583bcaf7e6f1ef159b38a7b7b1aa731e2f653c3ff WHIRLPOOL c85e4a389dec2d8807a158447eafb1062b2e1c70eb243f898c5155a26af92c99dba7bcf60217a51c26afbcb3e04ce996177b6e90cd4a0199f8fdc2c79c575ed8 | ||||||
| EBUILD gitlab-ce-8.13.6.ebuild 11979 SHA256 761411082e2e68f432f913f5c5c969847832d335b1f7843575890ba125542539 SHA512 ab01af577da7a27cee3308c6766a042edbce7f1c472639b9a24b9bef3a7ce37389dd8e32b43cf62b9ce7c20399ccf17fd35f678ea63598b4b06890bfeabded50 WHIRLPOOL cc14b981521f0513108ab4320f2e3d4f210ec0da7373f0f99b35d975003b5e1ff5783c5db5c6b7f29739e795fc73d4744716f81056039eefaf445354bd7cb000 |  | ||||||
| EBUILD gitlab-ce-8.14.0.ebuild 12058 SHA256 ef9893f42bf74b6864d5647c406afb69412cfa88ab89fa3bbc8a69d92f6eabe9 SHA512 182be258e2ede41a056d0ecc6c8691dc89af035474b711c74887b61105e1260fd0cc02556931e713cc256766a8879356ea07ce7bb9aa8f463eedf63925afe52e WHIRLPOOL 69c12e67507d5f27bf5491d06a1f0de7e0bc156b624008977f7150b623728e255ebdcecb100aa3133dc8063f7bdfb5586c0924fa3077c1141090719666d1cb76 |  | ||||||
| EBUILD gitlab-ce-8.14.1.ebuild 12058 SHA256 95df987cfcc654adfff434916f3b3c093bd363f147ce732f2712923c38c6cea1 SHA512 7aac8dd78a3d25eb6a3664f7818188d89dea015cfb88f37c5d54597b9e0351f208d82a96488ec0109769d59b264d0a81f4656e3e95b63fe1ac99290879f28497 WHIRLPOOL 683ca7f8b32b89ebc3f503481ef6891dea756297f4a474efb62791f5b0bfd3e5287498bc0f78b73592b1c1cc8ce7ec67748a439399c601992f300dfcbe190560 |  | ||||||
| EBUILD gitlab-ce-8.14.2.ebuild 12058 SHA256 d3ceac76fde85644bae8524b94e29c484a125aa3bb5e55cd4ffe0d738e0e2e90 SHA512 c47d3a69ba675a8f6637a229b1fc65a4c0c6c00c6532ecc06d32f332129cfea8b89c6267bf9110e449c3fe20487be8a0d627fac06f19ab2824e8b161598e8e6e WHIRLPOOL 4a394a334e1ba27d6438cf351b54d83324210b39d0d6d3707828fd48413e2258314b80507136bc09764568c479814d5b1b6cf30b40b64a80b29a3506c256f4da |  | ||||||
| EBUILD gitlab-ce-8.14.3.ebuild 12058 SHA256 c495099e43d677041f197e70c051ba2e5541b600d8e65a9bfc17de44bd46195a SHA512 bf50743972034453cb3d63563589e768ef2c394e6a119b34ca55b17ff03d34f98d85a09e3411090bee4a821f505a35ac9ea1c89c6fdd241c395b71c8daf671a4 WHIRLPOOL cedad6cb34a050bc052c3827a3f6e95cb5e68346fa3da2a77e7cceabe0b194abc545a5ffef6441e00f55be0d4a701dcab63a0b0907cb81529fd20d34403fb066 |  | ||||||
| EBUILD gitlab-ce-8.14.4.ebuild 12058 SHA256 8f856b037e7f6b299e24725dcc972bd83a0758f7f4d79972eb446a931c240614 SHA512 30c304448c208e20da70dbb4300150aa494a2d4b00e2bf3db6897b1b3c13834ece0a186f29917e05765ac7833be79e13a2513a56705a51351ece6b50ca87d68d WHIRLPOOL e188d79b0322cd6433529ef6d8d157cd09a96c36d6f8161412b2c41c07aabec047acda0e5b7ee8741ea4aa526824dd17e9c823072aeaf584fd6a6dd49e4d8bfd |  | ||||||
| EBUILD gitlab-ce-8.14.5.ebuild 12058 SHA256 ef48879ad31e34e3b451ed39d1a196c1ae37b53296b39fb2f5d9c55f8cb04fc0 SHA512 24b314b35b24712471bf0f9e887a3c8cd434be2d5231f270ea0ef5f4d59377b2ba1049bf3ee7bf5feb54f77bd1d9d4121409640bd562a3a871c6bef1e7a80f45 WHIRLPOOL 7fef550d27617de2176b0f3fadb4575ad15f09e3bc204a82ea0b62c97497d36c1e0154fd18b483ac678ff7b5f8ecb464161a132ecf250bad839f28dd721e5100 | EBUILD gitlab-ce-8.14.5.ebuild 12058 SHA256 ef48879ad31e34e3b451ed39d1a196c1ae37b53296b39fb2f5d9c55f8cb04fc0 SHA512 24b314b35b24712471bf0f9e887a3c8cd434be2d5231f270ea0ef5f4d59377b2ba1049bf3ee7bf5feb54f77bd1d9d4121409640bd562a3a871c6bef1e7a80f45 WHIRLPOOL 7fef550d27617de2176b0f3fadb4575ad15f09e3bc204a82ea0b62c97497d36c1e0154fd18b483ac678ff7b5f8ecb464161a132ecf250bad839f28dd721e5100 | ||||||
| EBUILD gitlab-ce-8.15.0_rc6.ebuild 12035 SHA256 f7fef2775eb434c2cf59ba92eb8fd16ea243fa3eb9a24da924df33aba396f06b SHA512 5f937d30851dc268ef76f15bef4d71aff5afe5b3b1a70a83cb07fc2589466577fdd947f9f381c92c84025261ae9e8bd04ecf625eff9657a5ac688ae0c9692181 WHIRLPOOL c17b8e3838d18cd4768413b2a63aed9071b66a16fe9c51e63de9631596f20b422d438608e64157d7182ce8133144b4f57b215c705ed283baeab70dc22fdb862e | EBUILD gitlab-ce-8.15.0_rc6.ebuild 12035 SHA256 f7fef2775eb434c2cf59ba92eb8fd16ea243fa3eb9a24da924df33aba396f06b SHA512 5f937d30851dc268ef76f15bef4d71aff5afe5b3b1a70a83cb07fc2589466577fdd947f9f381c92c84025261ae9e8bd04ecf625eff9657a5ac688ae0c9692181 WHIRLPOOL c17b8e3838d18cd4768413b2a63aed9071b66a16fe9c51e63de9631596f20b422d438608e64157d7182ce8133144b4f57b215c705ed283baeab70dc22fdb862e | ||||||
| EBUILD gitlab-ce-8.15.4.ebuild 12058 SHA256 6042a9e3d526643813d43133902947935347d25d6840c409f24b69a140c889e1 SHA512 21cf6b3bb9ed4293c51ba0cb7ae2e376031b7faa36e77558cea2a616d86d7e854ccf37c3154aac67e539e1e07163a74e5deea2ec8bfd87e41578c84006cc16d8 WHIRLPOOL 0e6f5de4791a2fce92c7fcc6364fac13e4c1dab27789067402a3b14626db72f61777fb809a8650ebb57ba48ac8fb49c9b8192b57ccb1c86681a6996aadd64daf | EBUILD gitlab-ce-8.15.4.ebuild 11982 SHA256 db794f18bc0d023a8b6adf49b82c2e37fd38b7206b064a7700289c0cfa16961c SHA512 ca30780d28ffc0242ac5f6ccad178cc44464a81f2d44cb13e53ddf06700d0f39b9fee9b77e356735435079b34090049d50d9019af71e92d6d8faaf3767a39dc5 WHIRLPOOL 42ee8b8e5a2c6fba69ecdbf6e306a87f369fa193f721c73481edc744953bfd210cb4495bc603ba01566efb2b0869ec71284a1f1b1c34d1a124bd08546829ca37 | ||||||
| EBUILD gitlab-ce-9999.ebuild 11913 SHA256 f6e02b9e122033339874bce07dd4b1663a8b3dee9ad86e5793a9dbf7517e78b6 SHA512 43943fc250c810f131bdcfef518373b12bb997b84c12d5ee50b3006ddc9a7df4541a08faf2ea35dcd56ad70a7fd3d5dfc17c529b30df99c426d6418c3e5ee051 WHIRLPOOL ff7cf1a2a82545f16e2c7804ace0a8b2d00acab24233afe293668ab7573131065e1b301979d87563dd235a9fb4bebd3156aa9bddcb547cfb1b837103273686f5 | EBUILD gitlab-ce-9999.ebuild 11916 SHA256 07ab1b9ad70ccfa349aaec23f400e3a229b3e74d089d383b7b8dbbb2bc99f24e SHA512 334c5f8c3ede88d7116a733f953a3b09de365aee97a4a9c58b9da762b1a644d2e90b6c0ffc81f71baa6c52594ca03878850818a68988fb80a3d41ca9d68bb923 WHIRLPOOL 6c51017b06547f723c1abb8fae002ab05e206a240c189ac048e2f1c388a4bb03cf84d22e3683713ea29f3196b5d05734fd12243a972b8e435b27e304a5315ba5 | ||||||
| MISC ChangeLog 12134 SHA256 d90c37dd130c4d65cf1fbcf7cc3202e4c0cdc277e8c93f6f504af75cf8569cc0 SHA512 ed221d43270e2f4c3069b796445bf871c7dd6e1def0227be148667410efa0ec3ae122d89a00437520982116ca56daf3ab6f494026ac2ebf8d511c50e97e69f03 WHIRLPOOL e11b0465d4755686d2e1e1136b0f4d3e542a801fb5b2667937cb63f3493e5dfb825603090988b580d55fd5d0448d408836bbc5e878c5b844a26a1f16ec252605 | MISC ChangeLog 12134 SHA256 d90c37dd130c4d65cf1fbcf7cc3202e4c0cdc277e8c93f6f504af75cf8569cc0 SHA512 ed221d43270e2f4c3069b796445bf871c7dd6e1def0227be148667410efa0ec3ae122d89a00437520982116ca56daf3ab6f494026ac2ebf8d511c50e97e69f03 WHIRLPOOL e11b0465d4755686d2e1e1136b0f4d3e542a801fb5b2667937cb63f3493e5dfb825603090988b580d55fd5d0448d408836bbc5e878c5b844a26a1f16ec252605 | ||||||
| MISC metadata.xml 559 SHA256 6c3f48d3ef57c97bf27790f33ee04bd8de8b01597caa8a2a7a473d6d0a3c5759 SHA512 5aa340b5429795d84cd106ee673fd55a42fd4b0d3299d6b95c6a3e3d50812a9620820a4de5c57d5048af0c3ecec7f575d5856d2f7fadc210aadcbdd4dd040fe1 WHIRLPOOL f3d7b8c0522e09f5156e6bb446bb74e4c75f5da4495ca2ece1eb78afce59307abe01bf3c5dd5344278fcac9e334300d912031c806f51b981591c01bc3588c6f3 | MISC metadata.xml 559 SHA256 6c3f48d3ef57c97bf27790f33ee04bd8de8b01597caa8a2a7a473d6d0a3c5759 SHA512 5aa340b5429795d84cd106ee673fd55a42fd4b0d3299d6b95c6a3e3d50812a9620820a4de5c57d5048af0c3ecec7f575d5856d2f7fadc210aadcbdd4dd040fe1 WHIRLPOOL f3d7b8c0522e09f5156e6bb446bb74e4c75f5da4495ca2ece1eb78afce59307abe01bf3c5dd5344278fcac9e334300d912031c806f51b981591c01bc3588c6f3 | ||||||
|  |  | ||||||
|  | @ -1,92 +0,0 @@ | ||||||
| diff --git a/config/database.yml.mysql b/config/database.yml.mysql
 |  | ||||||
| index a99c507..0f081c8 100644
 |  | ||||||
| --- a/config/database.yml.mysql
 |  | ||||||
| +++ b/config/database.yml.mysql
 |  | ||||||
| @@ -6,37 +6,9 @@ production:
 |  | ||||||
|    encoding: utf8 |  | ||||||
|    collation: utf8_general_ci |  | ||||||
|    reconnect: false |  | ||||||
| -  database: gitlabhq_production
 |  | ||||||
| +  database: gitlab
 |  | ||||||
|    pool: 10 |  | ||||||
|    username: git |  | ||||||
|    password: "secure password" |  | ||||||
|    # host: localhost |  | ||||||
| -  # socket: /tmp/mysql.sock
 |  | ||||||
| -
 |  | ||||||
| -#
 |  | ||||||
| -# Development specific
 |  | ||||||
| -#
 |  | ||||||
| -development:
 |  | ||||||
| -  adapter: mysql2
 |  | ||||||
| -  encoding: utf8
 |  | ||||||
| -  collation: utf8_general_ci
 |  | ||||||
| -  reconnect: false
 |  | ||||||
| -  database: gitlabhq_development
 |  | ||||||
| -  pool: 5
 |  | ||||||
| -  username: root
 |  | ||||||
| -  password: "secure password"
 |  | ||||||
| -  # socket: /tmp/mysql.sock
 |  | ||||||
| -
 |  | ||||||
| -# Warning: The database defined as "test" will be erased and
 |  | ||||||
| -# re-generated from your development database when you run "rake".
 |  | ||||||
| -# Do not set this db to the same as development or production.
 |  | ||||||
| -test: &test
 |  | ||||||
| -  adapter: mysql2
 |  | ||||||
| -  encoding: utf8
 |  | ||||||
| -  collation: utf8_general_ci
 |  | ||||||
| -  reconnect: false
 |  | ||||||
| -  database: gitlabhq_test
 |  | ||||||
| -  pool: 5
 |  | ||||||
| -  username: root
 |  | ||||||
| -  password:
 |  | ||||||
| -  # socket: /tmp/mysql.sock
 |  | ||||||
| +  # socket: /run/mysqld/mysqld.sock
 |  | ||||||
| diff --git a/config/database.yml.postgresql b/config/database.yml.postgresql
 |  | ||||||
| index 7067e0f..74af7df 100644
 |  | ||||||
| --- a/config/database.yml.postgresql
 |  | ||||||
| +++ b/config/database.yml.postgresql
 |  | ||||||
| @@ -4,42 +4,9 @@
 |  | ||||||
|  production: |  | ||||||
|    adapter: postgresql |  | ||||||
|    encoding: unicode |  | ||||||
| -  database: gitlabhq_production
 |  | ||||||
| +  database: gitlab
 |  | ||||||
|    pool: 10 |  | ||||||
|    # username: git |  | ||||||
|    # password: |  | ||||||
|    # host: localhost |  | ||||||
|    # port: 5432  |  | ||||||
| -
 |  | ||||||
| -#
 |  | ||||||
| -# Development specific
 |  | ||||||
| -#
 |  | ||||||
| -development:
 |  | ||||||
| -  adapter: postgresql
 |  | ||||||
| -  encoding: unicode
 |  | ||||||
| -  database: gitlabhq_development
 |  | ||||||
| -  pool: 5
 |  | ||||||
| -  username: postgres
 |  | ||||||
| -  password:
 |  | ||||||
| -
 |  | ||||||
| -#
 |  | ||||||
| -# Staging specific
 |  | ||||||
| -#
 |  | ||||||
| -staging:
 |  | ||||||
| -  adapter: postgresql
 |  | ||||||
| -  encoding: unicode
 |  | ||||||
| -  database: gitlabhq_staging
 |  | ||||||
| -  pool: 5
 |  | ||||||
| -  username: postgres
 |  | ||||||
| -  password:
 |  | ||||||
| -
 |  | ||||||
| -# Warning: The database defined as "test" will be erased and
 |  | ||||||
| -# re-generated from your development database when you run "rake".
 |  | ||||||
| -# Do not set this db to the same as development or production.
 |  | ||||||
| -test: &test
 |  | ||||||
| -  adapter: postgresql
 |  | ||||||
| -  encoding: unicode
 |  | ||||||
| -  database: gitlabhq_test
 |  | ||||||
| -  pool: 5
 |  | ||||||
| -  username: postgres
 |  | ||||||
| -  password:
 |  | ||||||
|  | @ -1,43 +0,0 @@ | ||||||
| #!/sbin/openrc-run |  | ||||||
| 
 |  | ||||||
| name="GitLab Sidekiq" |  | ||||||
| description="Sidekiq for GitLab" |  | ||||||
| 
 |  | ||||||
| : ${gitlab_user:=@USER@} |  | ||||||
| : ${gitlab_base:="@GITLAB_BASE@"} |  | ||||||
| : ${rails_env:=production} |  | ||||||
| 
 |  | ||||||
| : ${sidekiq_pidfile:="/run/gitlab/sidekiq.pid"} |  | ||||||
| : ${sidekiq_logfile:="@LOGS_DIR@/sidekiq.log"} |  | ||||||
| : ${sidekiq_queues:="@QUEUES@"} |  | ||||||
| 
 |  | ||||||
| sidekiq_command="/usr/bin/bundle" |  | ||||||
| sidekiq_command_args="exec sidekiq -q ${sidekiq_queues} -P ${sidekiq_pidfile} -L ${sidekiq_logfile}" |  | ||||||
| 
 |  | ||||||
| depend() { |  | ||||||
| 	need redis gitlab-workhorse |  | ||||||
| 	use net |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| start() { |  | ||||||
| 	checkpath -d -o ${gitlab_user} -m755 "$(dirname "${sidekiq_pidfile}")" |  | ||||||
| 
 |  | ||||||
| 	ebegin "Starting ${name} - Sidekiq" |  | ||||||
| 
 |  | ||||||
| 	start-stop-daemon --start \ |  | ||||||
| 		--background --quiet \ |  | ||||||
| 		--chdir "${gitlab_base}" \ |  | ||||||
| 		--user=${gitlab_user} \ |  | ||||||
| 		--pidfile="${sidekiq_pidfile}" \ |  | ||||||
| 		--env RAILS_ENV=${rails_env} \ |  | ||||||
| 		--exec ${sidekiq_command} -- ${sidekiq_command_args} |  | ||||||
| 	eend $? |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| stop() { |  | ||||||
| 	ebegin "Stopping ${name} - Sidekiq" |  | ||||||
| 	start-stop-daemon --stop \ |  | ||||||
| 		--pidfile=${sidekiq_pidfile} \ |  | ||||||
| 		--exec ${sidekiq_command} |  | ||||||
| 	eend $? |  | ||||||
| } |  | ||||||
|  | @ -1,122 +0,0 @@ | ||||||
| #!/sbin/openrc-run |  | ||||||
| 
 |  | ||||||
| extra_started_commands="restartsidekiq" |  | ||||||
| 
 |  | ||||||
| name="GitLab" |  | ||||||
| description="GitLab on Unicorns" |  | ||||||
| description_restartsidekiq="Restarts Sidekiq only" |  | ||||||
| 
 |  | ||||||
| : ${gitlab_user:=@USER@} |  | ||||||
| : ${gitlab_base:="@GITLAB_BASE@"} |  | ||||||
| : ${rails_env:=production} |  | ||||||
| 
 |  | ||||||
| : ${server_pidfile:="/run/gitlab/unicorn.pid"} |  | ||||||
| 
 |  | ||||||
| : ${sidekiq_pidfile:="/run/gitlab/sidekiq.pid"} |  | ||||||
| : ${sidekiq_logfile:="@LOGS_DIR@/sidekiq.log"} |  | ||||||
| : ${sidekiq_queues:="@QUEUES@"} |  | ||||||
| 
 |  | ||||||
| : ${mail_room_pidfile:="/run/gitlab/mail_room.pid"} |  | ||||||
| : ${mail_room_logfile:="/var/log/gitlab/mail_room.log"} |  | ||||||
| : ${mail_room_config:="/etc/gitlab/mail_room.yml"} |  | ||||||
| 
 |  | ||||||
| server_command="/usr/bin/bundle" |  | ||||||
| server_command_args="exec unicorn_rails -c ${gitlab_base}/config/unicorn.rb -E ${rails_env} -D" |  | ||||||
| 
 |  | ||||||
| sidekiq_command="/usr/bin/bundle" |  | ||||||
| sidekiq_command_args="exec sidekiq -q ${sidekiq_queues//,/ -q } -P ${sidekiq_pidfile} -L ${sidekiq_logfile}" |  | ||||||
| 
 |  | ||||||
| mail_room_command="/usr/bin/bundle" |  | ||||||
| mail_room_command_args="exec mail_room -q -c ${mail_room_config} >> ${mail_room_logfile} 2>&1" |  | ||||||
| 
 |  | ||||||
| depend() { |  | ||||||
| 	provide gitlab |  | ||||||
| 	need redis gitlab-workhorse |  | ||||||
| 	use net |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| start() { |  | ||||||
| 	ebegin "Starting ${name} - Unicorn servers" |  | ||||||
| 
 |  | ||||||
| 	checkpath -d -o ${gitlab_user} -m755 "$(dirname "${server_pidfile}")" |  | ||||||
| 	checkpath -d -o ${gitlab_user} -m755 "$(dirname "${sidekiq_pidfile}")" |  | ||||||
| 
 |  | ||||||
| 	start-stop-daemon --start \ |  | ||||||
| 		--chdir "${gitlab_base}" \ |  | ||||||
| 		--user=${gitlab_user} \ |  | ||||||
| 		--pidfile="${server_pidfile}" \ |  | ||||||
| 		--env RAILS_ENV=${rails_env} \ |  | ||||||
| 		--exec ${server_command} -- ${server_command_args} |  | ||||||
| 	eend $? |  | ||||||
| 
 |  | ||||||
| 	ebegin "Starting ${name} - Sidekiq" |  | ||||||
| 
 |  | ||||||
| 	start-stop-daemon --start \ |  | ||||||
| 		--background --quiet \ |  | ||||||
| 		--chdir "${gitlab_base}" \ |  | ||||||
| 		--user=${gitlab_user} \ |  | ||||||
| 		--pidfile="${sidekiq_pidfile}" \ |  | ||||||
| 		--env RAILS_ENV=${rails_env} \ |  | ||||||
| 		--exec ${sidekiq_command} -- ${sidekiq_command_args} |  | ||||||
| 	eend $? |  | ||||||
| 
 |  | ||||||
| 	if [ -e /etc/default/gitlab ]; then |  | ||||||
| 		. /etc/default/gitlab |  | ||||||
| 		if [ "${mail_room_enabled}" == "true" ]; then |  | ||||||
| 			ebegin "Starting ${name} - mail_room" |  | ||||||
| 
 |  | ||||||
| 			start-stop-daemon --start \ |  | ||||||
| 				--background --quiet \ |  | ||||||
| 				--chdir "${gitlab_base}" \ |  | ||||||
| 				--user=${gitlab_user} \ |  | ||||||
| 				--pidfile="${mail_room_pidfile}" -m \ |  | ||||||
| 				--env RAILS_ENV=${rails_env} \ |  | ||||||
| 				--exec ${mail_room_command} -- ${mail_room_command_args} |  | ||||||
| 			eend $? |  | ||||||
| 		fi |  | ||||||
| 	fi |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| stop() { |  | ||||||
| 	ebegin "Stopping ${name} - mail_room" |  | ||||||
| 	start-stop-daemon --stop \ |  | ||||||
| 		--signal QUIT \ |  | ||||||
| 		--pidfile=${mail_room_pidfile} \ |  | ||||||
| 		--exec ${mail_room_command} |  | ||||||
| 	eend $? |  | ||||||
| 
 |  | ||||||
| 	ebegin "Stopping ${name} - Sidekiq" |  | ||||||
| 	start-stop-daemon --stop \ |  | ||||||
| 		--pidfile=${sidekiq_pidfile} \ |  | ||||||
| 		--exec ${sidekiq_command} |  | ||||||
| 	eend $? |  | ||||||
| 
 |  | ||||||
| 	ebegin "Stopping ${name} - Unicorn servers" |  | ||||||
| 	start-stop-daemon --stop \ |  | ||||||
| 		--signal QUIT \ |  | ||||||
| 		--pidfile=${server_pidfile} \ |  | ||||||
| 		--exec ${server_command} |  | ||||||
| 	eend $? |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| restartsidekiq() { |  | ||||||
| 	ebegin "Restarting ${name} - Sidekiq: Stopping" |  | ||||||
| 	start-stop-daemon --stop \ |  | ||||||
| 		--pidfile=${sidekiq_pidfile} \ |  | ||||||
| 		--exec ${sidekiq_command} \ |  | ||||||
| 		--progress \ |  | ||||||
| 		--retry 180 |  | ||||||
| 
 |  | ||||||
| 	eend $? |  | ||||||
| 
 |  | ||||||
| 	ebegin "Starting ${name} - Sidekiq" |  | ||||||
| 
 |  | ||||||
| 	start-stop-daemon --start \ |  | ||||||
| 		--background --quiet \ |  | ||||||
| 		--chdir "${gitlab_base}" \ |  | ||||||
| 		--user=${gitlab_user} \ |  | ||||||
| 		--pidfile="${sidekiq_pidfile}" \ |  | ||||||
| 		--env RAILS_ENV=${rails_env} \ |  | ||||||
| 		--exec ${sidekiq_command} -- ${sidekiq_command_args} |  | ||||||
| 	eend $? |  | ||||||
| } |  | ||||||
|  | @ -1,391 +0,0 @@ | ||||||
| # Copyright 1999-2016 Gentoo Foundation |  | ||||||
| # Distributed under the terms of the GNU General Public License v2 |  | ||||||
| # $Id$ |  | ||||||
| 
 |  | ||||||
| EAPI="5" |  | ||||||
| 
 |  | ||||||
| # Maintainer notes: |  | ||||||
| # - This ebuild uses Bundler to download and install all gems in deployment mode |  | ||||||
| #   (i.e. into isolated directory inside application). That's not Gentoo way how |  | ||||||
| #   it should be done, but GitLab has too many dependencies that it will be too |  | ||||||
| #   difficult to maintain them via ebuilds. |  | ||||||
| # |  | ||||||
| 
 |  | ||||||
| USE_RUBY="ruby21 ruby23" |  | ||||||
| 
 |  | ||||||
| inherit eutils ruby-ng user systemd |  | ||||||
| 
 |  | ||||||
| MY_PV="v${PV/_/-}" |  | ||||||
| MY_GIT_COMMIT="69cda014abc941ff318728e63d37674b8368f33e" |  | ||||||
| 
 |  | ||||||
| DESCRIPTION="GitLab is a free project and repository management application" |  | ||||||
| HOMEPAGE="https://about.gitlab.com/" |  | ||||||
| SRC_URI="https://gitlab.com/gitlab-org/${PN}/repository/archive.tar.gz?ref=${MY_PV} -> ${P}.tar.gz" |  | ||||||
| RUBY_S="${PN}-${MY_PV}-${MY_GIT_COMMIT}" |  | ||||||
| 
 |  | ||||||
| RESTRICT="mirror" |  | ||||||
| 
 |  | ||||||
| LICENSE="MIT" |  | ||||||
| SLOT="0" |  | ||||||
| KEYWORDS="~amd64 ~x86 ~arm ~arm64" |  | ||||||
| IUSE="kerberos mysql +postgres +unicorn systemd rugged_use_system_libraries" |  | ||||||
| 
 |  | ||||||
| ## Gems dependencies: |  | ||||||
| #   charlock_holmes     dev-libs/icu |  | ||||||
| #   grape, capybara     dev-libs/libxml2, dev-libs/libxslt |  | ||||||
| #   rugged              dev-util/cmake, virtual/pkgconfig |  | ||||||
| #   json                dev-util/ragel |  | ||||||
| #   pygments.rb         python 2.7+ |  | ||||||
| #   execjs              net-libs/nodejs, or any other JS runtime |  | ||||||
| #   pg                  dev-db/postgresql |  | ||||||
| #   mysql               virtual/mysql |  | ||||||
| # |  | ||||||
| GEMS_DEPEND=" |  | ||||||
| 	dev-libs/icu |  | ||||||
| 	dev-libs/libxml2 |  | ||||||
| 	dev-libs/libxslt |  | ||||||
| 	dev-util/ragel |  | ||||||
| 	net-libs/nodejs |  | ||||||
| 	postgres? ( >=dev-db/postgresql-9.1:* ) |  | ||||||
| 	mysql? ( virtual/mysql ) |  | ||||||
| 	kerberos? ( virtual/krb5 )" |  | ||||||
| CDEPEND=" |  | ||||||
| 	dev-util/cmake |  | ||||||
| 	virtual/pkgconfig" |  | ||||||
| COMMON_DEPEND=" |  | ||||||
| 	${GEMS_DEPEND} |  | ||||||
| 	~dev-vcs/gitlab-shell-3.6.6 |  | ||||||
| 	>=dev-vcs/git-2.7.4 |  | ||||||
| 	~dev-vcs/gitlab-workhorse-0.8.5 |  | ||||||
| 	kerberos? ( !app-crypt/heimdal ) |  | ||||||
| 	rugged_use_system_libraries? ( net-libs/http-parser dev-libs/libgit2:0/24 )" |  | ||||||
| DEPEND=" |  | ||||||
| 	${CDEPEND} |  | ||||||
| 	${COMMON_DEPEND}" |  | ||||||
| RDEPEND=" |  | ||||||
| 	${COMMON_DEPEND} |  | ||||||
| 	>=dev-db/redis-2.8 |  | ||||||
| 	virtual/mta |  | ||||||
| 	systemd? ( sys-apps/systemd:0= )" |  | ||||||
| ruby_add_bdepend " |  | ||||||
| 	virtual/rubygems |  | ||||||
| 	>=dev-ruby/bundler-1.0" |  | ||||||
| 
 |  | ||||||
| # |  | ||||||
| # fix-sendmail-config: |  | ||||||
| #     Fix default settings to work with ssmtp that doesn't know '-t' argument. |  | ||||||
| # fix-redis-config-path: |  | ||||||
| #     Point to the absolute location of redis_config.rb |  | ||||||
| # |  | ||||||
| RUBY_PATCHES=( |  | ||||||
| 	"01-${PN}-8.7.5-fix-sendmail-config.patch" |  | ||||||
| 	"02-${PN}-8.11.0-fix-redis-config-path.patch" |  | ||||||
| 	"03-${PN}-8.12.7-database.yml.patch" |  | ||||||
| 	"04-${PN}-8.12.7-fix-check-task.patch" |  | ||||||
| 	"05-${PN}-8.12.7-replace-sys-filesystem.patch" |  | ||||||
| ) |  | ||||||
| 
 |  | ||||||
| MY_NAME="gitlab" |  | ||||||
| MY_USER="git"    # should be same as in gitlab-shell |  | ||||||
| 
 |  | ||||||
| DEST_DIR="/opt/${MY_NAME}" |  | ||||||
| CONF_DIR="/etc/${MY_NAME}" |  | ||||||
| LOGS_DIR="/var/log/${MY_NAME}" |  | ||||||
| TEMP_DIR="/var/tmp/${MY_NAME}" |  | ||||||
| 
 |  | ||||||
| all_ruby_prepare() { |  | ||||||
| 	# fix paths |  | ||||||
| 	local satellites_path="${TEMP_DIR}/repo_satellites" |  | ||||||
| 	local repos_path=/var/lib/git/repositories |  | ||||||
| 	local shell_path=/usr/share/gitlab-shell |  | ||||||
| 	sed -i -E \ |  | ||||||
| 		-e "/satellites:$/,/\w:$/   s|(\s*path:\s).*|\1${satellites_path}/|" \ |  | ||||||
| 		-e "/gitlab_shell:$/,/\w:$/ s|(\s*path:\s).*|\1${shell_path}/|" \ |  | ||||||
| 		-e "/gitlab_shell:$/,/\w:$/ s|(\s*repos_path:\s).*|\1${repos_path}/|" \ |  | ||||||
| 		-e "/gitlab_shell:$/,/\w:$/ s|(\s*hooks_path:\s).*|\1${shell_path}/hooks/|" \ |  | ||||||
| 		config/gitlab.yml.example || die "failed to filter gitlab.yml.example" |  | ||||||
| 
 |  | ||||||
| 	local run_path=/run/${MY_NAME} |  | ||||||
| 	sed -i -E \ |  | ||||||
| 		-e "s|/home/git/gitlab/tmp/(pids\|sockets)|${run_path}|" \ |  | ||||||
| 		-e "s|/home/git/gitlab/log|${LOGS_DIR}|" \ |  | ||||||
| 		-e "s|/home/git/gitlab|${DEST_DIR}|" \ |  | ||||||
| 		config/unicorn.rb.example || die "failed to filter unicorn.rb.example" |  | ||||||
| 
 |  | ||||||
| 	sed -i \ |  | ||||||
| 		-e "s|/home/git/gitlab/tmp/sockets|${run_path}|" \ |  | ||||||
| 		lib/support/nginx/gitlab || die "failed to filter nginx/gitlab" |  | ||||||
| 
 |  | ||||||
| 	# modify default database settings for PostgreSQL |  | ||||||
| 	sed -i -E \ |  | ||||||
| 		-e 's|(username:).*|\1 gitlab|' \ |  | ||||||
| 		-e 's|(password:).*|\1 gitlab|' \ |  | ||||||
| 		-e 's|(socket:).*|\1 /run/postgresql/.s.PGSQL.5432|' \ |  | ||||||
| 		config/database.yml.postgresql \ |  | ||||||
| 		|| die "failed to filter database.yml.postgresql" |  | ||||||
| 
 |  | ||||||
| 	# rename config files |  | ||||||
| 	mv config/gitlab.yml.example config/gitlab.yml |  | ||||||
| 	mv config/unicorn.rb.example config/unicorn.rb |  | ||||||
| 
 |  | ||||||
| 	local dbconf=config/database.yml |  | ||||||
| 	if use postgres && ! use mysql; then |  | ||||||
| 		mv ${dbconf}.postgresql ${dbconf} |  | ||||||
| 		rm ${dbconf}.mysql |  | ||||||
| 	elif use mysql && ! use postgres; then |  | ||||||
| 		mv ${dbconf}.mysql ${dbconf} |  | ||||||
| 		rm ${dbconf}.postgresql |  | ||||||
| 	fi |  | ||||||
| 
 |  | ||||||
| 	# remove useless files |  | ||||||
| 	rm -r lib/support/{deploy,init.d} |  | ||||||
| 	use unicorn || rm config/unicorn.rb |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| all_ruby_install() { |  | ||||||
| 	local dest=${DEST_DIR} |  | ||||||
| 	local conf=${CONF_DIR} |  | ||||||
| 	local logs=${LOGS_DIR} |  | ||||||
| 	local temp=${TEMP_DIR} |  | ||||||
| 
 |  | ||||||
| 	# prepare directories |  | ||||||
| 	diropts -m750 |  | ||||||
| 	dodir ${logs} ${temp} |  | ||||||
| 
 |  | ||||||
| 	diropts -m755 |  | ||||||
| 	dodir ${conf} ${dest}/public/uploads |  | ||||||
| 
 |  | ||||||
| 	dosym ${temp} ${dest}/tmp |  | ||||||
| 	dosym ${logs} ${dest}/log |  | ||||||
| 
 |  | ||||||
| 	# install configs |  | ||||||
| 	insinto ${conf} |  | ||||||
| 	doins -r config/* |  | ||||||
| 	dosym ${conf} ${dest}/config |  | ||||||
| 
 |  | ||||||
| 	echo 'export RAILS_ENV=production' > "${D}/${dest}/.profile" |  | ||||||
| 
 |  | ||||||
| 	# remove needless dirs |  | ||||||
| 	rm -Rf config tmp log |  | ||||||
| 
 |  | ||||||
| 	# install the rest files |  | ||||||
| 	# using cp 'cause doins is slow |  | ||||||
| 	cp -Rl * "${D}/${dest}"/ |  | ||||||
| 
 |  | ||||||
| 	# install logrotate config |  | ||||||
| 	dodir /etc/logrotate.d |  | ||||||
| 	cat > "${D}/etc/logrotate.d/${MY_NAME}" <<-EOF |  | ||||||
| 		${logs}/*.log { |  | ||||||
| 		    missingok |  | ||||||
| 		    delaycompress |  | ||||||
| 		    compress |  | ||||||
| 		    copytruncate |  | ||||||
| 		} |  | ||||||
| 	EOF |  | ||||||
| 
 |  | ||||||
| 	## Install gems via bundler ## |  | ||||||
| 
 |  | ||||||
| 	cd "${D}/${dest}" |  | ||||||
| 
 |  | ||||||
| 	local without="development test aws" |  | ||||||
| 	local flag; for flag in mysql postgres unicorn kerberos; do |  | ||||||
| 		without+="$(use $flag || echo ' '$flag)" |  | ||||||
| 	done |  | ||||||
| 	local bundle_args="--deployment ${without:+--without ${without}}" |  | ||||||
| 
 |  | ||||||
| 	use "rugged_use_system_libraries" && export RUGGED_USE_SYSTEM_LIBRARIES="YES" |  | ||||||
| 
 |  | ||||||
| 	einfo "Running bundle install ${bundle_args} ..." |  | ||||||
| 	${RUBY} /usr/bin/bundle install ${bundle_args} || die "bundler failed" |  | ||||||
| 
 |  | ||||||
| 	einfo "Cleaning old gems ..." |  | ||||||
| 	${RUBY} /usr/bin/bundle clean |  | ||||||
| 
 |  | ||||||
| 	# clean gems cache |  | ||||||
| 	rm -Rf vendor/bundle/ruby/*/cache |  | ||||||
| 	rm -Rf vendor/bundle/ruby/*/bundler/gems/charlock_holmes-dde194609b35/.git |  | ||||||
| 
 |  | ||||||
| 	## RC script ## |  | ||||||
| 
 |  | ||||||
| 	if use systemd ; then |  | ||||||
| 		ewarn "Beware: systemd support has not been tested, use at your own risk!" |  | ||||||
| 		systemd_newunit "${FILESDIR}/gitlab-8.13.0-sidekiq.service" "gitlab-sidekiq.service" |  | ||||||
| 		systemd_dounit "${FILESDIR}/gitlab-unicorn.service" |  | ||||||
| 		systemd_dounit "${FILESDIR}/gitlab-workhorse.service" |  | ||||||
| 		systemd_dounit "${FILESDIR}/gitlab-mailroom.service" |  | ||||||
| 		systemd_dotmpfilesd "${FILESDIR}/gitlab.conf" |  | ||||||
| 	else |  | ||||||
| 		local rcscript=gitlab-8.13.3-sidekiq.init |  | ||||||
| 		use unicorn && rcscript=gitlab-8.13.3-unicorn.init |  | ||||||
| 
 |  | ||||||
| 		cp "${FILESDIR}/${rcscript}" "${T}" || die |  | ||||||
| 		sed -i \ |  | ||||||
| 			-e "s|@USER@|${MY_USER}|" \ |  | ||||||
| 			-e "s|@GITLAB_BASE@|${dest}|" \ |  | ||||||
| 			-e "s|@LOGS_DIR@|${logs}|" \ |  | ||||||
| 			"${T}/${rcscript}" \ |  | ||||||
| 			|| die "failed to filter ${rcscript}" |  | ||||||
| 
 |  | ||||||
| 		newinitd "${T}/${rcscript}" "${MY_NAME}" |  | ||||||
| 	fi |  | ||||||
| 
 |  | ||||||
| 	# fix permissions |  | ||||||
| 	fowners -R ${MY_USER}:${MY_USER} ${dest} ${temp} ${logs} |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| pkg_postinst() { |  | ||||||
| 	elog "If this is an update from a previous version, stop your GitLab" |  | ||||||
| 	elog "instance and issue the following command to perform all required" |  | ||||||
| 	elog "migrations:" |  | ||||||
| 	elog "       emerge --config \"=${CATEGORY}/${PF}\"" |  | ||||||
| 	elog "PLEASE NOTE: It's HIGHLY recommended to backup your database" |  | ||||||
| 	elog "before running the config phase. Run these commands (as root):" |  | ||||||
| 	elog |  | ||||||
| 	elog "    cd /opt/gitlab" |  | ||||||
| 	elog "    sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production" |  | ||||||
| 	elog |  | ||||||
| 	elog "If this was a fresh install, follow these steps:" |  | ||||||
| 	elog |  | ||||||
| 	elog "1. Configure your GitLab's settings in ${CONF_DIR}/gitlab.yml." |  | ||||||
| 	elog |  | ||||||
| 	elog "2. Configure your database settings in ${CONF_DIR}/database.yml" |  | ||||||
| 	elog "   for \"production\" environment." |  | ||||||
| 	elog |  | ||||||
| 	elog "3. Then you should create a database for your GitLab instance, if you" |  | ||||||
| 	elog "   haven't done so already." |  | ||||||
| 	elog |  | ||||||
| 	if use postgres; then |  | ||||||
| 		elog "If you have local PostgreSQL running, just copy&run:" |  | ||||||
| 		elog "      su postgres" |  | ||||||
| 		elog "      psql -c \"CREATE ROLE gitlab PASSWORD 'gitlab' \\" |  | ||||||
| 		elog "          NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;\"" |  | ||||||
| 		elog "      createdb -E UTF-8 -O gitlab gitlabhq_production" |  | ||||||
| 		elog "  Note: You should change your password to something more random..." |  | ||||||
| 		elog |  | ||||||
| 	fi |  | ||||||
| 	elog "4. Finally execute the following command to initialize the environment:" |  | ||||||
| 	elog "       emerge --config \"=${CATEGORY}/${PF}\"" |  | ||||||
| 	elog "   Note: Do not forget to start Redis server first!" |  | ||||||
| 	elog |  | ||||||
| 	elog "If you're running GitLab behind an SSL proxy such as nginx or Apache and" |  | ||||||
| 	elog "you can't login after the upgrade, be sure to read the section about the" |  | ||||||
| 	elog "verification of the CSRF token in GitLab's trouble-shooting guide at" |  | ||||||
| 	elog "http://goo.gl/5XGRGv." |  | ||||||
| 	if use postgres; then |  | ||||||
| 		elog "Please note: As of GitLab 8.6, users of PostgreSQL need to enable the" |  | ||||||
| 		elog "`pg_trgm` extension by running the following command as a PostgreSQL" |  | ||||||
| 		elog "super user for *every* GitLab database:" |  | ||||||
| 		elog "      CREATE EXTENSION IF NOT EXISTS pg_trgm;" |  | ||||||
| 		elog "For details, see the documentation at the GitLab website." |  | ||||||
| 	fi |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| pkg_config() { |  | ||||||
| 	einfo "Checking configuration files" |  | ||||||
| 
 |  | ||||||
| 	if [ ! -r "${CONF_DIR}/database.yml" ]; then |  | ||||||
| 		eerror "Copy ${CONF_DIR}/database.yml.* to" |  | ||||||
| 		eerror "${CONF_DIR}/database.yml and edit this file in order to configure your" |  | ||||||
| 		eerror "database settings for \"production\" environment."; die |  | ||||||
| 	fi |  | ||||||
| 
 |  | ||||||
| 	local email_from="$(ryaml ${CONF_DIR}/gitlab.yml production gitlab email_from)" |  | ||||||
| 	local git_home="$(egethome ${MY_USER})" |  | ||||||
| 
 |  | ||||||
| 	# configure Git global settings |  | ||||||
| 	if [ ! -e "${git_home}/.gitconfig" ]; then |  | ||||||
| 		einfo "Setting git user" |  | ||||||
| 		su -l ${MY_USER} -c " |  | ||||||
| 			git config --global user.email '${email_from}'; |  | ||||||
| 			git config --global user.name 'GitLab'" \ |  | ||||||
| 			|| die "failed to setup git name and email" |  | ||||||
| 	fi |  | ||||||
| 
 |  | ||||||
| 	su -l ${MY_USER} -c "git config --global repack.writeBitmaps true" |  | ||||||
| 
 |  | ||||||
| 	# determine whether this is an update or a fresh install. we do this by |  | ||||||
| 	# checking whether the ${DEST_DIR}/.git directory exists or not |  | ||||||
| 	#  |  | ||||||
| 	if [ -d "${DEST_DIR}/.git" ]; then |  | ||||||
| 		local update=true |  | ||||||
| 	else |  | ||||||
| 		local update=false |  | ||||||
| 	fi |  | ||||||
| 
 |  | ||||||
| 	## Initialize app ## |  | ||||||
| 
 |  | ||||||
| 	local RAILS_ENV="production" |  | ||||||
| 	local RUBY=${RUBY:-/usr/bin/ruby} |  | ||||||
| 	local BUNDLE="${RUBY} /usr/bin/bundle" |  | ||||||
| 
 |  | ||||||
| 	# FIXME: this line existed in older ebuilds, but the variable is |  | ||||||
| 	# never used. what was it for!? |  | ||||||
| 	# local dbname="$(ryaml ${CONF_DIR}/database.yml production database)" |  | ||||||
| 
 |  | ||||||
| 	if [ "${update}" = 'true' ]; then |  | ||||||
| 		einfo "Migrating database ..." |  | ||||||
| 		exec_rake db:migrate |  | ||||||
| 
 |  | ||||||
| 		# https://github.com/gitlabhq/gitlabhq/issues/5311#issuecomment-31656496 |  | ||||||
| 		einfo "Migrating iids ..." |  | ||||||
| 		exec_rake migrate_iids |  | ||||||
| 
 |  | ||||||
| 		einfo "Cleaning old precompiled assets ..." |  | ||||||
| 		exec_rake assets:clean |  | ||||||
| 
 |  | ||||||
| 		einfo "Cleaning cache ..." |  | ||||||
| 		exec_rake cache:clear |  | ||||||
| 	else |  | ||||||
| 		# create dummy git repo as workaround for |  | ||||||
| 		# https://github.com/bundler/bundler/issues/2039 |  | ||||||
| 		einfo "Initializing dummy git repository to avoid false errors from bundler" |  | ||||||
| 		su -l ${MY_USER} -c " |  | ||||||
| 			cd ${DEST_DIR} |  | ||||||
| 			git init |  | ||||||
| 			git add README.md |  | ||||||
| 			git commit -m 'Dummy repository'" >/dev/null |  | ||||||
| 
 |  | ||||||
| 		einfo "Initializing database ..." |  | ||||||
| 		exec_rake gitlab:setup |  | ||||||
| 	fi |  | ||||||
| 
 |  | ||||||
| 	einfo "Precompiling assests ..." |  | ||||||
| 	exec_rake assets:precompile |  | ||||||
| 
 |  | ||||||
| 	if [ "${update}" = 'true' ]; then |  | ||||||
| 		ewarn |  | ||||||
| 		ewarn "This configuration script runs only common migration tasks." |  | ||||||
| 		ewarn "Please read guides on" |  | ||||||
| 		ewarn "    https://github.com/gitlabhq/gitlabhq/blob/master/doc/update/" |  | ||||||
| 		ewarn "for any additional migration tasks specific to your previous GitLab" |  | ||||||
| 		ewarn "version." |  | ||||||
| 	fi |  | ||||||
| 	elog |  | ||||||
| 	elog "If you want to make sure that the install/upgrade was successful, start" |  | ||||||
| 	elog "Gitlab now and then run these commands (as root):" |  | ||||||
| 	elog |  | ||||||
| 	elog "    cd /opt/gitlab" |  | ||||||
| 	elog "    sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production" |  | ||||||
| 	elog "    sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production" |  | ||||||
| 	elog |  | ||||||
| 	if ! use systemd ; then |  | ||||||
| 		elog "You may also run" |  | ||||||
| 		elog "    /etc/init.d/gitlab check" |  | ||||||
| 		elog " for convenience." |  | ||||||
| 	fi |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| ryaml() { |  | ||||||
| 	ruby -ryaml -e 'puts ARGV[1..-1].inject(YAML.load(File.read(ARGV[0]))) {|acc, key| acc[key] }' "$@" |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| exec_rake() { |  | ||||||
| 	local command="${BUNDLE} exec rake $@ RAILS_ENV=${RAILS_ENV}" |  | ||||||
| 
 |  | ||||||
| 	echo "   ${command}" |  | ||||||
| 	su -l ${MY_USER} -c " |  | ||||||
| 		export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8 |  | ||||||
| 		cd ${DEST_DIR} |  | ||||||
| 		${command}" \ |  | ||||||
| 		|| die "failed to run rake $@" |  | ||||||
| } |  | ||||||
|  | @ -1,392 +0,0 @@ | ||||||
| # Copyright 1999-2016 Gentoo Foundation |  | ||||||
| # Distributed under the terms of the GNU General Public License v2 |  | ||||||
| # $Id$ |  | ||||||
| 
 |  | ||||||
| EAPI="5" |  | ||||||
| 
 |  | ||||||
| # Maintainer notes: |  | ||||||
| # - This ebuild uses Bundler to download and install all gems in deployment mode |  | ||||||
| #   (i.e. into isolated directory inside application). That's not Gentoo way how |  | ||||||
| #   it should be done, but GitLab has too many dependencies that it will be too |  | ||||||
| #   difficult to maintain them via ebuilds. |  | ||||||
| # |  | ||||||
| 
 |  | ||||||
| USE_RUBY="ruby21 ruby23" |  | ||||||
| 
 |  | ||||||
| inherit eutils ruby-ng user systemd |  | ||||||
| 
 |  | ||||||
| MY_PV="v${PV/_/-}" |  | ||||||
| MY_GIT_COMMIT="cde955c9645ddfaae2f154d3d3aded79c9fc574f" |  | ||||||
| 
 |  | ||||||
| DESCRIPTION="GitLab is a free project and repository management application" |  | ||||||
| HOMEPAGE="https://about.gitlab.com/" |  | ||||||
| SRC_URI="https://gitlab.com/gitlab-org/${PN}/repository/archive.tar.gz?ref=${MY_PV} -> ${P}.tar.gz" |  | ||||||
| RUBY_S="${PN}-${MY_PV}-${MY_GIT_COMMIT}" |  | ||||||
| 
 |  | ||||||
| RESTRICT="mirror" |  | ||||||
| 
 |  | ||||||
| LICENSE="MIT" |  | ||||||
| SLOT="0" |  | ||||||
| KEYWORDS="~amd64 ~x86 ~arm ~arm64" |  | ||||||
| IUSE="kerberos mysql +postgres +unicorn systemd rugged_use_system_libraries" |  | ||||||
| 
 |  | ||||||
| ## Gems dependencies: |  | ||||||
| #   charlock_holmes     dev-libs/icu |  | ||||||
| #   grape, capybara     dev-libs/libxml2, dev-libs/libxslt |  | ||||||
| #   rugged              dev-util/cmake, virtual/pkgconfig |  | ||||||
| #   json                dev-util/ragel |  | ||||||
| #   pygments.rb         python 2.7+ |  | ||||||
| #   execjs              net-libs/nodejs, or any other JS runtime |  | ||||||
| #   pg                  dev-db/postgresql |  | ||||||
| #   mysql               virtual/mysql |  | ||||||
| # |  | ||||||
| GEMS_DEPEND=" |  | ||||||
| 	dev-libs/icu |  | ||||||
| 	dev-libs/libxml2 |  | ||||||
| 	dev-libs/libxslt |  | ||||||
| 	dev-util/ragel |  | ||||||
| 	net-libs/nodejs |  | ||||||
| 	postgres? ( >=dev-db/postgresql-9.1:* ) |  | ||||||
| 	mysql? ( virtual/mysql ) |  | ||||||
| 	kerberos? ( virtual/krb5 )" |  | ||||||
| CDEPEND=" |  | ||||||
| 	dev-util/cmake |  | ||||||
| 	virtual/pkgconfig" |  | ||||||
| COMMON_DEPEND=" |  | ||||||
| 	${GEMS_DEPEND} |  | ||||||
| 	~dev-vcs/gitlab-shell-4.0.0 |  | ||||||
| 	>=dev-vcs/git-2.7.4 |  | ||||||
| 	~dev-vcs/gitlab-workhorse-1.0.0 |  | ||||||
| 	kerberos? ( !app-crypt/heimdal ) |  | ||||||
| 	rugged_use_system_libraries? ( net-libs/http-parser dev-libs/libgit2:0/24 )" |  | ||||||
| DEPEND=" |  | ||||||
| 	${CDEPEND} |  | ||||||
| 	${COMMON_DEPEND}" |  | ||||||
| RDEPEND=" |  | ||||||
| 	${COMMON_DEPEND} |  | ||||||
| 	>=dev-db/redis-2.8 |  | ||||||
| 	virtual/mta |  | ||||||
| 	systemd? ( sys-apps/systemd:0= )" |  | ||||||
| # dev-ruby/bundler should be >=1.13.6, but that doesn't exist yet in the tree. |  | ||||||
| ruby_add_bdepend " |  | ||||||
| 	virtual/rubygems |  | ||||||
| 	>=dev-ruby/bundler-1.0" |  | ||||||
| 
 |  | ||||||
| # |  | ||||||
| # fix-sendmail-config: |  | ||||||
| #     Fix default settings to work with ssmtp that doesn't know '-t' argument. |  | ||||||
| # fix-redis-config-path: |  | ||||||
| #     Point to the absolute location of redis_config.rb |  | ||||||
| # |  | ||||||
| RUBY_PATCHES=( |  | ||||||
| 	"01-${PN}-8.7.5-fix-sendmail-config.patch" |  | ||||||
| 	"02-${PN}-8.11.0-fix-redis-config-path.patch" |  | ||||||
| 	"03-${PN}-8.14.0-database.yml.patch" |  | ||||||
| 	"04-${PN}-8.12.7-fix-check-task.patch" |  | ||||||
| 	"05-${PN}-8.12.7-replace-sys-filesystem.patch" |  | ||||||
| ) |  | ||||||
| 
 |  | ||||||
| MY_NAME="gitlab" |  | ||||||
| MY_USER="git"    # should be same as in gitlab-shell |  | ||||||
| 
 |  | ||||||
| DEST_DIR="/opt/${MY_NAME}" |  | ||||||
| CONF_DIR="/etc/${MY_NAME}" |  | ||||||
| LOGS_DIR="/var/log/${MY_NAME}" |  | ||||||
| TEMP_DIR="/var/tmp/${MY_NAME}" |  | ||||||
| 
 |  | ||||||
| all_ruby_prepare() { |  | ||||||
| 	# fix paths |  | ||||||
| 	local satellites_path="${TEMP_DIR}/repo_satellites" |  | ||||||
| 	local repos_path=/var/lib/git/repositories |  | ||||||
| 	local shell_path=/usr/share/gitlab-shell |  | ||||||
| 	sed -i -E \ |  | ||||||
| 		-e "/satellites:$/,/\w:$/   s|(\s*path:\s).*|\1${satellites_path}/|" \ |  | ||||||
| 		-e "/gitlab_shell:$/,/\w:$/ s|(\s*path:\s).*|\1${shell_path}/|" \ |  | ||||||
| 		-e "/gitlab_shell:$/,/\w:$/ s|(\s*repos_path:\s).*|\1${repos_path}/|" \ |  | ||||||
| 		-e "/gitlab_shell:$/,/\w:$/ s|(\s*hooks_path:\s).*|\1${shell_path}/hooks/|" \ |  | ||||||
| 		config/gitlab.yml.example || die "failed to filter gitlab.yml.example" |  | ||||||
| 
 |  | ||||||
| 	local run_path=/run/${MY_NAME} |  | ||||||
| 	sed -i -E \ |  | ||||||
| 		-e "s|/home/git/gitlab/tmp/(pids\|sockets)|${run_path}|" \ |  | ||||||
| 		-e "s|/home/git/gitlab/log|${LOGS_DIR}|" \ |  | ||||||
| 		-e "s|/home/git/gitlab|${DEST_DIR}|" \ |  | ||||||
| 		config/unicorn.rb.example || die "failed to filter unicorn.rb.example" |  | ||||||
| 
 |  | ||||||
| 	sed -i \ |  | ||||||
| 		-e "s|/home/git/gitlab/tmp/sockets|${run_path}|" \ |  | ||||||
| 		lib/support/nginx/gitlab || die "failed to filter nginx/gitlab" |  | ||||||
| 
 |  | ||||||
| 	# modify default database settings for PostgreSQL |  | ||||||
| 	sed -i -E \ |  | ||||||
| 		-e 's|(username:).*|\1 gitlab|' \ |  | ||||||
| 		-e 's|(password:).*|\1 gitlab|' \ |  | ||||||
| 		-e 's|(socket:).*|\1 /run/postgresql/.s.PGSQL.5432|' \ |  | ||||||
| 		config/database.yml.postgresql \ |  | ||||||
| 		|| die "failed to filter database.yml.postgresql" |  | ||||||
| 
 |  | ||||||
| 	# rename config files |  | ||||||
| 	mv config/gitlab.yml.example config/gitlab.yml |  | ||||||
| 	mv config/unicorn.rb.example config/unicorn.rb |  | ||||||
| 
 |  | ||||||
| 	local dbconf=config/database.yml |  | ||||||
| 	if use postgres && ! use mysql; then |  | ||||||
| 		mv ${dbconf}.postgresql ${dbconf} |  | ||||||
| 		rm ${dbconf}.mysql |  | ||||||
| 	elif use mysql && ! use postgres; then |  | ||||||
| 		mv ${dbconf}.mysql ${dbconf} |  | ||||||
| 		rm ${dbconf}.postgresql |  | ||||||
| 	fi |  | ||||||
| 
 |  | ||||||
| 	# remove useless files |  | ||||||
| 	rm -r lib/support/{deploy,init.d} |  | ||||||
| 	use unicorn || rm config/unicorn.rb |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| all_ruby_install() { |  | ||||||
| 	local dest=${DEST_DIR} |  | ||||||
| 	local conf=${CONF_DIR} |  | ||||||
| 	local logs=${LOGS_DIR} |  | ||||||
| 	local temp=${TEMP_DIR} |  | ||||||
| 
 |  | ||||||
| 	# prepare directories |  | ||||||
| 	diropts -m750 |  | ||||||
| 	dodir ${logs} ${temp} |  | ||||||
| 
 |  | ||||||
| 	diropts -m755 |  | ||||||
| 	dodir ${conf} ${dest}/public/uploads |  | ||||||
| 
 |  | ||||||
| 	dosym ${temp} ${dest}/tmp |  | ||||||
| 	dosym ${logs} ${dest}/log |  | ||||||
| 
 |  | ||||||
| 	# install configs |  | ||||||
| 	insinto ${conf} |  | ||||||
| 	doins -r config/* |  | ||||||
| 	dosym ${conf} ${dest}/config |  | ||||||
| 
 |  | ||||||
| 	echo 'export RAILS_ENV=production' > "${D}/${dest}/.profile" |  | ||||||
| 
 |  | ||||||
| 	# remove needless dirs |  | ||||||
| 	rm -Rf config tmp log |  | ||||||
| 
 |  | ||||||
| 	# install the rest files |  | ||||||
| 	# using cp 'cause doins is slow |  | ||||||
| 	cp -Rl * "${D}/${dest}"/ |  | ||||||
| 
 |  | ||||||
| 	# install logrotate config |  | ||||||
| 	dodir /etc/logrotate.d |  | ||||||
| 	cat > "${D}/etc/logrotate.d/${MY_NAME}" <<-EOF |  | ||||||
| 		${logs}/*.log { |  | ||||||
| 		    missingok |  | ||||||
| 		    delaycompress |  | ||||||
| 		    compress |  | ||||||
| 		    copytruncate |  | ||||||
| 		} |  | ||||||
| 	EOF |  | ||||||
| 
 |  | ||||||
| 	## Install gems via bundler ## |  | ||||||
| 
 |  | ||||||
| 	cd "${D}/${dest}" |  | ||||||
| 
 |  | ||||||
| 	local without="development test aws" |  | ||||||
| 	local flag; for flag in mysql postgres unicorn kerberos; do |  | ||||||
| 		without+="$(use $flag || echo ' '$flag)" |  | ||||||
| 	done |  | ||||||
| 	local bundle_args="--deployment ${without:+--without ${without}}" |  | ||||||
| 
 |  | ||||||
| 	use "rugged_use_system_libraries" && export RUGGED_USE_SYSTEM_LIBRARIES="YES" |  | ||||||
| 
 |  | ||||||
| 	einfo "Running bundle install ${bundle_args} ..." |  | ||||||
| 	${RUBY} /usr/bin/bundle install ${bundle_args} || die "bundler failed" |  | ||||||
| 
 |  | ||||||
| 	einfo "Cleaning old gems ..." |  | ||||||
| 	${RUBY} /usr/bin/bundle clean |  | ||||||
| 
 |  | ||||||
| 	# clean gems cache |  | ||||||
| 	rm -Rf vendor/bundle/ruby/*/cache |  | ||||||
| 	rm -Rf vendor/bundle/ruby/*/bundler/gems/charlock_holmes-dde194609b35/.git |  | ||||||
| 
 |  | ||||||
| 	## RC script ## |  | ||||||
| 
 |  | ||||||
| 	if use systemd ; then |  | ||||||
| 		ewarn "Beware: systemd support has not been tested, use at your own risk!" |  | ||||||
| 		systemd_newunit "${FILESDIR}/gitlab-8.13.0-sidekiq.service" "gitlab-sidekiq.service" |  | ||||||
| 		systemd_dounit "${FILESDIR}/gitlab-unicorn.service" |  | ||||||
| 		systemd_dounit "${FILESDIR}/gitlab-workhorse.service" |  | ||||||
| 		systemd_dounit "${FILESDIR}/gitlab-mailroom.service" |  | ||||||
| 		systemd_dotmpfilesd "${FILESDIR}/gitlab.conf" |  | ||||||
| 	else |  | ||||||
| 		local rcscript=gitlab-8.13.3-sidekiq.init |  | ||||||
| 		use unicorn && rcscript=gitlab-8.13.3-unicorn.init |  | ||||||
| 
 |  | ||||||
| 		cp "${FILESDIR}/${rcscript}" "${T}" || die |  | ||||||
| 		sed -i \ |  | ||||||
| 			-e "s|@USER@|${MY_USER}|" \ |  | ||||||
| 			-e "s|@GITLAB_BASE@|${dest}|" \ |  | ||||||
| 			-e "s|@LOGS_DIR@|${logs}|" \ |  | ||||||
| 			"${T}/${rcscript}" \ |  | ||||||
| 			|| die "failed to filter ${rcscript}" |  | ||||||
| 
 |  | ||||||
| 		newinitd "${T}/${rcscript}" "${MY_NAME}" |  | ||||||
| 	fi |  | ||||||
| 
 |  | ||||||
| 	# fix permissions |  | ||||||
| 	fowners -R ${MY_USER}:${MY_USER} ${dest} ${temp} ${logs} |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| pkg_postinst() { |  | ||||||
| 	elog "If this is an update from a previous version, stop your GitLab" |  | ||||||
| 	elog "instance and issue the following command to perform all required" |  | ||||||
| 	elog "migrations:" |  | ||||||
| 	elog "       emerge --config \"=${CATEGORY}/${PF}\"" |  | ||||||
| 	elog "PLEASE NOTE: It's HIGHLY recommended to backup your database" |  | ||||||
| 	elog "before running the config phase. Run these commands (as root):" |  | ||||||
| 	elog |  | ||||||
| 	elog "    cd /opt/gitlab" |  | ||||||
| 	elog "    sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production" |  | ||||||
| 	elog |  | ||||||
| 	elog "If this was a fresh install, follow these steps:" |  | ||||||
| 	elog |  | ||||||
| 	elog "1. Configure your GitLab's settings in ${CONF_DIR}/gitlab.yml." |  | ||||||
| 	elog |  | ||||||
| 	elog "2. Configure your database settings in ${CONF_DIR}/database.yml" |  | ||||||
| 	elog "   for \"production\" environment." |  | ||||||
| 	elog |  | ||||||
| 	elog "3. Then you should create a database for your GitLab instance, if you" |  | ||||||
| 	elog "   haven't done so already." |  | ||||||
| 	elog |  | ||||||
| 	if use postgres; then |  | ||||||
| 		elog "If you have local PostgreSQL running, just copy&run:" |  | ||||||
| 		elog "      su postgres" |  | ||||||
| 		elog "      psql -c \"CREATE ROLE gitlab PASSWORD 'gitlab' \\" |  | ||||||
| 		elog "          NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;\"" |  | ||||||
| 		elog "      createdb -E UTF-8 -O gitlab gitlabhq_production" |  | ||||||
| 		elog "  Note: You should change your password to something more random..." |  | ||||||
| 		elog |  | ||||||
| 	fi |  | ||||||
| 	elog "4. Finally execute the following command to initialize the environment:" |  | ||||||
| 	elog "       emerge --config \"=${CATEGORY}/${PF}\"" |  | ||||||
| 	elog "   Note: Do not forget to start Redis server first!" |  | ||||||
| 	elog |  | ||||||
| 	elog "If you're running GitLab behind an SSL proxy such as nginx or Apache and" |  | ||||||
| 	elog "you can't login after the upgrade, be sure to read the section about the" |  | ||||||
| 	elog "verification of the CSRF token in GitLab's trouble-shooting guide at" |  | ||||||
| 	elog "http://goo.gl/5XGRGv." |  | ||||||
| 	if use postgres; then |  | ||||||
| 		elog "Please note: As of GitLab 8.6, users of PostgreSQL need to enable the" |  | ||||||
| 		elog "`pg_trgm` extension by running the following command as a PostgreSQL" |  | ||||||
| 		elog "super user for *every* GitLab database:" |  | ||||||
| 		elog "      CREATE EXTENSION IF NOT EXISTS pg_trgm;" |  | ||||||
| 		elog "For details, see the documentation at the GitLab website." |  | ||||||
| 	fi |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| pkg_config() { |  | ||||||
| 	einfo "Checking configuration files" |  | ||||||
| 
 |  | ||||||
| 	if [ ! -r "${CONF_DIR}/database.yml" ]; then |  | ||||||
| 		eerror "Copy ${CONF_DIR}/database.yml.* to" |  | ||||||
| 		eerror "${CONF_DIR}/database.yml and edit this file in order to configure your" |  | ||||||
| 		eerror "database settings for \"production\" environment."; die |  | ||||||
| 	fi |  | ||||||
| 
 |  | ||||||
| 	local email_from="$(ryaml ${CONF_DIR}/gitlab.yml production gitlab email_from)" |  | ||||||
| 	local git_home="$(egethome ${MY_USER})" |  | ||||||
| 
 |  | ||||||
| 	# configure Git global settings |  | ||||||
| 	if [ ! -e "${git_home}/.gitconfig" ]; then |  | ||||||
| 		einfo "Setting git user" |  | ||||||
| 		su -l ${MY_USER} -c " |  | ||||||
| 			git config --global user.email '${email_from}'; |  | ||||||
| 			git config --global user.name 'GitLab'" \ |  | ||||||
| 			|| die "failed to setup git name and email" |  | ||||||
| 	fi |  | ||||||
| 
 |  | ||||||
| 	su -l ${MY_USER} -c "git config --global repack.writeBitmaps true" |  | ||||||
| 
 |  | ||||||
| 	# determine whether this is an update or a fresh install. we do this by |  | ||||||
| 	# checking whether the ${DEST_DIR}/.git directory exists or not |  | ||||||
| 	#  |  | ||||||
| 	if [ -d "${DEST_DIR}/.git" ]; then |  | ||||||
| 		local update=true |  | ||||||
| 	else |  | ||||||
| 		local update=false |  | ||||||
| 	fi |  | ||||||
| 
 |  | ||||||
| 	## Initialize app ## |  | ||||||
| 
 |  | ||||||
| 	local RAILS_ENV="production" |  | ||||||
| 	local RUBY=${RUBY:-/usr/bin/ruby} |  | ||||||
| 	local BUNDLE="${RUBY} /usr/bin/bundle" |  | ||||||
| 
 |  | ||||||
| 	# FIXME: this line existed in older ebuilds, but the variable is |  | ||||||
| 	# never used. what was it for!? |  | ||||||
| 	# local dbname="$(ryaml ${CONF_DIR}/database.yml production database)" |  | ||||||
| 
 |  | ||||||
| 	if [ "${update}" = 'true' ]; then |  | ||||||
| 		einfo "Migrating database ..." |  | ||||||
| 		exec_rake db:migrate |  | ||||||
| 
 |  | ||||||
| 		# https://github.com/gitlabhq/gitlabhq/issues/5311#issuecomment-31656496 |  | ||||||
| 		einfo "Migrating iids ..." |  | ||||||
| 		exec_rake migrate_iids |  | ||||||
| 
 |  | ||||||
| 		einfo "Cleaning old precompiled assets ..." |  | ||||||
| 		exec_rake assets:clean |  | ||||||
| 
 |  | ||||||
| 		einfo "Cleaning cache ..." |  | ||||||
| 		exec_rake cache:clear |  | ||||||
| 	else |  | ||||||
| 		# create dummy git repo as workaround for |  | ||||||
| 		# https://github.com/bundler/bundler/issues/2039 |  | ||||||
| 		einfo "Initializing dummy git repository to avoid false errors from bundler" |  | ||||||
| 		su -l ${MY_USER} -c " |  | ||||||
| 			cd ${DEST_DIR} |  | ||||||
| 			git init |  | ||||||
| 			git add README.md |  | ||||||
| 			git commit -m 'Dummy repository'" >/dev/null |  | ||||||
| 
 |  | ||||||
| 		einfo "Initializing database ..." |  | ||||||
| 		exec_rake gitlab:setup |  | ||||||
| 	fi |  | ||||||
| 
 |  | ||||||
| 	einfo "Precompiling assests ..." |  | ||||||
| 	exec_rake assets:precompile |  | ||||||
| 
 |  | ||||||
| 	if [ "${update}" = 'true' ]; then |  | ||||||
| 		ewarn |  | ||||||
| 		ewarn "This configuration script runs only common migration tasks." |  | ||||||
| 		ewarn "Please read guides on" |  | ||||||
| 		ewarn "    https://github.com/gitlabhq/gitlabhq/blob/master/doc/update/" |  | ||||||
| 		ewarn "for any additional migration tasks specific to your previous GitLab" |  | ||||||
| 		ewarn "version." |  | ||||||
| 	fi |  | ||||||
| 	elog |  | ||||||
| 	elog "If you want to make sure that the install/upgrade was successful, start" |  | ||||||
| 	elog "Gitlab now and then run these commands (as root):" |  | ||||||
| 	elog |  | ||||||
| 	elog "    cd /opt/gitlab" |  | ||||||
| 	elog "    sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production" |  | ||||||
| 	elog "    sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production" |  | ||||||
| 	elog |  | ||||||
| 	if ! use systemd ; then |  | ||||||
| 		elog "You may also run" |  | ||||||
| 		elog "    /etc/init.d/gitlab check" |  | ||||||
| 		elog " for convenience." |  | ||||||
| 	fi |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| ryaml() { |  | ||||||
| 	ruby -ryaml -e 'puts ARGV[1..-1].inject(YAML.load(File.read(ARGV[0]))) {|acc, key| acc[key] }' "$@" |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| exec_rake() { |  | ||||||
| 	local command="${BUNDLE} exec rake $@ RAILS_ENV=${RAILS_ENV}" |  | ||||||
| 
 |  | ||||||
| 	echo "   ${command}" |  | ||||||
| 	su -l ${MY_USER} -c " |  | ||||||
| 		export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8 |  | ||||||
| 		cd ${DEST_DIR} |  | ||||||
| 		${command}" \ |  | ||||||
| 		|| die "failed to run rake $@" |  | ||||||
| } |  | ||||||
|  | @ -1,392 +0,0 @@ | ||||||
| # Copyright 1999-2016 Gentoo Foundation |  | ||||||
| # Distributed under the terms of the GNU General Public License v2 |  | ||||||
| # $Id$ |  | ||||||
| 
 |  | ||||||
| EAPI="5" |  | ||||||
| 
 |  | ||||||
| # Maintainer notes: |  | ||||||
| # - This ebuild uses Bundler to download and install all gems in deployment mode |  | ||||||
| #   (i.e. into isolated directory inside application). That's not Gentoo way how |  | ||||||
| #   it should be done, but GitLab has too many dependencies that it will be too |  | ||||||
| #   difficult to maintain them via ebuilds. |  | ||||||
| # |  | ||||||
| 
 |  | ||||||
| USE_RUBY="ruby21 ruby23" |  | ||||||
| 
 |  | ||||||
| inherit eutils ruby-ng user systemd |  | ||||||
| 
 |  | ||||||
| MY_PV="v${PV/_/-}" |  | ||||||
| MY_GIT_COMMIT="e45bf3d32d771925ddc6152e0cc80b8c38ba768d" |  | ||||||
| 
 |  | ||||||
| DESCRIPTION="GitLab is a free project and repository management application" |  | ||||||
| HOMEPAGE="https://about.gitlab.com/" |  | ||||||
| SRC_URI="https://gitlab.com/gitlab-org/${PN}/repository/archive.tar.gz?ref=${MY_PV} -> ${P}.tar.gz" |  | ||||||
| RUBY_S="${PN}-${MY_PV}-${MY_GIT_COMMIT}" |  | ||||||
| 
 |  | ||||||
| RESTRICT="mirror" |  | ||||||
| 
 |  | ||||||
| LICENSE="MIT" |  | ||||||
| SLOT="0" |  | ||||||
| KEYWORDS="~amd64 ~x86 ~arm ~arm64" |  | ||||||
| IUSE="kerberos mysql +postgres +unicorn systemd rugged_use_system_libraries" |  | ||||||
| 
 |  | ||||||
| ## Gems dependencies: |  | ||||||
| #   charlock_holmes     dev-libs/icu |  | ||||||
| #   grape, capybara     dev-libs/libxml2, dev-libs/libxslt |  | ||||||
| #   rugged              dev-util/cmake, virtual/pkgconfig |  | ||||||
| #   json                dev-util/ragel |  | ||||||
| #   pygments.rb         python 2.7+ |  | ||||||
| #   execjs              net-libs/nodejs, or any other JS runtime |  | ||||||
| #   pg                  dev-db/postgresql |  | ||||||
| #   mysql               virtual/mysql |  | ||||||
| # |  | ||||||
| GEMS_DEPEND=" |  | ||||||
| 	dev-libs/icu |  | ||||||
| 	dev-libs/libxml2 |  | ||||||
| 	dev-libs/libxslt |  | ||||||
| 	dev-util/ragel |  | ||||||
| 	net-libs/nodejs |  | ||||||
| 	postgres? ( >=dev-db/postgresql-9.1:* ) |  | ||||||
| 	mysql? ( virtual/mysql ) |  | ||||||
| 	kerberos? ( virtual/krb5 )" |  | ||||||
| CDEPEND=" |  | ||||||
| 	dev-util/cmake |  | ||||||
| 	virtual/pkgconfig" |  | ||||||
| COMMON_DEPEND=" |  | ||||||
| 	${GEMS_DEPEND} |  | ||||||
| 	~dev-vcs/gitlab-shell-4.0.0 |  | ||||||
| 	>=dev-vcs/git-2.7.4 |  | ||||||
| 	~dev-vcs/gitlab-workhorse-1.0.0 |  | ||||||
| 	kerberos? ( !app-crypt/heimdal ) |  | ||||||
| 	rugged_use_system_libraries? ( net-libs/http-parser dev-libs/libgit2:0/24 )" |  | ||||||
| DEPEND=" |  | ||||||
| 	${CDEPEND} |  | ||||||
| 	${COMMON_DEPEND}" |  | ||||||
| RDEPEND=" |  | ||||||
| 	${COMMON_DEPEND} |  | ||||||
| 	>=dev-db/redis-2.8 |  | ||||||
| 	virtual/mta |  | ||||||
| 	systemd? ( sys-apps/systemd:0= )" |  | ||||||
| # dev-ruby/bundler should be >=1.13.6, but that doesn't exist yet in the tree. |  | ||||||
| ruby_add_bdepend " |  | ||||||
| 	virtual/rubygems |  | ||||||
| 	>=dev-ruby/bundler-1.0" |  | ||||||
| 
 |  | ||||||
| # |  | ||||||
| # fix-sendmail-config: |  | ||||||
| #     Fix default settings to work with ssmtp that doesn't know '-t' argument. |  | ||||||
| # fix-redis-config-path: |  | ||||||
| #     Point to the absolute location of redis_config.rb |  | ||||||
| # |  | ||||||
| RUBY_PATCHES=( |  | ||||||
| 	"01-${PN}-8.7.5-fix-sendmail-config.patch" |  | ||||||
| 	"02-${PN}-8.11.0-fix-redis-config-path.patch" |  | ||||||
| 	"03-${PN}-8.14.0-database.yml.patch" |  | ||||||
| 	"04-${PN}-8.12.7-fix-check-task.patch" |  | ||||||
| 	"05-${PN}-8.12.7-replace-sys-filesystem.patch" |  | ||||||
| ) |  | ||||||
| 
 |  | ||||||
| MY_NAME="gitlab" |  | ||||||
| MY_USER="git"    # should be same as in gitlab-shell |  | ||||||
| 
 |  | ||||||
| DEST_DIR="/opt/${MY_NAME}" |  | ||||||
| CONF_DIR="/etc/${MY_NAME}" |  | ||||||
| LOGS_DIR="/var/log/${MY_NAME}" |  | ||||||
| TEMP_DIR="/var/tmp/${MY_NAME}" |  | ||||||
| 
 |  | ||||||
| all_ruby_prepare() { |  | ||||||
| 	# fix paths |  | ||||||
| 	local satellites_path="${TEMP_DIR}/repo_satellites" |  | ||||||
| 	local repos_path=/var/lib/git/repositories |  | ||||||
| 	local shell_path=/usr/share/gitlab-shell |  | ||||||
| 	sed -i -E \ |  | ||||||
| 		-e "/satellites:$/,/\w:$/   s|(\s*path:\s).*|\1${satellites_path}/|" \ |  | ||||||
| 		-e "/gitlab_shell:$/,/\w:$/ s|(\s*path:\s).*|\1${shell_path}/|" \ |  | ||||||
| 		-e "/gitlab_shell:$/,/\w:$/ s|(\s*repos_path:\s).*|\1${repos_path}/|" \ |  | ||||||
| 		-e "/gitlab_shell:$/,/\w:$/ s|(\s*hooks_path:\s).*|\1${shell_path}/hooks/|" \ |  | ||||||
| 		config/gitlab.yml.example || die "failed to filter gitlab.yml.example" |  | ||||||
| 
 |  | ||||||
| 	local run_path=/run/${MY_NAME} |  | ||||||
| 	sed -i -E \ |  | ||||||
| 		-e "s|/home/git/gitlab/tmp/(pids\|sockets)|${run_path}|" \ |  | ||||||
| 		-e "s|/home/git/gitlab/log|${LOGS_DIR}|" \ |  | ||||||
| 		-e "s|/home/git/gitlab|${DEST_DIR}|" \ |  | ||||||
| 		config/unicorn.rb.example || die "failed to filter unicorn.rb.example" |  | ||||||
| 
 |  | ||||||
| 	sed -i \ |  | ||||||
| 		-e "s|/home/git/gitlab/tmp/sockets|${run_path}|" \ |  | ||||||
| 		lib/support/nginx/gitlab || die "failed to filter nginx/gitlab" |  | ||||||
| 
 |  | ||||||
| 	# modify default database settings for PostgreSQL |  | ||||||
| 	sed -i -E \ |  | ||||||
| 		-e 's|(username:).*|\1 gitlab|' \ |  | ||||||
| 		-e 's|(password:).*|\1 gitlab|' \ |  | ||||||
| 		-e 's|(socket:).*|\1 /run/postgresql/.s.PGSQL.5432|' \ |  | ||||||
| 		config/database.yml.postgresql \ |  | ||||||
| 		|| die "failed to filter database.yml.postgresql" |  | ||||||
| 
 |  | ||||||
| 	# rename config files |  | ||||||
| 	mv config/gitlab.yml.example config/gitlab.yml |  | ||||||
| 	mv config/unicorn.rb.example config/unicorn.rb |  | ||||||
| 
 |  | ||||||
| 	local dbconf=config/database.yml |  | ||||||
| 	if use postgres && ! use mysql; then |  | ||||||
| 		mv ${dbconf}.postgresql ${dbconf} |  | ||||||
| 		rm ${dbconf}.mysql |  | ||||||
| 	elif use mysql && ! use postgres; then |  | ||||||
| 		mv ${dbconf}.mysql ${dbconf} |  | ||||||
| 		rm ${dbconf}.postgresql |  | ||||||
| 	fi |  | ||||||
| 
 |  | ||||||
| 	# remove useless files |  | ||||||
| 	rm -r lib/support/{deploy,init.d} |  | ||||||
| 	use unicorn || rm config/unicorn.rb |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| all_ruby_install() { |  | ||||||
| 	local dest=${DEST_DIR} |  | ||||||
| 	local conf=${CONF_DIR} |  | ||||||
| 	local logs=${LOGS_DIR} |  | ||||||
| 	local temp=${TEMP_DIR} |  | ||||||
| 
 |  | ||||||
| 	# prepare directories |  | ||||||
| 	diropts -m750 |  | ||||||
| 	dodir ${logs} ${temp} |  | ||||||
| 
 |  | ||||||
| 	diropts -m755 |  | ||||||
| 	dodir ${conf} ${dest}/public/uploads |  | ||||||
| 
 |  | ||||||
| 	dosym ${temp} ${dest}/tmp |  | ||||||
| 	dosym ${logs} ${dest}/log |  | ||||||
| 
 |  | ||||||
| 	# install configs |  | ||||||
| 	insinto ${conf} |  | ||||||
| 	doins -r config/* |  | ||||||
| 	dosym ${conf} ${dest}/config |  | ||||||
| 
 |  | ||||||
| 	echo 'export RAILS_ENV=production' > "${D}/${dest}/.profile" |  | ||||||
| 
 |  | ||||||
| 	# remove needless dirs |  | ||||||
| 	rm -Rf config tmp log |  | ||||||
| 
 |  | ||||||
| 	# install the rest files |  | ||||||
| 	# using cp 'cause doins is slow |  | ||||||
| 	cp -Rl * "${D}/${dest}"/ |  | ||||||
| 
 |  | ||||||
| 	# install logrotate config |  | ||||||
| 	dodir /etc/logrotate.d |  | ||||||
| 	cat > "${D}/etc/logrotate.d/${MY_NAME}" <<-EOF |  | ||||||
| 		${logs}/*.log { |  | ||||||
| 		    missingok |  | ||||||
| 		    delaycompress |  | ||||||
| 		    compress |  | ||||||
| 		    copytruncate |  | ||||||
| 		} |  | ||||||
| 	EOF |  | ||||||
| 
 |  | ||||||
| 	## Install gems via bundler ## |  | ||||||
| 
 |  | ||||||
| 	cd "${D}/${dest}" |  | ||||||
| 
 |  | ||||||
| 	local without="development test aws" |  | ||||||
| 	local flag; for flag in mysql postgres unicorn kerberos; do |  | ||||||
| 		without+="$(use $flag || echo ' '$flag)" |  | ||||||
| 	done |  | ||||||
| 	local bundle_args="--deployment ${without:+--without ${without}}" |  | ||||||
| 
 |  | ||||||
| 	use "rugged_use_system_libraries" && export RUGGED_USE_SYSTEM_LIBRARIES="YES" |  | ||||||
| 
 |  | ||||||
| 	einfo "Running bundle install ${bundle_args} ..." |  | ||||||
| 	${RUBY} /usr/bin/bundle install ${bundle_args} || die "bundler failed" |  | ||||||
| 
 |  | ||||||
| 	einfo "Cleaning old gems ..." |  | ||||||
| 	${RUBY} /usr/bin/bundle clean |  | ||||||
| 
 |  | ||||||
| 	# clean gems cache |  | ||||||
| 	rm -Rf vendor/bundle/ruby/*/cache |  | ||||||
| 	rm -Rf vendor/bundle/ruby/*/bundler/gems/charlock_holmes-dde194609b35/.git |  | ||||||
| 
 |  | ||||||
| 	## RC script ## |  | ||||||
| 
 |  | ||||||
| 	if use systemd ; then |  | ||||||
| 		ewarn "Beware: systemd support has not been tested, use at your own risk!" |  | ||||||
| 		systemd_newunit "${FILESDIR}/gitlab-8.13.0-sidekiq.service" "gitlab-sidekiq.service" |  | ||||||
| 		systemd_dounit "${FILESDIR}/gitlab-unicorn.service" |  | ||||||
| 		systemd_dounit "${FILESDIR}/gitlab-workhorse.service" |  | ||||||
| 		systemd_dounit "${FILESDIR}/gitlab-mailroom.service" |  | ||||||
| 		systemd_dotmpfilesd "${FILESDIR}/gitlab.conf" |  | ||||||
| 	else |  | ||||||
| 		local rcscript=gitlab-8.13.3-sidekiq.init |  | ||||||
| 		use unicorn && rcscript=gitlab-8.13.3-unicorn.init |  | ||||||
| 
 |  | ||||||
| 		cp "${FILESDIR}/${rcscript}" "${T}" || die |  | ||||||
| 		sed -i \ |  | ||||||
| 			-e "s|@USER@|${MY_USER}|" \ |  | ||||||
| 			-e "s|@GITLAB_BASE@|${dest}|" \ |  | ||||||
| 			-e "s|@LOGS_DIR@|${logs}|" \ |  | ||||||
| 			"${T}/${rcscript}" \ |  | ||||||
| 			|| die "failed to filter ${rcscript}" |  | ||||||
| 
 |  | ||||||
| 		newinitd "${T}/${rcscript}" "${MY_NAME}" |  | ||||||
| 	fi |  | ||||||
| 
 |  | ||||||
| 	# fix permissions |  | ||||||
| 	fowners -R ${MY_USER}:${MY_USER} ${dest} ${temp} ${logs} |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| pkg_postinst() { |  | ||||||
| 	elog "If this is an update from a previous version, stop your GitLab" |  | ||||||
| 	elog "instance and issue the following command to perform all required" |  | ||||||
| 	elog "migrations:" |  | ||||||
| 	elog "       emerge --config \"=${CATEGORY}/${PF}\"" |  | ||||||
| 	elog "PLEASE NOTE: It's HIGHLY recommended to backup your database" |  | ||||||
| 	elog "before running the config phase. Run these commands (as root):" |  | ||||||
| 	elog |  | ||||||
| 	elog "    cd /opt/gitlab" |  | ||||||
| 	elog "    sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production" |  | ||||||
| 	elog |  | ||||||
| 	elog "If this was a fresh install, follow these steps:" |  | ||||||
| 	elog |  | ||||||
| 	elog "1. Configure your GitLab's settings in ${CONF_DIR}/gitlab.yml." |  | ||||||
| 	elog |  | ||||||
| 	elog "2. Configure your database settings in ${CONF_DIR}/database.yml" |  | ||||||
| 	elog "   for \"production\" environment." |  | ||||||
| 	elog |  | ||||||
| 	elog "3. Then you should create a database for your GitLab instance, if you" |  | ||||||
| 	elog "   haven't done so already." |  | ||||||
| 	elog |  | ||||||
| 	if use postgres; then |  | ||||||
| 		elog "If you have local PostgreSQL running, just copy&run:" |  | ||||||
| 		elog "      su postgres" |  | ||||||
| 		elog "      psql -c \"CREATE ROLE gitlab PASSWORD 'gitlab' \\" |  | ||||||
| 		elog "          NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;\"" |  | ||||||
| 		elog "      createdb -E UTF-8 -O gitlab gitlabhq_production" |  | ||||||
| 		elog "  Note: You should change your password to something more random..." |  | ||||||
| 		elog |  | ||||||
| 	fi |  | ||||||
| 	elog "4. Finally execute the following command to initialize the environment:" |  | ||||||
| 	elog "       emerge --config \"=${CATEGORY}/${PF}\"" |  | ||||||
| 	elog "   Note: Do not forget to start Redis server first!" |  | ||||||
| 	elog |  | ||||||
| 	elog "If you're running GitLab behind an SSL proxy such as nginx or Apache and" |  | ||||||
| 	elog "you can't login after the upgrade, be sure to read the section about the" |  | ||||||
| 	elog "verification of the CSRF token in GitLab's trouble-shooting guide at" |  | ||||||
| 	elog "http://goo.gl/5XGRGv." |  | ||||||
| 	if use postgres; then |  | ||||||
| 		elog "Please note: As of GitLab 8.6, users of PostgreSQL need to enable the" |  | ||||||
| 		elog "`pg_trgm` extension by running the following command as a PostgreSQL" |  | ||||||
| 		elog "super user for *every* GitLab database:" |  | ||||||
| 		elog "      CREATE EXTENSION IF NOT EXISTS pg_trgm;" |  | ||||||
| 		elog "For details, see the documentation at the GitLab website." |  | ||||||
| 	fi |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| pkg_config() { |  | ||||||
| 	einfo "Checking configuration files" |  | ||||||
| 
 |  | ||||||
| 	if [ ! -r "${CONF_DIR}/database.yml" ]; then |  | ||||||
| 		eerror "Copy ${CONF_DIR}/database.yml.* to" |  | ||||||
| 		eerror "${CONF_DIR}/database.yml and edit this file in order to configure your" |  | ||||||
| 		eerror "database settings for \"production\" environment."; die |  | ||||||
| 	fi |  | ||||||
| 
 |  | ||||||
| 	local email_from="$(ryaml ${CONF_DIR}/gitlab.yml production gitlab email_from)" |  | ||||||
| 	local git_home="$(egethome ${MY_USER})" |  | ||||||
| 
 |  | ||||||
| 	# configure Git global settings |  | ||||||
| 	if [ ! -e "${git_home}/.gitconfig" ]; then |  | ||||||
| 		einfo "Setting git user" |  | ||||||
| 		su -l ${MY_USER} -c " |  | ||||||
| 			git config --global user.email '${email_from}'; |  | ||||||
| 			git config --global user.name 'GitLab'" \ |  | ||||||
| 			|| die "failed to setup git name and email" |  | ||||||
| 	fi |  | ||||||
| 
 |  | ||||||
| 	su -l ${MY_USER} -c "git config --global repack.writeBitmaps true" |  | ||||||
| 
 |  | ||||||
| 	# determine whether this is an update or a fresh install. we do this by |  | ||||||
| 	# checking whether the ${DEST_DIR}/.git directory exists or not |  | ||||||
| 	#  |  | ||||||
| 	if [ -d "${DEST_DIR}/.git" ]; then |  | ||||||
| 		local update=true |  | ||||||
| 	else |  | ||||||
| 		local update=false |  | ||||||
| 	fi |  | ||||||
| 
 |  | ||||||
| 	## Initialize app ## |  | ||||||
| 
 |  | ||||||
| 	local RAILS_ENV="production" |  | ||||||
| 	local RUBY=${RUBY:-/usr/bin/ruby} |  | ||||||
| 	local BUNDLE="${RUBY} /usr/bin/bundle" |  | ||||||
| 
 |  | ||||||
| 	# FIXME: this line existed in older ebuilds, but the variable is |  | ||||||
| 	# never used. what was it for!? |  | ||||||
| 	# local dbname="$(ryaml ${CONF_DIR}/database.yml production database)" |  | ||||||
| 
 |  | ||||||
| 	if [ "${update}" = 'true' ]; then |  | ||||||
| 		einfo "Migrating database ..." |  | ||||||
| 		exec_rake db:migrate |  | ||||||
| 
 |  | ||||||
| 		# https://github.com/gitlabhq/gitlabhq/issues/5311#issuecomment-31656496 |  | ||||||
| 		einfo "Migrating iids ..." |  | ||||||
| 		exec_rake migrate_iids |  | ||||||
| 
 |  | ||||||
| 		einfo "Cleaning old precompiled assets ..." |  | ||||||
| 		exec_rake assets:clean |  | ||||||
| 
 |  | ||||||
| 		einfo "Cleaning cache ..." |  | ||||||
| 		exec_rake cache:clear |  | ||||||
| 	else |  | ||||||
| 		# create dummy git repo as workaround for |  | ||||||
| 		# https://github.com/bundler/bundler/issues/2039 |  | ||||||
| 		einfo "Initializing dummy git repository to avoid false errors from bundler" |  | ||||||
| 		su -l ${MY_USER} -c " |  | ||||||
| 			cd ${DEST_DIR} |  | ||||||
| 			git init |  | ||||||
| 			git add README.md |  | ||||||
| 			git commit -m 'Dummy repository'" >/dev/null |  | ||||||
| 
 |  | ||||||
| 		einfo "Initializing database ..." |  | ||||||
| 		exec_rake gitlab:setup |  | ||||||
| 	fi |  | ||||||
| 
 |  | ||||||
| 	einfo "Precompiling assests ..." |  | ||||||
| 	exec_rake assets:precompile |  | ||||||
| 
 |  | ||||||
| 	if [ "${update}" = 'true' ]; then |  | ||||||
| 		ewarn |  | ||||||
| 		ewarn "This configuration script runs only common migration tasks." |  | ||||||
| 		ewarn "Please read guides on" |  | ||||||
| 		ewarn "    https://github.com/gitlabhq/gitlabhq/blob/master/doc/update/" |  | ||||||
| 		ewarn "for any additional migration tasks specific to your previous GitLab" |  | ||||||
| 		ewarn "version." |  | ||||||
| 	fi |  | ||||||
| 	elog |  | ||||||
| 	elog "If you want to make sure that the install/upgrade was successful, start" |  | ||||||
| 	elog "Gitlab now and then run these commands (as root):" |  | ||||||
| 	elog |  | ||||||
| 	elog "    cd /opt/gitlab" |  | ||||||
| 	elog "    sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production" |  | ||||||
| 	elog "    sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production" |  | ||||||
| 	elog |  | ||||||
| 	if ! use systemd ; then |  | ||||||
| 		elog "You may also run" |  | ||||||
| 		elog "    /etc/init.d/gitlab check" |  | ||||||
| 		elog " for convenience." |  | ||||||
| 	fi |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| ryaml() { |  | ||||||
| 	ruby -ryaml -e 'puts ARGV[1..-1].inject(YAML.load(File.read(ARGV[0]))) {|acc, key| acc[key] }' "$@" |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| exec_rake() { |  | ||||||
| 	local command="${BUNDLE} exec rake $@ RAILS_ENV=${RAILS_ENV}" |  | ||||||
| 
 |  | ||||||
| 	echo "   ${command}" |  | ||||||
| 	su -l ${MY_USER} -c " |  | ||||||
| 		export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8 |  | ||||||
| 		cd ${DEST_DIR} |  | ||||||
| 		${command}" \ |  | ||||||
| 		|| die "failed to run rake $@" |  | ||||||
| } |  | ||||||
|  | @ -1,392 +0,0 @@ | ||||||
| # Copyright 1999-2016 Gentoo Foundation |  | ||||||
| # Distributed under the terms of the GNU General Public License v2 |  | ||||||
| # $Id$ |  | ||||||
| 
 |  | ||||||
| EAPI="5" |  | ||||||
| 
 |  | ||||||
| # Maintainer notes: |  | ||||||
| # - This ebuild uses Bundler to download and install all gems in deployment mode |  | ||||||
| #   (i.e. into isolated directory inside application). That's not Gentoo way how |  | ||||||
| #   it should be done, but GitLab has too many dependencies that it will be too |  | ||||||
| #   difficult to maintain them via ebuilds. |  | ||||||
| # |  | ||||||
| 
 |  | ||||||
| USE_RUBY="ruby21 ruby23" |  | ||||||
| 
 |  | ||||||
| inherit eutils ruby-ng user systemd |  | ||||||
| 
 |  | ||||||
| MY_PV="v${PV/_/-}" |  | ||||||
| MY_GIT_COMMIT="b9442a5eb08d79f33b7ac4d47576f2893ed2a91f" |  | ||||||
| 
 |  | ||||||
| DESCRIPTION="GitLab is a free project and repository management application" |  | ||||||
| HOMEPAGE="https://about.gitlab.com/" |  | ||||||
| SRC_URI="https://gitlab.com/gitlab-org/${PN}/repository/archive.tar.gz?ref=${MY_PV} -> ${P}.tar.gz" |  | ||||||
| RUBY_S="${PN}-${MY_PV}-${MY_GIT_COMMIT}" |  | ||||||
| 
 |  | ||||||
| RESTRICT="mirror" |  | ||||||
| 
 |  | ||||||
| LICENSE="MIT" |  | ||||||
| SLOT="0" |  | ||||||
| KEYWORDS="~amd64 ~x86 ~arm ~arm64" |  | ||||||
| IUSE="kerberos mysql +postgres +unicorn systemd rugged_use_system_libraries" |  | ||||||
| 
 |  | ||||||
| ## Gems dependencies: |  | ||||||
| #   charlock_holmes     dev-libs/icu |  | ||||||
| #   grape, capybara     dev-libs/libxml2, dev-libs/libxslt |  | ||||||
| #   rugged              dev-util/cmake, virtual/pkgconfig |  | ||||||
| #   json                dev-util/ragel |  | ||||||
| #   pygments.rb         python 2.7+ |  | ||||||
| #   execjs              net-libs/nodejs, or any other JS runtime |  | ||||||
| #   pg                  dev-db/postgresql |  | ||||||
| #   mysql               virtual/mysql |  | ||||||
| # |  | ||||||
| GEMS_DEPEND=" |  | ||||||
| 	dev-libs/icu |  | ||||||
| 	dev-libs/libxml2 |  | ||||||
| 	dev-libs/libxslt |  | ||||||
| 	dev-util/ragel |  | ||||||
| 	net-libs/nodejs |  | ||||||
| 	postgres? ( >=dev-db/postgresql-9.1:* ) |  | ||||||
| 	mysql? ( virtual/mysql ) |  | ||||||
| 	kerberos? ( virtual/krb5 )" |  | ||||||
| CDEPEND=" |  | ||||||
| 	dev-util/cmake |  | ||||||
| 	virtual/pkgconfig" |  | ||||||
| COMMON_DEPEND=" |  | ||||||
| 	${GEMS_DEPEND} |  | ||||||
| 	~dev-vcs/gitlab-shell-4.0.0 |  | ||||||
| 	>=dev-vcs/git-2.7.4 |  | ||||||
| 	~dev-vcs/gitlab-workhorse-1.0.1 |  | ||||||
| 	kerberos? ( !app-crypt/heimdal ) |  | ||||||
| 	rugged_use_system_libraries? ( net-libs/http-parser dev-libs/libgit2:0/24 )" |  | ||||||
| DEPEND=" |  | ||||||
| 	${CDEPEND} |  | ||||||
| 	${COMMON_DEPEND}" |  | ||||||
| RDEPEND=" |  | ||||||
| 	${COMMON_DEPEND} |  | ||||||
| 	>=dev-db/redis-2.8 |  | ||||||
| 	virtual/mta |  | ||||||
| 	systemd? ( sys-apps/systemd:0= )" |  | ||||||
| # dev-ruby/bundler should be >=1.13.6, but that doesn't exist yet in the tree. |  | ||||||
| ruby_add_bdepend " |  | ||||||
| 	virtual/rubygems |  | ||||||
| 	>=dev-ruby/bundler-1.0" |  | ||||||
| 
 |  | ||||||
| # |  | ||||||
| # fix-sendmail-config: |  | ||||||
| #     Fix default settings to work with ssmtp that doesn't know '-t' argument. |  | ||||||
| # fix-redis-config-path: |  | ||||||
| #     Point to the absolute location of redis_config.rb |  | ||||||
| # |  | ||||||
| RUBY_PATCHES=( |  | ||||||
| 	"01-${PN}-8.7.5-fix-sendmail-config.patch" |  | ||||||
| 	"02-${PN}-8.11.0-fix-redis-config-path.patch" |  | ||||||
| 	"03-${PN}-8.14.0-database.yml.patch" |  | ||||||
| 	"04-${PN}-8.12.7-fix-check-task.patch" |  | ||||||
| 	"05-${PN}-8.12.7-replace-sys-filesystem.patch" |  | ||||||
| ) |  | ||||||
| 
 |  | ||||||
| MY_NAME="gitlab" |  | ||||||
| MY_USER="git"    # should be same as in gitlab-shell |  | ||||||
| 
 |  | ||||||
| DEST_DIR="/opt/${MY_NAME}" |  | ||||||
| CONF_DIR="/etc/${MY_NAME}" |  | ||||||
| LOGS_DIR="/var/log/${MY_NAME}" |  | ||||||
| TEMP_DIR="/var/tmp/${MY_NAME}" |  | ||||||
| 
 |  | ||||||
| all_ruby_prepare() { |  | ||||||
| 	# fix paths |  | ||||||
| 	local satellites_path="${TEMP_DIR}/repo_satellites" |  | ||||||
| 	local repos_path=/var/lib/git/repositories |  | ||||||
| 	local shell_path=/usr/share/gitlab-shell |  | ||||||
| 	sed -i -E \ |  | ||||||
| 		-e "/satellites:$/,/\w:$/   s|(\s*path:\s).*|\1${satellites_path}/|" \ |  | ||||||
| 		-e "/gitlab_shell:$/,/\w:$/ s|(\s*path:\s).*|\1${shell_path}/|" \ |  | ||||||
| 		-e "/gitlab_shell:$/,/\w:$/ s|(\s*repos_path:\s).*|\1${repos_path}/|" \ |  | ||||||
| 		-e "/gitlab_shell:$/,/\w:$/ s|(\s*hooks_path:\s).*|\1${shell_path}/hooks/|" \ |  | ||||||
| 		config/gitlab.yml.example || die "failed to filter gitlab.yml.example" |  | ||||||
| 
 |  | ||||||
| 	local run_path=/run/${MY_NAME} |  | ||||||
| 	sed -i -E \ |  | ||||||
| 		-e "s|/home/git/gitlab/tmp/(pids\|sockets)|${run_path}|" \ |  | ||||||
| 		-e "s|/home/git/gitlab/log|${LOGS_DIR}|" \ |  | ||||||
| 		-e "s|/home/git/gitlab|${DEST_DIR}|" \ |  | ||||||
| 		config/unicorn.rb.example || die "failed to filter unicorn.rb.example" |  | ||||||
| 
 |  | ||||||
| 	sed -i \ |  | ||||||
| 		-e "s|/home/git/gitlab/tmp/sockets|${run_path}|" \ |  | ||||||
| 		lib/support/nginx/gitlab || die "failed to filter nginx/gitlab" |  | ||||||
| 
 |  | ||||||
| 	# modify default database settings for PostgreSQL |  | ||||||
| 	sed -i -E \ |  | ||||||
| 		-e 's|(username:).*|\1 gitlab|' \ |  | ||||||
| 		-e 's|(password:).*|\1 gitlab|' \ |  | ||||||
| 		-e 's|(socket:).*|\1 /run/postgresql/.s.PGSQL.5432|' \ |  | ||||||
| 		config/database.yml.postgresql \ |  | ||||||
| 		|| die "failed to filter database.yml.postgresql" |  | ||||||
| 
 |  | ||||||
| 	# rename config files |  | ||||||
| 	mv config/gitlab.yml.example config/gitlab.yml |  | ||||||
| 	mv config/unicorn.rb.example config/unicorn.rb |  | ||||||
| 
 |  | ||||||
| 	local dbconf=config/database.yml |  | ||||||
| 	if use postgres && ! use mysql; then |  | ||||||
| 		mv ${dbconf}.postgresql ${dbconf} |  | ||||||
| 		rm ${dbconf}.mysql |  | ||||||
| 	elif use mysql && ! use postgres; then |  | ||||||
| 		mv ${dbconf}.mysql ${dbconf} |  | ||||||
| 		rm ${dbconf}.postgresql |  | ||||||
| 	fi |  | ||||||
| 
 |  | ||||||
| 	# remove useless files |  | ||||||
| 	rm -r lib/support/{deploy,init.d} |  | ||||||
| 	use unicorn || rm config/unicorn.rb |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| all_ruby_install() { |  | ||||||
| 	local dest=${DEST_DIR} |  | ||||||
| 	local conf=${CONF_DIR} |  | ||||||
| 	local logs=${LOGS_DIR} |  | ||||||
| 	local temp=${TEMP_DIR} |  | ||||||
| 
 |  | ||||||
| 	# prepare directories |  | ||||||
| 	diropts -m750 |  | ||||||
| 	dodir ${logs} ${temp} |  | ||||||
| 
 |  | ||||||
| 	diropts -m755 |  | ||||||
| 	dodir ${conf} ${dest}/public/uploads |  | ||||||
| 
 |  | ||||||
| 	dosym ${temp} ${dest}/tmp |  | ||||||
| 	dosym ${logs} ${dest}/log |  | ||||||
| 
 |  | ||||||
| 	# install configs |  | ||||||
| 	insinto ${conf} |  | ||||||
| 	doins -r config/* |  | ||||||
| 	dosym ${conf} ${dest}/config |  | ||||||
| 
 |  | ||||||
| 	echo 'export RAILS_ENV=production' > "${D}/${dest}/.profile" |  | ||||||
| 
 |  | ||||||
| 	# remove needless dirs |  | ||||||
| 	rm -Rf config tmp log |  | ||||||
| 
 |  | ||||||
| 	# install the rest files |  | ||||||
| 	# using cp 'cause doins is slow |  | ||||||
| 	cp -Rl * "${D}/${dest}"/ |  | ||||||
| 
 |  | ||||||
| 	# install logrotate config |  | ||||||
| 	dodir /etc/logrotate.d |  | ||||||
| 	cat > "${D}/etc/logrotate.d/${MY_NAME}" <<-EOF |  | ||||||
| 		${logs}/*.log { |  | ||||||
| 		    missingok |  | ||||||
| 		    delaycompress |  | ||||||
| 		    compress |  | ||||||
| 		    copytruncate |  | ||||||
| 		} |  | ||||||
| 	EOF |  | ||||||
| 
 |  | ||||||
| 	## Install gems via bundler ## |  | ||||||
| 
 |  | ||||||
| 	cd "${D}/${dest}" |  | ||||||
| 
 |  | ||||||
| 	local without="development test aws" |  | ||||||
| 	local flag; for flag in mysql postgres unicorn kerberos; do |  | ||||||
| 		without+="$(use $flag || echo ' '$flag)" |  | ||||||
| 	done |  | ||||||
| 	local bundle_args="--deployment ${without:+--without ${without}}" |  | ||||||
| 
 |  | ||||||
| 	use "rugged_use_system_libraries" && export RUGGED_USE_SYSTEM_LIBRARIES="YES" |  | ||||||
| 
 |  | ||||||
| 	einfo "Running bundle install ${bundle_args} ..." |  | ||||||
| 	${RUBY} /usr/bin/bundle install ${bundle_args} || die "bundler failed" |  | ||||||
| 
 |  | ||||||
| 	einfo "Cleaning old gems ..." |  | ||||||
| 	${RUBY} /usr/bin/bundle clean |  | ||||||
| 
 |  | ||||||
| 	# clean gems cache |  | ||||||
| 	rm -Rf vendor/bundle/ruby/*/cache |  | ||||||
| 	rm -Rf vendor/bundle/ruby/*/bundler/gems/charlock_holmes-dde194609b35/.git |  | ||||||
| 
 |  | ||||||
| 	## RC script ## |  | ||||||
| 
 |  | ||||||
| 	if use systemd ; then |  | ||||||
| 		ewarn "Beware: systemd support has not been tested, use at your own risk!" |  | ||||||
| 		systemd_newunit "${FILESDIR}/gitlab-8.13.0-sidekiq.service" "gitlab-sidekiq.service" |  | ||||||
| 		systemd_dounit "${FILESDIR}/gitlab-unicorn.service" |  | ||||||
| 		systemd_dounit "${FILESDIR}/gitlab-workhorse.service" |  | ||||||
| 		systemd_dounit "${FILESDIR}/gitlab-mailroom.service" |  | ||||||
| 		systemd_dotmpfilesd "${FILESDIR}/gitlab.conf" |  | ||||||
| 	else |  | ||||||
| 		local rcscript=gitlab-8.13.3-sidekiq.init |  | ||||||
| 		use unicorn && rcscript=gitlab-8.13.3-unicorn.init |  | ||||||
| 
 |  | ||||||
| 		cp "${FILESDIR}/${rcscript}" "${T}" || die |  | ||||||
| 		sed -i \ |  | ||||||
| 			-e "s|@USER@|${MY_USER}|" \ |  | ||||||
| 			-e "s|@GITLAB_BASE@|${dest}|" \ |  | ||||||
| 			-e "s|@LOGS_DIR@|${logs}|" \ |  | ||||||
| 			"${T}/${rcscript}" \ |  | ||||||
| 			|| die "failed to filter ${rcscript}" |  | ||||||
| 
 |  | ||||||
| 		newinitd "${T}/${rcscript}" "${MY_NAME}" |  | ||||||
| 	fi |  | ||||||
| 
 |  | ||||||
| 	# fix permissions |  | ||||||
| 	fowners -R ${MY_USER}:${MY_USER} ${dest} ${temp} ${logs} |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| pkg_postinst() { |  | ||||||
| 	elog "If this is an update from a previous version, stop your GitLab" |  | ||||||
| 	elog "instance and issue the following command to perform all required" |  | ||||||
| 	elog "migrations:" |  | ||||||
| 	elog "       emerge --config \"=${CATEGORY}/${PF}\"" |  | ||||||
| 	elog "PLEASE NOTE: It's HIGHLY recommended to backup your database" |  | ||||||
| 	elog "before running the config phase. Run these commands (as root):" |  | ||||||
| 	elog |  | ||||||
| 	elog "    cd /opt/gitlab" |  | ||||||
| 	elog "    sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production" |  | ||||||
| 	elog |  | ||||||
| 	elog "If this was a fresh install, follow these steps:" |  | ||||||
| 	elog |  | ||||||
| 	elog "1. Configure your GitLab's settings in ${CONF_DIR}/gitlab.yml." |  | ||||||
| 	elog |  | ||||||
| 	elog "2. Configure your database settings in ${CONF_DIR}/database.yml" |  | ||||||
| 	elog "   for \"production\" environment." |  | ||||||
| 	elog |  | ||||||
| 	elog "3. Then you should create a database for your GitLab instance, if you" |  | ||||||
| 	elog "   haven't done so already." |  | ||||||
| 	elog |  | ||||||
| 	if use postgres; then |  | ||||||
| 		elog "If you have local PostgreSQL running, just copy&run:" |  | ||||||
| 		elog "      su postgres" |  | ||||||
| 		elog "      psql -c \"CREATE ROLE gitlab PASSWORD 'gitlab' \\" |  | ||||||
| 		elog "          NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;\"" |  | ||||||
| 		elog "      createdb -E UTF-8 -O gitlab gitlabhq_production" |  | ||||||
| 		elog "  Note: You should change your password to something more random..." |  | ||||||
| 		elog |  | ||||||
| 	fi |  | ||||||
| 	elog "4. Finally execute the following command to initialize the environment:" |  | ||||||
| 	elog "       emerge --config \"=${CATEGORY}/${PF}\"" |  | ||||||
| 	elog "   Note: Do not forget to start Redis server first!" |  | ||||||
| 	elog |  | ||||||
| 	elog "If you're running GitLab behind an SSL proxy such as nginx or Apache and" |  | ||||||
| 	elog "you can't login after the upgrade, be sure to read the section about the" |  | ||||||
| 	elog "verification of the CSRF token in GitLab's trouble-shooting guide at" |  | ||||||
| 	elog "http://goo.gl/5XGRGv." |  | ||||||
| 	if use postgres; then |  | ||||||
| 		elog "Please note: As of GitLab 8.6, users of PostgreSQL need to enable the" |  | ||||||
| 		elog "`pg_trgm` extension by running the following command as a PostgreSQL" |  | ||||||
| 		elog "super user for *every* GitLab database:" |  | ||||||
| 		elog "      CREATE EXTENSION IF NOT EXISTS pg_trgm;" |  | ||||||
| 		elog "For details, see the documentation at the GitLab website." |  | ||||||
| 	fi |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| pkg_config() { |  | ||||||
| 	einfo "Checking configuration files" |  | ||||||
| 
 |  | ||||||
| 	if [ ! -r "${CONF_DIR}/database.yml" ]; then |  | ||||||
| 		eerror "Copy ${CONF_DIR}/database.yml.* to" |  | ||||||
| 		eerror "${CONF_DIR}/database.yml and edit this file in order to configure your" |  | ||||||
| 		eerror "database settings for \"production\" environment."; die |  | ||||||
| 	fi |  | ||||||
| 
 |  | ||||||
| 	local email_from="$(ryaml ${CONF_DIR}/gitlab.yml production gitlab email_from)" |  | ||||||
| 	local git_home="$(egethome ${MY_USER})" |  | ||||||
| 
 |  | ||||||
| 	# configure Git global settings |  | ||||||
| 	if [ ! -e "${git_home}/.gitconfig" ]; then |  | ||||||
| 		einfo "Setting git user" |  | ||||||
| 		su -l ${MY_USER} -c " |  | ||||||
| 			git config --global user.email '${email_from}'; |  | ||||||
| 			git config --global user.name 'GitLab'" \ |  | ||||||
| 			|| die "failed to setup git name and email" |  | ||||||
| 	fi |  | ||||||
| 
 |  | ||||||
| 	su -l ${MY_USER} -c "git config --global repack.writeBitmaps true" |  | ||||||
| 
 |  | ||||||
| 	# determine whether this is an update or a fresh install. we do this by |  | ||||||
| 	# checking whether the ${DEST_DIR}/.git directory exists or not |  | ||||||
| 	#  |  | ||||||
| 	if [ -d "${DEST_DIR}/.git" ]; then |  | ||||||
| 		local update=true |  | ||||||
| 	else |  | ||||||
| 		local update=false |  | ||||||
| 	fi |  | ||||||
| 
 |  | ||||||
| 	## Initialize app ## |  | ||||||
| 
 |  | ||||||
| 	local RAILS_ENV="production" |  | ||||||
| 	local RUBY=${RUBY:-/usr/bin/ruby} |  | ||||||
| 	local BUNDLE="${RUBY} /usr/bin/bundle" |  | ||||||
| 
 |  | ||||||
| 	# FIXME: this line existed in older ebuilds, but the variable is |  | ||||||
| 	# never used. what was it for!? |  | ||||||
| 	# local dbname="$(ryaml ${CONF_DIR}/database.yml production database)" |  | ||||||
| 
 |  | ||||||
| 	if [ "${update}" = 'true' ]; then |  | ||||||
| 		einfo "Migrating database ..." |  | ||||||
| 		exec_rake db:migrate |  | ||||||
| 
 |  | ||||||
| 		# https://github.com/gitlabhq/gitlabhq/issues/5311#issuecomment-31656496 |  | ||||||
| 		einfo "Migrating iids ..." |  | ||||||
| 		exec_rake migrate_iids |  | ||||||
| 
 |  | ||||||
| 		einfo "Cleaning old precompiled assets ..." |  | ||||||
| 		exec_rake assets:clean |  | ||||||
| 
 |  | ||||||
| 		einfo "Cleaning cache ..." |  | ||||||
| 		exec_rake cache:clear |  | ||||||
| 	else |  | ||||||
| 		# create dummy git repo as workaround for |  | ||||||
| 		# https://github.com/bundler/bundler/issues/2039 |  | ||||||
| 		einfo "Initializing dummy git repository to avoid false errors from bundler" |  | ||||||
| 		su -l ${MY_USER} -c " |  | ||||||
| 			cd ${DEST_DIR} |  | ||||||
| 			git init |  | ||||||
| 			git add README.md |  | ||||||
| 			git commit -m 'Dummy repository'" >/dev/null |  | ||||||
| 
 |  | ||||||
| 		einfo "Initializing database ..." |  | ||||||
| 		exec_rake gitlab:setup |  | ||||||
| 	fi |  | ||||||
| 
 |  | ||||||
| 	einfo "Precompiling assests ..." |  | ||||||
| 	exec_rake assets:precompile |  | ||||||
| 
 |  | ||||||
| 	if [ "${update}" = 'true' ]; then |  | ||||||
| 		ewarn |  | ||||||
| 		ewarn "This configuration script runs only common migration tasks." |  | ||||||
| 		ewarn "Please read guides on" |  | ||||||
| 		ewarn "    https://github.com/gitlabhq/gitlabhq/blob/master/doc/update/" |  | ||||||
| 		ewarn "for any additional migration tasks specific to your previous GitLab" |  | ||||||
| 		ewarn "version." |  | ||||||
| 	fi |  | ||||||
| 	elog |  | ||||||
| 	elog "If you want to make sure that the install/upgrade was successful, start" |  | ||||||
| 	elog "Gitlab now and then run these commands (as root):" |  | ||||||
| 	elog |  | ||||||
| 	elog "    cd /opt/gitlab" |  | ||||||
| 	elog "    sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production" |  | ||||||
| 	elog "    sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production" |  | ||||||
| 	elog |  | ||||||
| 	if ! use systemd ; then |  | ||||||
| 		elog "You may also run" |  | ||||||
| 		elog "    /etc/init.d/gitlab check" |  | ||||||
| 		elog " for convenience." |  | ||||||
| 	fi |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| ryaml() { |  | ||||||
| 	ruby -ryaml -e 'puts ARGV[1..-1].inject(YAML.load(File.read(ARGV[0]))) {|acc, key| acc[key] }' "$@" |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| exec_rake() { |  | ||||||
| 	local command="${BUNDLE} exec rake $@ RAILS_ENV=${RAILS_ENV}" |  | ||||||
| 
 |  | ||||||
| 	echo "   ${command}" |  | ||||||
| 	su -l ${MY_USER} -c " |  | ||||||
| 		export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8 |  | ||||||
| 		cd ${DEST_DIR} |  | ||||||
| 		${command}" \ |  | ||||||
| 		|| die "failed to run rake $@" |  | ||||||
| } |  | ||||||
|  | @ -1,392 +0,0 @@ | ||||||
| # Copyright 1999-2016 Gentoo Foundation |  | ||||||
| # Distributed under the terms of the GNU General Public License v2 |  | ||||||
| # $Id$ |  | ||||||
| 
 |  | ||||||
| EAPI="5" |  | ||||||
| 
 |  | ||||||
| # Maintainer notes: |  | ||||||
| # - This ebuild uses Bundler to download and install all gems in deployment mode |  | ||||||
| #   (i.e. into isolated directory inside application). That's not Gentoo way how |  | ||||||
| #   it should be done, but GitLab has too many dependencies that it will be too |  | ||||||
| #   difficult to maintain them via ebuilds. |  | ||||||
| # |  | ||||||
| 
 |  | ||||||
| USE_RUBY="ruby21 ruby23" |  | ||||||
| 
 |  | ||||||
| inherit eutils ruby-ng user systemd |  | ||||||
| 
 |  | ||||||
| MY_PV="v${PV/_/-}" |  | ||||||
| MY_GIT_COMMIT="2f0065b28909fa328bd43a92b731eea012a35c2c" |  | ||||||
| 
 |  | ||||||
| DESCRIPTION="GitLab is a free project and repository management application" |  | ||||||
| HOMEPAGE="https://about.gitlab.com/" |  | ||||||
| SRC_URI="https://gitlab.com/gitlab-org/${PN}/repository/archive.tar.gz?ref=${MY_PV} -> ${P}.tar.gz" |  | ||||||
| RUBY_S="${PN}-${MY_PV}-${MY_GIT_COMMIT}" |  | ||||||
| 
 |  | ||||||
| RESTRICT="mirror" |  | ||||||
| 
 |  | ||||||
| LICENSE="MIT" |  | ||||||
| SLOT="0" |  | ||||||
| KEYWORDS="~amd64 ~x86 ~arm ~arm64" |  | ||||||
| IUSE="kerberos mysql +postgres +unicorn systemd rugged_use_system_libraries" |  | ||||||
| 
 |  | ||||||
| ## Gems dependencies: |  | ||||||
| #   charlock_holmes     dev-libs/icu |  | ||||||
| #   grape, capybara     dev-libs/libxml2, dev-libs/libxslt |  | ||||||
| #   rugged              dev-util/cmake, virtual/pkgconfig |  | ||||||
| #   json                dev-util/ragel |  | ||||||
| #   pygments.rb         python 2.7+ |  | ||||||
| #   execjs              net-libs/nodejs, or any other JS runtime |  | ||||||
| #   pg                  dev-db/postgresql |  | ||||||
| #   mysql               virtual/mysql |  | ||||||
| # |  | ||||||
| GEMS_DEPEND=" |  | ||||||
| 	dev-libs/icu |  | ||||||
| 	dev-libs/libxml2 |  | ||||||
| 	dev-libs/libxslt |  | ||||||
| 	dev-util/ragel |  | ||||||
| 	net-libs/nodejs |  | ||||||
| 	postgres? ( >=dev-db/postgresql-9.1:* ) |  | ||||||
| 	mysql? ( virtual/mysql ) |  | ||||||
| 	kerberos? ( virtual/krb5 )" |  | ||||||
| CDEPEND=" |  | ||||||
| 	dev-util/cmake |  | ||||||
| 	virtual/pkgconfig" |  | ||||||
| COMMON_DEPEND=" |  | ||||||
| 	${GEMS_DEPEND} |  | ||||||
| 	~dev-vcs/gitlab-shell-4.0.0 |  | ||||||
| 	>=dev-vcs/git-2.7.4 |  | ||||||
| 	~dev-vcs/gitlab-workhorse-1.0.1 |  | ||||||
| 	kerberos? ( !app-crypt/heimdal ) |  | ||||||
| 	rugged_use_system_libraries? ( net-libs/http-parser dev-libs/libgit2:0/24 )" |  | ||||||
| DEPEND=" |  | ||||||
| 	${CDEPEND} |  | ||||||
| 	${COMMON_DEPEND}" |  | ||||||
| RDEPEND=" |  | ||||||
| 	${COMMON_DEPEND} |  | ||||||
| 	>=dev-db/redis-2.8 |  | ||||||
| 	virtual/mta |  | ||||||
| 	systemd? ( sys-apps/systemd:0= )" |  | ||||||
| # dev-ruby/bundler should be >=1.13.6, but that doesn't exist yet in the tree. |  | ||||||
| ruby_add_bdepend " |  | ||||||
| 	virtual/rubygems |  | ||||||
| 	>=dev-ruby/bundler-1.0" |  | ||||||
| 
 |  | ||||||
| # |  | ||||||
| # fix-sendmail-config: |  | ||||||
| #     Fix default settings to work with ssmtp that doesn't know '-t' argument. |  | ||||||
| # fix-redis-config-path: |  | ||||||
| #     Point to the absolute location of redis_config.rb |  | ||||||
| # |  | ||||||
| RUBY_PATCHES=( |  | ||||||
| 	"01-${PN}-8.7.5-fix-sendmail-config.patch" |  | ||||||
| 	"02-${PN}-8.11.0-fix-redis-config-path.patch" |  | ||||||
| 	"03-${PN}-8.14.0-database.yml.patch" |  | ||||||
| 	"04-${PN}-8.12.7-fix-check-task.patch" |  | ||||||
| 	"05-${PN}-8.12.7-replace-sys-filesystem.patch" |  | ||||||
| ) |  | ||||||
| 
 |  | ||||||
| MY_NAME="gitlab" |  | ||||||
| MY_USER="git"    # should be same as in gitlab-shell |  | ||||||
| 
 |  | ||||||
| DEST_DIR="/opt/${MY_NAME}" |  | ||||||
| CONF_DIR="/etc/${MY_NAME}" |  | ||||||
| LOGS_DIR="/var/log/${MY_NAME}" |  | ||||||
| TEMP_DIR="/var/tmp/${MY_NAME}" |  | ||||||
| 
 |  | ||||||
| all_ruby_prepare() { |  | ||||||
| 	# fix paths |  | ||||||
| 	local satellites_path="${TEMP_DIR}/repo_satellites" |  | ||||||
| 	local repos_path=/var/lib/git/repositories |  | ||||||
| 	local shell_path=/usr/share/gitlab-shell |  | ||||||
| 	sed -i -E \ |  | ||||||
| 		-e "/satellites:$/,/\w:$/   s|(\s*path:\s).*|\1${satellites_path}/|" \ |  | ||||||
| 		-e "/gitlab_shell:$/,/\w:$/ s|(\s*path:\s).*|\1${shell_path}/|" \ |  | ||||||
| 		-e "/gitlab_shell:$/,/\w:$/ s|(\s*repos_path:\s).*|\1${repos_path}/|" \ |  | ||||||
| 		-e "/gitlab_shell:$/,/\w:$/ s|(\s*hooks_path:\s).*|\1${shell_path}/hooks/|" \ |  | ||||||
| 		config/gitlab.yml.example || die "failed to filter gitlab.yml.example" |  | ||||||
| 
 |  | ||||||
| 	local run_path=/run/${MY_NAME} |  | ||||||
| 	sed -i -E \ |  | ||||||
| 		-e "s|/home/git/gitlab/tmp/(pids\|sockets)|${run_path}|" \ |  | ||||||
| 		-e "s|/home/git/gitlab/log|${LOGS_DIR}|" \ |  | ||||||
| 		-e "s|/home/git/gitlab|${DEST_DIR}|" \ |  | ||||||
| 		config/unicorn.rb.example || die "failed to filter unicorn.rb.example" |  | ||||||
| 
 |  | ||||||
| 	sed -i \ |  | ||||||
| 		-e "s|/home/git/gitlab/tmp/sockets|${run_path}|" \ |  | ||||||
| 		lib/support/nginx/gitlab || die "failed to filter nginx/gitlab" |  | ||||||
| 
 |  | ||||||
| 	# modify default database settings for PostgreSQL |  | ||||||
| 	sed -i -E \ |  | ||||||
| 		-e 's|(username:).*|\1 gitlab|' \ |  | ||||||
| 		-e 's|(password:).*|\1 gitlab|' \ |  | ||||||
| 		-e 's|(socket:).*|\1 /run/postgresql/.s.PGSQL.5432|' \ |  | ||||||
| 		config/database.yml.postgresql \ |  | ||||||
| 		|| die "failed to filter database.yml.postgresql" |  | ||||||
| 
 |  | ||||||
| 	# rename config files |  | ||||||
| 	mv config/gitlab.yml.example config/gitlab.yml |  | ||||||
| 	mv config/unicorn.rb.example config/unicorn.rb |  | ||||||
| 
 |  | ||||||
| 	local dbconf=config/database.yml |  | ||||||
| 	if use postgres && ! use mysql; then |  | ||||||
| 		mv ${dbconf}.postgresql ${dbconf} |  | ||||||
| 		rm ${dbconf}.mysql |  | ||||||
| 	elif use mysql && ! use postgres; then |  | ||||||
| 		mv ${dbconf}.mysql ${dbconf} |  | ||||||
| 		rm ${dbconf}.postgresql |  | ||||||
| 	fi |  | ||||||
| 
 |  | ||||||
| 	# remove useless files |  | ||||||
| 	rm -r lib/support/{deploy,init.d} |  | ||||||
| 	use unicorn || rm config/unicorn.rb |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| all_ruby_install() { |  | ||||||
| 	local dest=${DEST_DIR} |  | ||||||
| 	local conf=${CONF_DIR} |  | ||||||
| 	local logs=${LOGS_DIR} |  | ||||||
| 	local temp=${TEMP_DIR} |  | ||||||
| 
 |  | ||||||
| 	# prepare directories |  | ||||||
| 	diropts -m750 |  | ||||||
| 	dodir ${logs} ${temp} |  | ||||||
| 
 |  | ||||||
| 	diropts -m755 |  | ||||||
| 	dodir ${conf} ${dest}/public/uploads |  | ||||||
| 
 |  | ||||||
| 	dosym ${temp} ${dest}/tmp |  | ||||||
| 	dosym ${logs} ${dest}/log |  | ||||||
| 
 |  | ||||||
| 	# install configs |  | ||||||
| 	insinto ${conf} |  | ||||||
| 	doins -r config/* |  | ||||||
| 	dosym ${conf} ${dest}/config |  | ||||||
| 
 |  | ||||||
| 	echo 'export RAILS_ENV=production' > "${D}/${dest}/.profile" |  | ||||||
| 
 |  | ||||||
| 	# remove needless dirs |  | ||||||
| 	rm -Rf config tmp log |  | ||||||
| 
 |  | ||||||
| 	# install the rest files |  | ||||||
| 	# using cp 'cause doins is slow |  | ||||||
| 	cp -Rl * "${D}/${dest}"/ |  | ||||||
| 
 |  | ||||||
| 	# install logrotate config |  | ||||||
| 	dodir /etc/logrotate.d |  | ||||||
| 	cat > "${D}/etc/logrotate.d/${MY_NAME}" <<-EOF |  | ||||||
| 		${logs}/*.log { |  | ||||||
| 		    missingok |  | ||||||
| 		    delaycompress |  | ||||||
| 		    compress |  | ||||||
| 		    copytruncate |  | ||||||
| 		} |  | ||||||
| 	EOF |  | ||||||
| 
 |  | ||||||
| 	## Install gems via bundler ## |  | ||||||
| 
 |  | ||||||
| 	cd "${D}/${dest}" |  | ||||||
| 
 |  | ||||||
| 	local without="development test aws" |  | ||||||
| 	local flag; for flag in mysql postgres unicorn kerberos; do |  | ||||||
| 		without+="$(use $flag || echo ' '$flag)" |  | ||||||
| 	done |  | ||||||
| 	local bundle_args="--deployment ${without:+--without ${without}}" |  | ||||||
| 
 |  | ||||||
| 	use "rugged_use_system_libraries" && export RUGGED_USE_SYSTEM_LIBRARIES="YES" |  | ||||||
| 
 |  | ||||||
| 	einfo "Running bundle install ${bundle_args} ..." |  | ||||||
| 	${RUBY} /usr/bin/bundle install ${bundle_args} || die "bundler failed" |  | ||||||
| 
 |  | ||||||
| 	einfo "Cleaning old gems ..." |  | ||||||
| 	${RUBY} /usr/bin/bundle clean |  | ||||||
| 
 |  | ||||||
| 	# clean gems cache |  | ||||||
| 	rm -Rf vendor/bundle/ruby/*/cache |  | ||||||
| 	rm -Rf vendor/bundle/ruby/*/bundler/gems/charlock_holmes-dde194609b35/.git |  | ||||||
| 
 |  | ||||||
| 	## RC script ## |  | ||||||
| 
 |  | ||||||
| 	if use systemd ; then |  | ||||||
| 		ewarn "Beware: systemd support has not been tested, use at your own risk!" |  | ||||||
| 		systemd_newunit "${FILESDIR}/gitlab-8.13.0-sidekiq.service" "gitlab-sidekiq.service" |  | ||||||
| 		systemd_dounit "${FILESDIR}/gitlab-unicorn.service" |  | ||||||
| 		systemd_dounit "${FILESDIR}/gitlab-workhorse.service" |  | ||||||
| 		systemd_dounit "${FILESDIR}/gitlab-mailroom.service" |  | ||||||
| 		systemd_dotmpfilesd "${FILESDIR}/gitlab.conf" |  | ||||||
| 	else |  | ||||||
| 		local rcscript=gitlab-8.13.3-sidekiq.init |  | ||||||
| 		use unicorn && rcscript=gitlab-8.13.3-unicorn.init |  | ||||||
| 
 |  | ||||||
| 		cp "${FILESDIR}/${rcscript}" "${T}" || die |  | ||||||
| 		sed -i \ |  | ||||||
| 			-e "s|@USER@|${MY_USER}|" \ |  | ||||||
| 			-e "s|@GITLAB_BASE@|${dest}|" \ |  | ||||||
| 			-e "s|@LOGS_DIR@|${logs}|" \ |  | ||||||
| 			"${T}/${rcscript}" \ |  | ||||||
| 			|| die "failed to filter ${rcscript}" |  | ||||||
| 
 |  | ||||||
| 		newinitd "${T}/${rcscript}" "${MY_NAME}" |  | ||||||
| 	fi |  | ||||||
| 
 |  | ||||||
| 	# fix permissions |  | ||||||
| 	fowners -R ${MY_USER}:${MY_USER} ${dest} ${temp} ${logs} |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| pkg_postinst() { |  | ||||||
| 	elog "If this is an update from a previous version, stop your GitLab" |  | ||||||
| 	elog "instance and issue the following command to perform all required" |  | ||||||
| 	elog "migrations:" |  | ||||||
| 	elog "       emerge --config \"=${CATEGORY}/${PF}\"" |  | ||||||
| 	elog "PLEASE NOTE: It's HIGHLY recommended to backup your database" |  | ||||||
| 	elog "before running the config phase. Run these commands (as root):" |  | ||||||
| 	elog |  | ||||||
| 	elog "    cd /opt/gitlab" |  | ||||||
| 	elog "    sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production" |  | ||||||
| 	elog |  | ||||||
| 	elog "If this was a fresh install, follow these steps:" |  | ||||||
| 	elog |  | ||||||
| 	elog "1. Configure your GitLab's settings in ${CONF_DIR}/gitlab.yml." |  | ||||||
| 	elog |  | ||||||
| 	elog "2. Configure your database settings in ${CONF_DIR}/database.yml" |  | ||||||
| 	elog "   for \"production\" environment." |  | ||||||
| 	elog |  | ||||||
| 	elog "3. Then you should create a database for your GitLab instance, if you" |  | ||||||
| 	elog "   haven't done so already." |  | ||||||
| 	elog |  | ||||||
| 	if use postgres; then |  | ||||||
| 		elog "If you have local PostgreSQL running, just copy&run:" |  | ||||||
| 		elog "      su postgres" |  | ||||||
| 		elog "      psql -c \"CREATE ROLE gitlab PASSWORD 'gitlab' \\" |  | ||||||
| 		elog "          NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;\"" |  | ||||||
| 		elog "      createdb -E UTF-8 -O gitlab gitlabhq_production" |  | ||||||
| 		elog "  Note: You should change your password to something more random..." |  | ||||||
| 		elog |  | ||||||
| 	fi |  | ||||||
| 	elog "4. Finally execute the following command to initialize the environment:" |  | ||||||
| 	elog "       emerge --config \"=${CATEGORY}/${PF}\"" |  | ||||||
| 	elog "   Note: Do not forget to start Redis server first!" |  | ||||||
| 	elog |  | ||||||
| 	elog "If you're running GitLab behind an SSL proxy such as nginx or Apache and" |  | ||||||
| 	elog "you can't login after the upgrade, be sure to read the section about the" |  | ||||||
| 	elog "verification of the CSRF token in GitLab's trouble-shooting guide at" |  | ||||||
| 	elog "http://goo.gl/5XGRGv." |  | ||||||
| 	if use postgres; then |  | ||||||
| 		elog "Please note: As of GitLab 8.6, users of PostgreSQL need to enable the" |  | ||||||
| 		elog "`pg_trgm` extension by running the following command as a PostgreSQL" |  | ||||||
| 		elog "super user for *every* GitLab database:" |  | ||||||
| 		elog "      CREATE EXTENSION IF NOT EXISTS pg_trgm;" |  | ||||||
| 		elog "For details, see the documentation at the GitLab website." |  | ||||||
| 	fi |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| pkg_config() { |  | ||||||
| 	einfo "Checking configuration files" |  | ||||||
| 
 |  | ||||||
| 	if [ ! -r "${CONF_DIR}/database.yml" ]; then |  | ||||||
| 		eerror "Copy ${CONF_DIR}/database.yml.* to" |  | ||||||
| 		eerror "${CONF_DIR}/database.yml and edit this file in order to configure your" |  | ||||||
| 		eerror "database settings for \"production\" environment."; die |  | ||||||
| 	fi |  | ||||||
| 
 |  | ||||||
| 	local email_from="$(ryaml ${CONF_DIR}/gitlab.yml production gitlab email_from)" |  | ||||||
| 	local git_home="$(egethome ${MY_USER})" |  | ||||||
| 
 |  | ||||||
| 	# configure Git global settings |  | ||||||
| 	if [ ! -e "${git_home}/.gitconfig" ]; then |  | ||||||
| 		einfo "Setting git user" |  | ||||||
| 		su -l ${MY_USER} -c " |  | ||||||
| 			git config --global user.email '${email_from}'; |  | ||||||
| 			git config --global user.name 'GitLab'" \ |  | ||||||
| 			|| die "failed to setup git name and email" |  | ||||||
| 	fi |  | ||||||
| 
 |  | ||||||
| 	su -l ${MY_USER} -c "git config --global repack.writeBitmaps true" |  | ||||||
| 
 |  | ||||||
| 	# determine whether this is an update or a fresh install. we do this by |  | ||||||
| 	# checking whether the ${DEST_DIR}/.git directory exists or not |  | ||||||
| 	#  |  | ||||||
| 	if [ -d "${DEST_DIR}/.git" ]; then |  | ||||||
| 		local update=true |  | ||||||
| 	else |  | ||||||
| 		local update=false |  | ||||||
| 	fi |  | ||||||
| 
 |  | ||||||
| 	## Initialize app ## |  | ||||||
| 
 |  | ||||||
| 	local RAILS_ENV="production" |  | ||||||
| 	local RUBY=${RUBY:-/usr/bin/ruby} |  | ||||||
| 	local BUNDLE="${RUBY} /usr/bin/bundle" |  | ||||||
| 
 |  | ||||||
| 	# FIXME: this line existed in older ebuilds, but the variable is |  | ||||||
| 	# never used. what was it for!? |  | ||||||
| 	# local dbname="$(ryaml ${CONF_DIR}/database.yml production database)" |  | ||||||
| 
 |  | ||||||
| 	if [ "${update}" = 'true' ]; then |  | ||||||
| 		einfo "Migrating database ..." |  | ||||||
| 		exec_rake db:migrate |  | ||||||
| 
 |  | ||||||
| 		# https://github.com/gitlabhq/gitlabhq/issues/5311#issuecomment-31656496 |  | ||||||
| 		einfo "Migrating iids ..." |  | ||||||
| 		exec_rake migrate_iids |  | ||||||
| 
 |  | ||||||
| 		einfo "Cleaning old precompiled assets ..." |  | ||||||
| 		exec_rake assets:clean |  | ||||||
| 
 |  | ||||||
| 		einfo "Cleaning cache ..." |  | ||||||
| 		exec_rake cache:clear |  | ||||||
| 	else |  | ||||||
| 		# create dummy git repo as workaround for |  | ||||||
| 		# https://github.com/bundler/bundler/issues/2039 |  | ||||||
| 		einfo "Initializing dummy git repository to avoid false errors from bundler" |  | ||||||
| 		su -l ${MY_USER} -c " |  | ||||||
| 			cd ${DEST_DIR} |  | ||||||
| 			git init |  | ||||||
| 			git add README.md |  | ||||||
| 			git commit -m 'Dummy repository'" >/dev/null |  | ||||||
| 
 |  | ||||||
| 		einfo "Initializing database ..." |  | ||||||
| 		exec_rake gitlab:setup |  | ||||||
| 	fi |  | ||||||
| 
 |  | ||||||
| 	einfo "Precompiling assests ..." |  | ||||||
| 	exec_rake assets:precompile |  | ||||||
| 
 |  | ||||||
| 	if [ "${update}" = 'true' ]; then |  | ||||||
| 		ewarn |  | ||||||
| 		ewarn "This configuration script runs only common migration tasks." |  | ||||||
| 		ewarn "Please read guides on" |  | ||||||
| 		ewarn "    https://github.com/gitlabhq/gitlabhq/blob/master/doc/update/" |  | ||||||
| 		ewarn "for any additional migration tasks specific to your previous GitLab" |  | ||||||
| 		ewarn "version." |  | ||||||
| 	fi |  | ||||||
| 	elog |  | ||||||
| 	elog "If you want to make sure that the install/upgrade was successful, start" |  | ||||||
| 	elog "Gitlab now and then run these commands (as root):" |  | ||||||
| 	elog |  | ||||||
| 	elog "    cd /opt/gitlab" |  | ||||||
| 	elog "    sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production" |  | ||||||
| 	elog "    sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production" |  | ||||||
| 	elog |  | ||||||
| 	if ! use systemd ; then |  | ||||||
| 		elog "You may also run" |  | ||||||
| 		elog "    /etc/init.d/gitlab check" |  | ||||||
| 		elog " for convenience." |  | ||||||
| 	fi |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| ryaml() { |  | ||||||
| 	ruby -ryaml -e 'puts ARGV[1..-1].inject(YAML.load(File.read(ARGV[0]))) {|acc, key| acc[key] }' "$@" |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| exec_rake() { |  | ||||||
| 	local command="${BUNDLE} exec rake $@ RAILS_ENV=${RAILS_ENV}" |  | ||||||
| 
 |  | ||||||
| 	echo "   ${command}" |  | ||||||
| 	su -l ${MY_USER} -c " |  | ||||||
| 		export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8 |  | ||||||
| 		cd ${DEST_DIR} |  | ||||||
| 		${command}" \ |  | ||||||
| 		|| die "failed to run rake $@" |  | ||||||
| } |  | ||||||
|  | @ -1,392 +0,0 @@ | ||||||
| # Copyright 1999-2016 Gentoo Foundation |  | ||||||
| # Distributed under the terms of the GNU General Public License v2 |  | ||||||
| # $Id$ |  | ||||||
| 
 |  | ||||||
| EAPI="5" |  | ||||||
| 
 |  | ||||||
| # Maintainer notes: |  | ||||||
| # - This ebuild uses Bundler to download and install all gems in deployment mode |  | ||||||
| #   (i.e. into isolated directory inside application). That's not Gentoo way how |  | ||||||
| #   it should be done, but GitLab has too many dependencies that it will be too |  | ||||||
| #   difficult to maintain them via ebuilds. |  | ||||||
| # |  | ||||||
| 
 |  | ||||||
| USE_RUBY="ruby21 ruby23" |  | ||||||
| 
 |  | ||||||
| inherit eutils ruby-ng user systemd |  | ||||||
| 
 |  | ||||||
| MY_PV="v${PV/_/-}" |  | ||||||
| MY_GIT_COMMIT="3ea6c8d730200c3811126ee0ab25495b9fab1b16" |  | ||||||
| 
 |  | ||||||
| DESCRIPTION="GitLab is a free project and repository management application" |  | ||||||
| HOMEPAGE="https://about.gitlab.com/" |  | ||||||
| SRC_URI="https://gitlab.com/gitlab-org/${PN}/repository/archive.tar.gz?ref=${MY_PV} -> ${P}.tar.gz" |  | ||||||
| RUBY_S="${PN}-${MY_PV}-${MY_GIT_COMMIT}" |  | ||||||
| 
 |  | ||||||
| RESTRICT="mirror" |  | ||||||
| 
 |  | ||||||
| LICENSE="MIT" |  | ||||||
| SLOT="0" |  | ||||||
| KEYWORDS="~amd64 ~x86 ~arm ~arm64" |  | ||||||
| IUSE="kerberos mysql +postgres +unicorn systemd rugged_use_system_libraries" |  | ||||||
| 
 |  | ||||||
| ## Gems dependencies: |  | ||||||
| #   charlock_holmes     dev-libs/icu |  | ||||||
| #   grape, capybara     dev-libs/libxml2, dev-libs/libxslt |  | ||||||
| #   rugged              dev-util/cmake, virtual/pkgconfig |  | ||||||
| #   json                dev-util/ragel |  | ||||||
| #   pygments.rb         python 2.7+ |  | ||||||
| #   execjs              net-libs/nodejs, or any other JS runtime |  | ||||||
| #   pg                  dev-db/postgresql |  | ||||||
| #   mysql               virtual/mysql |  | ||||||
| # |  | ||||||
| GEMS_DEPEND=" |  | ||||||
| 	dev-libs/icu |  | ||||||
| 	dev-libs/libxml2 |  | ||||||
| 	dev-libs/libxslt |  | ||||||
| 	dev-util/ragel |  | ||||||
| 	net-libs/nodejs |  | ||||||
| 	postgres? ( >=dev-db/postgresql-9.1:* ) |  | ||||||
| 	mysql? ( virtual/mysql ) |  | ||||||
| 	kerberos? ( virtual/krb5 )" |  | ||||||
| CDEPEND=" |  | ||||||
| 	dev-util/cmake |  | ||||||
| 	virtual/pkgconfig" |  | ||||||
| COMMON_DEPEND=" |  | ||||||
| 	${GEMS_DEPEND} |  | ||||||
| 	~dev-vcs/gitlab-shell-4.0.3 |  | ||||||
| 	>=dev-vcs/git-2.7.4 |  | ||||||
| 	~dev-vcs/gitlab-workhorse-1.1.1 |  | ||||||
| 	kerberos? ( !app-crypt/heimdal ) |  | ||||||
| 	rugged_use_system_libraries? ( net-libs/http-parser dev-libs/libgit2:0/24 )" |  | ||||||
| DEPEND=" |  | ||||||
| 	${CDEPEND} |  | ||||||
| 	${COMMON_DEPEND}" |  | ||||||
| RDEPEND=" |  | ||||||
| 	${COMMON_DEPEND} |  | ||||||
| 	>=dev-db/redis-2.8 |  | ||||||
| 	virtual/mta |  | ||||||
| 	systemd? ( sys-apps/systemd:0= )" |  | ||||||
| # dev-ruby/bundler should be >=1.13.6, but that doesn't exist yet in the tree. |  | ||||||
| ruby_add_bdepend " |  | ||||||
| 	virtual/rubygems |  | ||||||
| 	>=dev-ruby/bundler-1.0" |  | ||||||
| 
 |  | ||||||
| # |  | ||||||
| # fix-sendmail-config: |  | ||||||
| #     Fix default settings to work with ssmtp that doesn't know '-t' argument. |  | ||||||
| # fix-redis-config-path: |  | ||||||
| #     Point to the absolute location of redis_config.rb |  | ||||||
| # |  | ||||||
| RUBY_PATCHES=( |  | ||||||
| 	"01-${PN}-8.7.5-fix-sendmail-config.patch" |  | ||||||
| 	"02-${PN}-8.11.0-fix-redis-config-path.patch" |  | ||||||
| 	"03-${PN}-8.14.0-database.yml.patch" |  | ||||||
| 	"04-${PN}-8.12.7-fix-check-task.patch" |  | ||||||
| 	"05-${PN}-8.12.7-replace-sys-filesystem.patch" |  | ||||||
| ) |  | ||||||
| 
 |  | ||||||
| MY_NAME="gitlab" |  | ||||||
| MY_USER="git"    # should be same as in gitlab-shell |  | ||||||
| 
 |  | ||||||
| DEST_DIR="/opt/${MY_NAME}" |  | ||||||
| CONF_DIR="/etc/${MY_NAME}" |  | ||||||
| LOGS_DIR="/var/log/${MY_NAME}" |  | ||||||
| TEMP_DIR="/var/tmp/${MY_NAME}" |  | ||||||
| 
 |  | ||||||
| all_ruby_prepare() { |  | ||||||
| 	# fix paths |  | ||||||
| 	local satellites_path="${TEMP_DIR}/repo_satellites" |  | ||||||
| 	local repos_path=/var/lib/git/repositories |  | ||||||
| 	local shell_path=/usr/share/gitlab-shell |  | ||||||
| 	sed -i -E \ |  | ||||||
| 		-e "/satellites:$/,/\w:$/   s|(\s*path:\s).*|\1${satellites_path}/|" \ |  | ||||||
| 		-e "/gitlab_shell:$/,/\w:$/ s|(\s*path:\s).*|\1${shell_path}/|" \ |  | ||||||
| 		-e "/gitlab_shell:$/,/\w:$/ s|(\s*repos_path:\s).*|\1${repos_path}/|" \ |  | ||||||
| 		-e "/gitlab_shell:$/,/\w:$/ s|(\s*hooks_path:\s).*|\1${shell_path}/hooks/|" \ |  | ||||||
| 		config/gitlab.yml.example || die "failed to filter gitlab.yml.example" |  | ||||||
| 
 |  | ||||||
| 	local run_path=/run/${MY_NAME} |  | ||||||
| 	sed -i -E \ |  | ||||||
| 		-e "s|/home/git/gitlab/tmp/(pids\|sockets)|${run_path}|" \ |  | ||||||
| 		-e "s|/home/git/gitlab/log|${LOGS_DIR}|" \ |  | ||||||
| 		-e "s|/home/git/gitlab|${DEST_DIR}|" \ |  | ||||||
| 		config/unicorn.rb.example || die "failed to filter unicorn.rb.example" |  | ||||||
| 
 |  | ||||||
| 	sed -i \ |  | ||||||
| 		-e "s|/home/git/gitlab/tmp/sockets|${run_path}|" \ |  | ||||||
| 		lib/support/nginx/gitlab || die "failed to filter nginx/gitlab" |  | ||||||
| 
 |  | ||||||
| 	# modify default database settings for PostgreSQL |  | ||||||
| 	sed -i -E \ |  | ||||||
| 		-e 's|(username:).*|\1 gitlab|' \ |  | ||||||
| 		-e 's|(password:).*|\1 gitlab|' \ |  | ||||||
| 		-e 's|(socket:).*|\1 /run/postgresql/.s.PGSQL.5432|' \ |  | ||||||
| 		config/database.yml.postgresql \ |  | ||||||
| 		|| die "failed to filter database.yml.postgresql" |  | ||||||
| 
 |  | ||||||
| 	# rename config files |  | ||||||
| 	mv config/gitlab.yml.example config/gitlab.yml |  | ||||||
| 	mv config/unicorn.rb.example config/unicorn.rb |  | ||||||
| 
 |  | ||||||
| 	local dbconf=config/database.yml |  | ||||||
| 	if use postgres && ! use mysql; then |  | ||||||
| 		mv ${dbconf}.postgresql ${dbconf} |  | ||||||
| 		rm ${dbconf}.mysql |  | ||||||
| 	elif use mysql && ! use postgres; then |  | ||||||
| 		mv ${dbconf}.mysql ${dbconf} |  | ||||||
| 		rm ${dbconf}.postgresql |  | ||||||
| 	fi |  | ||||||
| 
 |  | ||||||
| 	# remove useless files |  | ||||||
| 	rm -r lib/support/{deploy,init.d} |  | ||||||
| 	use unicorn || rm config/unicorn.rb |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| all_ruby_install() { |  | ||||||
| 	local dest=${DEST_DIR} |  | ||||||
| 	local conf=${CONF_DIR} |  | ||||||
| 	local logs=${LOGS_DIR} |  | ||||||
| 	local temp=${TEMP_DIR} |  | ||||||
| 
 |  | ||||||
| 	# prepare directories |  | ||||||
| 	diropts -m750 |  | ||||||
| 	dodir ${logs} ${temp} |  | ||||||
| 
 |  | ||||||
| 	diropts -m755 |  | ||||||
| 	dodir ${conf} ${dest}/public/uploads |  | ||||||
| 
 |  | ||||||
| 	dosym ${temp} ${dest}/tmp |  | ||||||
| 	dosym ${logs} ${dest}/log |  | ||||||
| 
 |  | ||||||
| 	# install configs |  | ||||||
| 	insinto ${conf} |  | ||||||
| 	doins -r config/* |  | ||||||
| 	dosym ${conf} ${dest}/config |  | ||||||
| 
 |  | ||||||
| 	echo 'export RAILS_ENV=production' > "${D}/${dest}/.profile" |  | ||||||
| 
 |  | ||||||
| 	# remove needless dirs |  | ||||||
| 	rm -Rf config tmp log |  | ||||||
| 
 |  | ||||||
| 	# install the rest files |  | ||||||
| 	# using cp 'cause doins is slow |  | ||||||
| 	cp -Rl * "${D}/${dest}"/ |  | ||||||
| 
 |  | ||||||
| 	# install logrotate config |  | ||||||
| 	dodir /etc/logrotate.d |  | ||||||
| 	cat > "${D}/etc/logrotate.d/${MY_NAME}" <<-EOF |  | ||||||
| 		${logs}/*.log { |  | ||||||
| 		    missingok |  | ||||||
| 		    delaycompress |  | ||||||
| 		    compress |  | ||||||
| 		    copytruncate |  | ||||||
| 		} |  | ||||||
| 	EOF |  | ||||||
| 
 |  | ||||||
| 	## Install gems via bundler ## |  | ||||||
| 
 |  | ||||||
| 	cd "${D}/${dest}" |  | ||||||
| 
 |  | ||||||
| 	local without="development test aws" |  | ||||||
| 	local flag; for flag in mysql postgres unicorn kerberos; do |  | ||||||
| 		without+="$(use $flag || echo ' '$flag)" |  | ||||||
| 	done |  | ||||||
| 	local bundle_args="--deployment ${without:+--without ${without}}" |  | ||||||
| 
 |  | ||||||
| 	use "rugged_use_system_libraries" && export RUGGED_USE_SYSTEM_LIBRARIES="YES" |  | ||||||
| 
 |  | ||||||
| 	einfo "Running bundle install ${bundle_args} ..." |  | ||||||
| 	${RUBY} /usr/bin/bundle install ${bundle_args} || die "bundler failed" |  | ||||||
| 
 |  | ||||||
| 	einfo "Cleaning old gems ..." |  | ||||||
| 	${RUBY} /usr/bin/bundle clean |  | ||||||
| 
 |  | ||||||
| 	# clean gems cache |  | ||||||
| 	rm -Rf vendor/bundle/ruby/*/cache |  | ||||||
| 	rm -Rf vendor/bundle/ruby/*/bundler/gems/charlock_holmes-dde194609b35/.git |  | ||||||
| 
 |  | ||||||
| 	## RC script ## |  | ||||||
| 
 |  | ||||||
| 	if use systemd ; then |  | ||||||
| 		ewarn "Beware: systemd support has not been tested, use at your own risk!" |  | ||||||
| 		systemd_newunit "${FILESDIR}/gitlab-8.13.0-sidekiq.service" "gitlab-sidekiq.service" |  | ||||||
| 		systemd_dounit "${FILESDIR}/gitlab-unicorn.service" |  | ||||||
| 		systemd_dounit "${FILESDIR}/gitlab-workhorse.service" |  | ||||||
| 		systemd_dounit "${FILESDIR}/gitlab-mailroom.service" |  | ||||||
| 		systemd_dotmpfilesd "${FILESDIR}/gitlab.conf" |  | ||||||
| 	else |  | ||||||
| 		local rcscript=gitlab-8.13.3-sidekiq.init |  | ||||||
| 		use unicorn && rcscript=gitlab-8.13.3-unicorn.init |  | ||||||
| 
 |  | ||||||
| 		cp "${FILESDIR}/${rcscript}" "${T}" || die |  | ||||||
| 		sed -i \ |  | ||||||
| 			-e "s|@USER@|${MY_USER}|" \ |  | ||||||
| 			-e "s|@GITLAB_BASE@|${dest}|" \ |  | ||||||
| 			-e "s|@LOGS_DIR@|${logs}|" \ |  | ||||||
| 			"${T}/${rcscript}" \ |  | ||||||
| 			|| die "failed to filter ${rcscript}" |  | ||||||
| 
 |  | ||||||
| 		newinitd "${T}/${rcscript}" "${MY_NAME}" |  | ||||||
| 	fi |  | ||||||
| 
 |  | ||||||
| 	# fix permissions |  | ||||||
| 	fowners -R ${MY_USER}:${MY_USER} ${dest} ${temp} ${logs} |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| pkg_postinst() { |  | ||||||
| 	elog "If this is an update from a previous version, stop your GitLab" |  | ||||||
| 	elog "instance and issue the following command to perform all required" |  | ||||||
| 	elog "migrations:" |  | ||||||
| 	elog "       emerge --config \"=${CATEGORY}/${PF}\"" |  | ||||||
| 	elog "PLEASE NOTE: It's HIGHLY recommended to backup your database" |  | ||||||
| 	elog "before running the config phase. Run these commands (as root):" |  | ||||||
| 	elog |  | ||||||
| 	elog "    cd /opt/gitlab" |  | ||||||
| 	elog "    sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production" |  | ||||||
| 	elog |  | ||||||
| 	elog "If this was a fresh install, follow these steps:" |  | ||||||
| 	elog |  | ||||||
| 	elog "1. Configure your GitLab's settings in ${CONF_DIR}/gitlab.yml." |  | ||||||
| 	elog |  | ||||||
| 	elog "2. Configure your database settings in ${CONF_DIR}/database.yml" |  | ||||||
| 	elog "   for \"production\" environment." |  | ||||||
| 	elog |  | ||||||
| 	elog "3. Then you should create a database for your GitLab instance, if you" |  | ||||||
| 	elog "   haven't done so already." |  | ||||||
| 	elog |  | ||||||
| 	if use postgres; then |  | ||||||
| 		elog "If you have local PostgreSQL running, just copy&run:" |  | ||||||
| 		elog "      su postgres" |  | ||||||
| 		elog "      psql -c \"CREATE ROLE gitlab PASSWORD 'gitlab' \\" |  | ||||||
| 		elog "          NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;\"" |  | ||||||
| 		elog "      createdb -E UTF-8 -O gitlab gitlabhq_production" |  | ||||||
| 		elog "  Note: You should change your password to something more random..." |  | ||||||
| 		elog |  | ||||||
| 	fi |  | ||||||
| 	elog "4. Finally execute the following command to initialize the environment:" |  | ||||||
| 	elog "       emerge --config \"=${CATEGORY}/${PF}\"" |  | ||||||
| 	elog "   Note: Do not forget to start Redis server first!" |  | ||||||
| 	elog |  | ||||||
| 	elog "If you're running GitLab behind an SSL proxy such as nginx or Apache and" |  | ||||||
| 	elog "you can't login after the upgrade, be sure to read the section about the" |  | ||||||
| 	elog "verification of the CSRF token in GitLab's trouble-shooting guide at" |  | ||||||
| 	elog "http://goo.gl/5XGRGv." |  | ||||||
| 	if use postgres; then |  | ||||||
| 		elog "Please note: As of GitLab 8.6, users of PostgreSQL need to enable the" |  | ||||||
| 		elog "`pg_trgm` extension by running the following command as a PostgreSQL" |  | ||||||
| 		elog "super user for *every* GitLab database:" |  | ||||||
| 		elog "      CREATE EXTENSION IF NOT EXISTS pg_trgm;" |  | ||||||
| 		elog "For details, see the documentation at the GitLab website." |  | ||||||
| 	fi |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| pkg_config() { |  | ||||||
| 	einfo "Checking configuration files" |  | ||||||
| 
 |  | ||||||
| 	if [ ! -r "${CONF_DIR}/database.yml" ]; then |  | ||||||
| 		eerror "Copy ${CONF_DIR}/database.yml.* to" |  | ||||||
| 		eerror "${CONF_DIR}/database.yml and edit this file in order to configure your" |  | ||||||
| 		eerror "database settings for \"production\" environment."; die |  | ||||||
| 	fi |  | ||||||
| 
 |  | ||||||
| 	local email_from="$(ryaml ${CONF_DIR}/gitlab.yml production gitlab email_from)" |  | ||||||
| 	local git_home="$(egethome ${MY_USER})" |  | ||||||
| 
 |  | ||||||
| 	# configure Git global settings |  | ||||||
| 	if [ ! -e "${git_home}/.gitconfig" ]; then |  | ||||||
| 		einfo "Setting git user" |  | ||||||
| 		su -l ${MY_USER} -c " |  | ||||||
| 			git config --global user.email '${email_from}'; |  | ||||||
| 			git config --global user.name 'GitLab'" \ |  | ||||||
| 			|| die "failed to setup git name and email" |  | ||||||
| 	fi |  | ||||||
| 
 |  | ||||||
| 	su -l ${MY_USER} -c "git config --global repack.writeBitmaps true" |  | ||||||
| 
 |  | ||||||
| 	# determine whether this is an update or a fresh install. we do this by |  | ||||||
| 	# checking whether the ${DEST_DIR}/.git directory exists or not |  | ||||||
| 	#  |  | ||||||
| 	if [ -d "${DEST_DIR}/.git" ]; then |  | ||||||
| 		local update=true |  | ||||||
| 	else |  | ||||||
| 		local update=false |  | ||||||
| 	fi |  | ||||||
| 
 |  | ||||||
| 	## Initialize app ## |  | ||||||
| 
 |  | ||||||
| 	local RAILS_ENV="production" |  | ||||||
| 	local RUBY=${RUBY:-/usr/bin/ruby} |  | ||||||
| 	local BUNDLE="${RUBY} /usr/bin/bundle" |  | ||||||
| 
 |  | ||||||
| 	# FIXME: this line existed in older ebuilds, but the variable is |  | ||||||
| 	# never used. what was it for!? |  | ||||||
| 	# local dbname="$(ryaml ${CONF_DIR}/database.yml production database)" |  | ||||||
| 
 |  | ||||||
| 	if [ "${update}" = 'true' ]; then |  | ||||||
| 		einfo "Migrating database ..." |  | ||||||
| 		exec_rake db:migrate |  | ||||||
| 
 |  | ||||||
| 		# https://github.com/gitlabhq/gitlabhq/issues/5311#issuecomment-31656496 |  | ||||||
| 		einfo "Migrating iids ..." |  | ||||||
| 		exec_rake migrate_iids |  | ||||||
| 
 |  | ||||||
| 		einfo "Cleaning old precompiled assets ..." |  | ||||||
| 		exec_rake assets:clean |  | ||||||
| 
 |  | ||||||
| 		einfo "Cleaning cache ..." |  | ||||||
| 		exec_rake cache:clear |  | ||||||
| 	else |  | ||||||
| 		# create dummy git repo as workaround for |  | ||||||
| 		# https://github.com/bundler/bundler/issues/2039 |  | ||||||
| 		einfo "Initializing dummy git repository to avoid false errors from bundler" |  | ||||||
| 		su -l ${MY_USER} -c " |  | ||||||
| 			cd ${DEST_DIR} |  | ||||||
| 			git init |  | ||||||
| 			git add README.md |  | ||||||
| 			git commit -m 'Dummy repository'" >/dev/null |  | ||||||
| 
 |  | ||||||
| 		einfo "Initializing database ..." |  | ||||||
| 		exec_rake gitlab:setup |  | ||||||
| 	fi |  | ||||||
| 
 |  | ||||||
| 	einfo "Precompiling assests ..." |  | ||||||
| 	exec_rake assets:precompile |  | ||||||
| 
 |  | ||||||
| 	if [ "${update}" = 'true' ]; then |  | ||||||
| 		ewarn |  | ||||||
| 		ewarn "This configuration script runs only common migration tasks." |  | ||||||
| 		ewarn "Please read guides on" |  | ||||||
| 		ewarn "    https://github.com/gitlabhq/gitlabhq/blob/master/doc/update/" |  | ||||||
| 		ewarn "for any additional migration tasks specific to your previous GitLab" |  | ||||||
| 		ewarn "version." |  | ||||||
| 	fi |  | ||||||
| 	elog |  | ||||||
| 	elog "If you want to make sure that the install/upgrade was successful, start" |  | ||||||
| 	elog "Gitlab now and then run these commands (as root):" |  | ||||||
| 	elog |  | ||||||
| 	elog "    cd /opt/gitlab" |  | ||||||
| 	elog "    sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production" |  | ||||||
| 	elog "    sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production" |  | ||||||
| 	elog |  | ||||||
| 	if ! use systemd ; then |  | ||||||
| 		elog "You may also run" |  | ||||||
| 		elog "    /etc/init.d/gitlab check" |  | ||||||
| 		elog " for convenience." |  | ||||||
| 	fi |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| ryaml() { |  | ||||||
| 	ruby -ryaml -e 'puts ARGV[1..-1].inject(YAML.load(File.read(ARGV[0]))) {|acc, key| acc[key] }' "$@" |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| exec_rake() { |  | ||||||
| 	local command="${BUNDLE} exec rake $@ RAILS_ENV=${RAILS_ENV}" |  | ||||||
| 
 |  | ||||||
| 	echo "   ${command}" |  | ||||||
| 	su -l ${MY_USER} -c " |  | ||||||
| 		export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8 |  | ||||||
| 		cd ${DEST_DIR} |  | ||||||
| 		${command}" \ |  | ||||||
| 		|| die "failed to run rake $@" |  | ||||||
| } |  | ||||||
|  | @ -67,10 +67,9 @@ RDEPEND=" | ||||||
| 	>=dev-db/redis-2.8 | 	>=dev-db/redis-2.8 | ||||||
| 	virtual/mta | 	virtual/mta | ||||||
| 	systemd? ( sys-apps/systemd:0= )" | 	systemd? ( sys-apps/systemd:0= )" | ||||||
| # dev-ruby/bundler should be >=1.13.6, but that doesn't exist yet in the tree. |  | ||||||
| ruby_add_bdepend " | ruby_add_bdepend " | ||||||
| 	virtual/rubygems | 	virtual/rubygems | ||||||
| 	>=dev-ruby/bundler-1.0" | 	>=dev-ruby/bundler-1.13.6" | ||||||
| 
 | 
 | ||||||
| # | # | ||||||
| # fix-sendmail-config: | # fix-sendmail-config: | ||||||
|  |  | ||||||
|  | @ -52,9 +52,9 @@ CDEPEND=" | ||||||
| 	virtual/pkgconfig" | 	virtual/pkgconfig" | ||||||
| COMMON_DEPEND=" | COMMON_DEPEND=" | ||||||
| 	${GEMS_DEPEND} | 	${GEMS_DEPEND} | ||||||
| 	>=dev-vcs/gitlab-shell-4.0.0 | 	>=dev-vcs/gitlab-shell-4.1.1 | ||||||
| 	>=dev-vcs/git-2.7.4 | 	>=dev-vcs/git-2.8.4 | ||||||
| 	>=dev-vcs/gitlab-workhorse-1.0.0 | 	>=dev-vcs/gitlab-workhorse-1.2.1 | ||||||
| 	kerberos? ( !app-crypt/heimdal ) | 	kerberos? ( !app-crypt/heimdal ) | ||||||
| 	rugged_use_system_libraries? ( net-libs/http-parser dev-libs/libgit2:0/24 )" | 	rugged_use_system_libraries? ( net-libs/http-parser dev-libs/libgit2:0/24 )" | ||||||
| DEPEND=" | DEPEND=" | ||||||
|  | @ -67,7 +67,7 @@ RDEPEND=" | ||||||
| 	systemd? ( sys-apps/systemd:0= )" | 	systemd? ( sys-apps/systemd:0= )" | ||||||
| ruby_add_bdepend " | ruby_add_bdepend " | ||||||
| 	virtual/rubygems | 	virtual/rubygems | ||||||
| 	>=dev-ruby/bundler-1.0" | 	>=dev-ruby/bundler-1.13.6" | ||||||
| 
 | 
 | ||||||
| # | # | ||||||
| # fix-sendmail-config: | # fix-sendmail-config: | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue