6baebe7126
Package-Manager: portage-2.2.0_alpha166 RepoMan-Options: --force
59 lines
1.5 KiB
Bash
59 lines
1.5 KiB
Bash
# Copyright 1999-2013 Gentoo Foundation
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
# $Header: $
|
|
|
|
EAPI=4
|
|
|
|
inherit eutils rpm
|
|
|
|
RPM_VER="1.1"
|
|
KVER="3.6.11"
|
|
|
|
DESCRIPTION="opsi linux bootimage"
|
|
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"
|
|
IUSE=""
|
|
KEYWORDS="~amd64 ~x86"
|
|
|
|
RDEPEND="net-misc/opsi-utils"
|
|
DEPEND="${RDEPEND}"
|
|
RESTRICT=""
|
|
SLOT="0"
|
|
|
|
src_compile() {
|
|
einfo "Nothing to compile"
|
|
}
|
|
|
|
src_install() {
|
|
insinto /tftpboot/opsi
|
|
doins syslinux/chain.c32 syslinux/menu.c32 syslinux/pxelinux.0
|
|
newins miniroot.bz2 miniroot-${PV}.bz2
|
|
newins vmlinuz vmlinuz-${KVER}
|
|
dosym miniroot-${PV}.bz2 tftpboot/opsi/miniroot.bz2
|
|
dosym vmlinuz-${KVER} tftpboot/opsi/install
|
|
|
|
insinto /tftpboot/opsi/pxelinux.cfg
|
|
doins default.menu default.nomenu install
|
|
|
|
}
|
|
|
|
pkg_postinst() {
|
|
fileadmingroup=$(grep "fileadmingroup" /etc/opsi/opsi.conf | cut -d "=" -f 2 | sed 's/ //g')
|
|
|
|
chown -R opsiconfd:$fileadmingroup /tftpboot/opsi || true
|
|
chmod 2775 /tftpboot/opsi
|
|
chmod 2775 /tftpboot/opsi/pxelinux.cfg
|
|
find /tftpboot/opsi -type f -exec chmod 664 {} \;
|
|
if [ ! -e /tftpboot/opsi/pxelinux.cfg/default ]; then
|
|
cd /tftpboot/opsi/pxelinux.cfg
|
|
ln -s default.menu default
|
|
cd - >/dev/null
|
|
fi
|
|
serviceentry=$(opsi-admin --no-depot -Sd method config_getObjects '[]' '{"id":"clientconfig.configserver.url"}' | grep defaultValues | cut -d "'" -f2)
|
|
if [ "$serviceentry" != "" ]; then
|
|
sed -i "s,append.*$,& service=$serviceentry,g" /tmp/default.menu
|
|
fi
|
|
}
|