summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO24
-rw-r--r--PKGBUILD43
-rw-r--r--cubrid-database@.service17
-rw-r--r--cubrid.csh10
-rw-r--r--cubrid.install48
-rw-r--r--cubrid.service17
-rw-r--r--cubrid.sh16
7 files changed, 175 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..7bee7664f11
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,24 @@
+pkgbase = cubrid
+ pkgdesc = Comprehensive open source relational database management system highly optimized for Web Applications
+ pkgver = 10.1.2
+ pkgrel = 1
+ url = http://cubrid.org/
+ install = cubrid.install
+ arch = x86_64
+ license = GPLv2
+ depends = ncurses5-compat-libs
+ source = http://ftp.cubrid.org/CUBRID_Engine/10.1.2/CUBRID-10.1.2.7694-64632b2-Linux.x86_64.tar.gz
+ source = cubrid.service
+ source = cubrid-database@.service
+ source = cubrid.install
+ source = cubrid.sh
+ source = cubrid.csh
+ md5sums = 1404d7f0976e2393dfaa3d499fee05c5
+ md5sums = 7f4c8785860bfd9063da18caef2a6e2c
+ md5sums = 226da8427bfc5d2d9ef6a734c9f00e71
+ md5sums = 212cc0285c504c2c6e206c0d721289c4
+ md5sums = 7a366cc938717249b7cc0114ff98dfa3
+ md5sums = 1de08824d0136935b1c4d1fadd4912d8
+
+pkgname = cubrid
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..d330ced0e2b
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,43 @@
+# Maintainer: Valeri Nistor <nistor dot valeri at gmail dot com>
+
+pkgname=cubrid
+pkgver=10.1.2
+_buildver=7694-64632b2
+pkgrel=1
+pkgdesc='Comprehensive open source relational database management system highly optimized for Web Applications'
+url='http://cubrid.org/'
+arch=('x86_64')
+license=('GPLv2')
+depends=('ncurses5-compat-libs')
+install=cubrid.install
+
+source=(http://ftp.cubrid.org/CUBRID_Engine/${pkgver}/CUBRID-${pkgver}.${_buildver}-Linux.${arch}.tar.gz
+ cubrid.service
+ cubrid-database@.service
+ cubrid.install
+ cubrid.sh
+ cubrid.csh)
+
+md5sums=('1404d7f0976e2393dfaa3d499fee05c5'
+ '7f4c8785860bfd9063da18caef2a6e2c'
+ '226da8427bfc5d2d9ef6a734c9f00e71'
+ '212cc0285c504c2c6e206c0d721289c4'
+ '7a366cc938717249b7cc0114ff98dfa3'
+ '1de08824d0136935b1c4d1fadd4912d8')
+
+package() {
+ install -dm755 "$pkgdir/opt/${pkgname}"
+ cp -R "$srcdir"/CUBRID/* "$pkgdir/opt/${pkgname}"
+
+ # install profile.d script
+ install -dm755 "${pkgdir}"/etc/profile.d
+ install -m755 "${srcdir}"/cubrid.{csh,sh} "${pkgdir}"/etc/profile.d/
+
+ # add cubrid service files
+ install -Dm 644 "${srcdir}/${pkgname}.service" "${pkgdir}/usr/lib/systemd/system/${pkgname}.service"
+ install -Dm 644 "${srcdir}/${pkgname}-database@.service" "${pkgdir}/usr/lib/systemd/system/${pkgname}-database@.service"
+
+ # add cubrid library path to ld.so.conf.d
+ install -d "${pkgdir}/etc/ld.so.conf.d"
+ echo "/opt/${pkgname}/lib" > "${pkgdir}/etc/ld.so.conf.d/${pkgname}.conf"
+}
diff --git a/cubrid-database@.service b/cubrid-database@.service
new file mode 100644
index 00000000000..b484bf9196a
--- /dev/null
+++ b/cubrid-database@.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=cubrid database
+After=network.target
+
+[Service]
+Type=forking
+TimeoutSec=120
+User=cubrid
+Group=cubrid
+
+Environment=CUBRID=/opt/cubrid CUBRID_DATABASES=/var/lib/cubrid/databases
+ExecStart=/opt/cubrid/bin/cubrid server start %I
+ExecReload=/opt/cubrid/bin/cubrid server restart %I
+ExecStop=/opt/cubrid/bin/cubrid server stop %I
+
+[Install]
+WantedBy=multi-user.target
diff --git a/cubrid.csh b/cubrid.csh
new file mode 100644
index 00000000000..3dd80117e66
--- /dev/null
+++ b/cubrid.csh
@@ -0,0 +1,10 @@
+setenv CUBRID /opt/cubrid
+setenv CUBRID_DATABASES /var/lib/cubrid/databases
+if (${?LD_LIBRARY_PATH}) then
+ setenv LD_LIBRARY_PATH $CUBRID/lib:${LD_LIBRARY_PATH}
+else
+ setenv LD_LIBRARY_PATH $CUBRID/lib
+endif
+setenv SHLIB_PATH $LD_LIBRARY_PATH
+setenv LIBPATH $LD_LIBRARY_PATH
+set path=($CUBRID/bin $path)
diff --git a/cubrid.install b/cubrid.install
new file mode 100644
index 00000000000..55576a008c7
--- /dev/null
+++ b/cubrid.install
@@ -0,0 +1,48 @@
+# Colored makepkg-like functions
+msg_green() {
+ printf "${green}==>${bold} $1${all_off}\n"
+}
+msg_cmd() {
+ printf "${blue} ->${all_off} $1\n"
+}
+
+all_off="$(tput sgr0)"
+bold="${all_off}$(tput bold)"
+green="${bold}$(tput setaf 2)"
+blue="${bold}$(tput setaf 4)"
+
+post_install() {
+ if ! getent group cubrid > /dev/null; then
+ groupadd -g 42 cubrid
+ fi
+ if ! getent passwd cubrid > /dev/null; then
+ useradd -c 'cubrid user' -u 42 -g cubrid -d '/opt/cubrid' -s /bin/bash cubrid
+ passwd -l cubrid > /dev/null
+ fi
+ if [ -d '/opt/cubrid' ]; then
+ chown -R cubrid:cubrid '/opt/cubrid'
+ fi
+ if [ ! -d '/var/lib/cubrid/databases' ]; then
+ mkdir -p '/var/lib/cubrid/databases'
+ chmod 775 '/var/lib/cubrid/databases'
+
+ touch '/var/lib/cubrid/databases/databases.txt'
+ chmod 664 '/var/lib/cubrid/databases/databases.txt'
+
+ chown -R cubrid:cubrid '/var/lib/cubrid'
+ fi
+
+ print_note
+}
+
+print_note() {
+ msg_green "Add your user to cubrid group"
+ msg_cmd "sudo usermod -a -G cubrid <username>"
+ msg_green "Run this command for creating cubrid database"
+ msg_cmd "sudo -u cubrid bash -c 'source /etc/profile.d/cubrid.sh; cubrid createdb -v -F $CUBRID_DATABASES demodb en_US'"
+ msg_green "Then start cubrid database and service"
+ msg_cmd "sudo systemctl start cubrid"
+ msg_cmd "sudo systemctl start cubrid-database@demodb"
+ msg_green "Start cubrid interactive SQL utility"
+ msg_cmd "csql demodb@127.0.0.1"
+}
diff --git a/cubrid.service b/cubrid.service
new file mode 100644
index 00000000000..5bae006b18b
--- /dev/null
+++ b/cubrid.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=cubrid service
+After=network.target
+
+[Service]
+Type=forking
+TimeoutSec=120
+User=cubrid
+Group=cubrid
+
+Environment=CUBRID=/opt/cubrid CUBRID_DATABASES=/var/lib/cubrid/databases
+ExecStart=/opt/cubrid/bin/cubrid service start
+ExecStartPost=/usr/bin/chmod g+w /tmp/CUBRID1523
+ExecStop=/opt/cubrid/bin/cubrid service stop
+
+[Install]
+WantedBy=multi-user.target
diff --git a/cubrid.sh b/cubrid.sh
new file mode 100644
index 00000000000..43ffa767426
--- /dev/null
+++ b/cubrid.sh
@@ -0,0 +1,16 @@
+CUBRID=/opt/cubrid
+CUBRID_DATABASES=/var/lib/cubrid/databases
+if [ "x${LD_LIBRARY_PATH}x" = xx ]; then
+ LD_LIBRARY_PATH=$CUBRID/lib
+else
+ LD_LIBRARY_PATH=$CUBRID/lib:$LD_LIBRARY_PATH
+fi
+SHLIB_PATH=$LD_LIBRARY_PATH
+LIBPATH=$LD_LIBRARY_PATH
+PATH=$CUBRID/bin:$PATH
+export CUBRID
+export CUBRID_DATABASES
+export LD_LIBRARY_PATH
+export SHLIB_PATH
+export LIBPATH
+export PATH