From owner-svn-ports-head@freebsd.org Fri Sep 25 22:30:14 2020 Return-Path: Delivered-To: svn-ports-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 48C403E7064; Fri, 25 Sep 2020 22:30:14 +0000 (UTC) (envelope-from yuri@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bymnf1BSHz4fxC; Fri, 25 Sep 2020 22:30:14 +0000 (UTC) (envelope-from yuri@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C2841A0DE; Fri, 25 Sep 2020 22:30:14 +0000 (UTC) (envelope-from yuri@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08PMUD6o053928; Fri, 25 Sep 2020 22:30:13 GMT (envelope-from yuri@FreeBSD.org) Received: (from yuri@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08PMUBmt053916; Fri, 25 Sep 2020 22:30:11 GMT (envelope-from yuri@FreeBSD.org) Message-Id: <202009252230.08PMUBmt053916@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuri set sender to yuri@FreeBSD.org using -f From: Yuri Victorovich Date: Fri, 25 Sep 2020 22:30:11 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r550088 - in head/misc: . librepo librepo/files X-SVN-Group: ports-head X-SVN-Commit-Author: yuri X-SVN-Commit-Paths: in head/misc: . librepo librepo/files X-SVN-Commit-Revision: 550088 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2020 22:30:14 -0000 Author: yuri Date: Fri Sep 25 22:30:11 2020 New Revision: 550088 URL: https://svnweb.freebsd.org/changeset/ports/550088 Log: New port: misc/librepo: Library downloading repository metadata Added: head/misc/librepo/ head/misc/librepo/Makefile (contents, props changed) head/misc/librepo/distinfo (contents, props changed) head/misc/librepo/files/ head/misc/librepo/files/patch-CMakeLists.txt (contents, props changed) head/misc/librepo/files/patch-librepo_CMakeLists.txt (contents, props changed) head/misc/librepo/files/patch-librepo_checksum.c (contents, props changed) head/misc/librepo/files/patch-librepo_downloader.c (contents, props changed) head/misc/librepo/files/patch-librepo_librepo.pc.cmake (contents, props changed) head/misc/librepo/files/patch-tests_test__checksum.c (contents, props changed) head/misc/librepo/files/xattr.c (contents, props changed) head/misc/librepo/files/xattr.h (contents, props changed) head/misc/librepo/pkg-descr (contents, props changed) head/misc/librepo/pkg-plist (contents, props changed) Modified: head/misc/Makefile Modified: head/misc/Makefile ============================================================================== --- head/misc/Makefile Fri Sep 25 22:28:31 2020 (r550087) +++ head/misc/Makefile Fri Sep 25 22:30:11 2020 (r550088) @@ -216,6 +216,7 @@ SUBDIR += libpostal SUBDIR += libpredict SUBDIR += libpri + SUBDIR += librepo SUBDIR += libsolv SUBDIR += libsupertone SUBDIR += libsweep-lidar Added: head/misc/librepo/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/misc/librepo/Makefile Fri Sep 25 22:30:11 2020 (r550088) @@ -0,0 +1,43 @@ +# $FreeBSD$ + +PORTNAME= librepo +DISTVERSION= 1.12.1 +CATEGORIES= misc + +MAINTAINER= yuri@FreeBSD.org +COMMENT= Library downloading repository metadata + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/COPYING + +LIB_DEPENDS= libassuan.so:security/libassuan \ + libcurl.so:ftp/curl \ + libgpg-error.so:security/libgpg-error \ + libgpgme.so:security/gpgme + +USES= gettext-runtime gnome cmake localbase:ldflags pkgconfig +USE_GNOME= glib20 libxml2 +USE_LDCONFIG= yes + +USE_GITHUB= yes +GH_ACCOUNT= rpm-software-management + +CMAKE_OFF= ENABLE_DOCS ENABLE_TESTS + +OPTIONS_DEFINE= PYTHON ZCHUNK +OPTIONS_DEFAULT= ZCHUNK +OPTIONS_SUB= yes + +PYTHON_USES= python +PYTHON_CMAKE_BOOL= ENABLE_PYTHON +PYTHON_CMAKE_ON= -DPYTHON_DESIRED=${PYTHON_MAJOR_VER} + +ZCHUNK_DESC= Build with zchunk support +ZCHUNK_CMAKE_BOOL= WITH_ZCHUNK +ZCHUNK_LIB_DEPENDS= libzck.so:archivers/zchunk + +post-patch: + @${RLN} ${FILESDIR}/xattr.c ${WRKSRC}/librepo/xattr.c + @${RLN} ${FILESDIR}/xattr.h ${WRKSRC}/librepo/xattr.h + +.include Added: head/misc/librepo/distinfo ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/misc/librepo/distinfo Fri Sep 25 22:30:11 2020 (r550088) @@ -0,0 +1,3 @@ +TIMESTAMP = 1600625196 +SHA256 (rpm-software-management-librepo-1.12.1_GH0.tar.gz) = b78113f3aeb0d562b034dbeb926609019b7bed27e05c9ab5a584a9938de8da9f +SIZE (rpm-software-management-librepo-1.12.1_GH0.tar.gz) = 816206 Added: head/misc/librepo/files/patch-CMakeLists.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/misc/librepo/files/patch-CMakeLists.txt Fri Sep 25 22:30:11 2020 (r550088) @@ -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 Added: head/misc/librepo/files/patch-librepo_CMakeLists.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/misc/librepo/files/patch-librepo_CMakeLists.txt Fri Sep 25 22:30:11 2020 (r550088) @@ -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() Added: head/misc/librepo/files/patch-librepo_checksum.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/misc/librepo/files/patch-librepo_checksum.c Fri Sep 25 22:30:11 2020 (r550088) @@ -0,0 +1,11 @@ +--- librepo/checksum.c.orig 2020-09-20 18:54:37 UTC ++++ librepo/checksum.c +@@ -26,7 +26,7 @@ + #include + #include + #include +-#include ++#include "xattr.h" + #include + #include + Added: head/misc/librepo/files/patch-librepo_downloader.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/misc/librepo/files/patch-librepo_downloader.c Fri Sep 25 22:30:11 2020 (r550088) @@ -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 + #include +@@ -31,7 +33,7 @@ + #include + #include + #include +-#include ++#include "xattr.h" + #include + #include + Added: head/misc/librepo/files/patch-librepo_librepo.pc.cmake ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/misc/librepo/files/patch-librepo_librepo.pc.cmake Fri Sep 25 22:30:11 2020 (r550088) @@ -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 Added: head/misc/librepo/files/patch-tests_test__checksum.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/misc/librepo/files/patch-tests_test__checksum.c Fri Sep 25 22:30:11 2020 (r550088) @@ -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 + #include + #include +-#include ++#include "xattr.h" + #include + + #include "librepo/util.h" Added: head/misc/librepo/files/xattr.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/misc/librepo/files/xattr.c Fri Sep 25 22:30:11 2020 (r550088) @@ -0,0 +1,32 @@ + +#include +#include + + +/// +/// 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); +} Added: head/misc/librepo/files/xattr.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/misc/librepo/files/xattr.h Fri Sep 25 22:30:11 2020 (r550088) @@ -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); Added: head/misc/librepo/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/misc/librepo/pkg-descr Fri Sep 25 22:30:11 2020 (r550088) @@ -0,0 +1,4 @@ +A library providing C and Python (libcURL like) API for downloading linux +repository metadata and packages. + +WWW: https://github.com/rpm-software-management/librepo Added: head/misc/librepo/pkg-plist ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/misc/librepo/pkg-plist Fri Sep 25 22:30:11 2020 (r550088) @@ -0,0 +1,28 @@ +include/librepo/checksum.h +include/librepo/downloader.h +include/librepo/downloader_internal.h +include/librepo/downloadtarget.h +include/librepo/fastestmirror.h +include/librepo/gpg.h +include/librepo/handle.h +include/librepo/librepo.h +include/librepo/metadata_downloader.h +include/librepo/metalink.h +include/librepo/mirrorlist.h +include/librepo/package_downloader.h +include/librepo/rcodes.h +include/librepo/repoconf.h +include/librepo/repomd.h +include/librepo/repoutil_yum.h +include/librepo/result.h +include/librepo/types.h +include/librepo/url_substitution.h +include/librepo/util.h +include/librepo/version.h +include/librepo/xmlparser.h +include/librepo/yum.h +lib/librepo.so +lib/librepo.so.0 +%%PYTHON%%%%PYTHON_SITELIBDIR%%/librepo/__init__.py +%%PYTHON%%%%PYTHON_SITELIBDIR%%/librepo/_librepo.so +libdata/pkgconfig/librepo.pc