diff options
Diffstat (limited to 'net-print/cnijfilter-drivers/cnijfilter-drivers-3.80.ebuild')
-rw-r--r-- | net-print/cnijfilter-drivers/cnijfilter-drivers-3.80.ebuild | 167 |
1 files changed, 167 insertions, 0 deletions
diff --git a/net-print/cnijfilter-drivers/cnijfilter-drivers-3.80.ebuild b/net-print/cnijfilter-drivers/cnijfilter-drivers-3.80.ebuild new file mode 100644 index 00000000..008fd20a --- /dev/null +++ b/net-print/cnijfilter-drivers/cnijfilter-drivers-3.80.ebuild @@ -0,0 +1,167 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=5 + +MY_PN="${PN/-drivers/}" + +inherit eutils autotools flag-o-matic multilib + +DESCRIPTION="Canon InkJet Printer Driver for Linux (Pixus/Pixma-Series)." +HOMEPAGE="http://support-sg.canon-asia.com/contents/SG/EN/0100469302.html" +SRC_URI="http://gdlp01.c-wss.com/gds/3/0100004693/01/${MY_PN}-source-${PV}-1.tar.gz" + +LICENSE="GPL-2 cnijfilter" +SLOT="${PV}" +KEYWORDS="~amd64 ~x86" +PRINTER_USE=( mp230 mg2200 e510 mg3200 mg4200 ip7200 mg5400 mg6300 ) +PRINTER_ID=( 401 402 403 404 405 406 407 408 ) +IUSE="${PRINTER_USE[@]} +servicetools" + +RDEPEND=" + net-print/cnijfilter[servicetools?] + >=media-libs/libpng-1.5 + >=media-libs/tiff-3.4 + >=net-print/cups-1.4 + servicetools? ( + >=dev-libs/libxml2-2.7.3-r2 + >=x11-libs/gtk+-2.6:2 + ) +" +DEPEND="${DEPEND} + sys-devel/gettext +" + +REQUIRED_USE="|| ( ${PRINTER_USE[@]} )" + +S="${WORKDIR}/${MY_PN}-source-${PV}-1" + +_dir_build() { + local dirs=$1 + local command=$2 + local d + + [[ $# -ne 2 ]] && die "Call as: _dir_build DIRS COMMAND" + + for d in ${dirs}; do + local suffix="" + echo ">>> Working in: ${d}" + pushd ${d} >/dev/null + # progpath must be set otherwise we go for /usr/local/bin + if [[ ${command} == econf* ]]; then + ${command} --enable-progpath="${EPREFIX}/usr/bin" + else + ${command} + fi + popd > /dev/null + done +} + +_printer_dir_build() { + local command=$1 + local d + + [[ $# -ne 1 ]] && die "Call as: _printer_dir_build COMMAND" + + for (( i=0; i<${#PRINTER_USE[@]}; i++ )); do + local name="${PRINTER_USE[$i]}" + if use ${name}; then + for d in ${DIRS_PRINTER}; do + echo ">>> Working in: ${name}/${d}" + pushd ${name}/${d} > /dev/null + if [[ ${command} == econf* ]]; then + ${command} \ + --enable-progpath="${EPREFIX}/usr/bin" \ + --program-suffix=${name} + else + ${command} + fi + popd > /dev/null + done + fi + done +} + +pkg_setup() { + [[ -z ${LINGUAS} ]] && LINGUAS="en" + + DIRS_PRINTER="cnijfilter" + # lgmon must be first as it is required by cngpijmon + use servicetools && DIRS_PRINTER+=" lgmon cngpijmon maintenance" +} + +src_prepare() { + local d i + + # missing macros directory make aclocal fail + mkdir maintenance/m4 || die + + epatch \ + "${FILESDIR}/${MY_PN}"-3.70-png.patch \ + "${FILESDIR}/${MY_PN}"-3.70-ppd.patch \ + "${FILESDIR}/${MY_PN}"-3.70-ppd2.patch \ + "${FILESDIR}/${MY_PN}"-3.70-libexec-cups.patch \ + "${FILESDIR}/${MY_PN}"-3.70-libexec-backend.patch \ + "${FILESDIR}/${MY_PN}"-3.80-cups.patch + + _dir_build "${DIRS_PRINTER}" "eautoreconf" + + for (( i=0; i<${#PRINTER_USE[@]}; i++ )); do + local name="${PRINTER_USE[$i]}" + local pid="${PRINTER_ID[$i]}" + if use ${name}; then + mkdir -p ${name} || die + ln -s "${S}"/${pid} ${name}/ || die + for d in ${DIRS_PRINTER}; do + cp -a ${d} ${name} || die + done + fi + done +} + +src_configure() { + local d i + + _printer_dir_build "econf" +} + +src_compile() { + _printer_dir_build "emake" +} + +src_install() { + local _libdir="${EPREFIX}/usr/$(get_libdir)" + local _libdir_pkg=libs_bin$(use amd64 && echo 64 || echo 32) + local _ppddir="${EPREFIX}/usr/share/cups/model" + + _printer_dir_build "emake DESTDIR=${D} install" + + for (( i=0; i<${#PRINTER_USE[@]}; i++ )); do + local name="${PRINTER_USE[$i]}" + local pid="${PRINTER_ID[$i]}" + if use ${name}; then + dodir ${_libdir} + # no doexe due to symlinks + cp -a "${pid}/${_libdir_pkg}"/* "${D}/${_libdir}" || die + exeinto ${_libdir}/cnijlib + doexe ${pid}/database/* + # create symlink for the cnijlib to bjlib as some formats need it + dosym ${_libdir}/cnijlib ${_libdir}/bjlib + insinto ${_ppddir} + doins ppd/canon${name}.ppd + fi + done +} + +pkg_postinst() { + einfo "" + einfo "For installing a printer:" + einfo " * Restart CUPS: /etc/init.d/cupsd restart" + einfo " * Go to http://127.0.0.1:631/" + einfo " -> Printers -> Add Printer" + einfo "" + einfo "If you experience any problems, please visit:" + einfo " http://forums.gentoo.org/viewtopic-p-3217721.html" + einfo "" +} |