KlingonJoe
KlingonJoe

Reputation: 835

Is there a Linux standard structure for "install" directories?

I want to release a small software package, but I'm not sure how to structure the release directory.

Is there a Linux standard out there that specifies how to name of each directory in my release folder and what to put in them (or not put)?

For example, I expect compiled libraries to be in /lib and header files in /include - etc. I have a few other files in the release and it's not clear to me in what directory to put them.

Upvotes: 1

Views: 390

Answers (1)

Is there a Linux standard out there that specifies how to name of each directory ?

More or less, read about the File Hierarchy Standard (see also this and the FHS & LSB wikipages). See also hier(7) man page.

But it describes system-wide paths. Notice that libraries often go into /usr/lib/ (or /usr/lib/x86_64-linux-gnu/ ...) and header files into /usr/include/. For software outside of and unknown by your package manager, you'll use /usr/local/lib/ for libraries and /usr/local/include/ for headers. Be also aware of pkg-config.

BTW, you should consider making these directories configurable (at least at build time).

Read also about autoconf and the --prefix argument (default is /usr/local/) to its configure scripts.

Also, consider packaging your software (e.g. as .deb packages on Ubuntu or Debian). This also means to describe dependencies. See also GNU stow.

If your software package is some free software (I hope it is, then publish its source code, perhaps on github) you might get help from distribution packagers. And you should look into how similar free software are dealing with that.

Upvotes: 3

Related Questions