Background Image
조회 수 1349 추천 수 6 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 첨부

10.1 버전 부터 linux 용 버전인 CUBRID-10.x.x.xxxx-d56a158-Linux.x86_64.sh를 설치하면

기본 설치 디렉터리가 예전과 다르게 엄청 길어진다.

 

아래의 그림과 같이 보이게 된다.

sh_install.png

 

 

유지관리나 해당 콘솔에서 작업을 할 때 디렉터리명이 길어지면 상당히 불편하다. 이전 버전과 같이 CUBRID로 설치 되게 설치 패키지를 수정해 보자.

 

일단 linux용 버전의 패키지.sh 파일의 구조는 다음과 같다.

 

vi로 열어보면 상단 shell script + 하단 tar with gzip 으로 구성 되어 있다.

sh_install2.png

 

 

그래서 일단 스크립트 부분과 tar+gz 부분을 분리해 보자.

스크립트 소스 네에는 다음과 같은 힌트가 있다.

 

518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
# take the archive portion of this file and pipe it to tar
# the NUMERIC parameter in this command should be one more
# than the number of lines in this header file
# there are tails which don't understand the "-n" argument, e.g. on SunOS
# OTOH there are tails which complain when not using the "-n" argument (e.g. GNU)
# so at first try to tail some file to see if tail fails if used with "-n"
# if so, don't use "-n"
use_new_tail_syntax="-n"
tail $use_new_tail_syntax +1 "$0" > /dev/null 2> /dev/null || use_new_tail_syntax=""
 
tail $use_new_tail_syntax +613 "$0" | gunzip | (cd "${toplevel}" && tar xf - 2> /dev/null) || cpack_echo_exit "Problem unpacking the CUBRID-10.2.0.8797-d56a158-Linux.x86_64"
 
echo "Unpacking finished successfully"
 
#
# post-setup for CUBRID
cs

 

위에서 526번 라인이 스크립트와 tar+gz의 분리 하는 부분이다. 이 부분을 이용해서 shell script 와 tar+gz을 우선 분리하자.

분리하는 이유는 shell script 소스를 수정하면 라인 수가 변경될 것이기 때문이다.

분리하는 방법은 간단하게 head 명령과 tail명령으로 손쉽게 분리 할 수 있다.

 

[root@ ~]# head -612 CUBRID-10.2.0.8797-d56a158-Linux.x86_64.sh > install.sh
[root@ ~]# tail -n +613 CUBRID-10.2.0.8797-d56a158-Linux.x86_64.sh > cubrid.tgz
cs

 

이제 분리 하였으니 설치용 shell script를 수정 해 보자.

 

66
67
68
69
70
71
72
73
74
cpack_version
echo "This is a self-extracting archive."
toplevel="`pwd`"
if [ "x${cpack_prefix_dir}x" != "xx" ]
then
  toplevel="${cpack_prefix_dir}"
else
  toplevel="${toplevel}/CUBRID"
fi
cs

 

71번 라인으로 가서 보라색 부분을 추가 하도록 한다.(필수)

일단 추가된 라인 수는 2라인이다. 이점을 기억해 두자.

 

추가로 화면에 출력되는 설치 디렉터리 부분을 수정한다.(필수는 아니다)

483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
  if [ "x${cpack_include_subdir}x" = "xx" ]
  then
    echo "By default the CUBRID will be installed in:"
    #echo "  \"${toplevel}/CUBRID-10.2.0.8797-d56a158-Linux.x86_64\""
    echo "  \"${toplevel}/\""
    echo "Do you want to include the subdirectory CUBRID-10.2.0.8797-d56a158-Linux.x86_64?"
    echo "Saying no will install in: \"${toplevel}\" [Yn]: "
    read line leftover
    cpack_include_subdir=TRUE
    case ${line} in
      n* | N*)
        cpack_include_subdir=FALSE
    esac
  fi
 
cs

 

486번 라인으로 가면 디폴트 디렉터리를 상단에서 바꾸었지만 스크립트 내에 상수 값으로 디렉터리명이 되어 있으므로 이를 바꾸도록하자.

