When I had to install a few gentoo boxes in a row, I was looking for a simple way to install a basic set of packages and came up with this approach, using a virtual package pulling in the packages I wanted.
First approach:
The easiest thing is an ebuild, named virtual/myprefpack-0.ebuild, being a virtual package pulling in my stuff as RDEPEND:
Code: Select all
DESCRIPTION="Virtual for pulling in my default packages"
HOMEPAGE=""
SRC_URI=""
LICENSE=""
SLOT="0"
KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
DEPEND=""
RDEPEND="
app-admin/rsyslog
app-portage/gentoolkit
app-portage/layman
"
Adding some jobs and a reminder:
Now as we are lazy, we could perform basic things like updating the mlocate database and remind us of some stuff we shouldn't forget. I did it using einfo/elog messages in pkg_postinst()
Code: Select all
pkg_postinst() {
einfo "Updating mlocate database...";
updatedb
echo -e "\n\n\n"
elog "********************************************************************"
elog "Do not forget to:"
elog " - add the startup scripts to the runlevels"
elog "********************************************************************"
}
What we did so far was pulling in our packages and running an easy batch job and giving some useful messages. Looking at my systems here, I can sort them into 3 groups: generic clients, generic servers and machines having a the linux/apache/mysql/php stack on them. Introducing USE flags for doing that is pretty simple.
My definition of a pure server machine (USE='server') is, that it's powered on 24/7 while clients are turned off at times, which is why I use vixie-cron there, while using fcron on clients. Servers which are switched off as clients may have both flags set, so I am using a little exclude here:
Code: Select all
DESCRIPTION="Virtual for pulling in my default packages"
HOMEPAGE=""
SRC_URI=""
LICENSE=""
SLOT="0"
KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
IUSE="client lamp server"
DEPEND=""
RDEPEND="
app-admin/rsyslog
app-portage/gentoolkit
app-portage/layman
client? (
media-sound/alsa-utils
net-irc/irssi
net-misc/keychain
sys-process/fcron
)
lamp? (
dev-db/phpmyadmin
dev-lang/php
www-servers/apache
)
server? (
app-admin/logrotate
app-misc/screen
net-misc/ntp
sys-fs/xfsdump
sys-fs/xfsprogs
!client? (
sys-process/vixie-cron
mail-mta/ssmtp
)
)"
Code: Select all
elog " - add the startup scripts to the runlevels"
if use server ; then
elog " - set up ssmtp"
elog " - set up rkhunter"
fi




