[英]Is there a standard/recommended directory structure for Debian packages?
My next project will be a Debian daemon written in Python and I want to package it as a Debian native package. My next project will be a Debian daemon written in Python and I want to package it as a Debian native package. The project is versioned using Git and the code is hosted in GitHub.
该项目使用 Git 进行版本控制,代码托管在 GitHub 中。
How can I organize directories and branches in the repository?如何组织存储库中的目录和分支? Is there a standard/common/recommended way?
有标准/常用/推荐的方式吗?
The project is basically composed by some python scripts and systemd unit files.该项目基本上由一些 python 脚本和 systemd 单元文件组成。 By looking around I came up with this directory structure but I don't know if it is reasonable:
通过环顾四周,我想出了这个目录结构,但我不知道它是否合理:
my-app/
├── debian/
│ ├── control
│ ├── copyright
│ ├── changelog
│ ├── rules
│ └── ...
├── my_module/
│ ├── __init__.py
│ ├── my_script.py
│ └── ...
├── systemd/
│ ├── my-service.service
│ └── ...
├── README.md
├── LICENSE
└── ...
it seems you are asking about the directory structure (which files should be where), not the repository structure (which would be about branches).看来您是在询问目录结构(哪些文件应该在哪里),而不是存储库结构(关于分支)。
the structure is as follows:结构如下:
debian/
folder in the root of this directorydebian/
文件夹that's it.而已。 this structure was designed to allow packaging of arbitrary projects - with the only constraint that there is no
debian/
folder.这种结构旨在允许打包任意项目 - 唯一的限制是没有
debian/
文件夹。
now, this structure is very tightly coupled to the concept of having upstream-development separate from Debian-packaging.现在,这种结构与上游开发与 Debian 打包分离的概念非常紧密地结合在一起。 (something which might not apply to your use case, as you seem to be both upstream developer and the one creating the Debian package).
(这可能不适用于您的用例,因为您似乎既是上游开发人员又是创建 Debian 包的人)。
in order to make life easier for an eventual adaption into Debian proper (eg adaption of the package into a real Debian release), you should make sure that the /debian
directory is not included in the release tarballs.为了使最终适应 Debian 的生活更轻松(例如,将 package 调整为真正的 Debian 版本),确保不包括
/debian
tarsballdebianZ 版本的版本)。
You should also exclude repository configuration files from your release tarballs ( .gitignore
files, CI-configuration,...)您还应该从发布 tarball 中排除存储库配置文件(
.gitignore
文件、CI 配置...)
if using git, you might add a .gitattributes
file that contains (among other things):如果使用 git,您可以添加一个
.gitattributes
文件,其中包含(除其他外):
/debian/ export-ignore
.git* export-ignore
There's also a more elaborate online guide on how to be a nice upstream for Debian: https://wiki.debian.org/UpstreamGuide还有一个更详细的在线指南,介绍如何成为 Debian 的良好上游: https://wiki.debian.org/UpstreamGuide
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.