# Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils DESCRIPTION="Send and receive SMS and WAP-PUSH messages through GSM modems or mobile phones" HOMEPAGE="http://smstools3.kekekasvi.com/" SRC_URI="http://smstools3.kekekasvi.com/packages/${P}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="x86 ~amd64 ~ppc" IUSE="stats" DEPEND="" RDEPEND="sys-process/procps stats? ( >=dev-libs/mm-1.4.0 )" S="${WORKDIR}"/${PN} pkg_setup() { enewgroup sms enewuser smsd -1 -1 /var/spool/sms sms } src_unpack() { unpack ${A} cd "${S}" if use stats; then sed -i -e "s:CFLAGS += -D NOSTATS:#CFLAGS += -D NOSTATS:" src/Ma kefile fi } src_compile() { cd src emake || die "emake failed" } src_install() { into /usr/local dobin src/smsd cd "${S}"/scripts dobin sendsms sms2html sms2unicode unicode2sms dobin hex2bin hex2dec email2sms keepdir /var/spool/sms/incoming mkdir -p /var/spool/sms/outgoing keepdir /var/spool/sms/checked chown -R smsd:sms "${D}"/var/spool/sms chmod g+s "${D}"/var/spool/sms/incoming newinitd "${FILESDIR}"/smstools3.smsd.initd smsd insopts -o smsd -g sms -m0644 insinto /etc if use stats; then sed -i -e 's/^loglevel/stats = \/var\/log\/smsd\/stats\nstats_interval = 6000\nloglevel/' "${S}"/examples/smsd.conf.easy fi sed -i -e 's/smsd.log/smsd\/smsd.log/' "${S}"/examples/smsd.conf.easy sed -i -e 's/^loglevel/autosplit = 3\ninfofile = \/var\/run\/smsd\/smsd.pid\npidfile = \/var\/run\/smsd\/smsd.pid\nloglevel/' "${S}"/examples/smsd.conf.easy newins "${S}"/examples/smsd.conf.easy smsd.conf dohtml "${S}"/doc/* } pkg_postinst() { chown -R -f smsd:sms /var/log/smsd/ mkdir -p /var/run/smsd chown smsd /var/run/smsd mkdir -p /var/log/smsd if use stats; then keepdir /var/log/smsd/stats fi }