diff options
author | Marcel Campello Ferreira | 2014-01-12 01:03:51 -0200 |
---|---|---|
committer | Marcel Campello Ferreira | 2014-01-12 01:03:51 -0200 |
commit | 36ffc99959483d57048ff4a6c3abab06604a7c97 (patch) | |
tree | 1f132ad47b6fcdd566d85a04152935f4ce47dc0f | |
download | aur-36ffc99959483d57048ff4a6c3abab06604a7c97.tar.gz |
Version 2.0.0-1 (uploaded on 2014-01-07).
-rw-r--r-- | .SRCINFO | 31 | ||||
-rw-r--r-- | PKGBUILD | 84 | ||||
-rw-r--r-- | bin.patch | 119 | ||||
-rw-r--r-- | conf.patch | 122 | ||||
-rw-r--r-- | neo4j.install | 27 | ||||
-rw-r--r-- | neo4j.service | 9 |
6 files changed, 392 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..1c69876f5073 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,31 @@ +pkgbase = neo4j + pkgdesc = A fully transactional graph database implemented in Java + pkgver = 2.0.0 + pkgrel = 1 + url = http://neo4j.org/ + install = neo4j.install + arch = any + license = GPL + depends = bash + depends = lsof + depends = java-runtime + options = !strip + backup = etc/neo4j/custom-logback.xml + backup = etc/neo4j/logging.properties + backup = etc/neo4j/neo4j-http-logging.xml + backup = etc/neo4j/neo4j-server.properties + backup = etc/neo4j/neo4j-wrapper.conf + backup = etc/neo4j/neo4j.properties + source = http://dist.neo4j.org/neo4j-community-2.0.0-unix.tar.gz + source = bin.patch + source = conf.patch + source = neo4j.install + source = neo4j.service + sha256sums = 44a7160ead5cf70a385cceed30f7e999e29047b39ca92ac346bd230e2767f2ff + sha256sums = 3b7dfe7448e82a7be4dfa31d1d30aa3921a483c6a33926800664af3bef25e3d2 + sha256sums = d230ccb4d2ddd7bc504d729c50170c39acc8f16815168f99b82f4d7fdd07b094 + sha256sums = 2885511c87bd9594ffb81715fe4b9163c1f895c43206bc6f06048deca26d0de5 + sha256sums = 9a02869e8e974e6bb2003b920a43652605c0e7431f54b59a16fc566bc1833497 + +pkgname = neo4j + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..e39b648e2322 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,84 @@ +# Maintainer: Marcel Campello Ferreira <tucho.tijucano@gmail.com> +pkgname=neo4j +pkgver=2.0.0 +pkgrel=1 +pkgdesc="A fully transactional graph database implemented in Java" +arch=(any) +url="http://neo4j.org/" +license=(GPL) +depends=(bash lsof java-runtime) +backup=(etc/neo4j/custom-logback.xml + etc/neo4j/logging.properties + etc/neo4j/neo4j-http-logging.xml + etc/neo4j/neo4j-server.properties + etc/neo4j/neo4j-wrapper.conf + etc/neo4j/neo4j.properties) +options=(!strip) +install=neo4j.install +source=(http://dist.neo4j.org/neo4j-community-$pkgver-unix.tar.gz + bin.patch + conf.patch + neo4j.install + neo4j.service) +sha256sums=(44a7160ead5cf70a385cceed30f7e999e29047b39ca92ac346bd230e2767f2ff + 3b7dfe7448e82a7be4dfa31d1d30aa3921a483c6a33926800664af3bef25e3d2 + d230ccb4d2ddd7bc504d729c50170c39acc8f16815168f99b82f4d7fdd07b094 + 2885511c87bd9594ffb81715fe4b9163c1f895c43206bc6f06048deca26d0de5 + 9a02869e8e974e6bb2003b920a43652605c0e7431f54b59a16fc566bc1833497) + +prepare() { + + cd $srcdir/neo4j-community-$pkgver + + rm conf/windows-wrapper-logging.properties + rm bin/neo4j-installer + rm bin/org.neo4j.server.plist + + # Adjust configuration to match new directory structure + patch -Np1 -i ../conf.patch + patch -Np1 -i ../bin.patch +} + +package() { + + cd $srcdir/neo4j-community-$pkgver + + # Config files + install -dm755 $pkgdir/etc/neo4j + cp -r conf/* $pkgdir/etc/neo4j + + # Copy JARs in lib, system and plugins + install -dm755 $pkgdir/usr/share/java/neo4j + cp -r lib/* $pkgdir/usr/share/java/neo4j + install -dm755 $pkgdir/usr/share/java/neo4j/system + cp -r system/* $pkgdir/usr/share/java/neo4j/system + install -dm755 $pkgdir/usr/share/java/neo4j/plugins + cp -r plugins/* $pkgdir/usr/share/java/neo4j/plugins + + # Executable files + install -dm755 $pkgdir/usr/share/neo4j/bin + cp -r bin/* $pkgdir/usr/share/neo4j/bin + + install -dm755 $pkgdir/usr/bin + ln -s /usr/share/neo4j/bin/neo4j $pkgdir/usr/bin/neo4j + ln -s /usr/share/neo4j/bin/neo4j-shell $pkgdir/usr/bin/neo4j-shell + + # Data and log files + install -dm755 $pkgdir/var/lib/neo4j/data + install -dm755 $pkgdir/var/log/neo4j + + # Documentation files + install -dm 755 $pkgdir/usr/share/doc/neo4j + cp -r doc/* $pkgdir/usr/share/doc/neo4j + + # License files + install -dm755 $pkgdir/usr/share/licenses/neo4j + cp LICENSE.txt LICENSES.txt NOTICE.txt $pkgdir/usr/share/licenses/neo4j + + # Service definition files + cd $srcdir + install -Dm644 neo4j.service $pkgdir/usr/lib/systemd/system/neo4j.service + + # Runtime files + install -dm755 $pkgdir/run/neo4j +} diff --git a/bin.patch b/bin.patch new file mode 100644 index 000000000000..8139c5c04dea --- /dev/null +++ b/bin.patch @@ -0,0 +1,119 @@ +diff -Naur neo4j-community-2.0.0.orig/bin/neo4j neo4j-community-2.0.0/bin/neo4j +--- neo4j-community-2.0.0.orig/bin/neo4j 2013-12-08 13:51:51.000000000 -0200 ++++ neo4j-community-2.0.0/bin/neo4j 2013-12-20 16:15:21.365783596 -0200 +@@ -46,10 +46,11 @@ + cd "$(dirname "$SCRIPT")" + SCRIPT=`basename "$SCRIPT"` + done +- NEO4J_HOME=`cd $( dirname "$SCRIPT" )/.. && dirs -l +0` +- NEO4J_INSTANCE=$NEO4J_HOME +- NEO4J_CONFIG=$NEO4J_INSTANCE/conf +- NEO4J_LOG=$NEO4J_INSTANCE/data/log ++ NEO4J_HOME=/usr/share/java/neo4j ++ NEO4J_INSTANCE=/var/lib/neo4j ++ NEO4J_CONFIG=/etc/neo4j ++ NEO4J_LOG=/var/log/neo4j ++ NEO4J_SHARE=/usr/share/neo4j + + cd "$NEO4J_HOME" + } +@@ -67,14 +68,14 @@ + } + + findBaseDirAndCdThere +-source bin/utils ++source ${NEO4J_SHARE}/bin/utils + parseConfig + + JAVA_OPTS="-server -XX:+DisableExplicitGC ${wrapper_java_additional}" + [ -z "${wrapper_java_initmemory}" ] || JAVA_OPTS="$JAVA_OPTS -Xms${wrapper_java_initmemory}m" + [ -z "${wrapper_java_maxmemory}" ] || JAVA_OPTS="$JAVA_OPTS -Xmx${wrapper_java_maxmemory}m" + +-#NEO4J_SERVER_PORT=`( egrep "^org.neo4j.server.webserver.port" $NEO4J_INSTANCE/conf/neo4j-server.properties || echo 7474 ) | sed -e 's/.*=//'` ++#NEO4J_SERVER_PORT=`( egrep "^org.neo4j.server.webserver.port" ${NEO4J_CONFIG}/neo4j-server.properties || echo 7474 ) | sed -e 's/.*=//'` + NEO4J_SERVER_PORT=${org_neo4j_server_webserver_port:=7474} + + LAUNCHD_NAME="${LAUNCHD_NAME}.${NEO4J_SERVER_PORT}" +@@ -90,16 +91,16 @@ + # Username to propose for neo4j user, can be overridden by -u USERNAME option + DEFAULT_USER='neo4j' + +-SCRIPT_NAME="${NEO4J_HOME}/bin/neo4j" ++SCRIPT_NAME="/usr/bin/neo4j" + SERVICE_NAME=${wrapper_ntservice_name:=neo4j-service} + LAUNCHD_DIR=~/Library/LaunchAgents/ + + TIMEOUT=120 + +-PID_FILE=${NEO4J_INSTANCE}/data/neo4j-service.pid ++PID_FILE=/run/neo4j/neo4j-service.pid + buildclasspath() { + # confirm library jars +- LIBDIR="$NEO4J_HOME"/lib ++ LIBDIR="$NEO4J_HOME" + if [ ! -e "$LIBDIR" ] ; then + echo "Error: missing Neo4j Library, expected at $LIBDIR" + exit 1 +@@ -134,7 +135,7 @@ + CLASSPATH=${ALL_JARS} + + # add useful conf stuff to classpath - always a good idea +- CLASSPATH="$CLASSPATH":"$NEO4J_HOME"/conf/ ++ CLASSPATH="$CLASSPATH":"$NEO4J_CONFIG" + } + + detectrunning() { +@@ -289,16 +290,16 @@ + # pass in "true" for created to mark that the user was created (instead than pre-existing) + modify_user_config() { + created=${2:-"false"} +- if `grep -q "wrapper\.user=" "$NEO4J_INSTANCE/conf/neo4j-wrapper.conf"` ; then +- sed -i -e "s/^.*wrapper\.user=.*$/wrapper\.user=$1/" "$NEO4J_INSTANCE/conf/neo4j-wrapper.conf" ++ if `grep -q "wrapper\.user=" "$NEO4J_CONFIG/neo4j-wrapper.conf"` ; then ++ sed -i -e "s/^.*wrapper\.user=.*$/wrapper\.user=$1/" "$NEO4J_CONFIG/neo4j-wrapper.conf" + else +- echo "wrapper.user=$1" >> "$NEO4J_INSTANCE/conf/neo4j-wrapper.conf" ++ echo "wrapper.user=$1" >> "$NEO4J_CONFIG/neo4j-wrapper.conf" + fi + +- if `grep -q "wrapper\.user\.created=" "$NEO4J_INSTANCE/conf/neo4j-wrapper.conf"` ; then +- sed -i -e "s/^.*wrapper\.user\.created=.*$/wrapper\.user\.created=${created}/" "$NEO4J_INSTANCE/conf/neo4j-wrapper.conf" ++ if `grep -q "wrapper\.user\.created=" "$NEO4J_CONFIG/neo4j-wrapper.conf"` ; then ++ sed -i -e "s/^.*wrapper\.user\.created=.*$/wrapper\.user\.created=${created}/" "$NEO4J_CONFIG/neo4j-wrapper.conf" + else +- echo "wrapper.user.created=${created}" >> "$NEO4J_INSTANCE/conf/neo4j-wrapper.conf" ++ echo "wrapper.user.created=${created}" >> "$NEO4J_CONFIG/neo4j-wrapper.conf" + fi + } + +diff -Naur neo4j-community-2.0.0.orig/bin/neo4j-shell neo4j-community-2.0.0/bin/neo4j-shell +--- neo4j-community-2.0.0.orig/bin/neo4j-shell 2013-12-08 13:51:51.000000000 -0200 ++++ neo4j-community-2.0.0/bin/neo4j-shell 2014-01-06 16:03:05.279834973 -0200 +@@ -86,7 +86,7 @@ + + if [ -z "$REPO" ] + then +- REPO="$BASEDIR"/lib ++ REPO=/usr/share/java/neo4j/ + fi + + LIBRARY_JARS="" +diff -Naur neo4j-community-2.0.0.orig/bin/utils neo4j-community-2.0.0/bin/utils +--- neo4j-community-2.0.0.orig/bin/utils 2013-12-08 13:51:51.000000000 -0200 ++++ neo4j-community-2.0.0/bin/utils 2013-12-20 15:14:26.613409008 -0200 +@@ -325,11 +325,11 @@ + # in place. + checkandrepairenv() { + # Create data/log if missing, change owner if created. +- if [ ! -d "$NEO4J_HOME"/data/log ]; then +- echo "${NEO4J_HOME}/data/log was missing, recreating..." +- mkdir "$NEO4J_HOME"/data/log ++ if [ ! -d "$NEO4J_LOG" ]; then ++ echo "${NEO4J_LOG} was missing, recreating..." ++ mkdir "$NEO4J_LOG" + if [ $UID == 0 ] ; then +- chown $NEO4J_USER "$NEO4J_HOME"/data/log ++ chown $NEO4J_USER "$NEO4J_LOG" + fi + fi + } diff --git a/conf.patch b/conf.patch new file mode 100644 index 000000000000..71b764ec52e6 --- /dev/null +++ b/conf.patch @@ -0,0 +1,122 @@ +diff -Naur neo4j-community-2.0.0.orig/conf/logging.properties neo4j-community-2.0.0/conf/logging.properties +--- neo4j-community-2.0.0.orig/conf/logging.properties 2013-12-08 13:51:51.000000000 -0200 ++++ neo4j-community-2.0.0/conf/logging.properties 2013-12-19 14:01:10.531945416 -0200 +@@ -51,7 +51,7 @@ + # "%g" the generation number to distinguish rotated logs + # "%u" a unique number to resolve conflicts + # "%%" translates to a single percent sign "%" +-java.util.logging.FileHandler.pattern=data/log/neo4j.%u.%g.log ++java.util.logging.FileHandler.pattern=/var/log/neo4j/neo4j.%u.%g.log + + # Specifies whether the FileHandler should append onto any existing files + # (defaults to false): +diff -Naur neo4j-community-2.0.0.orig/conf/neo4j-http-logging.xml neo4j-community-2.0.0/conf/neo4j-http-logging.xml +--- neo4j-community-2.0.0.orig/conf/neo4j-http-logging.xml 2013-12-08 13:51:51.000000000 -0200 ++++ neo4j-community-2.0.0/conf/neo4j-http-logging.xml 2013-12-19 14:01:55.355564433 -0200 +@@ -21,9 +21,9 @@ + --> + <configuration> + <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> +- <file>data/log/http.log</file> ++ <file>/var/log/neo4j/http.log</file> + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> +- <fileNamePattern>data/log/http.%d{yyyy-MM-dd_HH}.log</fileNamePattern> ++ <fileNamePattern>/var/log/neo4j/http.%d{yyyy-MM-dd_HH}.log</fileNamePattern> + <maxHistory>30</maxHistory> + </rollingPolicy> + +diff -Naur neo4j-community-2.0.0.orig/conf/neo4j-server.properties neo4j-community-2.0.0/conf/neo4j-server.properties +--- neo4j-community-2.0.0.orig/conf/neo4j-server.properties 2013-12-08 13:51:51.000000000 -0200 ++++ neo4j-community-2.0.0/conf/neo4j-server.properties 2013-12-19 14:04:32.996949681 -0200 +@@ -8,7 +8,7 @@ + #*************************************************************** + + # location of the database directory +-org.neo4j.server.database.location=data/graph.db ++org.neo4j.server.database.location=/var/lib/neo4j/data/graph.db + + # Let the webserver only listen on the specified IP. Default is localhost (only + # accept local connections). Uncomment to allow any connection. Please see the +@@ -33,14 +33,14 @@ + org.neo4j.server.webserver.https.port=7473 + + # Certificate location (auto generated if the file does not exist) +-org.neo4j.server.webserver.https.cert.location=conf/ssl/snakeoil.cert ++org.neo4j.server.webserver.https.cert.location=/etc/neo4j/ssl/snakeoil.cert + + # Private key location (auto generated if the file does not exist) +-org.neo4j.server.webserver.https.key.location=conf/ssl/snakeoil.key ++org.neo4j.server.webserver.https.key.location=/etc/neo4j/ssl/snakeoil.key + + # Internally generated keystore (don't try to put your own + # keystore there, it will get deleted when the server starts) +-org.neo4j.server.webserver.https.keystore.location=data/keystore ++org.neo4j.server.webserver.https.keystore.location=/var/lib/neo4j/data/keystore + + #***************************************************************** + # Administration client configuration +@@ -50,7 +50,7 @@ + # - absolute path like /var/rrd + # - path relative to the server working directory like data/rrd + # - commented out, will default to the database data directory. +-org.neo4j.server.webadmin.rrdb.location=data/rrd ++org.neo4j.server.webadmin.rrdb.location=/var/lib/neo4j/data/rrd + + # REST endpoint for the data API + # Note the / in the end is mandatory +@@ -60,7 +60,7 @@ + org.neo4j.server.webadmin.management.uri=/db/manage/ + + # Low-level graph engine tuning file +-org.neo4j.server.db.tuning.properties=conf/neo4j.properties ++org.neo4j.server.db.tuning.properties=/etc/neo4j/neo4j.properties + + # The console services to be enabled + org.neo4j.server.manage.console_engines=shell +@@ -87,5 +87,5 @@ + # archived. Note: changing the rollover and retention policy is sensible, but + # changing the output format is less so, since it is configured to use the + # ubiquitous common log format +-org.neo4j.server.http.log.config=conf/neo4j-http-logging.xml ++org.neo4j.server.http.log.config=/etc/neo4j/neo4j-http-logging.xml + +diff -Naur neo4j-community-2.0.0.orig/conf/neo4j-wrapper.conf neo4j-community-2.0.0/conf/neo4j-wrapper.conf +--- neo4j-community-2.0.0.orig/conf/neo4j-wrapper.conf 2013-12-08 13:51:51.000000000 -0200 ++++ neo4j-community-2.0.0/conf/neo4j-wrapper.conf 2013-12-20 14:26:22.470030601 -0200 +@@ -1,6 +1,6 @@ +-wrapper.java.additional=-Dorg.neo4j.server.properties=conf/neo4j-server.properties +-wrapper.java.additional=-Djava.util.logging.config.file=conf/logging.properties +-wrapper.java.additional=-Dlog4j.configuration=file:conf/log4j.properties ++wrapper.java.additional=-Dorg.neo4j.server.properties=/etc/neo4j/neo4j-server.properties ++wrapper.java.additional=-Djava.util.logging.config.file=/etc/neo4j/logging.properties ++wrapper.java.additional=-Dlog4j.configuration=file:/etc/neo4j/log4j.properties + + #******************************************************************** + # JVM Parameters +@@ -10,7 +10,7 @@ + wrapper.java.additional=-XX:+CMSClassUnloadingEnabled + + # Uncomment the following lines to enable garbage collection logging +-#wrapper.java.additional=-Xloggc:data/log/neo4j-gc.log ++#wrapper.java.additional=-Xloggc:/var/log/neo4j/neo4j-gc.log + #wrapper.java.additional=-XX:+PrintGCDetails + #wrapper.java.additional=-XX:+PrintGCDateStamps + #wrapper.java.additional=-XX:+PrintGCApplicationStoppedTime +@@ -26,8 +26,8 @@ + # Wrapper settings + #******************************************************************** + # Override default pidfile and lockfile +-#wrapper.pidfile=../data/neo4j-server.pid +-#wrapper.lockfile=../data/neo4j-server.lck ++#wrapper.pidfile=/var/lib/neo4j/data/neo4j-server.pid ++#wrapper.lockfile=/var/lib/neo4j/data/neo4j-server.lck + + #******************************************************************** + # Wrapper Windows NT/2000/XP Service Properties +@@ -42,5 +42,5 @@ + + # User account to be used for linux installs. Will default to current + # user if not set. +-wrapper.user= ++wrapper.user=neo4j + diff --git a/neo4j.install b/neo4j.install new file mode 100644 index 000000000000..a035c1724d8b --- /dev/null +++ b/neo4j.install @@ -0,0 +1,27 @@ + post_install() { + if ! getent group neo4j >/dev/null; then + groupadd --system neo4j + fi + if ! getent passwd neo4j >/dev/null; then + useradd --system -g neo4j -d /var/lib/neo4j -s /bin/false neo4j + fi + + chown -R neo4j.neo4j /var/lib/neo4j + chown -R neo4j.neo4j /var/log/neo4j + chown -R neo4j.neo4j /etc/neo4j + chown -R neo4j.neo4j /run/neo4j + } + + post_upgrade() { + post_install $1 + } + + post_remove() { + if getent passwd neo4j >/dev/null; then + userdel neo4j + fi + if getent group neo4j >/dev/null; then + groupdel neo4j + fi + } +
\ No newline at end of file diff --git a/neo4j.service b/neo4j.service new file mode 100644 index 000000000000..5b1092a6a64b --- /dev/null +++ b/neo4j.service @@ -0,0 +1,9 @@ +[Unit] +Description=Neo4j + +[Service] +User=neo4j +Type=forking +ExecStart=/usr/bin/neo4j start +ExecStop=/usr/bin/neo4j stop +PIDFile=/run/neo4j/neo4j-service.pid |