public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/proj/guru:dev commit in: net-misc/yacy/, net-misc/yacy/files/
@ 2022-05-18 15:01 Tony Olagbaiye
  0 siblings, 0 replies; only message in thread
From: Tony Olagbaiye @ 2022-05-18 15:01 UTC (permalink / raw
  To: gentoo-commits

commit:     44e6b7f780363a63c5b4280433502a4d929e0b14
Author:     bqv <bqv <AT> fron <DOT> io>
AuthorDate: Wed May 18 14:53:22 2022 +0000
Commit:     Tony Olagbaiye <gentoo <AT> fron <DOT> io>
CommitDate: Wed May 18 15:01:08 2022 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=44e6b7f7

net-misc/yacy: new package, add 1.924.20210209.10069

Signed-off-by: Tony Olagbaiye <bqv <AT> fron.io>

 net-misc/yacy/Manifest                         |  1 +
 net-misc/yacy/files/yacy-ipv6.service          | 13 +++++
 net-misc/yacy/files/yacy.confd                 | 18 +++++++
 net-misc/yacy/files/yacy.rc                    | 75 ++++++++++++++++++++++++++
 net-misc/yacy/files/yacy.service               | 13 +++++
 net-misc/yacy/yacy-1.924.20210209.10069.ebuild | 71 ++++++++++++++++++++++++
 6 files changed, 191 insertions(+)

diff --git a/net-misc/yacy/Manifest b/net-misc/yacy/Manifest
new file mode 100644
index 000000000..d98eb3a96
--- /dev/null
+++ b/net-misc/yacy/Manifest
@@ -0,0 +1 @@
+DIST yacy_v1.924_20210209_10069.tar.gz 78723324 BLAKE2B b505e496a8cb8d10e1f1ef32b2d1d9766d4952aa477f20d2f4f13093acef8ab6272bbb747f561fd71b505598add914db45c1705099e38a604bc6baf292c64331 SHA512 c9c5d601baba57b57aad9c991f3aa10fde2143be08759fdef5901a9e8bcfa52496242dd003b23478376fbc368f48eb0be9496b2bdd01c799fa4fbd64fff517c2

diff --git a/net-misc/yacy/files/yacy-ipv6.service b/net-misc/yacy/files/yacy-ipv6.service
new file mode 100644
index 000000000..34e409729
--- /dev/null
+++ 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
new file mode 100644
index 000000000..8ddd3e6dd
--- /dev/null
+++ 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
new file mode 100644
index 000000000..225cd38db
--- /dev/null
+++ 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
new file mode 100644
index 000000000..187e9e9ee
--- /dev/null
+++ 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.924.20210209.10069.ebuild b/net-misc/yacy/yacy-1.924.20210209.10069.ebuild
new file mode 100644
index 000000000..7aceafe32
--- /dev/null
+++ b/net-misc/yacy/yacy-1.924.20210209.10069.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+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="systemd +openrc"
+
+DEPEND=">=virtual/jdk-1.8"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${PN}"
+
+EANT_BUILD_TARGET="all"
+UNINSTALL_IGNORE="/usr/share/yacy/DATA"
+
+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
+	keepdir /var/log/yacy
+
+	rmdir "$D/$yacy_home/DATA"
+	dosym /var/lib/yacy /${yacy_home}/DATA
+
+	use openrc && {
+		exeinto /etc/init.d
+		newexe "${FILESDIR}/yacy.rc" yacy
+		insinto /etc/conf.d
+		newins "${FILESDIR}/yacy.confd" yacy
+	}
+
+	use systemd && 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."
+}


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-18 15:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-18 15:01 [gentoo-commits] repo/proj/guru:dev commit in: net-misc/yacy/, net-misc/yacy/files/ Tony Olagbaiye

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox