On 01/07/2018 07:11 PM, Joaquin Garmendia Cabrera wrote:
I just updated the pkgbuild following your recommendations. I just have a question: Why not to put `autoreconf -fi` and `configure --prefix=/usr` under prepare() function?
Thanks for your time!, Joaquin
Strictly speaking, the prepare() function is meant to perform final changes to the source code in order to get it ready for building. This includes things like applying patches or sed commands, as well as autoreconf as autoreconf is used to create "dist" tarballs. It copies various m4 macros into the source tree, and generates the ./configure script as well as various other bits and pieces of an autotools system, and the final result is a source tree that is ready for distribution as "ready to build", since it has no need of external tools like aclocal, autoconf, autoheader, automake etc.
In comparison, ./configure is where the packaging starts. You use ./configure to specify things for *your* specific build, e.g. the --prefix, enabling and disabling optional features, toggling out-of-tree builds.
Semantically, autoreconf/autogen.sh are very much preparatory tools, whereas /.configure is very much a build tool. I like to be exact about things like this.