PPA .deb 创建打包时缺少文件

PPA .deb 创建打包时缺少文件

因此,在从一个文档到另一个文档摸索之后,我抓住并遵循了本教程: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-packageW: 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询问我正在制作的包类型以及我选择的包类型,llibrary应该选择别的吗?

编辑:

整个过程是这样的: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-servercontrol文件中以及其他文件libprime-server11(例如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标签)文件,而不是当前工作树。

以下是我修改过的文件:

  1. 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
    
  2. 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
    
  3. libprime-server1.install重命名为libprime-server0.install

  4. libprime-server1.dir重命名为libprime-server0.dir

  5. 创造prime-server-bin.dirs

    usr/bin
    
  6. 创造prime-server-bin.install

    usr/bin/*
    
  7. 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
    

相关内容