2014-01-22 21:23:56 +01:00
|
|
|
# Copyright 1999-2014 Gentoo Foundation
|
2013-04-16 22:35:35 +02:00
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
# $Header: $
|
|
|
|
|
|
|
|
EAPI="3"
|
|
|
|
inherit eutils rpm
|
|
|
|
|
2014-01-22 21:23:56 +01:00
|
|
|
RPM_VER="3.1"
|
|
|
|
OPSI="opsi40-testing"
|
|
|
|
SUSE="openSUSE_13.1"
|
|
|
|
|
2013-04-16 22:35:35 +02:00
|
|
|
DESCRIPTION="opsi depot server"
|
|
|
|
HOMEPAGE="http://opsi.org/"
|
2014-01-22 21:23:56 +01:00
|
|
|
SRC_URI="http://download.opensuse.org/repositories/home:/uibmz:/opsi:/${OPSI}/${SUSE}/src/${P}-${RPM_VER}.src.rpm"
|
2013-04-16 22:35:35 +02:00
|
|
|
|
|
|
|
LICENSE="GPL-2"
|
|
|
|
SLOT="0"
|
|
|
|
KEYWORDS="~amd64 ~arm ~x86"
|
|
|
|
IUSE=""
|
|
|
|
|
|
|
|
RDEPEND="dev-python/python-opsi
|
|
|
|
net-misc/opsiconfd
|
|
|
|
net-misc/opsipxeconfd
|
2013-04-17 08:38:21 +02:00
|
|
|
net-misc/opsi-utils
|
|
|
|
>=net-misc/opsi-linux-bootimage-20090927
|
|
|
|
app-admin/sudo
|
|
|
|
net-misc/wget
|
|
|
|
net-fs/samba
|
|
|
|
net-misc/dhcp"
|
2013-04-18 13:50:48 +02:00
|
|
|
DEPEND="${RDEPEND}"
|
2013-04-16 22:35:35 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
#}
|