[Gluster-devel] Reminder: adding source files

Jeff Darcy jdarcy at redhat.com
Fri Apr 1 15:46:00 UTC 2016


If you add a file to the project, please remember to add it to the
appropriate Makefile.am as well.  Failure to do so *will not show up* in
our standard smoke/regression tests because those do "make install" but
they will prevent RPMs (and probably equivalents on other
distros/platforms) from building.  To see why, let's review how building
real packages works.

 * First there's autogen and configure, which operate in your original
   source directory turning .am and .in files into real
   platform-specific makefiles and scripts.

 * Then there's "make dist-gzip" and friends, which package up *only
   files specified in makefiles* into a tarball.

 * The rpmbuild "prep" stage unpacks this tarball and applies patches,
   typically in ~/rpmbuild/BUILD.

 * The rpmbuild "compile" stage does what you'd expect within BUILD.

 * The rpmbuild "install" stage does a "make install" in BUILD, which
   populates BUILDROOT.

There's more, but those are the key parts.  With that in mind, we can
look at various options for adding new source files.

 * xxx_SOURCES go into the dist tarball and become available in BUILD
   for the compilation phase.  xxx_HEADERS do likewise, and also get
   populated into BUILDROOT during the install phase.

 * noinst_HEADERS inhibits propagation into BUILDROOT (making headers
   act like sources), and is generally what you'd want for headers that
   are not specifically intended to be in -devel packages.

 * nodist_xxx_SOURCES can be used to specify files that are needed to
   build xxx, but will not be in the dist tarball.  This is what you'd
   use for generated files.

 * Anything not specified in any of these ways never even makes it to
   the dist tarball.
        
There are different rules for other things like Python scripts, but I
don't remember those very well.  Also, I might have gotten some of the
above slightly wrong; corrections from people who know this stuff even
better than I do (Kaleb?) are welcome.  The most important point is
this:

        "git add" is not enough!


More information about the Gluster-devel mailing list