0

我已经为 Linux 和 OSX 编写了一个开源 (GPL) 应用程序,现在希望分发它。默认情况下将源代码与二进制文件一起分发是正常的,还是只提供一个可以获取它的链接?

如果我包含源文件,在 Linux 和 OSX 的用户系统上编写它们的正常位置在哪里(我认为 /usr/local/src 但在我的 Ubuntu 机器上,据说充满了开源应用程序,这个目录是空的)。

4

3 回答 3

4

通常将源代码和二进制文件分开分发。二进制文件通常以特定于发行版的包格式分发,而源文件将是一个包含项目文件夹的简单 .tar.gz。如果需要,用户可以将其解压缩到 /usr/local/src,但它应该在任何地方构建。将其源代码放在任何特定位置并不取决于您的程序。

我以为 /usr/local/src 但在我的 Ubuntu 机器上,据说塞满了开源应用程序,这个目录是空的

如果您只使用 Ubuntu 存储库,它将为空。操作系统负责 /usr 并将您安装的任何源放入 /usr/src。但是 /usr/local 留给你玩;那是你安装发行版不提供的东西的地方。

于 2009-10-25T12:54:39.083 回答
1

关于 /usr/local/src

/usr/local 和任何子目录在你的机器上总是空的,除非你专门在里面放了一些东西。它是文件系统的一部分,为特定机器的用户安装软件保留。Ubuntu(或任何发行版)不应该碰它。

Your distro will have separate places for its own source code, if any. Most Ubuntu installations won't need source code anyway (though you can download it if you want to), but if they do it'll go somewhere like /usr/src. But if you want to place your own source code somewhere and don't want your distro to mess with it, then just:

  • If it's just for developing/compiling in your own user account, you can just put it somewhere in your home directory.
  • If it's a piece of software you'll installing on the system, /usr/local/src is the suggested spot and your distro won't mess with it there.

FHS is the standard which says where in the filesystems things go, and includes distinctions such as the ones I've discussed above.

Your software should be able to be compiled no matter which directory it's in, because as you can see, it can depend.

于 2010-11-05T05:45:31.123 回答
0

Sourceforge ( http://www.sf.net )上的一些项目值得一看。正如@bobince 所提到的,分开分发二进制文件和源代码是正常的。不需要编译,这样他们就可以下载和运行,这对用户来说当然是件好事。

于 2009-10-25T14:14:31.617 回答