创建Debian包失败了

时间:2012-08-21 10:23:51

标签: ubuntu debian packages

我正在尝试构建一个Debian软件包。当我再次尝试构建它时,它失败了。

我有:

  1. /home/debpackage/debianpackage_1.0.orig.tar.gz
  2. 上面的tar包含一个名为debianpackage-1.0/的文件夹(其中包含各种包)
  3. 我提取了焦油,现在我已经 /home/alon/debpackage/debianpackage_1.0.orig.tar.gz /home/alon/debpackage/debianpackage-1.0/(提取的所有文件)

  4. /home/alon/debpackage/debianpackage-1.0/中,我创建了一个名为“debian”的文件夹

  5. 我在/home/alon/debpackage/debianpackage-1.0/中的
  6. ./debian/changelog/copyright(空) ./debian/changelog/rules ./debian/changelog/changelog ./debian/changelog/compact(包含“8”) ./debian/changelog/control ./debian/changelog/source/format(包含3.0(被子))
  7. rules包含:

    #!/usr/bin/make -f
    
    %:
            dh $@
    
    override_dh_auto_install:
            $(MAKE) DESTDIR=$$(pwd)/debian/debianpackage prefix=/usr install
    

    当我尝试运行./debian/debuild -us -uc时,我得到:

    dpkg-buildpackage -rfakeroot -D -us -uc
    dpkg-buildpackage: warning: using a gain-root-command while being root
    dpkg-buildpackage: export CFLAGS from dpkg-buildflags (origin: vendor): -g -O2
    dpkg-buildpackage: export CPPFLAGS from dpkg-buildflags (origin: vendor): 
    dpkg-buildpackage: export CXXFLAGS from dpkg-buildflags (origin: vendor): -g -O2
    dpkg-buildpackage: export FFLAGS from dpkg-buildflags (origin: vendor): -g -O2
    dpkg-buildpackage: export LDFLAGS from dpkg-buildflags (origin: vendor): -Wl,-Bsymbolic-functions
    dpkg-buildpackage: source package debianpackage
    dpkg-buildpackage: source version 1.0-1
    dpkg-buildpackage: source changed by root <alon.zeiri@gmail.com>
     dpkg-source --before-build debianpackage-1.0
    dpkg-buildpackage: host architecture amd64
     fakeroot debian/rules clean
    dh clean
    dh: Compatibility levels before 5 are deprecated.
       dh_testdir
       dh_auto_clean
    dh_auto_clean: Compatibility levels before 5 are deprecated.
       dh_clean
    dh_clean: Compatibility levels before 5 are deprecated.
     dpkg-source -b debianpackage-1.0
    dpkg-source: info: using source format `3.0 (quilt)'
    dpkg-source: info: building debianpackage using existing ./debianpackage_1.0.orig.tar.gz
    dpkg-source: info: building debianpackage in debianpackage_1.0-1.debian.tar.gz
    dpkg-source: info: building debianpackage in debianpackage_1.0-1.dsc
     debian/rules build
    dh build
    dh: Compatibility levels before 5 are deprecated.
       dh_testdir
       dh_auto_configure
    dh_auto_configure: Compatibility levels before 5 are deprecated.
       dh_auto_build
    dh_auto_build: Compatibility levels before 5 are deprecated.
       dh_auto_test
    dh_auto_test: Compatibility levels before 5 are deprecated.
     fakeroot debian/rules binary
    dh binary
    dh: Compatibility levels before 5 are deprecated.
       dh_testroot
       dh_prep
    dh_prep: Compatibility levels before 5 are deprecated.
       dh_installdirs
    dh_installdirs: Compatibility levels before 5 are deprecated.
       debian/rules override_dh_auto_install
    make[1]: Entering directory `/home/alon/debpackage/debianpackage-1.0'
    /usr/bin/make DESTDIR=$(pwd)/debian/debianpackage prefix=/usr install
    make[2]: Entering directory `/home/alon/debpackage/debianpackage-1.0'
    make[2]: *** No rule to make target `install'.  Stop.
    make[2]: Leaving directory `/home/alon/debpackage/debianpackage-1.0'
    make[1]: *** [override_dh_auto_install] Error 2
    make[1]: Leaving directory `/home/alon/debpackage/debianpackage-1.0'
    make: *** [binary] Error 2
    dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2
    debuild: fatal error at line 1335:
    dpkg-buildpackage -rfakeroot -D -us -uc failed
    

    有什么想法吗?

3 个答案:

答案 0 :(得分:1)

似乎上游源代码的makefile(“debianpackage-1.0”)没有install目标,但在override_dh_auto_install目标debian/rules中,您明确地调用make install }

可能的解决方案:

  • 将一个install目标添加到debianpackage-1./Makefile

    如果您不在上游,则应通过debian / patches

  • 中的路径执行此操作
  • 使用override_dh_auto_install目标手动将文件安装到适当的位置

不过,为什么你首先覆盖dh_auto_install?似乎你没有添加任何东西,而不是自动调用。

答案 1 :(得分:1)

为什么您的debian/changelog是一个目录?您不应该有debian/changelog/rulesdebian/changelog/changelog等。它应该是debian/changelog(常规文件),debian/rulesdebian/control ...你的目录结构发生了糟糕的事情。

你应该cd debian; mv changelog oopsdir; mv -i oopsdir/* .;rmdir oopsdir

或者只是杀死整个事情并重新开始,因为你无法知道导致changelog成为目录的灾难不会影响其他任何事情。

答案 2 :(得分:0)

如果我在cmake之前在源代码中运行debuild,我通常会遇到此错误。 debuild/dpkg-buildpackage非常特别,因为它需要在干净的源上运行。我建议您尝试使用干净源上的dh_make --createorig生成debian文件夹及其内容,而不是手动创建它。在debuild之后应该没有任何问题,除非源存档的创建者包含编译代码或自动生成的文件。