데비안 패키징

hokim의 이미지

데비안 패키지를 만드는 방법은 dh-make와 checkinstall을 사용하는 방법을 주로 사용하고 있는 것 같군요.
전자는 사용하기가 쉽지 않아 보이고 후자의 경우는 의존성에 대한 정보를
갖지 않기때문에 데비안 패키징의 장점을 제대로 살리지 못하고 있습니다
그래서 패키징이 쉬우면서 의존성을 갖는 다른 패키징 방법을 찾아 보았습니다.
일단은 소스로부터 바이너리를 아래와 같은 일반적인 방법으로 만듭니다

./configure --prefix=/path/to/binary/usr
make
make install

그러면 /path/to/binary 밑에 root(/)아래에 인스톨되는 것과 같은 구조를 갖는 바이너리가 설치될 것입니다.
그런 다음에 /path/to/binary로 가서 묶어서 압축합니다. 그것을 skype.tar.gz라고 가정하겠습니다
(실제로 skype.tar.gz는 http://skype.com/products/skype/linux/
에서 데비안 패키지를 가져와서 파일시스템에 깔리는 tar와 gz된 바이너리만 추출했습니다. 이 사이트에 가져온 패키지로 skype를 인스톨해 본 사람들은
알겠지만 잘못된 의존성 정보를 가지고 있기때문에 추가의 패키지를
수동으로 깔아주어야지만 제대로 깔릴 것입니다)

이제 바이러리로 부터 debian 패키로 만들기 위해서

$fakeroot alien -d skype.tar.gz

결과로 나오는 파일은 skype_1-2_all.deb 데비안 파일입니다
(중요한 점은 데비안 패키지를 만들기전, 즉 바이러리 상태에 있을때 제대로 동작해야 합니다.
다시 말해서, skype가 필요로 하는 deb방식으로 인스톨 된 라이브러리들이 이미 설치되어 있어야 합니다)
skype_1-2_all.deb자체로도 의존성 정보를 갖는 데비안 패키지이지만 좀더 커스터마이징하기 위해 다음과 같이 합니다
$ar -x skype_1-2_all.deb

그러면 데비안버전넘버파일(debian-binary), 컨트롤파일(control.tar.gz), 파일시스템에 깔리는 바이너리(data.tar.gz)로
분리 됩니다. 다시 control.tar.gz를 풀면 패키징 정보를 담고 있는
다음과 같은 control파일을 얻을 수 있습니다
Quote:

Package: skype
Version: 1-2
Section: alien
Priority: extra
Architecture: all
Depends: libc6 (>= 2.3.2.ds1-4), libgcc1 (>= 1:4.0-0pre6ubuntu4), libqt3c102-mt (>= 3:3.3.3), libstdc++5 (>= 1:3.3.4-1), libx11-6 | xlibs (>> 4.1.0), libxext6 | xlibs (>> 4.1.0)
Installed-Size: 7668
Maintainer: HyunOk Kim <hokim@ubuntu>
Description: Converted Slackware tgz package
Converted Slackware tgz package
.
(Converted from a tgz package by alien version 8.50.)


skype사이트에 받아온 원래의 데비안파일의 것은 다음과 같습니다
Quote:

Package: skype
Version: 1.1.0.13
Section: non-free/net
Priority: extra
Architecture: i386
Depends: libc6 (>= 2.2.4-4) | qt (>= 3.2)
Installed-Size: 7469
Maintainer: skype <info.skype.net>
Description: Skype is free Internet telephony that just works Skype offers free superior sound quality Internet telephony. In addition, it includes: . control Conference calling - enables simultaneous and seamless voice communication between groups of up to five friends, family or colleagues. . control Global Directory - the user-built global Skype contacts directory with numerous search options and an easy add-a-contact tool . control Customization - My Picture image display . control Mobility - login into Skype account on more than one PC anywhere in the world. . control Multiple Skype accounts on one PC

Depends 필드를 보면 alien에 의해 의존성을 제대로 찾아주고 있는 것을
확인할 수 있을것입니다 그래서 control파일을 다음처럼 수정했습니다
Quote:

Package: skype
Version: 1.1.0.13
Section: non-free/net
Priority: extra
Architecture: i386
Depends: libc6 (>= 2.3.2.ds1-4), libgcc1 (>= 1:4.0-0pre6ubuntu4), libqt3c102-mt (>= 3:3.3.3), libstdc++5 (>= 1:3.3.4-1), libx11-6 | xlibs (>> 4.1.0), libxext6 | xlibs (>> 4.1.0)
Installed-Size: 7668
Maintainer: skype <info.skype.net>
Description: Skype is free Internet telephony that just works Skype offers free superior sound quality Internet telephony. In addition, it includes: . control Conference calling - enables simultaneous and seamless voice communication between groups of up to five friends, family or colleagues. . control Global Directory - the user-built global Skype contacts directory with numerous search options and an easy add-a-contact tool . control Customization - My Picture image display . control Mobility - login into Skype account on more than one PC anywhere in the world. . control Multiple Skype accounts on one PC

다음과 같이 풀려진 것들을 다시 묶어서 deb파일을 만듭니다

$ tar cvzf control.tar.gz conffiles md5sums control
$ ar rc skype_1.1.0.13-1_i386.deb debian-binary control.tar.gz data.tar.gz

하다보니 설명이 다소 복잡해졌군요:cry:

참고자료
http://www-106.ibm.com/developerworks/linux/library/l-debpkg.html
http://debianusers.org/DebianWiki/wiki.php/%B5%A5%BA%F1%BE%C8%C6%D0%C5%B0%C1%F6%B8%B8%B5%E9%B1%E2

Forums: 
랜덤여신의 이미지

좋은 팁이네요... 가끔 바이너리 tar.gz 를 deb 패키지로 변환시키느라 좀 귀찮았는데, 이 글로 쉽게 할 수 있을듯 ;-)

hokim wrote:
데비안 패키지를 만드는 방법은 dh-make와 checkinstall을 사용하는 방법을 주로 사용하고 있는 것 같군요.
전자는 사용하기가 쉽지 않아 보이고

음 그런데 dh_make 를 이용한 패키징이 왜 어려운 방법인가요?

./configure
make
make install

대신에
dh_make
debian/rules binary

만 해주면 되는 건데요...;;
hokim의 이미지

dh_make에서는 Dependens: 필드를 직접 입력해주어야 하지 않나요?
의존성을 갖는 패키지를 일일이 찾아서 적어 주어야 한다는 점에서 쉽지 않다는 표현을 쓴 것입니다 alien은 자동으로 찾아줍니다
dh_make는 문서로만 보아서 제가 틀릴수도 있겠네요

hokim의 이미지

제가 잘못 알고 있었군요 :cry:
의존성이 있는 패키지를 자동으로 찾아주는군요

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.