# [SOLVED]emerge courier-imap fails --- bug or config problem?

## seifn06

Hello, everyone:

I'm trying to install net-mail/courier-imap-4.15-r1 on my Gentoo box running gentoo-sources 3.16.5 on an amd64 build with multilib and the emerge has failed repeatedly and at what seems like the same place each time during the emerge with following error. I would like to successfully install this software and am wondering if I have incorrectly configured my system (ex: with a bad USE flag setting, missed something in my kernel config, etc.) or if I have stumbled upon a bug in the courier-imap software/ebuild. 

```

# emerge courier-imap

...

Do not forget to run make install-configure

make[2]: Leaving directory '/var/tmp/portage/net-mail/courier-imap-4.15-r1/work/courier-imap-4.15'

make[1]: Leaving directory '/var/tmp/portage/net-mail/courier-imap-4.15-r1/work/courier-imap-4.15'

sed: can't read /usr/portage/net-mail/courier-imap/files/courier-imap-4.0.6-r1-courier-imapd.rc6: No such file or directory

 * ERROR: net-mail/courier-imap-4.15-r1::gentoo failed (install phase):

 *   initd libdir-sed failed

 *

 * Call stack:

 *     ebuild.sh, line  93:  Called src_install

 *   environment, line 2848:  Called die

 * The specific snippet of code:

 *           sed -e "s:GENTOO_LIBDIR:$(get_libdir):g" "${FILESDIR}/${PN}-${INITD_VER}-${initd}.rc6" > "${initd}" || die "initd libdir-sed failed";

 *

 * If you need support, post the output of `emerge --info '=net-mail/courier-imap-4.15-r1::gentoo'`,

 * the complete build log and the output of `emerge -pqv '=net-mail/courier-imap-4.15-r1::gentoo'`.

 * The complete build log is located at '/var/tmp/portage/net-mail/courier-imap-4.15-r1/temp/build.log'.

 * The ebuild environment file is located at '/var/tmp/portage/net-mail/courier-imap-4.15-r1/temp/environment'.

 * Working directory: '/var/tmp/portage/net-mail/courier-imap-4.15-r1/work/tmp'

 * S: '/var/tmp/portage/net-mail/courier-imap-4.15-r1/work/courier-imap-4.15'

```

I wonder why sed is looking for courier-imapd-4.0.6-r1 in the three emerge output lines immediately preceding this error message.

```

# emerge --info '=net-mail/courier-imap-4.15-r1::gentoo'

Portage 2.2.8-r2 (default/linux/amd64/13.0, gcc-4.8.3, glibc-2.19-r1, 3.16.5-gentoo x86_64)

=================================================================

                         System Settings

=================================================================

System uname: Linux-3.16.5-gentoo-x86_64-Intel-R-_Core-TM-2_Duo_CPU_E6750_@_2.66GHz-with-gentoo-2.2

KiB Mem:     2040536 total,   1024244 free

KiB Swap:    4194300 total,   4194180 free

Timestamp of tree: Tue, 18 Nov 2014 15:15:01 +0000

ld GNU ld (Gentoo 2.24 p1.4) 2.24

app-shells/bash:          4.2_p53

dev-lang/perl:            5.18.2-r2

dev-lang/python:          2.7.7, 3.3.5-r1, 3.4.1

dev-util/cmake:           2.8.12.2-r1

dev-util/pkgconfig:       0.28-r1

sys-apps/baselayout:      2.2

sys-apps/openrc:          0.12.4

sys-apps/sandbox:         2.6-r1

sys-devel/autoconf:       2.69

sys-devel/automake:       1.13.4

sys-devel/binutils:       2.24-r3

sys-devel/gcc:            4.8.3

sys-devel/gcc-config:     1.7.3

sys-devel/libtool:        2.4.2-r1

sys-devel/make:           4.0-r1

sys-kernel/linux-headers: 3.16 (virtual/os-headers)

sys-libs/glibc:           2.19-r1

Repositories: gentoo

ACCEPT_KEYWORDS="amd64"

ACCEPT_LICENSE="* -@EULA"

CBUILD="x86_64-pc-linux-gnu"

CFLAGS="-O2 -march=native -pipe"

CHOST="x86_64-pc-linux-gnu"

CONFIG_PROTECT="/etc"

CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/sandbox.d /etc/terminfo"

CXXFLAGS="-O2 -march=native -pipe"

DISTDIR="/usr/portage/distfiles"

FCFLAGS="-O2 -pipe"

FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"

FFLAGS="-O2 -pipe"

GENTOO_MIRRORS="rsync://mirror.mcs.anl.gov/gentoo/ http://mirror.mcs.anl.gov/pub/gentoo/ http://gentoo.osuosl.org/ http://gentoo.cites.uiuc.edu/pub/gentoo/"

LANG="en_US.utf8"

LDFLAGS="-Wl,-O1 -Wl,--as-needed"

MAKEOPTS="-j2"

PKGDIR="/usr/portage/packages"

PORTAGE_CONFIGROOT="/"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY=""

SYNC="rsync://rsync24.us.gentoo.org/gentoo-portage"

USE="acl amd64 apache2 bash-completion bindist bzip2 cli cracklib crypt cxx dri fortran iconv imap innodb ipv6 javascript maildir milter mmx modules mp3 multilib mysql mysqli ncurses nls nptl openmp pam pcre pdflib php readline samba sasl session sockets sse sse2 ssl subversion tcpd threads tokenizer unicode zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon autn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"

Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

```

The build log is around 3,800 lines. I can post if that will help.

I've tried compiling courier-imap with berkdb and -gdbm USE flags as well as berkdb and gdbm use flags set.

```

# emerge -pqv '=net-mail/courier-imap-4.15-r1::gentoo'

[ebuild  N    ] net-mail/courier-imap-4.15-r1  USE="berkdb ipv6 -debug -fam -gdbm -gnutls (-selinux) -trashquota"

```

Thank you in advance for any ideas, input and/or help!Last edited by seifn06 on Tue Nov 25, 2014 3:12 pm; edited 1 time in total

----------

## seifn06

This appears to be an open/unresolved bug in the ebuild. See Gentoo Bug 529852. 

https://bugs.gentoo.org/show_bug.cgi?id=529852

----------

## seifn06

emerge --sync a couple of days after original post and emerge courier-imap succeeds now. This bug has apparently been fixed as I no longer get this error message.

----------

