diff options
author | 2018-11-20 22:41:51 +0000 | |
---|---|---|
committer | 2018-11-20 22:41:51 +0000 | |
commit | 6c28119fa4fc57bc62e43f1c9d016a2c3459410b (patch) | |
tree | 6c3d2e71dcd5a1ffe74edd9ca370301c600b929e /dev-java | |
parent | add samba update patched (diff) | |
download | ssnb-6c28119fa4fc57bc62e43f1c9d016a2c3459410b.tar.gz ssnb-6c28119fa4fc57bc62e43f1c9d016a2c3459410b.tar.bz2 ssnb-6c28119fa4fc57bc62e43f1c9d016a2c3459410b.zip |
correct systemd service configuration and add some missing configurations
Signed-off-by: Samuel Bernardo <samuelbernardo.mail@gmail.com>
Diffstat (limited to 'dev-java')
-rw-r--r-- | dev-java/nexus-oss-bin/Manifest | 4 | ||||
-rw-r--r-- | dev-java/nexus-oss-bin/files/nexus-oss-bin_run_as_user.patch | 8 | ||||
-rw-r--r-- | dev-java/nexus-oss-bin/files/nexus-oss.service | 6 | ||||
-rw-r--r-- | dev-java/nexus-oss-bin/nexus-oss-bin-3.14.0-r1.ebuild | 88 |
4 files changed, 103 insertions, 3 deletions
diff --git a/dev-java/nexus-oss-bin/Manifest b/dev-java/nexus-oss-bin/Manifest index 45605b0..1566a00 100644 --- a/dev-java/nexus-oss-bin/Manifest +++ b/dev-java/nexus-oss-bin/Manifest @@ -1,6 +1,8 @@ -AUX nexus-oss.service 293 BLAKE2B 10e0fd9e5bb995bf434cbb4c4a522961acb5c0da792ccf310fbabb8bebe1d79738404d0f003aebc9dd39448d1d8bb837df290128c8a1e3e5175d1b40cde371ff SHA512 f65e51d0c1cee2516ddb15c99e9c1b287276de5f965cb2abbe221f8d6d2f6ce598754c8bacb8dc116531de50429befb8e7cdff80bf96547ff453d4b91008b462 +AUX nexus-oss-bin_run_as_user.patch 248 BLAKE2B 665accd3fbbcac5ffae37c50d03df0d59d445e8cd1ab6753f6e4d497d35d349c05e42e65fd3d7e516d151ef26c140fe712bb8645970b093ac2b43d898aa1304a SHA512 bbc15de98c51e4d6ba43a916bd18d23837bf40ac509222a9e5b539b5ef1ee7f735913130671b8f21d9c003cf7f20d9fdaf1744df6e0c80fb15dced4726c91ab1 +AUX nexus-oss.service 329 BLAKE2B 68098e91b78caabeafbf7a2ea4b4e604ff4ac00ab9757d65f2a414feffb50ea67c00480c6e8118c28bbb4fdb53a2c1869b94ed1954d4bc06f0e8e6b6c1caacbe SHA512 7a6b3c67bf54e1ae79a3af3587b0de214aa6bb5fdf0ed8a428c0e2ba51028e7ace11a0dcbe865d296a9696b88257f29aef60405ecaa85c916b8889fe41d88b27 DIST nexus-3.14.0-04-unix.tar.gz 125423547 BLAKE2B 06b58fe430c72f253ed0d49965aef69860141eca380ccaa76af2ffd12343e8a5cf2ac276e43810cc07a6a5c5fe75768ce908971aec4443caea0a8684fa1ba01e SHA512 2f4ce0bf4b1fdc6854713610892d20850004517b40176c025279c31323b1b81611d8ca109cfd765108640cff26b1a721a5c9d7704d03957521621f615a51b420 DIST nexus-3.7.0-04-unix.tar.gz 112670551 BLAKE2B b158d5ca666199bb7a205c127fad9a1547585d8ccc52ea858957a0aa64a6d3340bfc9476440e245af534df2f31f81871fc3b1e448d789039c616cbcac836e317 SHA512 78bca14e145e5c7878c755d74343496d78061ea4d53d75be75f3ba524df2796d7b323d94135ea4442ae297b12cd18f5096467cc765c0209a3ccd4652eabf478a +EBUILD nexus-oss-bin-3.14.0-r1.ebuild 2400 BLAKE2B a0d201503890cda5e673b48f40465ee0d5b854d3294f8d0b448bb4d7f6e62d3125c51357965e711957cc9f91d78a0bce692a21d15cb8ee8ee5f7f2e0a8d0e552 SHA512 d38f02b4a63750011c60754823f1f4e857b323e4bd961d68448445bf330af61d58f073fd15903f4b7278a9943c626f165d74b295669a423a3903d2a634a137f9 EBUILD nexus-oss-bin-3.14.0.ebuild 1777 BLAKE2B 3450826df52f0ac0b32c33e0f4bf19fba0938d095a7070eaabe686a3de4bf439a100e94620284603310cdb92c7eeb5479b69513061276bd07688d2056bbd83b0 SHA512 c119453ad1a5de4211b3749de6b73e20d48d946237bf8f11e1ad60bfe867d0a279b6095bb2feb15a11f08943afb585f232b5faea53d8c0be16506b939cb7e8a0 EBUILD nexus-oss-bin-3.7.0.ebuild 1777 BLAKE2B 3450826df52f0ac0b32c33e0f4bf19fba0938d095a7070eaabe686a3de4bf439a100e94620284603310cdb92c7eeb5479b69513061276bd07688d2056bbd83b0 SHA512 c119453ad1a5de4211b3749de6b73e20d48d946237bf8f11e1ad60bfe867d0a279b6095bb2feb15a11f08943afb585f232b5faea53d8c0be16506b939cb7e8a0 MISC metadata.xml 1392 BLAKE2B deda1cf98f75673bfede9344e3344a522e3bdd974fb19dc62a8185a39b51a80c28ebf6a47d75e5a091563fdc6e412f9b3dfeff67f8f842833bf30625c4415a34 SHA512 86204a863173c7d491cdf361f78be360bd8c192ebfdb51d1205439742967b62c196bbe99c20580e05fa2414786787ecdd896ee304ac29c17e28d0d85b3966523 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 new file mode 100644 index 0000000..1eedb53 --- /dev/null +++ b/dev-java/nexus-oss-bin/files/nexus-oss-bin_run_as_user.patch @@ -0,0 +1,8 @@ +diff -Naur a/bin/nexus.rc b/bin/nexus.rc +--- a/bin/nexus.rc 2018-10-12 05:00:40.000000000 +0100 ++++ b/bin/nexus.rc 2018-11-20 19:53:52.961818623 +0000 +@@ -1 +1,2 @@ +-#run_as_user="" +\ No newline at end of file ++#run_as_user="" ++run_as_user="nexus" diff --git a/dev-java/nexus-oss-bin/files/nexus-oss.service b/dev-java/nexus-oss-bin/files/nexus-oss.service index 4943ab4..71909b3 100644 --- a/dev-java/nexus-oss-bin/files/nexus-oss.service +++ b/dev-java/nexus-oss-bin/files/nexus-oss.service @@ -3,12 +3,14 @@ Description=Sonatype Nexus 3.x After=network.target [Service] +Type=forking +LimitNOFILE=65536 ExecStart=/opt/nexus-oss/bin/nexus start ExecStop=/opt/nexus-oss/bin/nexus stop ExecReload=/opt/nexus-oss/bin/nexus restart -PIDFile=/opt/nexus-oss/run/nexus.pid -Type=forking +#PIDFile=/opt/nexus-oss/run/nexus.pid User=nexus +Restart=on-abort [Install] WantedBy=multi-user.target 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 new file mode 100644 index 0000000..25692cb --- /dev/null +++ b/dev-java/nexus-oss-bin/nexus-oss-bin-3.14.0-r1.ebuild @@ -0,0 +1,88 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=4 + +inherit eutils user versionator systemd + +DESCRIPTION="Maven Repository Manager" +HOMEPAGE="http://nexus.sonatype.org/" +LICENSE="GPL-3" +MY_PN="nexus" +MY_PV="${PV}-04-unix" +#echo "Debug: custom package version: ${MY_PV}" +MY_P="${MY_PN}-${MY_PV}" +MY_MV="3" + +SRC_URI="http://download.sonatype.com/${MY_PN}/${MY_MV}/${MY_P}.tar.gz" +RESTRICT="mirror" +KEYWORDS="~x86 ~amd64" +SLOT="${MY_MV}" +IUSE="" +S="${WORKDIR}" +#echo "Debug: working directory: ${WORKDIR}" +RDEPEND=">=virtual/jdk-1.8" +INSTALL_DIR="/opt/nexus-oss" + +pkg_setup() { +#enewgroup <name> [gid] +enewgroup nexus +#enewuser <user> [uid] [shell] [homedir] [groups] [params] +enewuser nexus -1 /bin/bash "${INSTALL_DIR}" "nexus" +} + +src_unpack() { +unpack ${A} +} + +src_prepare() { +cd "${S}" +if -f "${FILESDIR}/${P}.patch"; then + epatch "${FILESDIR}/${P}.patch" +fi +epatch_user +} + +src_install() { +#echo "Debug: install sonatype work dir" +dodir ${INSTALL_DIR/nexus-oss/sonatype-work} +insinto ${INSTALL_DIR/nexus-oss/sonatype-work} +doins -r sonatype-work/* + +fowners -R nexus:nexus ${INSTALL_DIR/nexus-oss/sonatype-work} + +#echo "Debug: INSTALL_DIR: ${INSTALL_DIR}" +#echo "Debug: doins nexus-${MY_PV}" +#echo "Debug: ${WORKDIR}/nexus-${MY_PV}/bin/nexus" +insinto ${INSTALL_DIR} + +dodir ${INSTALL_DIR}/run +dodir "/etc/init.d/" +doins -r ${MY_P/-unix/}/* +doins -r ${MY_P/-unix/}/.??* +#BUG: nexus init script needs a symlink because it uses program path to find their configuration files +#newinitd "${WORKDIR}/nexus-${MY_PV}/bin/nexus" nexus +dosym ${INSTALL_DIR}/bin/nexus /etc/init.d/nexus +systemd_dounit "${FILESDIR}"/nexus-oss.service + +fowners -R nexus:nexus ${INSTALL_DIR} +fperms 755 "${INSTALL_DIR}/bin/nexus" + +#echo "Change NEXUS_HOME to the absolute folder location in your .bashrc file, then save" +echo NEXUS_HOME=\"${INSTALL_DIR}\" >> ${ED}/${INSTALL_DIR}/.bashrc +fowners -R nexus:nexus ${INSTALL_DIR}/.bashrc +fperms 644 ${INSTALL_DIR}/.bashrc +} + +pkg_postinst() { + ewarn "Activate the service with the following commands:" + ewarn "sudo systemctl daemon-reload" + ewarn "sudo systemctl enable nexus-oss.service" + ewarn "sudo systemctl start nexus-oss.service" + ewarn " " + elog "After starting the service in Gentoo, verify that" + elog "the service started successfully." + elog "tail -f /opt/sonatype-work/nexus3/log/nexus.log" +} + |