또한 원본도 유지하기 위해서 원본 라인에는 #를 붙여서 주석으로 변경하고 echo "  \"${toplevel}/\"" 으로 바꾼다.

이로 인하여 추가된 라인 수는 1라인이다. 이점을 기억해 주자.

 

이번에는 실제 디렉터리를 생성하는 구문을 수정해야한다.

방금 위에서 설명한 바로 아래의 if절 부분이다. 라인번호도 표시 해 두었으니 참고하자.

 

499
500
501
502
503
if [ "x${cpack_include_subdir}x" = "xTRUEx" ]
then
  #toplevel="${toplevel}/CUBRID-10.2.0.8797-d56a158-Linux.x86_64"
  mkdir -"${toplevel}"
fi
cs

 

위의 디렉터리 생성하는 구문인 mkdir를 할때 상수 값으로 지정되어 디렉터리명이 고정 되어 있다. 이를 바꾸도록하자.

 

이제 마지막으로  shell script 내부에서 tar+gz을 발췌하는 부분을 수정한다.

 

520
521
522
523
524
525
526
527
528
529
530
531
# take the archive portion of this file and pipe it to tar
# the NUMERIC parameter in this command should be one more
# than the number of lines in this header file
# there are tails which don't understand the "-n" argument, e.g. on SunOS
# OTOH there are tails which complain when not using the "-n" argument (e.g. GNU)
# so at first try to tail some file to see if tail fails if used with "-n"
# if so, don't use "-n"
use_new_tail_syntax="-n"
tail $use_new_tail_syntax +1 "$0" > /dev/null 2> /dev/null || use_new_tail_syntax=""
 
tail $use_new_tail_syntax +616 "$0" | gunzip | (cd "${toplevel}" && tar xf - 2> /dev/null) || cpack_echo_exit "Problem unpacking the CUBRID-10.2.0.8797-d56a158-Linux.x86_64"
 
cs

 

위의 613으로 되어 있는 부분을 616으로 수정한다.

위의 설치용 shell script에서 소스 수정으로 추가된 라인 수는 3라인 이므로 추가된 라인수 만큼만 조정하면 된다.

위에서 화면 출력용 부분을 수정하지 않았다면 615이다.

 

이제 해당 부분을 실제 패키지 처럼 합쳐보자. 합치는 방법은 매우 간단하다.

 

[root@ ~]# cat cubrid.tgz >> install.sh
cs

 

이제 sh instal.sh로 실행하면

다음과 같이 CUBRID 디렉터리로 설치된다.

 

sh_install3.png

 

 


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수 추천 수
154 큐브리더와의 만남, 그 생생한 현장속으로~ 8 1 file 멜라니 2009.07.16 91836 0
153 오픈소스 이야기 CUBRID 오픈 소스 프로젝트에 코드기여하기 1 file 일동차렷? 2009.04.21 78445 0
152 시장 살펴보기 DBMS시장, 그리고 CUBRID 6 file CUBRID_DEV 2008.12.24 74433 0
151 나머지... 스티브 잡스의 교훈 3 1 file CUBRID_DEV 2009.06.15 66760 0
150 알려요~ CUBRID 다운로드 추이 분석 file 정병주 2009.05.05 62867 0
149 오픈소스 이야기 2008년 큐브리드 핵심 키워드 - CUBRID 오픈소스화 file 정병주 2009.01.02 60743 0
148 나머지... 5월은 개발자 커뮤니티의 달? 3 file 정병주 2009.05.22 57351 0
147 알려요~ 텍스타일(Textyle) + CUBRID 2008 file 정병주 2009.07.30 55980 0
146 제품 여행 막무가내 DBA의 DISK 장애 대처 9 file 프란체스카 2009.04.16 54783 0
145 알려요~ CUBRID Inside에 여러분을 초대합니다~ file CUBRID_DEV 2009.01.15 54591 0
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 16 Next
/ 16

Contact Cubrid

대표전화 070-4077-2110 / 기술문의 070-4077-2113 / 영업문의 070-4077-2112 / Email. contact_at_cubrid.com
Contact Sales