2012-03-13 1 views
7

debhelper를 사용하기 전에 패키지를 만들었지 만 매우 실망한 문제가 있습니다.파이썬 deb 패키지를 만드는 데 문제가 있습니다. 수정 된 바이너리에 대해 불평합니다

이 내 파일 트리입니다 :

usr/ 
`-- share 
    |-- applications 
    | `-- create-launcher.desktop 
    `-- create-launcher 
     |-- bin 
     | |-- callbacks.py 
     | |-- callbacks.pyc 
     | |-- create_launcher.py 
     | |-- create_launcher.pyc 
     | |-- file_handler.py 
     | |-- file_handler.pyc 
     | |-- make_launcher.py 
     | |-- make_launcher.pyc 
     | |-- message_dialog.py 
     | |-- message_dialog.pyc 
     | `-- session 
     |-- data 
     | `-- gui.glade 
     |-- images 
     | `-- icon_48x48.png 
     `-- README 

A는 당신은 내가 바이너리 이미지 바이너리 일부 파이썬의 pyc 파일을 볼 수 있습니다. 이건 내 문제인지는 모르겠지만, 나는 데비안 디렉토리를 생성

dh_make 

실행하고 나는 필요한 모든 파일을 수정했습니다.

나는 실행하는 경우 :

dh_install 

모두가 올바른 데비안/생성 발사기는/usr ... 위치로 이동합니다.

그래도, 내가 실행하는 경우 :

debuild -uc -us 

나는 다음과 같은 출력을 얻을 :

dpkg-buildpackage -rfakeroot -D -us -uc 
dpkg-buildpackage: source package create-launcher 
dpkg-buildpackage: source version 0.1.2+alpha-1 
dpkg-buildpackage: source changed by Narnie Harshoe <[email protected]> 
dpkg-source --before-build create-launcher-0.1.2+alpha 
dpkg-buildpackage: host architecture amd64 
fakeroot debian/rules clean 
dh clean 
    dh_testdir 
    dh_auto_clean 
    dh_clean 
dpkg-source -b create-launcher-0.1.2+alpha 
dpkg-source: info: using source format `3.0 (quilt)' 
dpkg-source: info: building create-launcher using existing ./create-launcher_0.1.2+alpha.orig.tar.gz 
dpkg-source: warning: ignoring deletion of directory share 
dpkg-source: warning: ignoring deletion of directory share/applications 
dpkg-source: warning: ignoring deletion of file share/applications/create-launcher.desktop 
dpkg-source: warning: ignoring deletion of directory share/create-launcher 
dpkg-source: warning: ignoring deletion of file share/create-launcher/README 
dpkg-source: warning: ignoring deletion of directory share/create-launcher/data 
dpkg-source: warning: ignoring deletion of file share/create-launcher/data/gui.glade 
dpkg-source: warning: ignoring deletion of directory share/create-launcher/images 
dpkg-source: warning: ignoring deletion of file share/create-launcher/images/icon_48x48.png 
dpkg-source: warning: ignoring deletion of directory share/create-launcher/bin 
dpkg-source: warning: ignoring deletion of file share/create-launcher/bin/message_dialog.py 
dpkg-source: warning: ignoring deletion of file share/create-launcher/bin/create_launcher.py 
dpkg-source: warning: ignoring deletion of file share/create-launcher/bin/callbacks.py 
dpkg-source: warning: ignoring deletion of file share/create-launcher/bin/make_launcher.py 
dpkg-source: warning: ignoring deletion of file share/create-launcher/bin/file_handler.py 
dpkg-source: warning: newly created empty file 'usr/share/applications/create-launcher.desktop' will not be represented in diff 
dpkg-source: error: cannot represent change to create-launcher-0.1.2+alpha/usr/share/create-launcher/images/icon_48x48.png: binary file contents changed 
dpkg-source: error: add usr/share/create-launcher/images/icon_48x48.png in debian/source/include-binaries if you want to store the modified binary in the debian tarball 
dpkg-source: error: cannot represent change to create-launcher-0.1.2+alpha/usr/share/create-launcher/bin/file_handler.pyc: binary file contents changed 
dpkg-source: error: add usr/share/create-launcher/bin/file_handler.pyc in debian/source/include-binaries if you want to store the modified binary in the debian tarball 
dpkg-source: warning: executable mode 0755 of 'usr/share/create-launcher/bin/create_launcher.py' will not be represented in diff 
dpkg-source: error: cannot represent change to create-launcher-0.1.2+alpha/usr/share/create-launcher/bin/message_dialog.pyc: binary file contents changed 
dpkg-source: error: add usr/share/create-launcher/bin/message_dialog.pyc in debian/source/include-binaries if you want to store the modified binary in the debian tarball 
dpkg-source: error: cannot represent change to create-launcher-0.1.2+alpha/usr/share/create-launcher/bin/make_launcher.pyc: binary file contents changed 
dpkg-source: error: add usr/share/create-launcher/bin/make_launcher.pyc in debian/source/include-binaries if you want to store the modified binary in the debian tarball 
dpkg-source: error: cannot represent change to create-launcher-0.1.2+alpha/usr/share/create-launcher/bin/create_launcher.pyc: binary file contents changed 
dpkg-source: error: add usr/share/create-launcher/bin/create_launcher.pyc in debian/source/include-binaries if you want to store the modified binary in the debian tarball 
dpkg-source: error: cannot represent change to create-launcher-0.1.2+alpha/usr/share/create-launcher/bin/callbacks.pyc: binary file contents changed 
dpkg-source: error: add usr/share/create-launcher/bin/callbacks.pyc in debian/source/include-binaries if you want to store the modified binary in the debian tarball 
dpkg-source: error: unrepresentable changes to source 
dpkg-buildpackage: error: dpkg-source -b create-launcher-0.1.2+alpha gave error exit status 2 

