使用 debuild 构建共享库 .deb

使用 debuild 构建共享库 .deb

我正在尝试使用 debuild 打包共享库来构建 .deb 文件。在运行 dh_make 时,选择了库选项。一直在关注这个指导成功构建库后,我收到以下错误:

dh_install
dh_install: mylibrary-dev missing files (usr/lib/lib*.a), aborting
make: *** [binary] Error 255
dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2
debuild: fatal error at line 1337:
dpkg-buildpackage -rfakeroot -D -us -uc failed

我查看了错误中列出的目录,例如 ~/mylibrary-1.0/debian/mylibrary-dev/usr/lib/ ,它是空的。共享库实际上位于: ~/mylibrary-1.0/debian/tmp/usr/lib/ 但是那里没有 *.a 库。 mylibrary-dev.install 文件列出以下内容:

usr/include/*
usr/lib/lib*.a
usr/lib/lib*.so
usr/lib/pkgconfig/*
usr/lib/*.la
usr/share/pkgconfig/*

由于某种原因,控制文件中列出了一个额外的包。

Source: mylibrary
Priority: extra
Maintainer: satpal <satpal@unknown>
Build-Depends: debhelper (>= 7.0.50~), autotools-dev
Standards-Version: 3.8.4
Section: libs
Homepage: <insert the upstream URL, if relevant>

Package: mylibrary-dev
Section: libdevel
Architecture: any
Depends: mylibrary1 (= ${binary:Version})
Description: <insert up to 60 chars description>
 <insert long description, indented with spaces>

Package: mylibrary1
Section: libs
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: <insert up to 60 chars description>
 <insert long description, indented with spaces>

按照指南中使用的 helloworld 示例,它只提供了 Source 和一个包

我的规则文件是:

#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

%:
    dh $@

答案1

我重新阅读了 Gilles 对我原来帖子的评论,并设法找出为什么我没有 .a 文件。这是因为我实际上已经停止了在configure.ac中使用以下标志创建静态库:

AM_DISABLE_STATIC

对我来说真是太棒了。

相关内容