-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Maintainer: Neng Xu <[email protected]> | ||
|
||
pkgname=orientdb-community | ||
pkgver=1.6 | ||
pkgrel=1 | ||
pkgdesc="The Graph-Document NoSQL - Community Edition" | ||
arch=('any') | ||
license=('Apache') | ||
url="http://www.orientdb.org" | ||
depends=('java-runtime-headless') | ||
makedepends=('unzip') | ||
conflicts=('orientdb' 'orientdb-git' 'orientdb-graphed-git' 'orientdb-graphed') | ||
install=$pkgname.install | ||
source=("https://github.com/nengxu/archlinux-orientdb-community/archive/${pkgname}-${pkgver}.zip" | ||
'orientdb.service') | ||
noextract=("${pkgname}-${pkgver}.zip") | ||
md5sums=('9adb13cebce5e12f1e1a5a05eca12be6' | ||
'64c40019196576036766e7b92729a741') | ||
|
||
build() { | ||
cd "${srcdir}" | ||
unzip "${pkgname}-${pkgver}.zip" | ||
} | ||
|
||
package() { | ||
cd ${pkgname}-${pkgver} | ||
|
||
install -dm755 "${pkgdir}"/opt/orientdb | ||
install -dm700 "${pkgdir}"/opt/orientdb/config | ||
install -dm700 "${pkgdir}"/opt/orientdb/databases | ||
install -dm755 "${pkgdir}"/opt/orientdb/bin | ||
install -dm700 "${pkgdir}"/opt/orientdb/www | ||
install -dm755 "${pkgdir}"/opt/orientdb/lib | ||
|
||
install -d "${pkgdir}"/usr/bin | ||
install -d "${pkgdir}"/var/log/orientdb | ||
install -d "${pkgdir}"/usr/lib/systemd/system | ||
|
||
sed -i 's|\.\./log|/opt/orientdb/log|' config/orientdb-server-log.properties | ||
sed -i 's|YOUR_ORIENTDB_INSTALLATION_PATH|/opt/orientdb|' bin/orientdb.sh | ||
sed -i 's|USER_YOU_WANT_ORIENTDB_RUN_WITH|orient|' bin/orientdb.sh | ||
|
||
install -m755 bin/console.sh "${pkgdir}"/opt/orientdb/bin/ | ||
install -m755 lib/* "${pkgdir}"/opt/orientdb/lib/ | ||
install -m700 config/* "${pkgdir}"/opt/orientdb/config/ | ||
install -m700 bin/shutdown.sh bin/server.sh bin/orientdb.sh "${pkgdir}"/opt/orientdb/bin/ | ||
cp -r www/* "${pkgdir}"/opt/orientdb/www/ | ||
|
||
install -m644 "${srcdir}"/orientdb.service "${pkgdir}"/usr/lib/systemd/system/ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
post_install() { | ||
groupadd -r orient | ||
useradd -r -g orient -d /opt/orientdb -c "OrientDB The Graph-Document NoSQL - Community Edition" orient | ||
|
||
chown -R orient.orient /opt/orientdb | ||
chown -R orient.orient /var/log/orientdb | ||
|
||
ln -sf /var/log/orientdb /opt/orientdb/log | ||
ln -sf /opt/orientdb/config /etc/orientdb | ||
ln -sf /opt/orientdb/bin/console.sh /usr/bin/orientdb-console | ||
|
||
echo "==> OrientDB server should be launched from user 'orient'. Please keep that in mind." | ||
} | ||
|
||
post_upgrade() { | ||
chown -R orient.orient /opt/orientdb | ||
chown -R orient.orient /var/log/orientdb | ||
} | ||
|
||
post_remove() { | ||
userdel orient | ||
groupdel orient 2>/dev/null || /bin/true | ||
if [ -d /opt/orientdb ]; then | ||
echo "==> OrientDB directory is not empty and will not be removed. Please check files" | ||
echo " at path: '/opt/orientdb' and remove it manually." | ||
fi | ||
if [ -d /var/log/orientdb ]; then | ||
rm -rf /var/log/orientdb | ||
fi | ||
} | ||
|
||
pre_remove() { | ||
if [ "$(ps aux | grep -e '^orient' | grep -v grep)" != "" ]; then | ||
echo -n "==> OrientDB server is running. Stopping OrientDB" | ||
systemctl stop orientdb.service | ||
while [ "$(ps aux | grep -e '^orient' | grep -v grep)" != "" ]; do | ||
sleep 1 | ||
done | ||
echo "." | ||
fi | ||
rm /etc/orientdb /usr/bin/orientdb-console /opt/orientdb/log || /bin/true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[Unit] | ||
Description=OrientDB The Graph-Document NoSQL - Community Edition | ||
|
||
[Service] | ||
Type=simple | ||
User=orient | ||
ExecStart=/opt/orientdb/bin/server.sh | ||
ExecStop=/opt/orientdb/bin/shutdown.sh | ||
|
||
[Install] | ||
WantedBy=multi-user.target |