# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-dialup/isdn4k-utils/isdn4k-utils-3.8_pre20050821.ebuild,v 1.9 2006/11/23 20:31:38 vivo Exp $ inherit eutils multilib gnuconfig linux-info MY_PV="${PV/*_pre/}" MY_P="${PN}-CVS-${MY_PV:0:4}-${MY_PV:4:2}-${MY_PV:6:2}" FW_DIR="/lib/firmware" #FW_DIR="/lib/firmware/isdn" DESCRIPTION="ISDN4Linux Utils" SRC_URI="ftp://ftp.isdn4linux.de/pub/isdn4linux/CVS-Snapshots/${MY_P}.tar.bz2" HOMEPAGE="http://www.isdn4linux.de/" KEYWORDS="alpha amd64 ~ppc x86" LICENSE="GPL-2" IUSE="X unicode activefilter mschap ipppd isdnlog eurofile usb pcmcia" # TODO: mysql postgres oracle radius SLOT="0" # mysql? ( virtual/mysql ) # oracle? ( dev-db/oracle-instantclient-basic ) # postgres? ( dev-db/postgresql ) DEPEND="virtual/linux-sources virtual/libc sys-libs/ncurses sys-libs/gdbm dev-lang/tcl app-text/rman eurofile? ( net-ftp/ftpbase ) ipppd? ( net-libs/libpcap ) ipppd? ( mschap? ( dev-libs/openssl ) ) ipppd? ( activefilter? ( >=virtual/libpcap-0.9.3 ) ) X? ( x11-libs/libX11 x11-libs/libXaw x11-libs/libXmu x11-libs/libXt x11-misc/imake x11-proto/xextproto x11-proto/xproto )" RDEPEND="${DEPEND} virtual/modutils ipppd? ( net-dialup/ppp ) X? ( x11-libs/libICE x11-libs/libSM x11-libs/libXext x11-libs/libXp x11-libs/libXpm ) pcmcia? ( virtual/pcmcia )" S="${WORKDIR}/${MY_P}" pkg_setup() { # check kernel config CONFIG_CHECK="ISDN ISDN_I4L" if use ipppd; then CONFIG_CHECK="${CONFIG_CHECK} ISDN_PPP" use activefilter && CONFIG_CHECK="${CONFIG_CHECK} IPPP_FILTER" fi use eurofile && CONFIG_CHECK="${CONFIG_CHECK} X25 ISDN_X25" # linux-info_pkg_setup -> disabled until I have a better solution # Get country code from I4L_CC variable # default country: DE (Germany) I4L_CC=$(echo -n "${I4L_CC}" | tr "[:lower:]" "[:upper:]") [ -z "${I4L_CC}" ] && I4L_CC="DE" I4L_CC_LOW=$(echo -n "${I4L_CC}" | tr "[:upper:]" "[:lower:]") # Get language from I4L_LANG variable ('de' or 'en') I4L_LANG=$(echo -n "${I4L_CC}" | tr "[:lower:]" "[:upper:]") if [ -z "${I4L_LANG}" ]; then case "${I4L_CC}" in AT|CH|DE) I4L_LANG="DE" ;; *) I4L_LANG="EN" ;; esac fi [ "${I4L_LANG}" = "DE" -o "${I4L_LANG}" = "EN" ] || I4L_LANG="EN" } src_unpack() { unpack ${A} cd "${S}" # apply pcap patch (bug #99190) use ipppd && use activefilter && \ epatch "${FILESDIR}/ipppd-pcap-0.9.3.patch" # patch all Makefiles to use our CFLAGS find . -name "Makefile*" -type f | \ xargs -r sed -i -e "s:^\(CFLAGS.*=.*-Wall\) -O2:\1 \$(MYCFLAGS):g" \ -e "s:^\(CFLAGS.*=.*\) -O[26] -fomit-frame-pointer:\1 \$(MYCFLAGS):g" \ -e "s:^\(CFLAGS.*=.*\) -fomit-frame-pointer -O2:\1 \$(MYCFLAGS):g" \ -e "s:^\(CFLAGS.*=.*\) -g -Wall:\1 \$(MYCFLAGS) -Wall:g" \ -e "s:^\(CFLAGS.*=.*\) -Wall -g:\1 -Wall \$(MYCFLAGS):g" \ -e "s:^\(CFLAGS.*=.*-Wall.*\) -O2 -g:\1 \$(MYCFLAGS):g" \ -e "s:^\(CFLAGS.*= -Wall\)$:\1 \$(MYCFLAGS):g" \ -e "s:^\(CFLAGS.*=\) -g$:\1 \$(MYCFLAGS):g" || die "sed failed" # install our config case "${I4L_CC}" in DE|AT|NL|LU|CH) # These countries are specially supported in the isdnlog source. sed -e "s:^CONFIG_ISDN_LOG_XX=:CONFIG_ISDN_LOG_${I4L_CC}=:g" \ -e "s:^\(CONFIG_ISDN_LOG_CC_\)..=:\1${I4L_LANG}=:g" \ -e "s:^CONFIG_ISDN_LOG_CC=.*$:#:g" \ < ${FILESDIR}/config-${PV} > .config || die "failed to modify .config" ;; *) # Others get a generic isdnlog. sed -e "s:^\(CONFIG_ISDN_LOG_CC=\).*$:\1'${I4L_CC_LOW}':g" \ -e "s:^\(CONFIG_ISDN_LOG_CC_\)..=:\1${I4L_LANG}=:g" \ < ${FILESDIR}/config-${PV} > .config || die "failed to modify .config" ;; esac # build X clients use X || \ sed -i -e "s:^\(CONFIG_BUILDX11=.*\)$:# \1:g" \ -e "s:^\(CONFIG_XISDNLOAD=.*\)$:# \1:g" \ -e "s:^\(CONFIG_XMONISDN=.*\)$:# \1:g" .config # build ipppd if use ipppd; then use activefilter || \ sed -i -e "s:^\(CONFIG_IPPP_FILTER=.*\)$:# \1:g" .config use mschap || \ sed -i -e "s:^\(CONFIG_IPPPD_MSCHAP=.*\)$:# \1:g" .config else sed -i -e "s:^\(CONFIG_IPPPD=.*\)$:# \1:g" \ -e "s:^\(CONFIG_IPPPSTATS=.*\)$:# \1:g" .config fi # build isdnlog use isdnlog || sed -i -e "s:^\(CONFIG_ISDNLOG=.*\)$:# \1:g" .config # build eurofile (etf) use eurofile || sed -i -e "s:^\(CONFIG_EUROFILE=.*\)$:# \1:g" .config # set firmware location sed -i -e "s:^\(CONFIG_FIRMWAREDIR=\).*$:\1'${FW_DIR}':g" .config # selecting database support for isdnlog (only ONE is possible) #use mysql || sed -i -e "s:^\(CONFIG_ISDNLOG_MYSQL.*=.*\)$:# \1:g" .config #use oracle || sed -i -e "s:^\(CONFIG_ISDNLOG_ORACLE.*=.*\)$:# \1:g" .config #use postgres || sed -i -e "s:^\(CONFIG_ISDNLOG_POSTGRES.*=.*\)$:# \1:g" .config # Patch in order to make generic config for countries which are not known to isdnlog source sed -i -e "s:\$(INSTALL_DATA) rate-:-\$(INSTALL_DATA) rate-:g" \ -e "s:\$(INSTALL_DATA) holiday-:-\$(INSTALL_DATA) holiday-:g" isdnlog/Makefile.in # Patch path to isdnlog docs sed -i -e "s:^\(CONFIG_ISDNLOG_DOCDIR=\).*$:\1'/usr/share/doc/${PF}/isdnlog':g" .config # add --libdir to configure call in Makefile sed -i -e "s:\(\./configure \):\1--libdir=/usr/$(get_libdir) :g" Makefile # Fixing /usr/lib to /usr/$(get_libdir} (for multilib-strict) sed -i -e "s:/usr/lib:/usr/$(get_libdir):g" isdnctrl/Makefile.in # Fixing location of openssl-headers sed -i -e "s: