2017-03-05 13:03:30 +01:00
|
|
|
# Copyright 1999-2017 Gentoo Foundation
|
2011-11-12 19:21:01 +01:00
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
# $Header: $
|
|
|
|
|
2017-06-07 10:58:01 +02:00
|
|
|
EAPI=6
|
|
|
|
PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
|
2011-11-12 19:21:01 +01:00
|
|
|
|
2017-03-05 13:03:30 +01:00
|
|
|
RPM_VER="5.1"
|
2014-12-12 16:09:16 +01:00
|
|
|
OPSI="opsi40"
|
2015-10-17 17:51:29 +02:00
|
|
|
SUSE="openSUSE_13.2"
|
2011-11-12 19:21:01 +01:00
|
|
|
|
2017-06-07 10:58:01 +02:00
|
|
|
inherit distutils-r1 eutils rpm
|
2011-11-12 19:21:01 +01:00
|
|
|
|
|
|
|
DESCRIPTION="opsi python library"
|
|
|
|
HOMEPAGE="http://opsi.org/"
|
2014-01-22 21:12:40 +01:00
|
|
|
SRC_URI="http://download.opensuse.org/repositories/home:/uibmz:/opsi:/${OPSI}/${SUSE}/src/${P}-${RPM_VER}.src.rpm"
|
2011-11-12 19:21:01 +01:00
|
|
|
|
|
|
|
LICENSE="GPL-2"
|
|
|
|
SLOT="0"
|
|
|
|
KEYWORDS="~amd64 ~arm ~x86"
|
|
|
|
IUSE=""
|
|
|
|
|
2015-10-17 17:51:29 +02:00
|
|
|
|
2011-11-12 19:21:01 +01:00
|
|
|
RDEPEND="dev-python/twisted-web
|
|
|
|
dev-python/twisted-conch
|
|
|
|
dev-python/pycrypto
|
|
|
|
dev-python/python-ldap
|
|
|
|
dev-python/simplejson
|
|
|
|
dev-python/pypam
|
|
|
|
dev-python/mysql-python
|
|
|
|
dev-python/sqlalchemy
|
2013-04-17 08:34:23 +02:00
|
|
|
dev-python/pyasn1
|
|
|
|
dev-python/m2crypto
|
|
|
|
dev-python/pyopenssl
|
2015-10-17 17:51:29 +02:00
|
|
|
dev-python/ldaptor
|
2011-11-12 19:21:01 +01:00
|
|
|
sys-apps/iproute2
|
|
|
|
app-backup/duplicity
|
|
|
|
sys-apps/lshw
|
2013-04-17 08:34:23 +02:00
|
|
|
sys-apps/file[python]
|
2011-11-12 19:21:01 +01:00
|
|
|
sys-apps/lsb-release
|
|
|
|
dev-libs/newt
|
2013-04-17 09:10:28 +02:00
|
|
|
sys-apps/shadow
|
|
|
|
net-misc/zsync"
|
2011-11-12 19:21:01 +01:00
|
|
|
DEPEND="${RDEPEND}
|
|
|
|
sys-devel/gettext
|
|
|
|
dev-python/setuptools"
|
|
|
|
|
|
|
|
PYTHON_MODNAME="OPSI"
|
|
|
|
|
|
|
|
src_prepare() {
|
|
|
|
distutils_src_prepare
|
|
|
|
sed -i 's#/etc/dhcp3/dhcpd.conf#/etc/dhcp/dhcpd.conf#;s#/etc/init.d/dhcp3-server#/etc/init.d/dhcpd#' data/backends/dhcpd.conf
|
|
|
|
}
|
|
|
|
|
|
|
|
src_install() {
|
|
|
|
distutils_src_install
|
|
|
|
dosym ../20_legacy.conf etc/opsi/backendManager/extend.d/configed/20_legacy.conf
|
2013-04-16 22:37:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pkg_postinst() {
|
|
|
|
distutils_pkg_postinst
|
|
|
|
|
|
|
|
fileadmingroup=$(grep "fileadmingroup" /etc/opsi/opsi.conf | cut -d "=" -f 2 | sed 's/\s*//g')
|
|
|
|
if [ -z "$fileadmingroup" ]; then
|
|
|
|
fileadmingroup=pcpatch
|
|
|
|
fi
|
|
|
|
if [ $fileadmingroup != pcpatch -a -z "$(getent group $fileadmingroup)" ]; then
|
|
|
|
groupmod -n $fileadmingroup pcpatch
|
|
|
|
else
|
|
|
|
if [ -z "$(getent group $fileadmingroup)" ]; then
|
|
|
|
groupadd $fileadmingroup
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "`getent passwd pcpatch`" ]; then
|
|
|
|
useradd -G $fileadmingroup -d /var/lib/opsi -s /bin/bash pcpatch
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "`getent group opsiadmin`" ]; then
|
|
|
|
groupadd opsiadmin
|
|
|
|
fi
|
2011-11-12 19:21:01 +01:00
|
|
|
|
2013-04-16 22:37:17 +02:00
|
|
|
chown -R root:$fileadmingroup /etc/opsi/backendManager
|
|
|
|
find /etc/opsi/backendManager -type d -exec chmod 770 {} \;
|
|
|
|
find /etc/opsi/backendManager -type f -exec chmod 660 {} \;
|
|
|
|
chown -R root:$fileadmingroup /etc/opsi/backends
|
|
|
|
chmod 770 /etc/opsi/backends
|
|
|
|
chmod 660 /etc/opsi/backends/*.conf
|
|
|
|
chown root:$fileadmingroup /etc/opsi/opsi.conf
|
|
|
|
chmod 660 /etc/opsi/opsi.conf
|
2011-11-12 19:21:01 +01:00
|
|
|
|
2013-04-16 22:37:17 +02:00
|
|
|
test -e /etc/opsi/pckeys || touch /etc/opsi/pckeys
|
|
|
|
chown root:$fileadmingroup /etc/opsi/pckeys
|
|
|
|
chmod 660 /etc/opsi/pckeys
|
2011-11-12 19:21:01 +01:00
|
|
|
|
2013-04-16 22:37:17 +02:00
|
|
|
test -e /etc/opsi/passwd || touch /etc/opsi/passwd
|
|
|
|
chown root:$fileadmingroup /etc/opsi/passwd
|
|
|
|
chmod 660 /etc/opsi/passwd
|
2011-11-12 19:21:01 +01:00
|
|
|
|
2013-04-16 22:37:17 +02:00
|
|
|
[ -e "/etc/opsi/backendManager/acl.conf" ] || ln -s /etc/opsi/backendManager/acl.conf.default /etc/opsi/backendManager/acl.conf
|
|
|
|
[ -e "/etc/opsi/backendManager/dispatch.conf" ] || ln -s /etc/opsi/backendManager/dispatch.conf.default /etc/opsi/backendManager/dispatch.conf
|
2011-11-12 19:21:01 +01:00
|
|
|
}
|