Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[krb5] Update portfile #38685

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
113 changes: 85 additions & 28 deletions ports/krb5/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,37 +1,94 @@
vcpkg_download_distfile(ARCHIVE
URLS "https://kerberos.org/dist/krb5/1.21/krb5-${VERSION}.tar.gz"
FILENAME "krb5-${VERSION}.tar.gz"
SHA512 4e09296b412383d53872661718dbfaa90201e0d85f69db48e57a8d4bd73c95a90c7ec7b6f0f325f6bc967f8d203b256b071c0191facf080aca0e2caec5d0ac49
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO krb5/krb5
REF "krb5-${VERSION}-final"
SHA512 184ef8645d7e17f30a8e3d4005364424d2095b3d0c96f26ecef0c2dd2f3a096a0dd40558ed113121483717e44f6af41e71be0e5e079c76a205535d0c11a2ea34
PATCHES relative_paths.patch
)

vcpkg_extract_source_archive(
SOURCE_PATH
ARCHIVE ${ARCHIVE}
)
if ("${VCPKG_TARGET_IS_OSX}")
# Required for recent macOS and static build: https://mailman.mit.edu/pipermail/krbdev/2024-January/013653.html
if ("${VCPKG_LIBRARY_LINKAGE}" STREQUAL "static")
set(LD_FLAGS "-framework Kerberos")
endif ()
set(EXTRA_OPTIONS
"--disable-nls"
"--disable-silent-rules"
"--without-system-verto"
"--without-keyutils"
)
endif ()

vcpkg_configure_make(
SOURCE_PATH "${SOURCE_PATH}/src"
AUTOCONFIG
OPTIONS
"CFLAGS=-fcommon \$CFLAGS"
SOURCE_PATH "${SOURCE_PATH}"
PROJECT_SUBPATH src
AUTOCONFIG
NO_ADDITIONAL_PATHS
DETERMINE_BUILD_TRIPLET
OPTIONS
--disable-rpath
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to disable building the tools on debug since they will be removed by vcpkg_copy_tools anyway?

"CFLAGS=-fcommon \$CFLAGS"
"LDFLAGS=${LD_FLAGS}"
${EXTRA_OPTIONS}
)

vcpkg_install_make()
vcpkg_fixup_pkgconfig()
vcpkg_copy_pdbs()

vcpkg_copy_tools(
SEARCH_DIR "${CURRENT_PACKAGES_DIR}/bin"
DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin"
TOOL_NAMES
gss-client
kadmin
kdestroy
kinit
klist
kpasswd
kswitch
ktutil
kvno
sclient
sim_client
uuclient
compile_et
k5srvutil
krb5-config
AUTO_CLEAN
)

vcpkg_copy_tools(
SEARCH_DIR "${CURRENT_PACKAGES_DIR}/sbin"
DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}/sbin"
TOOL_NAMES
gss-server
kadmind
kdb5_util
kprop
kpropd
kproplog
krb5kdc
sim_server
sserver
uuserver
kadmin.local
krb5-send-pr
)

# Required because AUTO_CLEAN doesn't work with sbin
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/sbin")

# Empty directories
file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug"
"${CURRENT_PACKAGES_DIR}/share/man"
"${CURRENT_PACKAGES_DIR}/var"
)

# Also empty when static
if("${VCPKG_LIBRARY_LINKAGE}" STREQUAL "static")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/krb5")
endif()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/krb5/cat1")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/krb5/cat5")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/krb5/cat7")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/krb5/cat8")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/krb5/")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/krb5/")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/var")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/var")

# remove due to absolute path error
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/tools/krb5/bin/compile_et")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/tools/krb5/bin/krb5-config")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/tools/krb5/debug/")

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/doc/copyright.rst")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/NOTICE")
35 changes: 35 additions & 0 deletions ports/krb5/relative_paths.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
diff --git a/src/build-tools/krb5-config.in b/src/build-tools/krb5-config.in
index 8e6eb8660..89a401dab 100755
--- a/src/build-tools/krb5-config.in
+++ b/src/build-tools/krb5-config.in
@@ -27,7 +27,7 @@
# Configurable parameters set by autoconf
version_string="Kerberos 5 release @KRB5_VERSION@"

-prefix=@prefix@
+prefix='$(pwd)/../../../'
exec_prefix=@exec_prefix@
includedir=@includedir@
libdir=@libdir@
@@ -39,7 +39,7 @@ PTHREAD_CFLAGS='@PTHREAD_CFLAGS@'
DL_LIB='@DL_LIB@'
DEFCCNAME='@DEFCCNAME@'
DEFKTNAME='@DEFKTNAME@'
-DEFCKTNAME='@DEFCKTNAME@'
+DEFCKTNAME='$(pwd)/../../../var/krb5/user/%{euid}/client.keytab'

LIBS='@LIBS@'
GEN_LIB=@GEN_LIB@
diff --git a/src/util/et/compile_et.sh b/src/util/et/compile_et.sh
index f17ddba71..6a98a8bab 100755
--- a/src/util/et/compile_et.sh
+++ b/src/util/et/compile_et.sh
@@ -2,7 +2,7 @@
#
#
AWK=@AWK@
-DIR=@DIR@
+DIR='$(pwd)/../../../share/et'

usage="usage: $0 [ -d scriptDir ] [ --textdomain domain [ --localedir dir ] ]"
usage="$usage inputfile.et"
11 changes: 9 additions & 2 deletions ports/krb5/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
"name": "krb5",
"version": "1.21.2",
"description": "Network authentication protocol",
"port-version": 1,
"description": [
"Kerberos is a network authentication protocol.",
"It is designed to provide strong authentication for client/server applications by using secret-key cryptography.",
"A free implementation of this protocol is available from the Massachusetts Institute of Technology.",
"Kerberos is available in many commercial products as well."
],
"homepage": "https://web.mit.edu/kerberos/",
"license": "MIT",
"supports": "linux"
"supports": "osx | (x64 & linux)"
}
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4050,7 +4050,7 @@
},
"krb5": {
"baseline": "1.21.2",
"port-version": 0
"port-version": 1
},
"ktx": {
"baseline": "4.3.1",
Expand Down
5 changes: 5 additions & 0 deletions versions/k-/krb5.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [

Check failure on line 2 in versions/k-/krb5.json

View check run for this annotation

Azure Pipelines / microsoft.vcpkg.pr (x86_windows)

versions/k-/krb5.json#L2

versions/k-/krb5.json(2,): error : while parsing versions for krb5 from version/k-/krb5.json

Check failure on line 2 in versions/k-/krb5.json

View check run for this annotation

Azure Pipelines / microsoft.vcpkg.pr

versions/k-/krb5.json#L2

versions/k-/krb5.json(2,): error : while parsing versions for krb5 from version/k-/krb5.json
{
"git-tree": "19f68551b5a14434b8e38068b96aa801a4dac1d8",
"version": "1.21.2",
"port-version": 1
},
{
"git-tree": "287bac02bb53283b043688050edd9d02e0b039c7",
"version": "1.21.2",
Expand Down