
そこで、ドキュメントからドキュメントへと手探りした後、私はこのチュートリアルに固執して従ってきました。http://packaging.ubuntu.com/html/packaging-new-software.html
そこで、そこに書かれている手順を試してみたところ、トラブルに遭遇し始めました。グーグルで調べてもほとんど役に立ちませんでした。ライブラリと実行可能ファイルを作成する、非常に標準的な autotools c++ プロジェクトがあります。そこから libfoo-dev スタイルのパッケージを作成し、PPA にアップロードしたいと考えていました。
私が何をしているのかを示すために、チュートリアルで提案されている手順を実行するスクリプトを貼り付けました (私が正しく理解している限り)。これが私のやっていることです:https://github.com/kevinkreiser/ppa-libprime-server
そこには、私が行ってきたすべての手順が記述された bash スクリプトがありますbuild.sh
。最初は、@sneetsher がルール ファイルを変更して autoreconf を実行するように教えてくれるまで、プロジェクトから何かをビルドするのに苦労していましたdh_*
。この時点で、問題は と だけ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 サーバーでビルドするときに失敗します。テストの 1 つが失敗したので、それらをスキップして回避します。 をオーバーライドします
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
。注意点が 1 つだけあります。前回のビルドからビルド ツリーをクリーンアップする必要があります。そのため、debian/libprime-server1
フォルダーを削除して、再度再構築を試みてください。必要な数のパッケージを追加できます。以下の更新されたファイルを参照してください。
はい、依存関係にはバイナリ パッケージが含まれている必要があります。
libprime-server0
ソース パッケージはlibprime-server
いずれにも依存しません。私はビルドにあなたのスクリプトを使用していませんでした。別の手動ワークフローを使用していました (元の zip アーカイブをダウンロードし、それを解凍し、debian フォルダーを追加し、を使用してビルドします
debuild
)。空のバイナリ パッケージの場合と同じ問題を再現できませんでした。で再現できました
build.sh
。問題は、 全体を変更したことですdebian/
:rm -rf libprime-server/debian cp -rp ../debian libprime-server
しかし、コミットされたファイルは1つだけです
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