logo

overlay

My own overlay for experimentations, use with caution, no support is provided
commit: 14fd90fffab962a4123af80b9acbde62b890af2a
parent: cfe6e8c5516859c8e0b5654e97b102fef718a5da
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Thu, 26 Mar 2020 06:27:34 +0100

net-misc/yacy: New package (based on ::booboo)

Diffstat:

Anet-misc/yacy/Manifest1+
Anet-misc/yacy/files/yacy-ipv6.service13+++++++++++++
Anet-misc/yacy/files/yacy.confd18++++++++++++++++++
Anet-misc/yacy/files/yacy.rc75+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Anet-misc/yacy/files/yacy.service13+++++++++++++
Anet-misc/yacy/yacy-1.922.20191013.9964.ebuild66++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 186 insertions(+), 0 deletions(-)

diff --git a/net-misc/yacy/Manifest b/net-misc/yacy/Manifest @@ -0,0 +1 @@ +DIST yacy_v1.922_20191013_9964.tar.gz 76224245 BLAKE2B a9f29c28b8fd1d4daad0ffe207ac5ee9493f16437cd6c2b7bbbf5c7677f020eeea7bd4357fd5f51008ed5f3039ff7dde0f283b18695f1181da7b71417df9dff4 SHA512 cc21a5513a25da9941c9bac6d1006eee733290ccb1fa4038e3a7228bfb384344985797cb23b643772feffadcb55f6a1b972f52b9e386a15bf3a9029fa1dfce05 diff --git a/net-misc/yacy/files/yacy-ipv6.service b/net-misc/yacy/files/yacy-ipv6.service @@ -0,0 +1,13 @@ +[Unit] +Description=YaCy +After=network.target + +[Service] +Environment=CLASSPATH=.:htroot:lib/* +Environment="JAVA_ARGS=-Xmx600m -Xms180m -server -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Dsolr.directoryFactsolr.MMapDirectoryFactory" +ExecStart=/usr/bin/java $JAVA_ARGS net.yacy.yacy +User=yacy +WorkingDirectory=/usr/share/yacy + +[Install] +WantedBy=multi-user.target diff --git a/net-misc/yacy/files/yacy.confd b/net-misc/yacy/files/yacy.confd @@ -0,0 +1,18 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +# home-directory +YACY_HOME="/usr/share/yacy" + +# user to run yacy as +YACY_USER="yacy" + +# java options (optional) +JAVA_OPTIONS="-Xmx600m -Xms180m" + +# niceness (optional) +NICENESS="1" + +# wait on stop, should be maxWaitingWordFlush, see DATA/SETTINGS/httpProxy.conf +WAIT_ON_STOP="180" diff --git a/net-misc/yacy/files/yacy.rc b/net-misc/yacy/files/yacy.rc @@ -0,0 +1,75 @@ +#!/sbin/openrc-run +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +depend() { + need net +} + +cd $YACY_HOME + +JAVA="$(java-config --java)" + +JAVA_ARGS="" +if [ -e DATA/SETTINGS/httpProxy.conf ] ; then + for i in $(grep javastart DATA/SETTINGS/httpProxy.conf); do + i="${i#javastart_*=}"; + JAVA_ARGS=-$i" "$JAVA_ARGS; + done +fi + +CLASSPATH="" +test -e lib/ && for N in `ls -1 lib/*.jar`; do CLASSPATH="$CLASSPATH$N:"; done +CLASSPATH="-classpath classes:htroot:$CLASSPATH" + +if [ -n "${NICENESS}" ] ; then + NICE="nice -n ${NICENESS}" +fi + +#PORT="8090" + +start() { + set -x + ebegin "Starting YaCy" + ${NICE} sudo -u ${YACY_USER} ${JAVA} ${JAVA_OPTIONS} ${JAVA_ARGS} ${CLASSPATH} net.yacy.yacy & + echo $! > /var/run/yacy.pid + sleep 1 + ps ax|grep "^ *$(cat /var/run/yacy.pid)" > /dev/null + eend $? +} + +stop() { + ebegin "Shutting down YaCy" + sudo -u ${YACY_USER} ${JAVA} ${JAVA_OPTIONS} ${JAVA_ARGS} ${CLASSPATH} net.yacy.yacy -shutdown &> /dev/null & + einfon "Waiting ." + cnt=0 + while ( ps ax|grep "^ *$(cat /var/run/yacy.pid)" > /dev/null ) + do + cnt=`expr $cnt + 2` + if [ $cnt -gt ${WAIT_ON_STOP} ] ; then + eend 1 "Failed." + exit + fi + sleep 2 + echo -n "." + done + rm /var/run/yacy.pid + echo "done." + eend $? +} + +status() { + if service_started "${myservice}" ; then + if ! ps p `cat /var/run/yacy.pid` &> /dev/null ; then + eerror "Service seems to be down" + return 1 + fi + else + if [ -e /var/run/yacy.pid ]; then + eerror "Service seems to be running already" + return 1 + fi + return 0 + fi +} diff --git a/net-misc/yacy/files/yacy.service b/net-misc/yacy/files/yacy.service @@ -0,0 +1,13 @@ +[Unit] +Description=YaCy +After=network.target + +[Service] +Environment=CLASSPATH=.:htroot:lib/* +Environment="JAVA_ARGS=-Xmx600m -Xms180m -server -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Dsolr.directoryFactsolr.MMapDirectoryFactory" +ExecStart=/usr/bin/java $JAVA_ARGS net.yacy.yacy +User=yacy +WorkingDirectory=/usr/share/yacy + +[Install] +WantedBy=multi-user.target diff --git a/net-misc/yacy/yacy-1.922.20191013.9964.ebuild b/net-misc/yacy/yacy-1.922.20191013.9964.ebuild @@ -0,0 +1,66 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 + +inherit eutils java-pkg-2 java-ant-2 systemd versionator user +MAJOR_PV="$(get_version_component_range 1-2)" +REL_PV="$(get_version_component_range 3)" +SVN_PV="$(get_version_component_range 4)" + +DESCRIPTION="YaCy - p2p based distributed web-search engine" +HOMEPAGE="http://www.yacy.net/" +SRC_URI="http://www.yacy.net/release/yacy_v${MAJOR_PV}_${REL_PV}_${SVN_PV}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +DEPEND=">=virtual/jdk-1.8" +RDEPEND="${DEPEND}" + +S="${WORKDIR}/${PN}" + +EANT_BUILD_TARGET="all" + +pkg_setup() { + enewgroup yacy + enewuser yacy -1 -1 /var/lib/yacy yacy +} + +src_install() { + # remove win-only stuff + find "${S}" -name "*.bat" -exec rm '{}' \; || die + # remove init-scripts + rm ${S}/*.sh || die + # remove sources + rm -r "${S}/source" || die + rm ${S}/build.properties ${S}/build.xml + + dodoc AUTHORS NOTICE && rm AUTHORS NOTICE COPYRIGHT gpl.txt + + yacy_home="${EROOT}usr/share/${PN}" + dodir ${yacy_home} + cp -r ${S}/* ${D}${yacy_home} || die + + rm -r ${D}${yacy_home}/lib/*License + + dodir /var/log/yacy || die + chown yacy:yacy "${D}/var/log/yacy" || die + + rmdir "$D/$yacy_home/DATA" + dosym /var/lib/yacy /${yacy_home}/DATA + + exeinto /etc/init.d + newexe "${FILESDIR}/yacy.rc" yacy + insinto /etc/conf.d + newins "${FILESDIR}/yacy.confd" yacy + + systemd_newunit "${FILESDIR}"/${PN}-ipv6.service ${PN}.service +} + +pkg_postinst() { + einfo "yacy.logging will write logfiles into /var/lib/yacy/LOG" + einfo "To setup YaCy, open http://localhost:8090 in your browser." +}