summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Wagner2015-06-11 10:38:15 -0400
committerAndreas Wagner2015-06-11 10:38:15 -0400
commitec7b8617f341a902578da1d68f4f239c4787c368 (patch)
tree4f1049bcdd6787be87c3450a96dcf577ba0f66b1
downloadaur-ec7b8617f341a902578da1d68f4f239c4787c368.tar.gz
Initial import
-rw-r--r--.SRCINFO21
-rw-r--r--PKGBUILD43
-rw-r--r--yacy.install37
-rw-r--r--yacy.service14
-rw-r--r--yacy.sh74
5 files changed, 189 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..116c0c1a6ff3
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,21 @@
+pkgbase = yacy
+ pkgdesc = Peer to peer search engine
+ pkgver = 1.82
+ pkgrel = 2
+ url = http://www.yacy.net/
+ install = yacy.install
+ arch = any
+ license = GPL2
+ makedepends = apache-ant
+ depends = java-environment
+ options = !emptydirs
+ source = http://www.yacy.net/release/yacy_v1.82_20150121_9000.tar.gz
+ source = yacy.sh
+ source = yacy.service
+ sha512sums = cf76d19b76f68fac8fc3aa6478d09d3d071e4e0ecdc01475d43ec651bd38883b5a6b5e6abfc04e966e1cefd5785a709fbd6a20601d0275fa7ee27b00a012c7f9
+ sha512sums = 7cf58016c099fd63af8611a2618a562fd3a6e8b46507ca3c8b44a1ba4822ad8a7ff27bef6a431f4c6b1fa273aaa42dea41d91201cacbe6d07191fddf8eacec7c
+ sha512sums = ba15bcb3ee1873bae57881ca4d96f65ee1fa5b40cff0f0c21c542cad6a7983a057ec83faae9452b426d5441aad02f80e3633d1798d7f0d84a680ed2233adb11f
+ sha512sums = 754b6224ef2a640cbfb50a3d46e92c04955dac3e683239872d2a5c9ba92016a1511c6049903322dd8a21e6d2cc51e2f4e9bd3339b4ef4aada68ae20b3acc189b
+
+pkgname = yacy
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..8b945fa1f2d0
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,43 @@
+# Maintainer: Andreas B. Wagner <AndreasBWagner@pointfree.net>
+# Maintainer: Timothy Redaelli <timothy.redaelli@gmail.com>
+# Contributor: Dan Serban
+# Contributor: 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'
+ '7cf58016c099fd63af8611a2618a562fd3a6e8b46507ca3c8b44a1ba4822ad8a7ff27bef6a431f4c6b1fa273aaa42dea41d91201cacbe6d07191fddf8eacec7c'
+ '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/yacy.install b/yacy.install
new file mode 100644
index 000000000000..dbd350d17a1b
--- /dev/null
+++ b/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/yacy.service b/yacy.service
new file mode 100644
index 000000000000..4dd6d84cb279
--- /dev/null
+++ b/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/yacy.sh b/yacy.sh
new file mode 100644
index 000000000000..ddbdadbd112a
--- /dev/null
+++ b/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