diff options
author | Yuri Victorovich <yuri@FreeBSD.org> | 2020-09-25 22:30:11 +0000 |
---|---|---|
committer | Yuri Victorovich <yuri@FreeBSD.org> | 2020-09-25 22:30:11 +0000 |
commit | 67f362deb11608426e6fd6b93a32052d63148b4b (patch) | |
tree | 677f89a6ada917367ffd751257ee7d979373649d /misc/librepo/files | |
parent | 87f1e62a93241efe26e2d0d961b46c6b7090b7ca (diff) |
New port: misc/librepo: Library downloading repository metadata
Notes
Notes:
svn path=/head/; revision=550088
Diffstat (limited to 'misc/librepo/files')
-rw-r--r-- | misc/librepo/files/patch-CMakeLists.txt | 27 | ||||
-rw-r--r-- | misc/librepo/files/patch-librepo_CMakeLists.txt | 19 | ||||
-rw-r--r-- | misc/librepo/files/patch-librepo_checksum.c | 11 | ||||
-rw-r--r-- | misc/librepo/files/patch-librepo_downloader.c | 23 | ||||
-rw-r--r-- | misc/librepo/files/patch-librepo_librepo.pc.cmake | 11 | ||||
-rw-r--r-- | misc/librepo/files/patch-tests_test__checksum.c | 11 | ||||
-rw-r--r-- | misc/librepo/files/xattr.c | 32 | ||||
-rw-r--r-- | misc/librepo/files/xattr.h | 4 |
8 files changed, 138 insertions, 0 deletions
diff --git a/misc/librepo/files/patch-CMakeLists.txt b/misc/librepo/files/patch-CMakeLists.txt new file mode 100644 index 000000000000..26182931ed88 --- /dev/null +++ b/misc/librepo/files/patch-CMakeLists.txt @@ -0,0 +1,27 @@ +--- CMakeLists.txt.orig 2020-08-22 20:15:59 UTC ++++ CMakeLists.txt +@@ -28,7 +28,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SO + + FIND_PACKAGE(PkgConfig) + PKG_CHECK_MODULES(GLIB2 glib-2.0 REQUIRED) +-PKG_SEARCH_MODULE(LIBCRYPTO REQUIRED libcrypto openssl) ++#PKG_SEARCH_MODULE(LIBCRYPTO REQUIRED libcrypto openssl) + PKG_CHECK_MODULES(LIBXML2 libxml-2.0 REQUIRED) + FIND_PACKAGE(CURL REQUIRED) + FIND_PACKAGE(Gpgme REQUIRED) +@@ -66,6 +66,7 @@ INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIR}) + include (GNUInstallDirs) + # Python stuff + ++if (ENABLE_PYTHON) + IF (NOT PYTHON_DESIRED) + FIND_PACKAGE (PythonInterp REQUIRED) + ELSEIF (${PYTHON_DESIRED} STREQUAL "2") +@@ -79,6 +80,7 @@ ELSE () + MESSAGE (FATAL_ERROR "Invalid PYTHON_DESIRED value: " ${PYTHON_DESIRED}) + ENDIF() + FIND_PACKAGE (PythonLibs REQUIRED) ++endif() + + + # Subdirs diff --git a/misc/librepo/files/patch-librepo_CMakeLists.txt b/misc/librepo/files/patch-librepo_CMakeLists.txt new file mode 100644 index 000000000000..d74cffee9c49 --- /dev/null +++ b/misc/librepo/files/patch-librepo_CMakeLists.txt @@ -0,0 +1,19 @@ +--- librepo/CMakeLists.txt.orig 2020-08-22 20:15:59 UTC ++++ librepo/CMakeLists.txt +@@ -18,7 +18,8 @@ SET (librepo_SRCS + url_substitution.c + util.c + xmlparser.c +- yum.c) ++ yum.c ++ xattr.c) + + SET(librepo_HEADERS + checksum.h +@@ -73,4 +74,6 @@ INSTALL(TARGETS librepo LIBRARY DESTINATION ${CMAKE_IN + INSTALL(FILES "${CMAKE_BINARY_DIR}/librepo.pc" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") + ++if (ENABLE_PYTHON) + ADD_SUBDIRECTORY(python) ++endif() diff --git a/misc/librepo/files/patch-librepo_checksum.c b/misc/librepo/files/patch-librepo_checksum.c new file mode 100644 index 000000000000..2cc409949df2 --- /dev/null +++ b/misc/librepo/files/patch-librepo_checksum.c @@ -0,0 +1,11 @@ +--- librepo/checksum.c.orig 2020-09-20 18:54:37 UTC ++++ librepo/checksum.c +@@ -26,7 +26,7 @@ + #include <errno.h> + #include <sys/types.h> + #include <sys/stat.h> +-#include <sys/xattr.h> ++#include "xattr.h" + #include <unistd.h> + #include <openssl/evp.h> + diff --git a/misc/librepo/files/patch-librepo_downloader.c b/misc/librepo/files/patch-librepo_downloader.c new file mode 100644 index 000000000000..ed1fdc00ada9 --- /dev/null +++ b/misc/librepo/files/patch-librepo_downloader.c @@ -0,0 +1,23 @@ +--- librepo/downloader.c.orig 2020-08-22 20:15:59 UTC ++++ librepo/downloader.c +@@ -18,9 +18,11 @@ + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + ++#if __FreeBSD__ + #define _XOPEN_SOURCE 500 // Because of fdopen() and ftruncate() + #define _DEFAULT_SOURCE // Because of futimes() + #define _BSD_SOURCE // Because of futimes() ++#endif + + #include <glib.h> + #include <assert.h> +@@ -31,7 +33,7 @@ + #include <sys/types.h> + #include <sys/stat.h> + #include <sys/time.h> +-#include <sys/xattr.h> ++#include "xattr.h" + #include <fcntl.h> + #include <curl/curl.h> + diff --git a/misc/librepo/files/patch-librepo_librepo.pc.cmake b/misc/librepo/files/patch-librepo_librepo.pc.cmake new file mode 100644 index 000000000000..cb50eb0bbde4 --- /dev/null +++ b/misc/librepo/files/patch-librepo_librepo.pc.cmake @@ -0,0 +1,11 @@ +--- librepo/librepo.pc.cmake.orig 2020-09-20 19:51:54 UTC ++++ librepo/librepo.pc.cmake +@@ -6,7 +6,7 @@ Name: librepo + Description: Repodata downloading library. + Version: @VERSION@ + Requires: glib-2.0 +-Requires.private: libcurl openssl libxml-2.0 ++Requires.private: libcurl libxml-2.0 + Libs: -L${libdir} -lrepo + Libs.private: -lgpgme -lgpg-error + Cflags: -I${includedir} -D_FILE_OFFSET_BITS=64 diff --git a/misc/librepo/files/patch-tests_test__checksum.c b/misc/librepo/files/patch-tests_test__checksum.c new file mode 100644 index 000000000000..6af6602ee9af --- /dev/null +++ b/misc/librepo/files/patch-tests_test__checksum.c @@ -0,0 +1,11 @@ +--- tests/test_checksum.c.orig 2020-09-20 19:02:27 UTC ++++ tests/test_checksum.c +@@ -6,7 +6,7 @@ + #include <string.h> + #include <sys/types.h> + #include <sys/stat.h> +-#include <sys/xattr.h> ++#include "xattr.h" + #include <fcntl.h> + + #include "librepo/util.h" diff --git a/misc/librepo/files/xattr.c b/misc/librepo/files/xattr.c new file mode 100644 index 000000000000..3797f2117080 --- /dev/null +++ b/misc/librepo/files/xattr.c @@ -0,0 +1,32 @@ + +#include <sys/types.h> +#include <sys/extattr.h> + + +/// +/// xattr is a Linux kernel API that has to be mapped to the FreeBSD API +/// + +// code below is adopted and simplified from the 'xattr' python module https://github.com/xattr/xattr/blob/master/xattr/lib_build.c + +int fsetxattr(int fd, const char *name, const void *value, size_t size, int flags) { + int rv = 0; + + assert(flags == 0); // we do not handle flags here and the project currently doesn't use flags!=0 + + rv = extattr_set_fd(fd, EXTATTR_NAMESPACE_USER, name, value, size); + + /* freebsd returns the written length on success, not zero. */ + if (rv >= 0) + return 0; + else + return rv; +} + +ssize_t fgetxattr(int fd, const char *name, void *value, size_t size) { + return extattr_get_fd(fd, EXTATTR_NAMESPACE_USER, name, value, size); +} + +int fremovexattr(int fd, const char *name) { + return extattr_delete_fd(fd, EXTATTR_NAMESPACE_USER, name); +} diff --git a/misc/librepo/files/xattr.h b/misc/librepo/files/xattr.h new file mode 100644 index 000000000000..633417b953b3 --- /dev/null +++ b/misc/librepo/files/xattr.h @@ -0,0 +1,4 @@ + +int fsetxattr(int fd, const char *name, const void *value, size_t size, int flags); +ssize_t fgetxattr(int fd, const char *name, void *value, size_t size); +int fremovexattr(int fd, const char *name); |