読者です 読者をやめる 読者になる 読者になる

tmux入れるときに色々エラーとか出たりしたのでその時のメモ

環境はこんな感じ

OS: CentOS 5.2
RPM: libevent-1.1a-3.2.1 インストール済み

yum install tmux

$ yum install tmux
Loaded plugins: rhnplugin
Excluding Packages in global exclude list
Finished
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package tmux.x86_64 0:1.6-1.el5.rf set to be updated
--> Processing Dependency: libevent-1.4.so.2()(64bit) for package: tmux
--> Finished Dependency Resolution
tmux-1.6-1.el5.rf.x86_64 from rpmforge has depsolving problems
  --> Missing Dependency: libevent-1.4.so.2()(64bit) is needed by package tmux-1.6-1.el5.rf.x86_64 (rpmforge)
Error: Missing Dependency: libevent-1.4.so.2()(64bit) is needed by package tmux-1.6-1.el5.rf.x86_64 (rpmforge)
 You could try using --skip-broken to work around the problem
 You could try running: package-cleanup --problems
                        package-cleanup --dupes
                        rpm -Va --nofiles --nodigest
The program package-cleanup is found in the yum-utils package.

ふええ〜
仕方ないのでlibeventをsourceでインストール

libevent

$ wget http://downloads.sourceforge.net/project/levent/libevent/libevent-2.0/libevent-2.0.19-stable.tar.gz
$ tar xzf libevent-2.0.19-stable.tar.gz
$ cd libevent-2.0.19-stable
$ ./configure
$ make -j8
$ make install

$ # ls /usr/local/lib
libdrac.a              libevent_core-2.0.so.5      libevent_extra-2.0.so.5.1.7    libevent_openssl.a              libevent_pthreads.la
libevent-2.0.so.5      libevent_core-2.0.so.5.1.7  libevent_extra.a               libevent_openssl.la             libevent_pthreads.so
libevent-2.0.so.5.1.7  libevent_core.a             libevent_extra.la              libevent_openssl.so             pkgconfig
libevent.a             libevent_core.la            libevent_extra.so              libevent_pthreads-2.0.so.5
libevent.la            libevent_core.so            libevent_openssl-2.0.so.5      libevent_pthreads-2.0.so.5.1.7
libevent.so            libevent_extra-2.0.so.5     libevent_openssl-2.0.so.5.1.7  libevent_pthreads.a

$ ldconfig -p でlibeventが出てくればOK、出てこなければ
$ echo /usr/local/lib >> /etc/ld.so.conf
$ ldconfig -p して表示されればOK

サーバで ldconfig 打つ怖さ

tmux

$ wget http://downloads.sourceforge.net/project/tmux/tmux/tmux-1.6/tmux-1.6.tar.gz
$ tar tmux-1.6.tar.gz
$ cd tmux-1.6
$ ./configure
$ make -j8 

...
server.o: In function `server_start':
server.c:(.text+0x223): undefined reference to `event_reinit'
status.o: In function `status_job_callback':
status.c:(.text+0x27bb): undefined reference to `evbuffer_get_length'
status.c:(.text+0x27f2): undefined reference to `evbuffer_pullup'
tty-keys.o: In function `tty_keys_next':
tty-keys.c:(.text+0x452): undefined reference to `evbuffer_pullup'
tty-keys.c:(.text+0x46a): undefined reference to `evbuffer_get_length'
window.o: In function `window_pane_read_callback':
window.c:(.text+0x403f): undefined reference to `evbuffer_get_length'
window.c:(.text+0x408b): undefined reference to `evbuffer_pullup'
window.c:(.text+0x40c4): undefined reference to `evbuffer_get_length'
collect2: ld はステータス 1 で終了しました
make: *** [tmux] エラー 1

エラー出る。さっきインストールしたlibeventのライブラリ読み込ませる

$ ./configure LDFLAGS=-L/usr/local/lib/
$ make -j8

エラー出ない

$ make install

インストールできた

という感じ。