[The path where Pakfire stores temporary data])
AC_DEFINE_UNQUOTED([PAKFIRE_PRIVATE_DIR], ["/var/lib/${PACKAGE_NAME}"],
[The path where Pakfire stores its private data])
+AC_DEFINE_UNQUOTED([PAKFIRE_SCRIPTS_DIR], ["${PREFIX}/lib/${PACKAGE_NAME}"],
+ [The path where Pakfire stores its scripts])
AC_CONFIG_FILES([
Makefile
"\n" \
"exit 0\n"
+static int pakfire_build_run_script(Pakfire pakfire, const char* filename,
+ pakfire_execute_logging_callback logging_callback, void* data) {
+ char* script = NULL;
+ size_t size = 0;
+ char path[PATH_MAX];
+
+ DEBUG(pakfire, "Running build script '%s'...\n", filename);
+
+ // Make the source path
+ pakfire_path_join(path, PAKFIRE_SCRIPTS_DIR, filename);
+
+ // Open the source script
+ FILE* f = fopen(path, "r");
+ if (!f) {
+ ERROR(pakfire, "Could not open %s: %s\n", path, strerror(errno));
+ return 1;
+ }
+
+ // Read the script into memory
+ int r = pakfire_read_file_into_buffer(f, &script, &size);
+ if (r) {
+ ERROR(pakfire, "Could not read script into memory: %s\n", strerror(errno));
+ goto ERROR;
+ }
+
+ // Execute it
+ r = pakfire_execute_script(pakfire, script, size, NULL, 0, logging_callback, data);
+ if (r) {
+ ERROR(pakfire, "Script '%s' failed with status %d\n", filename, r);
+ }
+
+ERROR:
+ if (script)
+ free(script);
+
+ return r;
+}
+
static int append_to_array(const char*** array, const char* s) {
unsigned int length = 0;
}
}
+ // Remove static libraries
+ r = pakfire_build_run_script(pakfire, "compress-man-pages", logging_callback, data);
+ if (r)
+ goto ERROR;
+
// Create the packages
r = pakfire_build_packages(pakfire, makefile, target);
if (r) {