#kerberos #integration #build #directory #system #build-script #libkrb5

sys krb5-src

Build system integration for libkrb5, MIT's Kerberos implementation

10 releases

0.3.2+1.19.2 Jan 16, 2022
0.3.1+1.19.2 Dec 23, 2021
0.3.0+1.19.2 Nov 28, 2021
0.2.4+1.18.2 Jul 8, 2020
0.1.1+1.18.1 Apr 28, 2020

#1280 in Database interfaces

Download history 8019/week @ 2023-11-20 8858/week @ 2023-11-27 7304/week @ 2023-12-04 7170/week @ 2023-12-11 7402/week @ 2023-12-18 6404/week @ 2023-12-25 6561/week @ 2024-01-01 8373/week @ 2024-01-08 9135/week @ 2024-01-15 8785/week @ 2024-01-22 10829/week @ 2024-01-29 7323/week @ 2024-02-05 4662/week @ 2024-02-12 5987/week @ 2024-02-19 7654/week @ 2024-02-26 7987/week @ 2024-03-04

26,569 downloads per month
Used in 9 crates (via sasl2-sys)

Apache-2.0

12MB
279K SLoC

C 252K SLoC // 0.2% comments Python 8K SLoC // 0.2% comments C++ 8K SLoC // 0.2% comments Perl 2K SLoC // 0.1% comments M4 2K SLoC // 0.3% comments ASN.1 1.5K SLoC // 0.2% comments GNU Style Assembly 1.5K SLoC Happy 1K SLoC INI 602 SLoC // 0.0% comments Bitbake 575 SLoC // 0.2% comments Shell 506 SLoC // 0.1% comments AWK 396 SLoC // 0.1% comments Visual Studio Project 338 SLoC Alex 245 SLoC SWIG 162 SLoC // 0.3% comments Rust 127 SLoC // 0.3% comments Emacs Lisp 104 SLoC // 0.3% comments Batch 69 SLoC Visual Studio Solution 60 SLoC

rust-krb5-src

crates.io CI Rust Documentation

Rust build system integration for libkrb5, MIT's Kerberos implementation.

View documentation.

Installation

# Cargo.toml
[dependencies]
krb5-src = "0.3.2+1.19.2"

lib.rs:

Build system integration for libkrb5, MIT's Kerberos implementation.

This crate builds a vendored copy of libkrb5 using Cargo's support for custom build scripts. It is not intended for direct consumption, but as a dependency for other crates that need libkrb5 available, like sasl2-sys.

krb5-src is currently bundling libkrb5 v1.19.2.

To use this crate, declare a dependency or dev-dependency on krb5-src. Then, in the build script for your crate, the environment variable DEP_KRB5_SRC_ROOT will point to the directory in which the bundled copy of libkrb5 has been installed. You can build and link another C library against this copy of libkrb5, or generate Rust bindings and link Rust code against this copy of libkrb5.

Note that you are responsible for instructing Cargo to link in the components of libkrb5 that you depend upon. Here is an example build script fragment.

println!(
    "cargo:rustc-link-search=native={}",
    PathBuf::from(env::var("DEP_KRB5_SRC_ROOT").unwrap()).join("lib").display(),
);
println!("cargo:rustc-link-lib=static=gssapi_krb5");
println!("cargo:rustc-link-lib=static=krb5");
println!("cargo:rustc-link-lib=static=k5crypto");
println!("cargo:rustc-link-lib=static=com_err");
println!("cargo:rustc-link-lib=static=krb5support");

Cargo features

krb5-src can be configured with the following Cargo features:

  • binaries builds the binaries that come with libkrb5 (kinit, kdestroy, et al.) and installs them into DEP_KRB5_SRC_ROOT/bin.

  • nls enables native language support (i.e., localization). This feature corresponds to the --enable-nls configure flag.

    On some platforms, when this feature is enabled, the application must additionally link against libintl.

  • openssl-vendored enables the vendored feature of the openssl-sys crate.

Note that none of these features have any effect when compiling on Windows.

Platform support

krb5-src is tested on recent versions of Ubuntu, macOS, and Windows. Patches that improve support for other platforms are welcome.

Dependencies