summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Reggiani Manzo2016-01-16 21:35:43 -0200
committerRafael Reggiani Manzo2016-02-17 19:45:45 -0200
commitc6bbcca199e3fd969ad41ba16fa8a29087954d35 (patch)
treebdbaee508a6bb737b5598641e4e2875d7d4cf5ab
parent569693c4f6d94f0300a218250d372a4be99d63be (diff)
downloadaur-c6bbcca199e3fd969ad41ba16fa8a29087954d35.tar.gz
Modify to systemwide installation
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD68
-rw-r--r--opennebula.install19
-rw-r--r--set_locations.patch15
4 files changed, 34 insertions, 72 deletions
diff --git a/.SRCINFO b/.SRCINFO
index fb213aa6271d..66f68cb7fc61 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -34,9 +34,11 @@ pkgbase = opennebula
source = http://downloads.opennebula.org/packages/opennebula-4.14.2/opennebula-4.14.2.tar.gz
source = opennebula.service
source = chown_fix.patch
+ source = set_locations.patch
sha512sums = ed572bf1a6e0a4eecb85c1f2beb1f686e6729f74a354f41dbb5113fd089af06013f63d022ee8c068234e5be64df818771a0ba0c452ffbf4fd096dd16cf878926
- sha512sums = aa03623853515afc0f0e25e76a4f55fc844570ec432c8398616e336402fad0f6eea5853fe2488f6a0069831dfb6528ee8cd38772ffe415e349b9394c851299f1
+ sha512sums = a142effd0037966a04a9bbb8416c12835f676108c53b1e42186cec9222cc09a60a01be1ddf24773914f2615238f501579e4d39abbf28c5f89b0fc7140855af20
sha512sums = 8d6a311072da61ca49458aaf787daf4ef5c5969a9aa282f2276d679dc38e14e5fd1c23bc51b12a29d2d40b65aa45bd2c38d6741726b09d75a38565b7d4ad4677
+ sha512sums = 1f20e688a0f6d36a6bc875392473e75c7de77b159b9cbdf262ac0f093b4d65555231ab15897156e2558d0df6ae631f8d79a3265073ea8c0546586937544e47c9
pkgname = opennebula
diff --git a/PKGBUILD b/PKGBUILD
index 4e175880c31b..74f20f5d94c0 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -36,10 +36,12 @@ install=opennebula.install
changelog=ChangeLog
source=("http://downloads.opennebula.org/packages/${pkgname}-${pkgver}/${pkgname}-${pkgver}.tar.gz"
'opennebula.service'
- 'chown_fix.patch')
+ 'chown_fix.patch'
+ 'set_locations.patch')
sha512sums=('ed572bf1a6e0a4eecb85c1f2beb1f686e6729f74a354f41dbb5113fd089af06013f63d022ee8c068234e5be64df818771a0ba0c452ffbf4fd096dd16cf878926'
- 'aa03623853515afc0f0e25e76a4f55fc844570ec432c8398616e336402fad0f6eea5853fe2488f6a0069831dfb6528ee8cd38772ffe415e349b9394c851299f1'
- '8d6a311072da61ca49458aaf787daf4ef5c5969a9aa282f2276d679dc38e14e5fd1c23bc51b12a29d2d40b65aa45bd2c38d6741726b09d75a38565b7d4ad4677')
+ 'a142effd0037966a04a9bbb8416c12835f676108c53b1e42186cec9222cc09a60a01be1ddf24773914f2615238f501579e4d39abbf28c5f89b0fc7140855af20'
+ '8d6a311072da61ca49458aaf787daf4ef5c5969a9aa282f2276d679dc38e14e5fd1c23bc51b12a29d2d40b65aa45bd2c38d6741726b09d75a38565b7d4ad4677'
+ '1f20e688a0f6d36a6bc875392473e75c7de77b159b9cbdf262ac0f093b4d65555231ab15897156e2558d0df6ae631f8d79a3265073ea8c0546586937544e47c9')
prepare() {
cd "${pkgname}-${pkgver}"
@@ -47,7 +49,8 @@ prepare() {
# Patch upstream install script to not attempt to chown the install
# directories because `makepkg` will otherwise fail on a fresh installation.
# We do our own chown in post_install().
- patch < "${srcdir}/chown_fix.patch"
+ patch < "${srcdir}/chown_fix.patch"
+ patch < "${srcdir}/set_locations.patch"
}
build() {
@@ -80,62 +83,9 @@ package() {
if [[ ("$(pacman -Qq ${pkgname} 2>/dev/null)" == "${pkgname}") || ("$(pacman -Qq ${_unstable_pkg} 2>/dev/null)" == "${_unstable_pkg}") ]]; then
# Use -k when running ./install.sh to keep previous configuration files
# Note: It is highly recommended to not keep the oned.conf file.
- DESTDIR="${pkgdir}" ./install.sh -k -u oneadmin -g cloud -d /srv/cloud/one
+ DESTDIR="${pkgdir}" ./install.sh -k -u oneadmin -g cloud
else
# Do not use -k when running ./install.sh for new installations
- DESTDIR="${pkgdir}" ./install.sh -u oneadmin -g cloud -d /srv/cloud/one
+ DESTDIR="${pkgdir}" ./install.sh -u oneadmin -g cloud
fi
-
- mkdir -p "${pkgdir}/usr/bin"
- ln -s /srv/cloud/one/bin/econe-allocate-address "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/econe-associate-address "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/econe-attach-volume "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/econe-create-keypair "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/econe-create-volume "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/econe-delete-keypair "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/econe-delete-volume "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/econe-describe-addresses "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/econe-describe-images "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/econe-describe-instances "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/econe-describe-keypairs "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/econe-describe-volumes "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/econe-detach-volume "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/econe-disassociate-address "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/econe-reboot-instances "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/econe-register "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/econe-release-address "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/econe-run-instances "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/econe-server "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/econe-start-instances "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/econe-stop-instances "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/econe-terminate-instances "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/econe-upload "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/mm_sched "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/novnc-server "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/one "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/oneacct "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/oneacl "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/onecluster "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/oned "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/onedatastore "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/onedb "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/oneflow "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/oneflow-server "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/oneflow-template "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/onegate-server "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/onegroup "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/onehost "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/oneimage "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/onemarket "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/onesecgroup "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/oneshowback "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/onetemplate "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/oneuser "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/onevcenter "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/onevdc "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/onevm "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/onevnet "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/onezone "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/sunstone-server "${pkgdir}/usr/bin/"
- ln -s /srv/cloud/one/bin/tty_expect "${pkgdir}/usr/bin/"
}
diff --git a/opennebula.install b/opennebula.install
index e12e129a9f3f..f7a660dd91f1 100644
--- a/opennebula.install
+++ b/opennebula.install
@@ -1,32 +1,27 @@
pre_install() {
- # Prepare for a self-contained installation before build() runs
- mkdir -p /srv/cloud/one
groupadd cloud
- useradd -d /srv/cloud/one -g cloud -c "OpenNebula administrator account" -s /usr/bin/bash oneadmin
- mkdir -p /srv/cloud/one/.one/
- echo "ONE_LOCATION="/srv/cloud/one"; export ONE_LOCATION; export PATH=$PATH:/srv/cloud/one/bin" > /srv/cloud/one/.bashrc
-
- mkdir -p /var/run/one
+ useradd -g cloud -c "OpenNebula administrator account" -s /usr/bin/bash oneadmin
}
post_install() {
# Append the oneadmin credentials to one_auth to avoid overwriting a file
# that may already exist
- echo 'oneadmin:0neadm1n' >> /srv/cloud/one/.one/one_auth
- echo ">> You must edit the password in /srv/cloud/one/.one/one_auth"
- chown oneadmin:cloud -R /srv/cloud/one /var/run/one
+ usermod -m -d /var/lib/one oneadmin
+ mkdir -p /var/lib/one/.one/
+ echo 'oneadmin:0neadm1n' >> /var/lib/one/.one/one_auth
+ echo ">> You must edit the password in /var/lib/one/.one/one_auth"
+ chown oneadmin:cloud -R /var/log/one /var/lib/one /run/one /run/lock/one
}
pre_remove() {
userdel oneadmin && echo ">> User 'oneadmin' has been removed."
groupdel cloud && echo ">> Group 'cloud' has been removed."
rm -rf /var/run/one && echo ">> Removed /var/run/one"
+ rm -rf /var/lock/one && echo ">> Removed /var/lock/one"
}
post_remove() {
echo ">> You can uninstall the Ruby gems if no other packages require them."
echo ">> For example, 'gem uninstall sequel' would uninstall the 'sequel' Ruby gem."
echo ">> If you installed the Ruby gems via pacman, then uninstall the gems via pacman."
- echo ">> "
- echo ">> You may also want to remove the /srv/cloud/one directory."
}
diff --git a/set_locations.patch b/set_locations.patch
new file mode 100644
index 000000000000..0795928dd7a0
--- /dev/null
+++ b/set_locations.patch
@@ -0,0 +1,15 @@
+Index: opennebula-4.14.2/install.sh
+===================================================================
+--- opennebula-4.14.2.orig/install.sh
++++ opennebula-4.14.2/install.sh
+@@ -114,8 +114,8 @@ if [ -z "$ROOT" ] ; then
+ ONEFLOW_LOCATION="$LIB_LOCATION/oneflow"
+ SYSTEM_DS_LOCATION="$VAR_LOCATION/datastores/0"
+ DEFAULT_DS_LOCATION="$VAR_LOCATION/datastores/1"
+- RUN_LOCATION="/var/run/one"
+- LOCK_LOCATION="/var/lock/one"
++ RUN_LOCATION="/run/one"
++ LOCK_LOCATION="/run/lock/one"
+ INCLUDE_LOCATION="/usr/include"
+ SHARE_LOCATION="/usr/share/one"
+ MAN_LOCATION="/usr/share/man/man1"