2014/02/08

gentoo emergeで独自パッチの適用

そんなことができるようになっていたなんて。
sys-power/apcupsd-3.14.8-r2でまたエラーが出た。
net-snmpの構造が変わったので、オリジナルのapcupsdでは対応できない。パッチを早く入れてくれればいいのに。。。
と思っていたら、自分専用のパッチをemergeで当ててくれるようになっていた。

  CXX   src/cgi/cgilib.c
  CXX   src/cgi/upsfetch.c
  CXX   src/cgi/multimon.c
  CXX   src/cgi/upsstats.c
  CXX   src/cgi/upsfstats.c
  CXX   src/cgi/upsimage.c
make[1]: *** [drivers_DIR] Error 2
make[1]: *** Waiting for unfinished jobs....
  LD    src/cgi/upsfstats.cgi
  LD    src/cgi/upsstats.cgi
  LD    src/cgi/upsimage.cgi
  LD    src/cgi/multimon.cgi
make: *** [src_DIR] Error 2
emake failed
 * ERROR: sys-power/apcupsd-3.14.8-r2::gentoo failed (compile phase):
 *   emake failed
 *
 * Call stack:
 *     ebuild.sh, line  93:  Called src_compile
 *   environment, line 2900:  Called die
 * The specific snippet of code:
 *       MANPAGER=$(type -p cat) emake || die "emake failed"
 *
 * If you need support, post the output of `emerge --info '=sys-power/apcupsd-3.14.8-r2::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-power/apcupsd-3.14.8-r2::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/sys-power/apcupsd-3.14.8-r2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-power/apcupsd-3.14.8-r2/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-power/apcupsd-3.14.8-r2/work/apcupsd-3.14.8'
 * S: '/var/tmp/portage/sys-power/apcupsd-3.14.8-r2/work/apcupsd-3.14.8'

>>> Failed to emerge sys-power/apcupsd-3.14.8-r2, Log file:

>>>  '/var/tmp/portage/sys-power/apcupsd-3.14.8-r2/temp/build.log'

 * Messages for package sys-power/apcupsd-3.14.8-r2:

 * ERROR: sys-power/apcupsd-3.14.8-r2::gentoo failed (compile phase):
 *   emake failed
 *
 * Call stack:
 *     ebuild.sh, line  93:  Called src_compile
 *   environment, line 2900:  Called die
 * The specific snippet of code:
 *       MANPAGER=$(type -p cat) emake || die "emake failed"
 *
 * If you need support, post the output of `emerge --info '=sys-power/apcupsd-3.14.8-r2::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-power/apcupsd-3.14.8-r2::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/sys-power/apcupsd-3.14.8-r2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-power/apcupsd-3.14.8-r2/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-power/apcupsd-3.14.8-r2/work/apcupsd-3.14.8'
 * S: '/var/tmp/portage/sys-power/apcupsd-3.14.8-r2/work/apcupsd-3.14.8'

ということで、emergeがfail。

# mkdir -p /etc/portage/patches/sys-power/apcupsd-3.14.8-r2

# cd /etc/portage/patches/sys-power/apcupsd-3.14.8-r2/

# wget -O Change_MIB_to_mib_to_build_with_latest_net-snmp.patch http://www.luniel.com/w/images/f/f2/Change_MIB_to_mib_to_build_with_latest_net-snmp.patch

# /bin/ls
Change_MIB_to_mib_to_build_with_latest_net-snmp.patch

# cat /etc/portage/bashrc
post_src_prepare() {
       epatch_user
}

この状態でemergeを再度実行すると。。。

>>> Emerging (1 of 1) sys-power/apcupsd-3.14.8-r2
 * apcupsd-3.14.8.tar.gz SHA256 SHA512 WHIRLPOOL size ;-) ...                                                                                                     [ ok ]
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found sources for kernel version:
 *     3.11.2-hardened_edo.fukatani.org
 * Checking for suitable kernel configuration options...                                                                                                          [ ok ]
>>> Unpacking source...
>>> Unpacking apcupsd-3.14.8.tar.gz to /var/tmp/portage/sys-power/apcupsd-3.14.8-r2/work
>>> Source unpacked in /var/tmp/portage/sys-power/apcupsd-3.14.8-r2/work
>>> Preparing source in /var/tmp/portage/sys-power/apcupsd-3.14.8-r2/work/apcupsd-3.14.8 ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/sys-power/apcupsd-3.14.8-r2/work/apcupsd-3.14.8 ...
 * econf: updating apcupsd-3.14.8/autoconf/config.guess with /usr/share/gnuconfig/config.guess
 * econf: updating apcupsd-3.14.8/autoconf/config.sub with /usr/share/gnuconfig/config.sub
./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --libdir=/usr/lib64 --sbindir=/sbin --sysconfdir=/etc/apcupsd --with-pwrfail-dir=/etc/apcupsd --with-lock-dir=/var/lock --with-pid-dir=/var/run --with-log-dir=/var/log --with-nis-port=3551 --enable-net --enable-pcnet --with-distname=gentoo --enable-net-snmp --disable-gapcmon --enable-cgi --with-cgi-bin=/usr/libexec/apcupsd/cgi-bin --with-upstype=usb --with-upscable=usb --enable-usb --with-dev= APCUPSD_MAIL=/bin/mail

というのが、

>>> Emerging (1 of 1) sys-power/apcupsd-3.14.8-r2
 * apcupsd-3.14.8.tar.gz SHA256 SHA512 WHIRLPOOL size ;-) ...                                                                                                     [ ok ]
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found sources for kernel version:
 *     3.11.2-hardened_edo.fukatani.org
 * Checking for suitable kernel configuration options...                                                                                                          [ ok ]
>>> Unpacking source...
>>> Unpacking apcupsd-3.14.8.tar.gz to /var/tmp/portage/sys-power/apcupsd-3.14.8-r2/work
>>> Source unpacked in /var/tmp/portage/sys-power/apcupsd-3.14.8-r2/work
>>> Preparing source in /var/tmp/portage/sys-power/apcupsd-3.14.8-r2/work/apcupsd-3.14.8 ...
>>> Source prepared.
 * Applying user patches from /etc/portage/patches//sys-power/apcupsd-3.14.8-r2 ...
 *   Change_MIB_to_mib_to_build_with_latest_net-snmp.patch ...                                                                                                    [ ok ]
 * Done with patching
>>> Configuring source in /var/tmp/portage/sys-power/apcupsd-3.14.8-r2/work/apcupsd-3.14.8 ...
 * econf: updating apcupsd-3.14.8/autoconf/config.guess with /usr/share/gnuconfig/config.guess
 * econf: updating apcupsd-3.14.8/autoconf/config.sub with /usr/share/gnuconfig/config.sub
./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --libdir=/usr/lib64 --sbindir=/sbin --sysconfdir=/etc/apcupsd --with-pwrfail-dir=/etc/apcupsd --with-lock-dir=/var/lock --with-pid-dir=/var/run --with-log-dir=/var/log --with-nis-port=3551 --enable-net --enable-pcnet --with-distname=gentoo --enable-net-snmp --disable-gapcmon --enable-cgi --with-cgi-bin=/usr/libexec/apcupsd/cgi-bin --with-upstype=usb --with-upscable=usb --enable-usb --with-dev= APCUPSD_MAIL=/bin/mail
となって、パッチが適用されていた。

0 件のコメント:

コメントを投稿