summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pcr/yacy/PKGBUILD42
-rw-r--r--pcr/yacy/yacy.install37
-rw-r--r--pcr/yacy/yacy.service14
-rw-r--r--pcr/yacy/yacy.sh74
4 files changed, 167 insertions, 0 deletions
diff --git a/pcr/yacy/PKGBUILD b/pcr/yacy/PKGBUILD
new file mode 100644
index 000000000..f890998d9
--- /dev/null
+++ b/pcr/yacy/PKGBUILD
@@ -0,0 +1,42 @@
+# Maintainer (Arch): Andreas B. Wagner <AndreasBWagner@pointfree.net>
+# Maintainer (Arch): Timothy Redaelli <timothy.redaelli@gmail.com>
+# Contributor (Arch): Dan Serban
+# Contributor (Arch): Florian Richter <Florian_Richter@gmx.de>
+
+pkgname=yacy
+pkgver=1.82
+_pkgextraver=20150121_9000
+pkgrel=2
+pkgdesc="Peer to peer search engine"
+arch=('any')
+url=http://www.yacy.net/
+license=('GPL2')
+depends=('java-environment')
+makedepends=('apache-ant')
+install=yacy.install
+source=("http://www.yacy.net/release/yacy_v${pkgver}_${_pkgextraver}.tar.gz"
+ 'yacy.sh'
+ 'yacy.service')
+options=(!emptydirs)
+sha512sums=('cf76d19b76f68fac8fc3aa6478d09d3d071e4e0ecdc01475d43ec651bd38883b5a6b5e6abfc04e966e1cefd5785a709fbd6a20601d0275fa7ee27b00a012c7f9'
+ 'ba15bcb3ee1873bae57881ca4d96f65ee1fa5b40cff0f0c21c542cad6a7983a057ec83faae9452b426d5441aad02f80e3633d1798d7f0d84a680ed2233adb11f'
+ '754b6224ef2a640cbfb50a3d46e92c04955dac3e683239872d2a5c9ba92016a1511c6049903322dd8a21e6d2cc51e2f4e9bd3339b4ef4aada68ae20b3acc189b')
+
+build() {
+ . /etc/profile.d/apache-ant.sh
+
+ cd "$srcdir/$pkgname"
+ ant all
+}
+
+package() {
+ cd "$srcdir/$pkgname"
+ ant installonlinux -DDESTDIR="$pkgdir/"
+ install -d "$pkgdir"/usr/share/java/yacy
+ install -t "$pkgdir"/usr/share/java/yacy/ lib/*.jar
+
+ install -Dm755 "${srcdir}/yacy.sh" "${pkgdir}/opt/yacy/yacy"
+ install -Dm644 "${srcdir}/yacy.service" "${pkgdir}/usr/lib/systemd/system/yacy.service"
+
+ rm -f "$pkgdir"/etc/yacy "$pkgdir"/usr/share/yacy/DATA "$pkgdir"/var/log/yacy
+}
diff --git a/pcr/yacy/yacy.install b/pcr/yacy/yacy.install
new file mode 100644
index 000000000..dbd350d17
--- /dev/null
+++ b/pcr/yacy/yacy.install
@@ -0,0 +1,37 @@
+post_install() {
+ echo
+ echo -n ">>> Creating yacy system user and group... "
+ getent group yacy &>/dev/null || groupadd -r yacy
+ getent passwd yacy &>/dev/null || /usr/sbin/useradd --comment 'YaCy P2P Searchengine' --system -g yacy --home '/usr/share/yacy/' -s /bin/false yacy
+ mkdir -p /var/lib/yacy
+ chown -R yacy:yacy /var/lib/yacy /opt/yacy
+ rm -f /usr/share/yacy/DATA
+ ln -s /var/lib/yacy /usr/share/yacy/DATA
+ echo "done"
+ echo
+}
+
+post_upgrade() {
+ chown -R yacy:yacy /var/lib/yacy /opt/yacy
+ systemctl --system daemon-reload
+}
+
+pre_remove() {
+ echo
+ echo -n ">>> Removing yacy system user and group... "
+ getent passwd yacy &>/dev/null &&
+ /usr/sbin/userdel yacy &>/dev/null
+ getent group yacy &>/dev/null &&
+ groupdel yacy &>/dev/null
+ rm -f /usr/share/yacy/DATA
+ echo "done"
+ echo
+}
+
+post_remove() {
+ echo
+ echo "-> All configfiles and the cache are in /var/lib/yacy/"
+ echo "-> You may use this for another installation."
+ echo "-> If you don't need it, you should delete it, because"
+ echo "-> it may have grown very large"
+}
diff --git a/pcr/yacy/yacy.service b/pcr/yacy/yacy.service
new file mode 100644
index 000000000..4dd6d84cb
--- /dev/null
+++ b/pcr/yacy/yacy.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=YaCy P2P Web Search
+After=network.target
+
+[Service]
+PIDFile=/opt/yacy/.yacy/yacy.pid
+ExecStart=/opt/yacy/yacy start
+ExecReload=/opt/yacy/yacy restart
+ExecStop=/opt/yacy/yacy stop
+User=yacy
+TimeoutStopSec=50
+
+[Install]
+WantedBy=multi-user.target
diff --git a/pcr/yacy/yacy.sh b/pcr/yacy/yacy.sh
new file mode 100644
index 000000000..ddbdadbd1
--- /dev/null
+++ b/pcr/yacy/yacy.sh
@@ -0,0 +1,74 @@
+#!/bin/sh
+YACY_HOME=/usr/share/yacy
+JAVA_ARGS="-server -Xss256k -XX:MaxPermSize=256m -XX:ReservedCodeCacheSize=1024m -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseGCOverheadLimit -XX:+UseAdaptiveSizePolicy -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Dfile.encoding=UTF-8"
+#check if system supports large memory pages and enable it if possible
+HUGEPAGESTOTAL="$(cat /proc/meminfo | grep HugePages_Total | sed s/[^0-9]//g)"
+if [ -n "$HUGEPAGESTOTAL" ] && [ $HUGEPAGESTOTAL -ne 0 ]
+then
+ JAVA_ARGS="$JAVA_ARGS -XX:+UseLargePages"
+fi
+
+[ -f /etc/profile.d/jre.sh ] && . /etc/profile.d/jre.sh
+
+[ -f /etc/conf.d/yacy ] && . /etc/conf.d/yacy
+
+if [ "$(id -u)" != "0" -a "$(whoami)" != "$USER" ] ; then
+ echo "please run this script as root!"
+ exit 4
+fi
+
+JAVA=$(which java 2> /dev/null)
+if [ ! -x "$JAVA" ]; then
+ echo "The 'java' command is not executable."
+ echo "Either you have not installed java or it is not in your PATH"
+ if [ $1 == "stop" -a $2 == "--force" ]; then exit 0; else exit 1; fi
+fi
+
+cd $YACY_HOME
+
+#get javastart args
+if [ -s DATA/SETTINGS/yacy.conf ]
+then
+ # startup memory
+ for i in Xmx Xms; do
+ j=$(grep javastart_$i DATA/SETTINGS/yacy.conf | sed 's/^[^=]*=//')
+ if [ -n $j ]; then JAVA_ARGS="-$j $JAVA_ARGS"
+ fi
+ done
+
+ # Priority
+ j=$(grep javastart_priority DATA/SETTINGS/yacy.conf | sed 's/^[^=]*=//')
+
+ if [ ! -z "$j" ];
+ then
+ if [ -n $j ]
+ then NICE_VAL=$j
+ fi
+ fi
+
+else
+ JAVA_ARGS="-Xmx120m -Xms120m $JAVA_ARGS"
+fi
+
+
+CP=/usr/share/java/yacy.jar:$YACY_HOME/htroot
+for name in /usr/share/java/yacy/*.jar; do
+ CP=$CP:$name
+done
+CLASSPATH=$CP
+
+case "$1" in
+ start)
+ printf "Starting YaCy Daemon\n"
+ ARGS="$JAVA_ARGS -classpath $CLASSPATH net.yacy.yacy"
+ $JAVA $ARGS
+ ;;
+ stop)
+ $JAVA $JAVA_ARGS -cp $CLASSPATH net.yacy.yacy -shutdown
+ ;;
+ restart)
+ $0 stop
+ sleep 3
+ $0 start
+ ;;
+esac