在软件包中创建经典小型 Linux 应用程序的教程/指南 (Debian)

发布于 2024-09-29 19:34:32 字数 847 浏览 0 评论 0原文

我在我的机器中创建了一个小脚本,并在 .bashrc 中创建了一个调用它的alias。这是一个只有 3 行的 bash 脚本,但它可以增长。

现在,我团队中的一些人发现它很有用,并且想要使用它。

我没有说“复制这个别名,做这个,做那个,安装那个库”,而是考虑创建一个简单的包来更专业一点。事实上,我以前从未做过这样的事情。对我来说,问题不是创建一个包,而是试图决定你通常在包中放入什么。

假设我想使用我的脚本并创建myapplication。我想创建一个我的团队将安装的 .deb 文件,并且:

  • 有一个 /usr/bin/myapplication/usr/sbin/myapplication (它们之间有什么区别?),所以他们只需在终端上调用 myapplication 就可以了;
  • 有一个手册页; (debian 系统中的手册页通常位于哪里?);
  • 可以通过一些配置读取主文件夹中的 .myapplicationrc
  • 在 gnome 安装中有一个快捷方式条目(是否有可能有一个适用于 KDE 和 Gnome 的通用快捷方式“格式”?);
  • 安装依赖项。

我对所有这些东西都很陌生。我通常编写简单的脚本并在 bashrc 中创建一个别名。我以前从来没有做过包裹。您知道哪些指南可以帮助我实现上述想法?

I've made a small script in my machine, and an alias in .bashrc that calls it. It's a bash script with 3 lines, but it can grow.

Now, some people in my team found it useful, and want to use it.

Instead of saying "copy this alias, do this, do that, install that lib" I was thinking about creating a simple package to be a little more professional. Fact is, I've never done something like this before. And the problem to me is not creating a package, is trying to decide what usually do you put in a package.

Suppose I want to take my script, and create myapplication. I want to create a .deb file that my team would install and:

  • Have a /usr/bin/myapplication or /usr/sbin/myapplication (what's the difference between them?), so they would just call myapplication at their terminal and it would work;
  • Have a man page; (Where are usually located man pages in a debian system?);
  • Have a possibility to read a .myapplicationrc in home folder with some configurations;
  • Have an entry for shortcuts in a gnome installation (is it possible to have an universal shortcut "format" that's is available to KDE and Gnome as well?);
  • Install dependencies.

I'm new to all that stuff. I usually code simple scripts and create an alias in my bashrc. I've never done a package before. Which guides do you know of that can help me accomplish what I thinking of above?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

满天都是小星星 2024-10-06 19:34:32

这里是一个起点,尽管我欢迎更简洁的内容回答。

Here is a place to start, though I welcome a more succinct answer.

人│生佛魔见 2024-10-06 19:34:32

我找不到完整的指南。我认为最好的办法是下载一个完全符合我的想法的软件包并进行一些阅读,例如 taskwarrior

I couldn't find a complete guide. I think the best thing to do is download a package that does exactly what I'm thinking of and do some reading, like taskwarrior.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文