
因此,在從一個文檔到另一個文檔掙扎之後,我已經鎖定並遵循了本教程:http://packaging.ubuntu.com/html/packaging-new-software.html
所以我嘗試了那裡的步驟並開始遇到麻煩。谷歌搜尋基本上沒有幫助。我有一個非常標準的 autotools c++ 項目,它建立了一個庫和一些可執行檔。我想用它製作一個 libfoo-dev 風格的套件並將其貼到 PPA 上。
為了幫助展示我正在做的事情,我貼了一個腳本來執行教程中提出的步驟(就我正確理解它們而言...)。這是我所擁有的:https://github.com/kevinkreiser/ppa-libprime-server
我在那裡有一個 bash 腳本,build.sh
其中包含我一直在執行的所有步驟。起初,我無法dh_*
從專案中建立任何內容,直到 @sneetsher 提示我更改規則檔案以執行 autoreconf。此時我唯一的問題是W: libprime-server0: empty-binary-package
和W: prime-server-bin: empty-binary-package
。
正如它所說,現在的問題是我的幾個包裹中沒有太多東西:
user@pc$ lesspipe libprime-server0_0.3.2-0ubuntu1_amd64.deb
libprime-server0_0.3.2-0ubuntu1_amd64.deb:
neues Debian-Paket, Version 2.0.
Größe 2004 Byte: control-Archiv= 528 Byte.
425 Byte, 12 Zeilen control
160 Byte, 2 Zeilen md5sums
Package: libprime-server0
Source: libprime-server
Version: 0.3.2-0ubuntu1
Architecture: amd64
Maintainer: Kevin Kreiser <[email protected]>
Installed-Size: 26
Section: contrib/libs
Priority: optional
Homepage: https://github.com/kevinkreiser/prime_server
Description: Service oriented distributed computing API
A set of APIs designed around the zeromq butterfly pattern
specifically focused on servicing http requests
*** Contents:
drwxr-xr-x root/root 0 2016-04-21 11:48 ./
drwxr-xr-x root/root 0 2016-04-21 11:48 ./usr/
drwxr-xr-x root/root 0 2016-04-21 11:48 ./usr/share/
drwxr-xr-x root/root 0 2016-04-21 11:48 ./usr/share/doc/
drwxr-xr-x root/root 0 2016-04-21 11:48 ./usr/share/doc/libprime-server0/
-rw-r--r-- root/root 167 2016-04-18 11:04 ./usr/share/doc/libprime-server0/changelog.Debian.gz
-rw-r--r-- root/root 1558 2016-04-15 09:46 ./usr/share/doc/libprime-server0/copyright
user@pc:~/sandbox/ppa-libprime-server/build$ lesspipe prime-server-bin_0.3.2-0ubuntu1_amd64.deb
prime-server-bin_0.3.2-0ubuntu1_amd64.deb:
neues Debian-Paket, Version 2.0.
Größe 1994 Byte: control-Archiv= 517 Byte.
437 Byte, 12 Zeilen control
160 Byte, 2 Zeilen md5sums
Package: prime-server-bin
Source: libprime-server
Version: 0.3.2-0ubuntu1
Architecture: amd64
Maintainer: Kevin Kreiser <[email protected]>
Installed-Size: 26
Depends: libprime-server0 (= 0.3.2-0ubuntu1)
Section: contrib/misc
Priority: optional
Homepage: https://github.com/kevinkreiser/prime_server
Description: Service oriented distributed computing executables
A set of executables for use in running a distributed http service
*** Contents:
drwxr-xr-x root/root 0 2016-04-21 11:48 ./
drwxr-xr-x root/root 0 2016-04-21 11:48 ./usr/
drwxr-xr-x root/root 0 2016-04-21 11:48 ./usr/share/
drwxr-xr-x root/root 0 2016-04-21 11:48 ./usr/share/doc/
drwxr-xr-x root/root 0 2016-04-21 11:48 ./usr/share/doc/prime-server-bin/
-rw-r--r-- root/root 167 2016-04-18 11:04 ./usr/share/doc/prime-server-bin/changelog.Debian.gz
-rw-r--r-- root/root 1558 2016-04-15 09:46 ./usr/share/doc/prime-server-bin/copyright
如果我將文件重新命名為libprime-server1.install
和libprime-server1.dirs
,第一個包確實可以工作。我無法弄清楚我對這個-bin
包做錯了什麼。詢問我正在製作和選擇bzr
的包裝類型,我應該選擇其他類型嗎?l
library
編輯:
整件事情有效:https://launchpad.net/~kevinkreiser/+archive/ubuntu/prime-server
在 @sneetsher 的幫助下,我能夠將所有這些都放在 ppa 上並在 trusty 中正常工作!我只想感謝@sneetsher 一路以來提供的所有幫助和耐心。希望這個腳本可以幫助其他想要做類似事情的人:https://github.com/kevinkreiser/ppa-libprime-server/blob/master/build.sh
答案1
好吧,我可以在 Ubuntu 14.04 和(最後一次提交)Ubuntu 16.04 上測試它。
由於您是打包新手,最好啟用詳細
debhelper
輸出。取消文件export DH_VERBOSE=1
中的註釋rules
。該包似乎
autoreconf
不僅僅依賴於automake
/autotools
。因此將rules
主線改為:%: #dh $@ --with autotolls-dev dh $@ --parallel --list-missing --with autoreconf
並添加到文件
dh-autoreconf
中構建依賴項。control
因此,您現在不再需要透過手動運行來預先產生自動建置檔案
./autogen.sh
。請記住,每件事都應該透過rules
檔案完成,否則當它在具有乾淨原始碼樹的 PPA 伺服器上建置時將會失敗。其中一項測試失敗了,我跳過它們。覆蓋
dh_auto_test
.所以我將其添加到rules
文件中:override_dh_auto_test: echo skip auto-test
留待以後修復。
對於空
libprime-server
包,這是因為它的名稱錯誤。libprime-server
在control
文件中以及libprime-server1
在1
其他文件中(例如libprime-server1.install
)是的,
lintian
(QA 工具)會發出該警告,因為它預計是該包的主要版本。是的,重新命名為 應該就可以了libprime-server0
。只有一個注意事項,您必須清理上一個建置的建置樹。因此,刪除debian/libprime-server1
資料夾並再次嘗試重建。您可以根據需要添加任意數量的包,請參閱下面的更新文件。
是的,依賴項應該包括二進位包
libprime-server0
.它的源碼包libprime-server
不依賴任何東西。我沒有使用您的腳本來構建,而是使用另一個手動工作流程(下載原始 zip 存檔,解壓縮它,添加 debian 資料夾,使用 構建
debuild
)。我無法重現與空二進制包之一相同的問題。我可以用 重現它
build.sh
。問題是,你已經改變了完整的debian/
:rm -rf libprime-server/debian cp -rp ../debian libprime-server
但只提交了一個文件
bzr add debian/source/format
要修復它,請提交整個資料夾:
bzr add debian
bzr builddeb
似乎只使用提交/標記(帶Debian
標籤)文件,而不是當前的工作樹。
以下是我更改過的文件:
debian/rules
#!/usr/bin/make -f # -*- makefile -*- # Uncomment this to turn on verbose mode. export DH_VERBOSE=1 %: #dh $@ --with autotools-dev dh $@ --parallel --list-missing --with autoreconf override_dh_auto_test: echo skip auto-test
debian/control
Source: libprime-server Priority: optional Maintainer: Kevin Kreiser <[email protected]> Build-Depends: debhelper (>= 9), autotools-dev, dh-autoreconf, libcurl4-openssl-dev, libzmq3-dev Standards-Version: 3.9.5 Section: libs Homepage: https://github.com/kevinkreiser/prime_server Vcs-Git: git://github.com/kevinkreiser/prime_server.git Package: libprime-server-dev Section: contrib/libdevel Architecture: any Depends: libprime-server0 (= ${binary:Version}), ${misc:Depends} Description: Service oriented distributed computing API A set of APIs designed around the zeromq butterfly pattern specifically focused on servicing http requests Package: libprime-server0 Section: contrib/libs Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: Service oriented distributed computing API A set of APIs designed around the zeromq butterfly pattern specifically focused on servicing http requests Package: prime-server-bin Section: contrib/misc Architecture: any Depends: libprime-server0 (= ${binary:Version}), ${misc:Depends} Description: Service oriented distributed computing API A set of APIs designed around the zeromq butterfly pattern specifically focused on servicing http requests
libprime-server1.install
被重新命名為libprime-server0.install
libprime-server1.dir
被重新命名為libprime-server0.dir
創造
prime-server-bin.dirs
usr/bin
創造
prime-server-bin.install
usr/bin/*
build.sh
#!/bin/bash set -e rm -rf build mkdir build pushd build #get prime_server software #sudo apt-get install autoconf automake libtool make gcc-4.9 g++-4.9 lcov sudo apt-get install libcurl4-openssl-dev libzmq3-dev git clone --branch 0.3.2 --recursive https://github.com/kevinkreiser/prime_server.git tar pczf prime_server.tar.gz prime_server rm -rf prime_server #start building the package sudo apt-get install dh-make dh-autoreconf bzr-builddeb bzr dh-make libprime-server 0.3.2 prime_server.tar.gz rm -rf libprime-server/debian cp -rp ../debian libprime-server pushd libprime-server bzr add debian bzr commit -m "Initial commit of Debian packaging." bzr builddeb -- -us -uc #TODO: sign the package popd #TODO: push the package to the ppa #TODO: make an ITP for inclusion in mainline popd