내가 그렇게에 "디렉토리 공유의 삭제를 무시"하고 말하는 이유를 전혀 몰라합니다. 먼저 공유가 아닌 폴더 usr으로 시작해야합니다. 둘째, 삭제되지 않습니다.

타르볼을 굴려서 파일이 변경되지 않아 바이너리가 그 오류를 만드는 이유를 이해할 수 없습니다.

왜 share /와/usr가 아닌가요?

dh의 dh_install 부분을 실행하기 전에 죽어가는 것 같습니다.

도움 주시면 감사하겠습니다.

답변

10

많은 읽기와 시행 착오 끝에 잘못된 것이 무엇인지 알아 냈습니다. 나는

dpkg-source -b create-launcher_0.1.2+alpha 

을 실행했다 그리고 어떤 이유로, 그것은 압축을 푼 만들-launcher_0.1.2 + 생성 - 실행 - 0.1.2 + 알파과 같이 보입니다 alpha.orig.tar.gz 파일 디렉토리를 삭제하는 데 실패 .orig.6h0gQo. 나는 그것을 들여다 보았다. 그리고 그것은 폴더와 함께 시작했다. share, 위의 질문에서 언급 한 것처럼 usr이 아닌. 그것은 내가 타르를 짓는 것을 망쳤다는 생각을하기 시작했다. 물론, 필자는 usr로 최상위 폴더로 만들었고, 비교를하기 위해 그 파일을 "잘라냅니다". create-launcher_0.1.2 + alpha /를 최상위 디렉토리로 사용하여 타르를 빌드해야했습니다. 따라서 각 트리의 아래쪽에있는 "usr"디렉토리의 diff를 허용합니다.

아직 제대로 구축되지 않았습니다.

dpkg-source --include-binaries -b create-launcher_0.1.2+alpha 

난 당신이 같은 '--source-옵션 "매개 변수와 함께 그렇게 그것을 발견 : :이 명령이 필요

debuild -uc -us --source-option=--include-binaries 

이 여전히 실패를하기 때문에/bin 디렉토리에 내 정력 세션 파일 이유를 모르지만 무시할 필요가있었습니다 .dpkg-source에는 몇 가지 무시 옵션이 있습니다.이 마지막 명령은 트릭을 수행했습니다.

debuild -uc -us --source-option=--include-binaries --source-option=-isession 

뎁을 성공적으로 롤아웃 할 수있었습니다.

희망이 있으면 도움이 될 것입니다. 내 멍청한 실수. 나는 매번 그것을 만들지 않고 나의 오래된 스크립트 (타르를 만들기 위해)를 사용하는 법을 배워야한다. 수업은 배웠다.

+0

감사합니다. 유용한 예입니다. 나는 dpkg를 이해하려고 애 쓰고있다 : 당신의 app-create-launcher는 선언 할 필요가있는 Python에 의존성이 있는가? 이렇게하면 .desktop 파일이 설치되면 아이콘이 예를 들어 Ubuntu Software Center의 Installed Apps 아래에 표시되는 .deb 패키지가 생성됩니다. 앱이 .desktop 파일을 만드는 데 도움이됩니다. http://sourceforge.net/projects/createlauncher/?source=navbar – bootchk

+0

Thanks! 추가 된 '--source-option = - include-binaries'는 https://wiki.debian.org/SimpleBackportCreation에 따라 gnu make의 서명되지 않은 백 포트를 만드는 동안 저를 구해줬습니다. – Epu

1

소스 패키지에 모든 *.pyc 파일을 포함하면 안됩니다. 데비안에는 바이너리 패키지를 빌드 할 때 자동으로 이들을 컴파일하는 기계가 있습니다. 설치 단계에서 모든 파일을 제자리에 놓았는지 확인하거나 debian/install 파일을 작성하십시오.

에 대한 addon이 있습니다. 표준 도구 체인을 사용하는 경우 Python 프로젝트를 자동으로 처리 할 수 ​​있습니다. dh_make에이를 사용하도록 지정할 수 있습니다 (기본적으로 debian/rules 파일에있는 dh의 옵션 일뿐입니다).

관련 문제