2013年8月19日月曜日

「RPM build errors:」を解決させた!

前回のNagiosの日本語パッチ適用RPMを作成しようとして、何度も以下のようなエラーが出たので解決してみたメモです。

RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.eq1q5s (%build)

(最後にエラー全文)

こんなメッセージが出ちゃうんですね・・・

メッセージを頼りにいろいろ・・・

configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.

う~ん。(´・ω・`)



config.log 探す


1
2
3
4
cd ~/rpmbuild/
find . -name "config.log"
 
./BUILD/nagios/config.log

  • config.log中身

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
configure:1843: $? = 1
configure: failed program was:
| /* confdefs.h.  */
|
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:1882: error: C compiler cannot create executables
See `config.log' for more details.

やっぱり、よくわからない・・・

お!


Webで検索したり、試行錯誤しながら、rpmコマンド叩いてみたら・・・

$ rpm -q glibc-devel

glibc-devel-2.12-1.107.el6_4.2.i686


何か、glibcが32bit しか、入ってないや!

このOS 64bitなんですけど~

て、ことで試しに glibc-devel64bit を入れてみる

1
2
3
4
5
6
7
yum install glibc-devel
 
================================================================================================
 Package               Arch             Version                         Repository         Size
================================================================================================
Installing:
 glibc-devel           x86_64           2.12-1.107.el6_4.2              updates           974 k

で、入った。

ビルドした!出来た~

1
2
3
4
5
6
7
8
9
10
11
12
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/snicker_jp/rpmbuild/BUILDROOT/nagios-3.5.0-1.el6.ja.x86_64
warning: Could not canonicalize hostname: monitor8
Wrote: /home/snicker_jp/rpmbuild/RPMS/x86_64/nagios-3.5.0-1.el6.ja.x86_64.rpm
Wrote: /home/snicker_jp/rpmbuild/RPMS/x86_64/nagios-common-3.5.0-1.el6.ja.x86_64.rpm
Wrote: /home/snicker_jp/rpmbuild/RPMS/x86_64/nagios-devel-3.5.0-1.el6.ja.x86_64.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.LSaku2
+ umask 022
+ cd /home/snicker_jp/rpmbuild/BUILD
+ cd nagios
+ rm -rf /home/snicker_jp/rpmbuild/BUILDROOT/nagios-3.5.0-1.el6.ja.x86_64
+ exit 0

まとめ

  • glibc 関連 エラーがちょっとわかりづらかったです!
  • glibc-devel がまさかの 32bit だけインストールされていたとは・・・(;´д`)トホホ
  • いい加減「mock」使おうぜ~!>< 2回目

エラー全文

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
[snicker_jp@monitor8 SPECS]$ rpmbuild -bb nagios-ja.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.UgzTse
+ umask 022
+ cd /home/snicker_jp/rpmbuild/BUILD
+ cd /home/snicker_jp/rpmbuild/BUILD
+ rm -rf nagios
+ /usr/bin/gzip -dc /home/snicker_jp/rpmbuild/SOURCES/nagios-3.5.0.tar.gz
+ /bin/tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd nagios
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ echo 'Patch #1 (nagios-0001-from-rpm.patch):'
Patch #1 (nagios-0001-from-rpm.patch):
+ /bin/cat /home/snicker_jp/rpmbuild/SOURCES/nagios-0001-from-rpm.patch
+ /usr/bin/patch -p1 -b --suffix .fedora --fuzz=0
patching file daemon-init.in
Hunk #1 succeeded at 129 (offset 5 lines).
+ echo 'Patch #2 (nagios-0002-SELinux-relabeling.patch):'
Patch #2 (nagios-0002-SELinux-relabeling.patch):
+ /bin/cat /home/snicker_jp/rpmbuild/SOURCES/nagios-0002-SELinux-relabeling.patch
+ /usr/bin/patch -p1 -b --suffix .selinux_relabel --fuzz=0
patching file daemon-init.in
Hunk #1 succeeded at 134 (offset 5 lines).
+ echo 'Patch #3 (nagios-0003-Fix-etc-init.d-nagios-status.patch):'
Patch #3 (nagios-0003-Fix-etc-init.d-nagios-status.patch):
+ /bin/cat /home/snicker_jp/rpmbuild/SOURCES/nagios-0003-Fix-etc-init.d-nagios-status.patch
+ /usr/bin/patch -p1 -b --suffix .fix_status_retcode --fuzz=0
patching file daemon-init.in
Hunk #1 succeeded at 57 (offset 5 lines).
Hunk #2 succeeded at 181 (offset 5 lines).
+ echo 'Patch #4 (nagios-0004-Fix-installation-of-httpd-conf.d-config-file.patch):'
Patch #4 (nagios-0004-Fix-installation-of-httpd-conf.d-config-file.patch):
+ /bin/cat /home/snicker_jp/rpmbuild/SOURCES/nagios-0004-Fix-installation-of-httpd-conf.d-config-file.patch
+ /usr/bin/patch -p1 -b --suffix .fix_httpd_conf_d --fuzz=0
patching file Makefile.in
Hunk #1 succeeded at 284 (offset 20 lines).
+ echo 'Patch #5 (nagios-0005-Install-config-files-too.patch):'
Patch #5 (nagios-0005-Install-config-files-too.patch):
+ /bin/cat /home/snicker_jp/rpmbuild/SOURCES/nagios-0005-Install-config-files-too.patch
+ /usr/bin/patch -p1 -b --suffix .install_config --fuzz=0
patching file Makefile.in
Hunk #1 succeeded at 329 (offset 38 lines).
+ echo 'Patch #6 (nagios-0006-Do-not-start-service-by-default.patch):'
Patch #6 (nagios-0006-Do-not-start-service-by-default.patch):
+ /bin/cat /home/snicker_jp/rpmbuild/SOURCES/nagios-0006-Do-not-start-service-by-default.patch
+ /usr/bin/patch -p1 -b --suffix .dont_start_by_default --fuzz=0
patching file daemon-init.in
+ echo 'Patch #7 (nagios-0007-The-init-script-should-return-2-in-case-of-unknown-c.patch):'
Patch #7 (nagios-0007-The-init-script-should-return-2-in-case-of-unknown-c.patch):
+ /bin/cat /home/snicker_jp/rpmbuild/SOURCES/nagios-0007-The-init-script-should-return-2-in-case-of-unknown-c.patch
+ /usr/bin/patch -p1 -b --suffix .return_2 --fuzz=0
patching file daemon-init.in
Hunk #1 succeeded at 234 (offset 5 lines).
+ echo 'Patch #8 (nagios-0008-Fix-path-to-CGI-executables.patch):'
Patch #8 (nagios-0008-Fix-path-to-CGI-executables.patch):
+ /bin/cat /home/snicker_jp/rpmbuild/SOURCES/nagios-0008-Fix-path-to-CGI-executables.patch
+ /usr/bin/patch -p1 -b --suffix .fix_path_to_cgi --fuzz=0
patching file sample-config/httpd.conf.in
patching file subst.in
+ echo 'Patch #9 (nagios-0009-Fixed-path-to-passwd-file-in-Apache-s-config-file.patch):'
Patch #9 (nagios-0009-Fixed-path-to-passwd-file-in-Apache-s-config-file.patch):
+ /bin/cat /home/snicker_jp/rpmbuild/SOURCES/nagios-0009-Fixed-path-to-passwd-file-in-Apache-s-config-file.patch
+ /usr/bin/patch -p1 -b --suffix .fix_path_to_passwd --fuzz=0
patching file sample-config/httpd.conf.in
+ echo 'Patch #10 (nagios-0010-Added-several-images-to-the-sample-config-revb.patch):'
Patch #10 (nagios-0010-Added-several-images-to-the-sample-config-revb.patch):
+ /bin/cat /home/snicker_jp/rpmbuild/SOURCES/nagios-0010-Added-several-images-to-the-sample-config-revb.patch
+ /usr/bin/patch -p1 -b --suffix .more_images --fuzz=0
patching file sample-config/template-object/templates.cfg.in
+ echo 'Patch #11 (nagios-0011-Fixed-strange-permissions.patch):'
Patch #11 (nagios-0011-Fixed-strange-permissions.patch):
+ /bin/cat /home/snicker_jp/rpmbuild/SOURCES/nagios-0011-Fixed-strange-permissions.patch
+ /usr/bin/patch -p1 -b --suffix .fix_perms --fuzz=0
patching file base/Makefile.in
Hunk #1 succeeded at 205 (offset 2 lines).
+ echo 'Patch #13 (nagios-3.4.3-spaces-to-plus-signs.patch):'
Patch #13 (nagios-3.4.3-spaces-to-plus-signs.patch):
+ /bin/cat /home/snicker_jp/rpmbuild/SOURCES/nagios-3.4.3-spaces-to-plus-signs.patch
+ /usr/bin/patch -p1 -b --suffix .plus_signs --fuzz=0
patching file common/macros.c
+ echo 'Patch #14 (nagios-3.5.0-conf.d-configuration-directory.patch):'
Patch #14 (nagios-3.5.0-conf.d-configuration-directory.patch):
+ /bin/cat /home/snicker_jp/rpmbuild/SOURCES/nagios-3.5.0-conf.d-configuration-directory.patch
+ /usr/bin/patch -p1 -b --suffix .conf_d --fuzz=0
patching file sample-config/nagios.cfg.in
+ echo 'Patch #15 (nagios-jp-3.5.0.patch.gz):'
Patch #15 (nagios-jp-3.5.0.patch.gz):
+ /usr/bin/gzip -dc /home/snicker_jp/rpmbuild/SOURCES/nagios-jp-3.5.0.patch.gz
+ /usr/bin/patch -p1 -b --suffix .ja_patch --fuzz=0
patching file cgi/avail.c
patching file cgi/cgiutils.c
patching file cgi/cmd.c
patching file cgi/config.c
patching file cgi/extcmd_list.c
patching file cgi/extinfo.c
patching file cgi/histogram.c
patching file cgi/history.c
patching file cgi/notifications.c
patching file cgi/outages.c
patching file cgi/showlog.c
patching file cgi/status.c
patching file cgi/statusmap.c
patching file cgi/statuswml.c
patching file cgi/summary.c
patching file cgi/tac.c
patching file cgi/trends.c
patching file common/downtime.c
patching file common/statusdata.c
patching file html/Makefile.in
patching file html/index.php
patching file html/main.php
patching file html/side.php
patching file include/cgiutils.h
patching file sample-config/cgi.cfg.in
+ install -p -m 0644 /home/snicker_jp/rpmbuild/SOURCES/printer.png /home/snicker_jp/rpmbuild/SOURCES/router.png /home/snicker_jp/rpmbuild/SOURCES/switch.png html/images/logos/
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.eq1q5s
+ umask 022
+ cd /home/snicker_jp/rpmbuild/BUILD
+ cd nagios
+ CFLAGS='-O2 -g'
+ export CFLAGS
+ CXXFLAGS='-O2 -g'
+ export CXXFLAGS
+ FFLAGS='-O2 -g'
+ export FFLAGS
+ ./configure --host=x86_64-redhat-linux-gnu --build=x86_64-redhat-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --prefix=/usr/share/nagios --exec-prefix=/var/lib/nagios --with-init-dir=/etc/rc.d/init.d --with-cgiurl=/nagios/cgi-bin/ --with-htmlurl=/nagios --with-lockfile=/var/run/nagios.pid --libdir=/usr/lib64/nagios --with-nagios-user=nagios --with-nagios-grp=nagios --bindir=/usr/sbin --libexecdir=/usr/lib64/nagios/plugins --sysconfdir=/etc/nagios --localstatedir=/var/log/nagios --datadir=/usr/share/nagios/html --with-gd-lib=/usr/lib64 --with-gd-inc=/usr/include --enable-embedded-perl --with-perlcache --with-template-objects --with-template-extinfo STRIP=/bin/true
checking for a BSD-compatible install... /usr/bin/install -c
checking build system type... x86_64-redhat-linux-gnu
checking host system type... x86_64-redhat-linux-gnu
checking for x86_64-redhat-linux-gnu-gcc... no
checking for gcc... gcc
checking for C compiler default output file name... configure: error: C compiler cannot create executables
See `config.log' for more details.
error: Bad exit status from /var/tmp/rpm-tmp.eq1q5s (%build)
 
 
RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.eq1q5s (%build)

画像参考

共有

Clip to Evernote
0follow