我想构建一个Debian/Ubuntu包,在./configure'd --prefix下安装一个应用程序。
当我运行./configure --prefix=/opt/d-ph/my_app && make && sudo make install时,我最终得到了以下文件夹结构:
/opt/d-ph/my_app
|- bin/(my binaries)
|- etc/(my configuration)
|- include/
|- lib/
|- share/但是当我使用下面的debian/rules覆盖运行debuild时:
override_dh_auto_configure:
dh_auto_configure -- --prefix=/opt/d-ph/my_app然后我得到了下面的包结构:
|- /DEBIAN
|- /etc/(my configuration)
|- /opt/d-ph/my_app
|- bin/(my binaries)
|- include/
|- lib/
|- share/
|- /share/我不希望我的软件包将其配置(即/etc文件夹)安装在/etc根目录下。也就是说,我希望配置驻留在--prefix选项指定的目录中。也就是说,我希望生成以下包结构:
|- /DEBIAN
|- /opt/d-ph/my_app
|- bin/(my binaries)
|- etc/(my configuration)
|- include/
|- lib/
|- share/
|- /share/在准备软件包目录结构时,如何防止debuild将etc文件夹移出已配置的--prefix文件夹?
发布于 2017-04-11 00:22:20
我最终覆盖了dh_installdeb构建步骤。我基本上还原了它将etc文件夹移回已配置的--prefix下的过程。
APP_PREFIX=/opt/d-ph/my_app
ETC_DIR_PATH=$(CURDIR)/debian/my_app/etc
(...)
override_dh_installdeb:
dh_installdeb
# move the /etc folder
if [ -d $(ETC_DIR_PATH) ]; then mv $(ETC_DIR_PATH) $(CURDIR)/debian/my_app$(APP_PREFIX); fi
# tell dpkg not to look for the etc files anymore
> $(CURDIR)/debian/my_app/DEBIAN/conffiles正如@tripleee在问题下面评论的那样,这样做可能并不好,所以这样做的风险自负。不过,它对我来说是有效的,这对我来说是最重要的(生成的.deb包仅供我个人使用)
https://stackoverflow.com/questions/43321735
复制相似问题