1 |
commit: 6c28119fa4fc57bc62e43f1c9d016a2c3459410b |
2 |
Author: Samuel Bernardo <samuelbernardo.mail <AT> gmail <DOT> com> |
3 |
AuthorDate: Tue Nov 20 22:41:51 2018 +0000 |
4 |
Commit: Samuel Bernardo <samuelbernardo.mail <AT> gmail <DOT> com> |
5 |
CommitDate: Tue Nov 20 22:41:51 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/user/ssnb.git/commit/?id=6c28119f |
7 |
|
8 |
correct systemd service configuration and add some missing configurations |
9 |
|
10 |
Signed-off-by: Samuel Bernardo <samuelbernardo.mail <AT> gmail.com> |
11 |
|
12 |
dev-java/nexus-oss-bin/Manifest | 4 +- |
13 |
.../files/nexus-oss-bin_run_as_user.patch | 8 ++ |
14 |
dev-java/nexus-oss-bin/files/nexus-oss.service | 6 +- |
15 |
.../nexus-oss-bin/nexus-oss-bin-3.14.0-r1.ebuild | 88 ++++++++++++++++++++++ |
16 |
4 files changed, 103 insertions(+), 3 deletions(-) |
17 |
|
18 |
diff --git a/dev-java/nexus-oss-bin/Manifest b/dev-java/nexus-oss-bin/Manifest |
19 |
index 45605b0..1566a00 100644 |
20 |
--- a/dev-java/nexus-oss-bin/Manifest |
21 |
+++ b/dev-java/nexus-oss-bin/Manifest |
22 |
@@ -1,6 +1,8 @@ |
23 |
-AUX nexus-oss.service 293 BLAKE2B 10e0fd9e5bb995bf434cbb4c4a522961acb5c0da792ccf310fbabb8bebe1d79738404d0f003aebc9dd39448d1d8bb837df290128c8a1e3e5175d1b40cde371ff SHA512 f65e51d0c1cee2516ddb15c99e9c1b287276de5f965cb2abbe221f8d6d2f6ce598754c8bacb8dc116531de50429befb8e7cdff80bf96547ff453d4b91008b462 |
24 |
+AUX nexus-oss-bin_run_as_user.patch 248 BLAKE2B 665accd3fbbcac5ffae37c50d03df0d59d445e8cd1ab6753f6e4d497d35d349c05e42e65fd3d7e516d151ef26c140fe712bb8645970b093ac2b43d898aa1304a SHA512 bbc15de98c51e4d6ba43a916bd18d23837bf40ac509222a9e5b539b5ef1ee7f735913130671b8f21d9c003cf7f20d9fdaf1744df6e0c80fb15dced4726c91ab1 |
25 |
+AUX nexus-oss.service 329 BLAKE2B 68098e91b78caabeafbf7a2ea4b4e604ff4ac00ab9757d65f2a414feffb50ea67c00480c6e8118c28bbb4fdb53a2c1869b94ed1954d4bc06f0e8e6b6c1caacbe SHA512 7a6b3c67bf54e1ae79a3af3587b0de214aa6bb5fdf0ed8a428c0e2ba51028e7ace11a0dcbe865d296a9696b88257f29aef60405ecaa85c916b8889fe41d88b27 |
26 |
DIST nexus-3.14.0-04-unix.tar.gz 125423547 BLAKE2B 06b58fe430c72f253ed0d49965aef69860141eca380ccaa76af2ffd12343e8a5cf2ac276e43810cc07a6a5c5fe75768ce908971aec4443caea0a8684fa1ba01e SHA512 2f4ce0bf4b1fdc6854713610892d20850004517b40176c025279c31323b1b81611d8ca109cfd765108640cff26b1a721a5c9d7704d03957521621f615a51b420 |
27 |
DIST nexus-3.7.0-04-unix.tar.gz 112670551 BLAKE2B b158d5ca666199bb7a205c127fad9a1547585d8ccc52ea858957a0aa64a6d3340bfc9476440e245af534df2f31f81871fc3b1e448d789039c616cbcac836e317 SHA512 78bca14e145e5c7878c755d74343496d78061ea4d53d75be75f3ba524df2796d7b323d94135ea4442ae297b12cd18f5096467cc765c0209a3ccd4652eabf478a |
28 |
+EBUILD nexus-oss-bin-3.14.0-r1.ebuild 2400 BLAKE2B a0d201503890cda5e673b48f40465ee0d5b854d3294f8d0b448bb4d7f6e62d3125c51357965e711957cc9f91d78a0bce692a21d15cb8ee8ee5f7f2e0a8d0e552 SHA512 d38f02b4a63750011c60754823f1f4e857b323e4bd961d68448445bf330af61d58f073fd15903f4b7278a9943c626f165d74b295669a423a3903d2a634a137f9 |
29 |
EBUILD nexus-oss-bin-3.14.0.ebuild 1777 BLAKE2B 3450826df52f0ac0b32c33e0f4bf19fba0938d095a7070eaabe686a3de4bf439a100e94620284603310cdb92c7eeb5479b69513061276bd07688d2056bbd83b0 SHA512 c119453ad1a5de4211b3749de6b73e20d48d946237bf8f11e1ad60bfe867d0a279b6095bb2feb15a11f08943afb585f232b5faea53d8c0be16506b939cb7e8a0 |
30 |
EBUILD nexus-oss-bin-3.7.0.ebuild 1777 BLAKE2B 3450826df52f0ac0b32c33e0f4bf19fba0938d095a7070eaabe686a3de4bf439a100e94620284603310cdb92c7eeb5479b69513061276bd07688d2056bbd83b0 SHA512 c119453ad1a5de4211b3749de6b73e20d48d946237bf8f11e1ad60bfe867d0a279b6095bb2feb15a11f08943afb585f232b5faea53d8c0be16506b939cb7e8a0 |
31 |
MISC metadata.xml 1392 BLAKE2B deda1cf98f75673bfede9344e3344a522e3bdd974fb19dc62a8185a39b51a80c28ebf6a47d75e5a091563fdc6e412f9b3dfeff67f8f842833bf30625c4415a34 SHA512 86204a863173c7d491cdf361f78be360bd8c192ebfdb51d1205439742967b62c196bbe99c20580e05fa2414786787ecdd896ee304ac29c17e28d0d85b3966523 |
32 |
|
33 |
diff --git a/dev-java/nexus-oss-bin/files/nexus-oss-bin_run_as_user.patch b/dev-java/nexus-oss-bin/files/nexus-oss-bin_run_as_user.patch |
34 |
new file mode 100644 |
35 |
index 0000000..1eedb53 |
36 |
--- /dev/null |
37 |
+++ b/dev-java/nexus-oss-bin/files/nexus-oss-bin_run_as_user.patch |
38 |
@@ -0,0 +1,8 @@ |
39 |
+diff -Naur a/bin/nexus.rc b/bin/nexus.rc |
40 |
+--- a/bin/nexus.rc 2018-10-12 05:00:40.000000000 +0100 |
41 |
++++ b/bin/nexus.rc 2018-11-20 19:53:52.961818623 +0000 |
42 |
+@@ -1 +1,2 @@ |
43 |
+-#run_as_user="" |
44 |
+\ No newline at end of file |
45 |
++#run_as_user="" |
46 |
++run_as_user="nexus" |
47 |
|
48 |
diff --git a/dev-java/nexus-oss-bin/files/nexus-oss.service b/dev-java/nexus-oss-bin/files/nexus-oss.service |
49 |
index 4943ab4..71909b3 100644 |
50 |
--- a/dev-java/nexus-oss-bin/files/nexus-oss.service |
51 |
+++ b/dev-java/nexus-oss-bin/files/nexus-oss.service |
52 |
@@ -3,12 +3,14 @@ Description=Sonatype Nexus 3.x |
53 |
After=network.target |
54 |
|
55 |
[Service] |
56 |
+Type=forking |
57 |
+LimitNOFILE=65536 |
58 |
ExecStart=/opt/nexus-oss/bin/nexus start |
59 |
ExecStop=/opt/nexus-oss/bin/nexus stop |
60 |
ExecReload=/opt/nexus-oss/bin/nexus restart |
61 |
-PIDFile=/opt/nexus-oss/run/nexus.pid |
62 |
-Type=forking |
63 |
+#PIDFile=/opt/nexus-oss/run/nexus.pid |
64 |
User=nexus |
65 |
+Restart=on-abort |
66 |
|
67 |
[Install] |
68 |
WantedBy=multi-user.target |
69 |
|
70 |
diff --git a/dev-java/nexus-oss-bin/nexus-oss-bin-3.14.0-r1.ebuild b/dev-java/nexus-oss-bin/nexus-oss-bin-3.14.0-r1.ebuild |
71 |
new file mode 100644 |
72 |
index 0000000..25692cb |
73 |
--- /dev/null |
74 |
+++ b/dev-java/nexus-oss-bin/nexus-oss-bin-3.14.0-r1.ebuild |
75 |
@@ -0,0 +1,88 @@ |
76 |
+# Copyright 1999-2016 Gentoo Foundation |
77 |
+# Distributed under the terms of the GNU General Public License v2 |
78 |
+# $Header: $ |
79 |
+ |
80 |
+EAPI=4 |
81 |
+ |
82 |
+inherit eutils user versionator systemd |
83 |
+ |
84 |
+DESCRIPTION="Maven Repository Manager" |
85 |
+HOMEPAGE="http://nexus.sonatype.org/" |
86 |
+LICENSE="GPL-3" |
87 |
+MY_PN="nexus" |
88 |
+MY_PV="${PV}-04-unix" |
89 |
+#echo "Debug: custom package version: ${MY_PV}" |
90 |
+MY_P="${MY_PN}-${MY_PV}" |
91 |
+MY_MV="3" |
92 |
+ |
93 |
+SRC_URI="http://download.sonatype.com/${MY_PN}/${MY_MV}/${MY_P}.tar.gz" |
94 |
+RESTRICT="mirror" |
95 |
+KEYWORDS="~x86 ~amd64" |
96 |
+SLOT="${MY_MV}" |
97 |
+IUSE="" |
98 |
+S="${WORKDIR}" |
99 |
+#echo "Debug: working directory: ${WORKDIR}" |
100 |
+RDEPEND=">=virtual/jdk-1.8" |
101 |
+INSTALL_DIR="/opt/nexus-oss" |
102 |
+ |
103 |
+pkg_setup() { |
104 |
+#enewgroup <name> [gid] |
105 |
+enewgroup nexus |
106 |
+#enewuser <user> [uid] [shell] [homedir] [groups] [params] |
107 |
+enewuser nexus -1 /bin/bash "${INSTALL_DIR}" "nexus" |
108 |
+} |
109 |
+ |
110 |
+src_unpack() { |
111 |
+unpack ${A} |
112 |
+} |
113 |
+ |
114 |
+src_prepare() { |
115 |
+cd "${S}" |
116 |
+if -f "${FILESDIR}/${P}.patch"; then |
117 |
+ epatch "${FILESDIR}/${P}.patch" |
118 |
+fi |
119 |
+epatch_user |
120 |
+} |
121 |
+ |
122 |
+src_install() { |
123 |
+#echo "Debug: install sonatype work dir" |
124 |
+dodir ${INSTALL_DIR/nexus-oss/sonatype-work} |
125 |
+insinto ${INSTALL_DIR/nexus-oss/sonatype-work} |
126 |
+doins -r sonatype-work/* |
127 |
+ |
128 |
+fowners -R nexus:nexus ${INSTALL_DIR/nexus-oss/sonatype-work} |
129 |
+ |
130 |
+#echo "Debug: INSTALL_DIR: ${INSTALL_DIR}" |
131 |
+#echo "Debug: doins nexus-${MY_PV}" |
132 |
+#echo "Debug: ${WORKDIR}/nexus-${MY_PV}/bin/nexus" |
133 |
+insinto ${INSTALL_DIR} |
134 |
+ |
135 |
+dodir ${INSTALL_DIR}/run |
136 |
+dodir "/etc/init.d/" |
137 |
+doins -r ${MY_P/-unix/}/* |
138 |
+doins -r ${MY_P/-unix/}/.??* |
139 |
+#BUG: nexus init script needs a symlink because it uses program path to find their configuration files |
140 |
+#newinitd "${WORKDIR}/nexus-${MY_PV}/bin/nexus" nexus |
141 |
+dosym ${INSTALL_DIR}/bin/nexus /etc/init.d/nexus |
142 |
+systemd_dounit "${FILESDIR}"/nexus-oss.service |
143 |
+ |
144 |
+fowners -R nexus:nexus ${INSTALL_DIR} |
145 |
+fperms 755 "${INSTALL_DIR}/bin/nexus" |
146 |
+ |
147 |
+#echo "Change NEXUS_HOME to the absolute folder location in your .bashrc file, then save" |
148 |
+echo NEXUS_HOME=\"${INSTALL_DIR}\" >> ${ED}/${INSTALL_DIR}/.bashrc |
149 |
+fowners -R nexus:nexus ${INSTALL_DIR}/.bashrc |
150 |
+fperms 644 ${INSTALL_DIR}/.bashrc |
151 |
+} |
152 |
+ |
153 |
+pkg_postinst() { |
154 |
+ ewarn "Activate the service with the following commands:" |
155 |
+ ewarn "sudo systemctl daemon-reload" |
156 |
+ ewarn "sudo systemctl enable nexus-oss.service" |
157 |
+ ewarn "sudo systemctl start nexus-oss.service" |
158 |
+ ewarn " " |
159 |
+ elog "After starting the service in Gentoo, verify that" |
160 |
+ elog "the service started successfully." |
161 |
+ elog "tail -f /opt/sonatype-work/nexus3/log/nexus.log" |
162 |
+} |
163 |
+ |