설치 준비하기
최소한의 설치 준비를 위해 다음을 생각해 두어야 합니다.
1. 어느 디렉토리에서 설치를 위한 빌드를 준비할 것인가?
2. 어느 디렉토리에 설치할 것인가?
두가지를 결정하였다면 환경 변수로 등록해 둡니다.
1 2 |
<SPAN class=pln>BUILD_DIR</SPAN><SPAN class=pun>=</SPAN><SPAN class=str>/tmp/</SPAN><SPAN class=pln>rrdbuild INSTALL_DIR</SPAN><SPAN class=pun>=</SPAN><SPAN class=str>/opt/</SPAN><SPAN class=pln>rrdtool</SPAN><SPAN class=pun>-</SPAN><SPAN class=lit>1.4</SPAN><SPAN class=pun>.</SPAN><SPAN class=lit>2</SPAN> |
빌드를 할 디렉토리를 만들어서 이동합니다.
1 2 |
<SPAN class=pln>mkdir </SPAN><SPAN class=pun>-</SPAN><SPAN class=pln>p $BUILD_DIR cd $BUILD_DIR</SPAN> |
추가로 필요로 하는 라이브러리를 알아보기 위한 설치를 시도해 봅니다.
1 2 3 4 |
<SPAN class=pln>wget http</SPAN><SPAN class=pun>:</SPAN><SPAN class=com>//oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.2.tar.gz</SPAN><SPAN class=pln> gunzip </SPAN><SPAN class=pun>-</SPAN><SPAN class=pln>c rrdtool</SPAN><SPAN class=pun>-</SPAN><SPAN class=lit>1.4</SPAN><SPAN class=pun>.</SPAN><SPAN class=lit>2.tar</SPAN><SPAN class=pun>.</SPAN><SPAN class=pln>gz </SPAN><SPAN class=pun>|</SPAN><SPAN class=pln> tar xf </SPAN><SPAN class=pun>-</SPAN><SPAN class=pln> cd rrdtool</SPAN><SPAN class=pun>-</SPAN><SPAN class=lit>1.4</SPAN><SPAN class=pun>.</SPAN><SPAN class=lit>2</SPAN><SPAN class=pln> </SPAN><SPAN class=pun>./</SPAN><SPAN class=pln>configure </SPAN><SPAN class=pun>--</SPAN><SPAN class=pln>prefix</SPAN><SPAN class=pun>=</SPAN><SPAN class=pln>$INSTALL_DIR </SPAN><SPAN class=pun>&&</SPAN><SPAN class=pln> make </SPAN><SPAN class=pun>&&</SPAN><SPAN class=pln> make install</SPAN> |
위의 결과가 정상적으로 끝난다면 필요한 라이브러리가 모두 있는것으로써 바로 사용이 가능해 집니다. 하지만 보통은 어떤 라이브러리들이 없는 쭉 나오게 됩니다. 그것을 적어두고 다음으로 넘어갑니다.
의존성 라이브러리 설치하기
설치를 하기에 앞서 라이브러리들이 서로 참조를 하기 때문에 다음을 수행하여 문제 없이 이루어 지도록 해줍니다.
1 2 3 4 |
<SPAN class=kwd>export</SPAN><SPAN class=pln> PKG_CONFIG_PATH</SPAN><SPAN class=pun>=</SPAN><SPAN class=pln>$</SPAN><SPAN class=pun>{</SPAN><SPAN class=pln>INSTALL_DIR</SPAN><SPAN class=pun>}/</SPAN><SPAN class=pln>lib</SPAN><SPAN class=pun>/</SPAN><SPAN class=pln>pkgconfig </SPAN><SPAN class=kwd>export</SPAN><SPAN class=pln> PATH</SPAN><SPAN class=pun>=</SPAN><SPAN class=pln>$INSTALL_DIR</SPAN><SPAN class=pun>/</SPAN><SPAN class=pln>bin</SPAN><SPAN class=pun>:</SPAN><SPAN class=pln>$PATH </SPAN><SPAN class=kwd>export</SPAN><SPAN class=pln> LDFLAGS</SPAN><SPAN class=pun>=</SPAN><SPAN class=str>"-Wl,--rpath -Wl,${INSTALL_DIR}/lib"</SPAN><SPAN class=pln> </SPAN><SPAN class=kwd>export</SPAN><SPAN class=pln> MAKE</SPAN><SPAN class=pun>=</SPAN><SPAN class=pln>make</SPAN> |
이후 다음의 라이브러리들중 필요로 하는 라이브러리만 선별적으로 순서대로 설치를 합니다.
– pkgconfig
1 2 3 4 5 6 |
<SPAN class=pln>wget http</SPAN><SPAN class=pun>:</SPAN><SPAN class=com>//pkgconfig.freedesktop.org/releases/pkg-config-0.23.tar.gz</SPAN><SPAN class=pln> gunzip </SPAN><SPAN class=pun>-</SPAN><SPAN class=pln>c pkg</SPAN><SPAN class=pun>-</SPAN><SPAN class=pln>config</SPAN><SPAN class=pun>-</SPAN><SPAN class=lit>0.23</SPAN><SPAN class=pun>.</SPAN><SPAN class=pln>tar</SPAN><SPAN class=pun>.</SPAN><SPAN class=pln>gz </SPAN><SPAN class=pun>|</SPAN><SPAN class=pln> tar xf </SPAN><SPAN class=pun>-</SPAN><SPAN class=pln> cd pkg</SPAN><SPAN class=pun>-</SPAN><SPAN class=pln>config</SPAN><SPAN class=pun>-</SPAN><SPAN class=lit>0.23</SPAN><SPAN class=pln> </SPAN><SPAN class=pun>./</SPAN><SPAN class=pln>configure </SPAN><SPAN class=pun>--</SPAN><SPAN class=pln>prefix</SPAN><SPAN class=pun>=</SPAN><SPAN class=pln>$INSTALL_DIR CFLAGS</SPAN><SPAN class=pun>=</SPAN><SPAN class=str>"-O3 -fPIC"</SPAN><SPAN class=pln> $MAKE $MAKE install</SPAN> |
– zlib
1 2 3 4 5 6 7 |
<SPAN class=pln>cd $BUILD_DIR wget http</SPAN><SPAN class=pun>:</SPAN><SPAN class=com>//oss.oetiker.ch/rrdtool/pub/libs/zlib-1.2.3.tar.gz</SPAN><SPAN class=pln> gunzip </SPAN><SPAN class=pun>-</SPAN><SPAN class=pln>c zlib</SPAN><SPAN class=pun>-</SPAN><SPAN class=lit>1.2</SPAN><SPAN class=pun>.</SPAN><SPAN class=lit>3.tar</SPAN><SPAN class=pun>.</SPAN><SPAN class=pln>gz </SPAN><SPAN class=pun>|</SPAN><SPAN class=pln> tar xf </SPAN><SPAN class=pun>-</SPAN><SPAN class=pln> cd zlib</SPAN><SPAN class=pun>-</SPAN><SPAN class=lit>1.2</SPAN><SPAN class=pun>.</SPAN><SPAN class=lit>3</SPAN><SPAN class=pln> </SPAN><SPAN class=pun>./</SPAN><SPAN class=pln>configure </SPAN><SPAN class=pun>--</SPAN><SPAN class=pln>prefix</SPAN><SPAN class=pun>=</SPAN><SPAN class=pln>$INSTALL_DIR CFLAGS</SPAN><SPAN class=pun>=</SPAN><SPAN class=str>"-O3 -fPIC"</SPAN><SPAN class=pln> </SPAN><SPAN class=pun>--</SPAN><SPAN class=pln>shared $MAKE $MAKE install</SPAN> |
– libpng
1 2 3 4 5 6 7 |
<SPAN class=pln>cd $BUILD_DIR wget http</SPAN><SPAN class=pun>:</SPAN><SPAN class=com>//oss.oetiker.ch/rrdtool/pub/libs/libpng-1.2.18.tar.gz</SPAN><SPAN class=pln> gunzip </SPAN><SPAN class=pun>-</SPAN><SPAN class=pln>c libpng</SPAN><SPAN class=pun>-</SPAN><SPAN class=lit>1.2</SPAN><SPAN class=pun>.</SPAN><SPAN class=lit>18.tar</SPAN><SPAN class=pun>.</SPAN><SPAN class=pln>gz </SPAN><SPAN class=pun>|</SPAN><SPAN class=pln> tar xf </SPAN><SPAN class=pun>-</SPAN><SPAN class=pln> cd libpng</SPAN><SPAN class=pun>-</SPAN><SPAN class=lit>1.2</SPAN><SPAN class=pun>.</SPAN><SPAN class=lit>18</SPAN><SPAN class=pln> env CFLAGS</SPAN><SPAN class=pun>=</SPAN><SPAN class=str>"-O3 -fPIC"</SPAN><SPAN class=pln> </SPAN><SPAN class=pun>./</SPAN><SPAN class=pln>configure </SPAN><SPAN class=pun>--</SPAN><SPAN class=pln>prefix</SPAN><SPAN class=pun>=</SPAN><SPAN class=pln>$INSTALL_DIR $MAKE $MAKE install</SPAN> |
– freetype
1 2 3 4 5 6 7 |
<SPAN class=pln>cd $BUILD_DIR wget http</SPAN><SPAN class=pun>:</SPAN><SPAN class=com>//oss.oetiker.ch/rrdtool/pub/libs/freetype-2.3.5.tar.gz</SPAN><SPAN class=pln> gunzip </SPAN><SPAN class=pun>-</SPAN><SPAN class=pln>c freetype</SPAN><SPAN class=pun>-</SPAN><SPAN class=lit>2.3</SPAN><SPAN class=pun>.</SPAN><SPAN class=lit>5.tar</SPAN><SPAN class=pun>.</SPAN><SPAN class=pln>gz </SPAN><SPAN class=pun>|</SPAN><SPAN class=pln> tar xf </SPAN><SPAN class=pun>-</SPAN><SPAN class=pln> cd freetype</SPAN><SPAN class=pun>-</SPAN><SPAN class=lit>2.3</SPAN><SPAN class=pun>.</SPAN><SPAN class=lit>5</SPAN><SPAN class=pln> </SPAN><SPAN class=pun>./</SPAN><SPAN class=pln>configure </SPAN><SPAN class=pun>--</SPAN><SPAN class=pln>prefix</SPAN><SPAN class=pun>=</SPAN><SPAN class=pln>$INSTALL_DIR CFLAGS</SPAN><SPAN class=pun>=</SPAN><SPAN class=str>"-O3 -fPIC"</SPAN><SPAN class=pln> $MAKE $MAKE install</SPAN> |
– libXML2
1 2 3 4 5 6 7 |
<SPAN class=pln>cd $BUILD_DIR wget http</SPAN><SPAN class=pun>:</SPAN><SPAN class=com>//oss.oetiker.ch/rrdtool/pub/libs/libxml2-2.6.32.tar.gz</SPAN><SPAN class=pln> gunzip </SPAN><SPAN class=pun>-</SPAN><SPAN class=pln>c libxml2</SPAN><SPAN class=pun>-</SPAN><SPAN class=lit>2.6</SPAN><SPAN class=pun>.</SPAN><SPAN class=lit>32.tar</SPAN><SPAN class=pun>.</SPAN><SPAN class=pln>gz </SPAN><SPAN class=pun>|</SPAN><SPAN class=pln> tar xf </SPAN><SPAN class=pun>-</SPAN><SPAN class=pln> cd libxml2</SPAN><SPAN class=pun>-</SPAN><SPAN class=lit>2.6</SPAN><SPAN class=pun>.</SPAN><SPAN class=lit>32</SPAN><SPAN class=pln> </SPAN><SPAN class=pun>./</SPAN><SPAN class=pln>configure </SPAN><SPAN class=pun>--</SPAN><SPAN class=pln>prefix</SPAN><SPAN class=pun>=</SPAN><SPAN class=pln>$INSTALL_DIR CFLAGS</SPAN><SPAN class=pun>=</SPAN><SPAN class=str>"-O3 -fPIC"</SPAN><SPAN class=pln> $MAKE $MAKE install</SPAN> |
– fontconfig
1 2 3 4 5 6 7 8 |
<SPAN class=pln>cd $BUILD_DIR wget http</SPAN><SPAN class=pun>:</SPAN><SPAN class=com>//oss.oetiker.ch/rrdtool/pub/libs/fontconfig-2.4.2.tar.gz</SPAN><SPAN class=pln> gunzip </SPAN><SPAN class=pun>-</SPAN><SPAN class=pln>c fontconfig</SPAN><SPAN class=pun>-</SPAN><SPAN class=lit>2.4</SPAN><SPAN class=pun>.</SPAN><SPAN class=lit>2.tar</SPAN><SPAN class=pun>.</SPAN><SPAN class=pln>gz </SPAN><SPAN class=pun>|</SPAN><SPAN class=pln> tar xf </SPAN><SPAN class=pun>-</SPAN><SPAN class=pln> cd fontconfig</SPAN><SPAN class=pun>-</SPAN><SPAN class=lit>2.4</SPAN><SPAN class=pun>.</SPAN><SPAN class=lit>2</SPAN><SPAN class=pln> </SPAN><SPAN class=pun>./</SPAN><SPAN class=pln>configure </SPAN><SPAN class=pun>--</SPAN><SPAN class=pln>prefix</SPAN><SPAN class=pun>=</SPAN><SPAN class=pln>$INSTALL_DIR CFLAGS</SPAN><SPAN class=pun>=</SPAN><SPAN class=str>"-O3 -fPIC"</SPAN><SPAN class=pln> </SPAN><SPAN class=pun>\</SPAN><SPAN class=pln> </SPAN><SPAN class=pun>--</SPAN><SPAN class=kwd>with</SPAN><SPAN class=pun>-</SPAN><SPAN class=pln>freetype</SPAN><SPAN class=pun>-</SPAN><SPAN class=pln>config</SPAN><SPAN class=pun>=</SPAN><SPAN class=pln>$INSTALL_DIR</SPAN><SPAN class=pun>/</SPAN><SPAN class=pln>bin</SPAN><SPAN class=pun>/</SPAN><SPAN class=pln>freetype</SPAN><SPAN class=pun>-</SPAN><SPAN class=pln>config $MAKE $MAKE install</SPAN> |
font-config의 경우, 설치중에 폰트캐시를 생성하게 됩니다. 하지만 시스템을 X를 제외하여 설치하였다면 폰트가 하나도 없게 되어 캐시를 생성해봤자 사용할 수 있는 폰트가 없기 때문에 모든 문자가 깨져 나오게 됩니다. 이때에는 사용하려는 트루타입 폰트(ttf)를 $INSTALL_DIR/etc/fonts(rpm 패키지로 설치되어있을 경우 /usr/share/fonts) 안에 설치하여 주신후에 fc-cache를 실행하여 주시면 됩니다.
– Pixman
1 2 3 4 5 6 7 |
<SPAN class=pln>cd $BUILD_DIR wget http</SPAN><SPAN class=pun>:</SPAN><SPAN class=com>//oss.oetiker.ch/rrdtool/pub/libs/pixman-0.10.0.tar.gz</SPAN><SPAN class=pln> gunzip </SPAN><SPAN class=pun>-</SPAN><SPAN class=pln>c pixman</SPAN><SPAN class=pun>-</SPAN><SPAN class=lit>0.10</SPAN><SPAN class=pun>.</SPAN><SPAN class=lit>0.tar</SPAN><SPAN class=pun>.</SPAN><SPAN class=pln>gz </SPAN><SPAN class=pun>|</SPAN><SPAN class=pln> tar xf </SPAN><SPAN class=pun>-</SPAN><SPAN class=pln> cd pixman</SPAN><SPAN class=pun>-</SPAN><SPAN class=lit>0.10</SPAN><SPAN class=pun>.</SPAN><SPAN class=lit>0</SPAN><SPAN class=pln> </SPAN><SPAN class=pun>./</SPAN><SPAN class=pln>configure </SPAN><SPAN class=pun>--</SPAN><SPAN class=pln>prefix</SPAN><SPAN class=pun>=</SPAN><SPAN class=pln>$INSTALL_DIR CFLAGS</SPAN><SPAN class=pun>=</SPAN><SPAN class=str>"-O3 -fPIC"</SPAN><SPAN class=pln> $MAKE $MAKE install</SPAN> |
– Cairo
1 2 3 4 5 6 7 8 9 10 11 |
<SPAN class=pln>cd $BUILD_DIR wget http</SPAN><SPAN class=pun>:</SPAN><SPAN class=com>//oss.oetiker.ch/rrdtool/pub/libs/cairo-1.6.4.tar.gz</SPAN><SPAN class=pln> gunzip </SPAN><SPAN class=pun>-</SPAN><SPAN class=pln>c cairo</SPAN><SPAN class=pun>-</SPAN><SPAN class=lit>1.6</SPAN><SPAN class=pun>.</SPAN><SPAN class=lit>4.tar</SPAN><SPAN class=pun>.</SPAN><SPAN class=pln>gz </SPAN><SPAN class=pun>|</SPAN><SPAN class=pln> tar xf </SPAN><SPAN class=pun>-</SPAN><SPAN class=pln> cd cairo</SPAN><SPAN class=pun>-</SPAN><SPAN class=lit>1.6</SPAN><SPAN class=pun>.</SPAN><SPAN class=lit>4</SPAN><SPAN class=pln> </SPAN><SPAN class=pun>./</SPAN><SPAN class=pln>configure </SPAN><SPAN class=pun>--</SPAN><SPAN class=pln>prefix</SPAN><SPAN class=pun>=</SPAN><SPAN class=pln>$INSTALL_DIR </SPAN><SPAN class=pun>\</SPAN><SPAN class=pln> </SPAN><SPAN class=pun>--</SPAN><SPAN class=pln>enable</SPAN><SPAN class=pun>-</SPAN><SPAN class=pln>xlib</SPAN><SPAN class=pun>=</SPAN><SPAN class=kwd>no</SPAN><SPAN class=pln> </SPAN><SPAN class=pun>\</SPAN><SPAN class=pln> </SPAN><SPAN class=pun>--</SPAN><SPAN class=pln>enable</SPAN><SPAN class=pun>-</SPAN><SPAN class=pln>xlib</SPAN><SPAN class=pun>-</SPAN><SPAN class=pln>render</SPAN><SPAN class=pun>=</SPAN><SPAN class=kwd>no</SPAN><SPAN class=pln> </SPAN><SPAN class=pun>\</SPAN><SPAN class=pln> </SPAN><SPAN class=pun>--</SPAN><SPAN class=pln>enable</SPAN><SPAN class=pun>-</SPAN><SPAN class=pln>win32</SPAN><SPAN class=pun>=</SPAN><SPAN class=kwd>no</SPAN><SPAN class=pln> </SPAN><SPAN class=pun>\</SPAN><SPAN class=pln> CFLAGS</SPAN><SPAN class=pun>=</SPAN><SPAN class=str>"-O3 -fPIC"</SPAN><SPAN class=pln> $MAKE $MAKE install</SPAN> |
– Glib
1 2 3 4 5 6 7 |
<SPAN class=pln>cd $BUILD_DIR wget http</SPAN><SPAN class=pun>:</SPAN><SPAN class=com>//oss.oetiker.ch/rrdtool/pub/libs/glib-2.15.4.tar.gz</SPAN><SPAN class=pln> gunzip </SPAN><SPAN class=pun>-</SPAN><SPAN class=pln>c glib</SPAN><SPAN class=pun>-</SPAN><SPAN class=lit>2.15</SPAN><SPAN class=pun>.</SPAN><SPAN class=lit>4.tar</SPAN><SPAN class=pun>.</SPAN><SPAN class=pln>gz </SPAN><SPAN class=pun>|</SPAN><SPAN class=pln> tar xf </SPAN><SPAN class=pun>-</SPAN><SPAN class=pln> cd glib</SPAN><SPAN class=pun>-</SPAN><SPAN class=lit>2.15</SPAN><SPAN class=pun>.</SPAN><SPAN class=lit>4</SPAN><SPAN class=pln> </SPAN><SPAN class=pun>./</SPAN><SPAN class=pln>configure </SPAN><SPAN class=pun>--</SPAN><SPAN class=pln>prefix</SPAN><SPAN class=pun>=</SPAN><SPAN class=pln>$INSTALL_DIR CFLAGS</SPAN><SPAN class=pun>=</SPAN><SPAN class=str>"-O3 -fPIC"</SPAN><SPAN class=pln> $MAKE $MAKE install</SPAN> |
– Pango
1 2 3 4 5 6 7 |
<SPAN class=pln>cd $BUILD_DIR wget http</SPAN><SPAN class=pun>:</SPAN><SPAN class=com>//oss.oetiker.ch/rrdtool/pub/libs/pango-1.21.1.tar.bz2</SPAN><SPAN class=pln> bunzip2 </SPAN><SPAN class=pun>-</SPAN><SPAN class=pln>c pango</SPAN><SPAN class=pun>-</SPAN><SPAN class=lit>1.21</SPAN><SPAN class=pun>.</SPAN><SPAN class=lit>1.tar</SPAN><SPAN class=pun>.</SPAN><SPAN class=pln>bz2 </SPAN><SPAN class=pun>|</SPAN><SPAN class=pln> tar xf </SPAN><SPAN class=pun>-</SPAN><SPAN class=pln> cd pango</SPAN><SPAN class=pun>-</SPAN><SPAN class=lit>1.21</SPAN><SPAN class=pun>.</SPAN><SPAN class=lit>1</SPAN><SPAN class=pln> </SPAN><SPAN class=pun>./</SPAN><SPAN class=pln>configure </SPAN><SPAN class=pun>--</SPAN><SPAN class=pln>prefix</SPAN><SPAN class=pun>=</SPAN><SPAN class=pln>$INSTALL_DIR CFLAGS</SPAN><SPAN class=pun>=</SPAN><SPAN class=str>"-O3 -fPIC"</SPAN><SPAN class=pln> </SPAN><SPAN class=pun>--</SPAN><SPAN class=pln>without</SPAN><SPAN class=pun>-</SPAN><SPAN class=pln>x $MAKE $MAKE install</SPAN> |
다시 rrdtool 설치하기
필요한 의존 라이브러리를 설치하였다면 다시한번 설치를 시도해 봅시다.
1 2 3 4 5 |
<SPAN class=pln>cd $BUILD_DIR</SPAN><SPAN class=pun>/</SPAN><SPAN class=pln>rrdtool</SPAN><SPAN class=pun>-</SPAN><SPAN class=lit>1.4</SPAN><SPAN class=pun>.</SPAN><SPAN class=lit>2</SPAN><SPAN class=pln> </SPAN><SPAN class=pun>./</SPAN><SPAN class=pln>configure </SPAN><SPAN class=pun>--</SPAN><SPAN class=pln>prefix</SPAN><SPAN class=pun>=</SPAN><SPAN class=pln>$INSTALL_DIR </SPAN><SPAN class=pun>--</SPAN><SPAN class=pln>disable</SPAN><SPAN class=pun>-</SPAN><SPAN class=pln>tcl </SPAN><SPAN class=pun>--</SPAN><SPAN class=pln>disable</SPAN><SPAN class=pun>-</SPAN><SPAN class=pln>python $MAKE clean $MAKE $MAKE install</SPAN> |
설치후에 $INSTALL_DIR/share/rrdtool/examples 안에 있는 예제를 실행하여 정상적으로 그래프가 그려지는지 확인하여 봅시다. 잘 된다면 설치 성공입니다.
출저 : http://theeye.pe.kr/entry/how-to-install-rrdtool-with-compiling