2013-10-16 40 views
1

我開發了一個基於自動工具的C++應用程序,它能夠與通常的./configure完美地編譯和安裝;進行安裝。創建.deb pacckage不包括由autoconf項目中的make install創建的文件

現在我創建了一個.deb包,令我驚訝的是它沒有包含我的任何數據或二進制文件。它只包括像CONTENTS,DEBIAN,INFO,INSTALL等強制性的.deb文件。

我已經嘗試了很多不同的方法與bzr(對於Ubuntu)builddeb,debuild等等。所有這些使我的程序沒有錯誤,然後創建幾乎空的.deb。

這些是在debian文件夾中的相關文件: 的Debian /控制:

Source: gestiong 
Section: office 
Priority: optional 
Maintainer: santilin <[email protected]> 
Build-Depends: debhelper (>= 8.0.0) 
Standards-Version: 3.9.3 
Homepage: www.programacionsocial.net 
#Vcs-Git: git://git.debian.org/collab-maint/gestiong.git 
#Vcs-Browser: http://git.debian.org/?p=collab-maint/gestiong.git;a=summary 

Package: gestiong 
Architecture: any 
Depends: ${shlibs:Depends}, ${misc:Depends} 
Description: <Programa libre de gestión de ONG y asociaciones sin ánimo de lucro> 
<GestiONG es un ...> 

Package: gestiong-doc 
Architecture: all 
Description: documentation for gestiong 
    <insert long description, indented with spaces> 

的Debian /更改日誌:

gestiong (0.5-0ubuntu1) precise; urgency=low 

    * Initial release 

-- santilín <[email protected]> Tue, 15 Oct 2013 14:21:22 +0200 

而且命令出源碼包的構建解封裝( gestiong_0.5.orig.tar.gz)

bzr dh_make gestiong 0.5 gestiong_0.5.orig.tar.gz 

Type of package: single binary, indep binary, multiple binary, library, kernel module, kernel patch? 
    [s/i/m/l/k/n] s 

cd gestiong; bzr builddeb -- -us -uc 

經過很長一段時間程序我編譯後的.deb創建時沒有錯誤。

drwxrwxr-x 3 santilin santilin 4096 oct 16 18:58 build-area 
drwxrwxr-x 14 santilin santilin 4096 oct 16 18:35 gestiong 
-rw------- 1 santilin santilin 2246 oct 16 18:51 gestiong_0.5-0ubuntu1.debian.tar.gz 
-rw------- 1 santilin santilin  894 oct 16 18:51 gestiong_0.5-0ubuntu1.dsc 
-rw------- 1 santilin santilin 1885 oct 16 18:51 gestiong_0.5-0ubuntu1_i386.changes 
-rw------- 1 santilin santilin 2226 oct 16 18:51 gestiong_0.5-0ubuntu1_i386.deb 
-rw-rw-r-- 1 santilin santilin 3638028 oct 16 18:35 gestiong_0.5.orig.tar.gz 
-rw------- 1 santilin santilin 1888 oct 16 18:51 gestiong-doc_0.5-0ubuntu1_all.deb 

但.deb文件幾乎是空的。我究竟做錯了什麼?

(壓縮包可以從https://sourceforge.net/projects/gestiong/files/gestiong/gestiong-0.5.beta.tar.gz/download下載)

+0

你的軟件包根本不會構建。它看起來像是在頂層缺少一個名爲acinclude.m4的文件? –

+0

我已經嘗試過保羅的建議,並且我有更深入的瞭解。可能問題是,dh_auto_install在debian/tmp /下而不是debian/gestiong下安裝了所有東西,然後db_builddeb在debian/gestiong下找不到任何東西? –

回答

3

看起來你從遺漏acinclude.m4有幾件事情需要解決,一邊。

首先,你必須在你的debian/rules一個比較奇怪的行:

DH_OPTIONS=extend-diff-ignore 

這沒有任何意義。很有可能你打算將--extend-diff-ignore的參數提供給dpkg-source,但將其放入DH_OPTIONS不會完成該操作。它只會讓debhelper工具中斷。所以把它完全取出來。

接下來,您錯過了很多構建依賴關係。在沒有聲明的情況下,其他人很難構建你的軟件包。一些快速的#include裏grep建議您可能希望至少:

Build-Depends: debhelper (>= 8.0.0), libmysqlclient-dev, libxml2-dev, libdb-dev, 
       qt4-qmake, libqt4-dev, libqt4-dev-bin, libjpeg-dev, libpng-dev, 
       libx11-dev, libboost-system-dev 

最後,這是你問的是一部分,你還沒有告訴debhelper的,其中每個打包內置的文件應該去。一切都應該建立並安裝在debian/tmp/下(因爲你的debian/control中有多個二進制包),但是你沒有任何debian/*.install文件來說明把它們全部放在哪裏(或者你有一個,但它有隻有一行在讀「#DOCS#」,這是無益的)。

因此,您需要確定要將哪些已安裝文件隨軟件包一起發貨,並將其命名爲debian/$packagename.install。例如,您可能希望所有的二進制文件都在gestiong(主包)中。所以:

echo '/usr/bin' >> debian/gestiong.install 

如果有必要太運重要的共享庫,並沒有其他的軟件將使用它們,你可能想

echo '/usr/lib/*.so*' >> debian/gestiong.install 

(如果您有共享庫,其他包使用,你應該打破他們出到libgestiong包或一些這樣的,瞭解包裝庫,這是一個全新的冒險。)

它看起來像得到安裝在一堆頭文件。我不知道你是否在意運輸他們。同樣,如果其他軟件包可能需要針對這些文件構建,那麼您將需要打開libgestiong-dev軟件包。

看起來像/ usr/share/gonglib下還有一些東西。

echo '/usr/share/gonglib' >> debian/gestiong.install 

您還可以在debian/control定義的gestiong-doc軟件包,但它不是我清楚你想擺在那裏的。

希望這會有所幫助。您可能想要查看關於dh_installdh_auto_installdebhelperdh的手冊以獲取更多信息。

+0

關於依賴性,我認爲dh_會爲我做,因爲在控制文件中有這些標籤:取決於:$ {shlibs:Depends},$ {misc:Depends} –

+0

來自dh_install手冊頁:_If you just have a文件或兩個上游的Makefile不會爲你安裝,你可以運行dh_install將它們移動到位。我認爲debhelper是添加到deb包的所有文件,我的上游Makefile安裝,不是它? –

+0

相關性:是的,'dh_shlibdeps'將會填充所有的共享庫依賴項('$ {shlibs:Depends}')和其他一些Debhelper工具爲'$ {misc:Depends}添加依賴關係。但是,它們不會自動檢測* build *依賴項,這是爲了創建包而必須存在的包。你需要明確說明這些。 –