커피닉스, 시스템 엔지니어의 쉼터
  ports로 설치한 프로그램을 패키지로 만들기(FreeBSD) 작성일 : 2010/03/02 19:11
 
  • 글쓴이 : 좋은진호 ( http://coffeenix.net/ )
  • 조회수 : 7639
     
    제  목 : ports로 설치한 프로그램을 패키지로 만들기(FreeBSD)
    작성자 : 좋은진호(truefeel, http://coffeenix.net/ )
    작성일 : 2010.2.19(금)


    1. 설치 패키지 정보 보기와 패키지 파일 만들기

    아주 기본적인 이야기 부터 시작하겠다. FreeBSD유저라면 모르지 않을 것이다.
    FreeBSD에서 설치된 패키지 목록을 볼 때 pkg_info명령으로 확인한다.

     
    # pkg_info
    apache-2.2.14_5     Version 2.2.x of Apache web server with prefork MPM.
    autoconf-2.62       Automatically configure source code on many Un*x platforms
    ... 생략 ...
     


    그리고, 설치된 패키지를 패키지 파일(.tbz)로 만들 때는 pkg_create 명령으로 만든다.

     
    # pkg_create -b apache-2.2.14_5
    # ls
    apache-2.2.14_5.tbz
     


    2. 설치된 패키지 중에 의존적인 것까지 모두 패키지 파일로 만들기

    지정한 패키지가 의존하고 있는 패키지(Depends on)들까지 모두 패키지 파일로 만드려면 어떻게 해야할까?
    man page에 나와 있는 다음 옵션들이 답을 준다.

     
         -b, --backup pkg-name
                 Create package file from a locally installed package named
                 pkg-name.  If the pkg-filename is not specified, then resulting
                 archive will be created in the current directory and named
                 pkg-name with an appropriate extraction suffix applied.

         -R, --recursive
                 When creating package file from a locally installed package also
                 create package files for all packages required by pkg-name.
                 Resulting archive(s) will be created in the current directory and
                 named using name of the respective package with appropriate
                 extraction suffix applied.

         -x, --regex
                 Use basic regular expressions for pkg-name.
     


    위 옵션을 조합하여 pkg_create만 해주면 된다. 패키지 파일 생성 상황을 보려면 -v 옵션까지 넣어주면 된다.

     
    # pkg_create -Rxb 패키지명
     


    - 지정한 패키지가 의존하고 있는 패키지 목록(Depends on)을  볼 때 : pkg_info -r 설치된_패키지명
    - 지정한 패키지를 필요로 하는   패키지 목록(Required by)을 볼 때 : pkg_info -R 설치된_패키지명

     
    # pkg_info -r apache-2.2.14_5
    Information for apache-2.2.14_5:

    Depends on:
    Dependency: expat-2.0.1_1
    Dependency: perl-5.10.1
    Dependency: pcre-8.00
    Dependency: libiconv-1.13.1_1
    # pkg_create -Rvxb apache
    Creating package apache
    Creating bzip'd tar ball in '/home/cnx/apache-2.2.14_5.tbz'
    Creating package expat-2.0.1_1
    Creating bzip'd tar ball in '/home/cnx/expat-2.0.1_1.tbz'
    Creating package perl-5.10.1
    Creating bzip'd tar ball in '/home/cnx/perl-5.10.1.tbz'
    Creating package pcre-8.00
    Creating bzip'd tar ball in '/home/cnx/pcre-8.00.tbz'
    Creating package libiconv-1.13.1_1
    Creating bzip'd tar ball in '/home/cnx/libiconv-1.13.1_1.tbz'
     



    3. 참고자료

    - "make package" and dependencies
      http://forums.freebsd.org/showthread.php?t=5052
    - pkg_info, pkg_create man page


    커피닉스, 시스템 엔지니어의 쉼터 / URL : http://coffeenix.net/board_view.php?bd_code=1700