opsi/net-misc/opsi-depotserver/opsi-depotserver-4.0.6.7.ebuild

88 lines
2.3 KiB
Bash
Raw Normal View History

# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="3"
inherit eutils rpm
RPM_VER="2.1"
OPSI="opsi40"
SUSE="openSUSE_13.2"
DESCRIPTION="opsi depot server"
HOMEPAGE="http://opsi.org/"
SRC_URI="http://download.opensuse.org/repositories/home:/uibmz:/opsi:/${OPSI}/${SUSE}/src/${P}-${RPM_VER}.src.rpm"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~arm ~x86"
IUSE=""
RDEPEND="dev-python/python-opsi
net-misc/opsiconfd
net-misc/opsipxeconfd
net-misc/opsi-utils
>=net-misc/opsi-linux-bootimage-20090927
app-admin/sudo
net-misc/wget
net-fs/samba
net-misc/dhcp"
DEPEND="${RDEPEND}"
src_install() {
keepdir /var/lib/opsi/workbench
keepdir /var/lib/opsi/depot
keepdir /home/opsiproducts
keepdir /opt/pcbin/install
keepdir /var/lib/opsi/repository
keepdir /var/log/opsi/clientconnect
keepdir /var/log/opsi/bootimage
keepdir /var/log/opsi/instlog
dobin opsi-setup
}
pkg_preinst() {
# add system group fileadmins and users pcpatch
fileadmingroup=$(grep "fileadmingroup" /etc/opsi/opsi.conf | cut -d "=" -f 2 | sed 's/\*//g')
if [ -z "$fileadmingroup" ]; then
fileadmingroup=pcpatch
fi
if [ $fileadmingroup != pcpatch -a -z "$(getent group $fileadmingroup)" ]; then
echo " -> Renaming group pcpatch to $fileadmingroup"
groupmod -n $fileadmingroup pcpatch
else
if [ -z "$(getent group $fileadmingroup)" ]; then
echo " -> Adding group $fileadmingroup"
groupadd -G pcpatch $fileadmingroup
fi
fi
if [ -z "`getent passwd pcpatch`" ]; then
echo " -> Adding user pcpatch"
useradd -G pcpatch -d /opt/pcbin/pcpatch -s /bin/bash pcpatch
fi
if [ -z "`getent passwd opsiconfd`" ]; then
echo " -> Adding user opsiconfd"
useradd -G pcpatch -d /var/lib/opsi -s /bin/bash opsiconfd
fi
}
#pkg_postinst() {
# echo "test1"
# if [ has_version =net-misc/opsi-depotserver-${PVR} ]; then
# # Upgrade
# echo "tess2"
# /usr/bin/opsi-setup --update-from unknown || true
# echo "test3"
# /usr/bin/opsi-setup --set-rights /etc/opsi || true
# echo "test4"
# /usr/bin/opsi-setup --set-rights /tftpboot || true
# #/usr/bin/opsi-setup --set-rights /var/lib/opsi || true
# else
# # Install
# echo "test5"
# /usr/bin/opsi-setup --init-current-config --auto-configure-dhcpd --auto-configure-samba || true
# echo "test6"
# /usr/bin/opsi-setup --set-rights || true
# fi
#}