text: #include "main.h"
  #include "build.h"
  #include "fork.h"
  
  #include <unistd.h>
  
  /**
   * Install `package` on the user's system, assuming it has been downloaded.
   * If the dependencies of `package` are not solved, then the installation won't
   * be successful.
   *
   * Returns: exit code of makepkg program
   */
  int build_package(struct Package *package)
  {
      char lastdir[PATH_MAX]; getcwd(lastdir, PATH_MAX);
      char *makepkg_args[] = {"makepkg", "--install", "--syncdeps", "--rmdeps", NULL};
  
      chdir(package->name);
      int status = fork_program("makepkg", makepkg_args);
      chdir(lastdir);
      return status;
  }
  
  