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

87 lines
2.3 KiB
Bash
Raw Normal View History

# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="3"
RPM_VER="1.1"
inherit eutils rpm
DESCRIPTION="opsi depot server"
HOMEPAGE="http://opsi.org/"
SRC_URI="http://download.opensuse.org/repositories/home:/uibmz:/opsi:/opsi40/openSUSE_12.2/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"
DEPEND="${RDEPEND}"
#Requires: opsi-linux-bootimage >= 20090927 samba sudo wget
#BuildRequires: pwdutils python-opsi
RDEPEND="dev-python/python-opsi"
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
#}