# Copyright 1999-2005 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils rpm # Local environment variables S="${WORKDIR}" _srcURI="ftp://download.canon.jp/pub/driver/bj/linux" _prefix="/usr" # Driver selection _targetNames=("pixus560i" "pixus860i" "pixus990i") _allNames="" _allSRCs="" _names="" _srcs="" for ((I=0 ; I<${#_targetNames[*]} ; I++ )) ; do IUSE="${_targetNames[I]}_only ${IUSE}" _allNames="${_allNames}${_targetNames[I]} " _allSRCs="${_allSRCs}${_srcURI}/bjfilter${_targetNames[I]}-${PV}-0.i386.rpm " done for ((I=0 ; I<${#_targetNames[*]} ; I++ )) ; do if use ${_targetNames[I]}_only ; then _names="${_names}${_targetNames[I]} " _srcs="${_srcs}${_srcURI}/bjfilter${_targetNames[I]}-${PV}-0.i386.rpm " fi done if [ -z "${_names}" ] ; then _names="${_allNames}" _srcs="${_allSRCs}" fi DESCRIPTION="Canon PIXUS printer drivers for models 560i, 860i and 990i" HOMEPAGE="http://canon.jp/" SRC_URI=" ${_srcURI}/bjcups-${PV}-0.tar.gz ${_srcURI}/${P}-0.tar.gz ${_srcURI}/bjcupsmon-${PV}-0.tar.gz ${_srcURI}/printui-${PV}-0.tar.gz ${_srcURI}/stsmon-${PV}-0.tar.gz ${_srcs} " LICENSE="GPL-2" SLOT="0" KEYWORDS="x86" RDEPEND=" >=app-text/ghostscript-5.50 >=dev-libs/libxml-1.8 >=dev-libs/popt-1.6 =media-libs/libpng-1.0.9 >=media-libs/tiff-3.4 >=net-print/cups-1.1.14 >=x11-libs/gtk+-1.2 " DEPEND=" ${RDEPEND} >=sys-devel/autoconf-2.5 >=sys-devel/automake-1.4 >=sys-libs/glibc-2.0 " src_unpack() { cd ${S} # Extract printer tools and libraries _archives="bjcups ${PN} printui" for _archive in ${_archives} ; do unpack ${_archive}-${PV}-0.tar.gz || die "Could no unpack archive '${_archive}-${PV}-0.tar.gz'." mv ${_archive}-${PV}-0 ${_archive} || die "Could no move directory '${_archive}-${PV}-0'." done _archives="bjcupsmon stsmon" for _archive in ${_archives} ; do unpack ${_archive}-${PV}-0.tar.gz || die "Could no unpack archive '${_archive}-${PV}-0.tar.gz'." mv ${_archive}-${PV} ${_archive} || die "Could no move directory '${_archive}-${PV}'." done # Apply patches for version epatch ${FILESDIR}/${P}.patch || die "Could not apply patch '${P}.patch'." # Extract all RPM archives for _name in ${_names} ; do rpm_unpack ${DISTDIR}/bjfilter${_name}-${PV}-0.i386.rpm || die "Could not unpack RPM archive 'bjfilter${_name}-${PV}-0-i386.rpm'." done # Create temporary libraries symlinks cd ${S}/usr/lib for _lib in libcnbp*.so.* ; do ln -s ${_lib} $(echo ${_lib} | cut -d "." -f 1).so done } src_compile() { einfo "Creating libraries for models '${_names}'" sleep 10 # Compile tools cd ${S}/bjcups/libs emake || die "Could not make 'bjcups/libs'." cd ${S}/bjcups emake || die "Could not make 'bjcups'." export WANT_AUTOCONF=2.5 WANT_AUTOMAKE=1.4 cd ${S}/bjcupsmon ./autogen.sh --prefix=${_prefix} || die "Could not configure 'bjcupsmon'." emake || die "Could not make 'bjcupsmon'." unset WANT_AUTOCONF WANT_AUTOMAKE } src_install() { # Create directories dodir /usr/bin /usr/lib/cups/filter # Install tools _dirs="bjcups bjcupsmon" for _dir in ${_dirs} ; do cd ${S}/${_dir} emake install DESTDIR=${D} || die "Could not install '${_dir}'." done export WANT_AUTOCONF=2.5 WANT_AUTOMAKE=1.4 for _model in ${_names} ; do _dirs="bjfilter printui stsmon" for _dir in ${_dirs} ; do cd ${S}/${_dir} ./autogen.sh --prefix=${_prefix} --program-suffix=${_model} || die "Could not configure '${_dir}'." emake clean || die "Could not clean '${_dir}'." emake || die "Could not make '${_dir}'." emake install DESTDIR=${D} || die "Could not install 'bjfilter'." done done unset WANT_AUTOCONF WANT_AUTOMAKE # Install cups files insinto /usr/share/cups/model for _name in ${_names} ; do doins ${S}/bjcups/ppd/canon${_name}.ppd done # Install libraries dolib.so ${S}/usr/lib/libcnbp*.so.* insinto /usr/lib/bjlib insopts -m 0755 doins ${S}/usr/lib/bjlib/* # Create libraries symlinks cd ${D}/usr/lib for _lib in libcnbp*.so.* ; do dosym ${_lib} /usr/lib/$(echo ${_lib} | cut -d "." -f 1).so done # Install docs _docdirs="bjcups bjfilter bjcupsmon printui stsmon" for _doc in ${_docdirs} ; do cd ${S}/${_doc} docinto ${_doc} _files="AUTHORS ChangeLog COPYING INSTALL LICENSE NEWS README" for _file in ${_files} ; do if [ -e ${_file} ] ; then dodoc ${_file} fi done done }