# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ #inherit eutils #DESCRIPTION="A utility for local system news aka old UNIX news" DESCRIPTION="The news command keeps you informed of news concerning the system. This command has nothing to do with USENET news. It is more like an enhanced motd." SRC_URI="http://distro.ibiblio.org/pub/linux/distributions/debian/pool/main/s/sysnews/${PN}_$PV.orig.tar.gz http://distro.ibiblio.org/pub/linux/distributions/debian/pool/main/s/sysnews/${PN}_0.9-12.diff.gz" HOMEPAGE="http://olympus.het.brown.edu/doc/sysnews" SLOT="0" LICENSE="GPL-2" KEYWORDS="~x86" IUSE="" DEPEND="" src_unpack() { unpack ${A} sed "s:NEWSDIR =/var/sysnews:NEWSDIR =/var/lib/sysnews:" ${WORKDIR}/${P}/Makefile > ${WORKDIR}/${P}/__Makefile__.tmp mv ${WORKDIR}/${P}/__Makefile__.tmp ${WORKDIR}/${P}/Makefile mv ${WORKDIR}/${PN}_0.9-12.diff ${WORKDIR}/${P} cd ${WORKDIR}/${P} && patch < ${PN}_0.9-12.diff || die "patch < ${PN}_0.9-12.diff failed" } src_compile() { emake || die "emake failed" } src_install() { dodir /var/lib/sysnews dobin news doman news.1 dodoc README* changelog copyright insinto /var/lib/sysnews doins WELCOME dosed "s:Debian:Gentoo:g" /var/lib/sysnews/WELCOME dosed "s,/usr/share/doc/debian/mailing-lists.txt,http://www.gentoo.org/main/en/lists.xml," /var/lib/sysnews/WELCOME mv cron.daily sysnews.cron insinto /etc/cron.daily insopts -m0755 doins sysnews.cron dosed "s:Debian:Gentoo:g" /etc/cron.daily/sysnews.cron } pkg_postinst() { einfo "This package installs a cron job that deletes news articles after 30 days." einfo "It never deletes files named WELCOME, POLICY, or NEWUSERS; the first of" einfo "these files comes with the package, and you are free to add the other two" einfo "if you like." echo "" einfo "As described in the README, this program should be added to the shell rc" einfo "files of users who want to see news (or added globally). This is not done" einfo "automatically by this package; you should do it manually." einfo "" einfo "i.e. add to /etc/profile" einfo ' [ -x /usr/bin/news ] && [ "$UID" -ge "1000" ] && /usr/bin/news -n' echo "" }