# synta.spec — Fedora RPM packaging for the synta ASN.1 library workspace # # The source package produces the following binary packages: # # synta CLI tools (synta-tool, synta-codegen) # synta-doc Documentation, guides, and examples # libcsynta C FFI shared library # libcsynta-devel C FFI headers and pkg-config file # libcsynta-static C FFI static library # libcsynta-doc C FFI documentation and C examples # python3-synta Python bindings (PyO3 / maturin, abi3-py38+) # python3-synta-doc Python bindings documentation # rust-synta-devel Rust crate sources — core ASN.1 library # rust-synta-doc Rust crate documentation # rust-synta-certificate-devel Rust crate sources — X.509 types # rust-synta-certificate-doc X.509 crate documentation # rust-synta-krb5-devel Rust crate sources — Kerberos V5 types # rust-synta-krb5-doc Kerberos V5 crate documentation # rust-synta-derive-devel Rust crate sources — derive proc-macros # rust-synta-derive-doc derive proc-macro crate documentation # rust-synta-codegen-devel Rust crate sources — ASN.1-to-Rust code generator # rust-synta-codegen-doc code generator crate documentation # rust-synta-mtc-devel Rust crate sources — Merkle Tree Certificates # rust-synta-mtc-doc Merkle Tree Certificates crate documentation # # Source preparation notes # ───────────────────────── # Source0 (main tarball): # git archive --prefix=synta-%%{version}/ v%%{version} \ # | gzip > synta-%%{version}.tar.gz # # Source1 (vendor tarball): # The packaging patch removes synta-bench and synta-fuzz from workspace # members (both are publish=false and pull git-only deps irrelevant to # installable packages) and removes [patch.crates-io] git entries (cargo # cannot route [patch] git sources through [source.*] replacement, causing # offline failures). # 'cargo vendor' stdout (git-source redirect stanzas) is saved alongside # the vendor directory as vendor-config.toml; %%prep appends it to # .cargo/config.toml so --locked builds can find git-sourced packages in # vendor/ via source replacement without any network access. # Use 'make sources' (or 'make vendor') to regenerate this tarball. # %global crate synta # Snapshot release identifiers. # 'make srpm' substitutes the real date (YYYYMMDD) and short commit hash here # before invoking rpmbuild so that the SRPM contains the expanded Release tag. # The placeholder values below are only used when the spec is processed without # going through the Makefile (e.g. rpmlint, manual rpmbuild invocations). # Release numbering: 1.YYYYMMDD.gitSHASH so that snapshot builds sort above # the formal 0.1.0-1 release (RPM compares the leading integer first). %global snapdate 202603221746 %global snapcommit c42d411 Name: %{crate} Version: 0.1.0 Release: 1.%{snapdate}.git%{snapcommit}%{?dist} Summary: Command-line tools for ASN.1 DER/PEM inspection and parsing License: MIT OR Apache-2.0 URL: https://codeberg.org/abbra/synta Source0: %{name}-%{version}.tar.gz Source1: %{name}-%{version}-vendor.tar.gz Patch0001: 0001-packaging-remove-synta-bench-from-workspace.patch # Rust build infrastructure BuildRequires: cargo-rpm-macros >= 25 # cargo-c provides `cargo cbuild` / `cargo cinstall` for the C FFI library BuildRequires: cargo-c # cbindgen generates include/synta.h from the Rust FFI source BuildRequires: cbindgen # Python extension (maturin / PyO3) BuildRequires: python3-devel BuildRequires: pyproject-rpm-macros BuildRequires: %{py3_dist maturin} >= 1.0 BuildRequires: %{py3_dist maturin} < 2.0 # pytest is declared in [dependency-groups] dev in pyproject.toml; # %%pyproject_buildrequires without -d does not emit it, so list it explicitly. BuildRequires: %{py3_dist pytest} >= 7 # OpenSSL development headers for the openssl and deprecated-pkcs12-algorithms # features in python3-synta (PKCS#12 decryption via openssl-sys). BuildRequires: openssl-devel %description Synta is a high-performance ASN.1 (Abstract Syntax Notation One) parser, decoder, and encoder library written in Rust. It supports zero-copy DER and BER decoding, full DER encoding, X.509 certificate/CRL/CSR/OCSP parsing (RFC 5280), PKCS#7 and PKCS#12 archive reading, Kerberos V5 and GSSAPI ASN.1 structures (RFC 4120), and Merkle Tree Certificates. This package provides: * synta-tool — inspect and parse ASN.1 DER and PEM files (similar to openssl asn1parse / openssl x509) * synta-codegen — generate Rust and C type definitions from ASN.1 module schemas # ────────────────────────────────────────────────────────────────────────────── # synta-doc — documentation, guides, and examples # ────────────────────────────────────────────────────────────────────────────── %package doc Summary: Documentation, guides, and examples for Synta License: MIT OR Apache-2.0 BuildArch: noarch %description doc Comprehensive documentation for the Synta ASN.1 library, including: * API reference and user guide * Tutorial and usage examples * ASN.1 support reference * Performance guide and benchmarks * Migration guides from libtasn1 and OpenSSL * no_std usage notes * Runnable Rust and Python examples # ────────────────────────────────────────────────────────────────────────────── # libcsynta — C FFI shared library # ────────────────────────────────────────────────────────────────────────────── %package -n libcsynta Summary: C FFI shared library for the Synta ASN.1 library License: MIT OR Apache-2.0 %description -n libcsynta The libcsynta shared library exposes the Synta ASN.1 parser, decoder, and encoder to C and C++ programs through a stable C ABI. # ────────────────────────────────────────────────────────────────────────────── # libcsynta-devel — C FFI development files # ────────────────────────────────────────────────────────────────────────────── %package -n libcsynta-devel Summary: Development files for libcsynta (Synta C FFI bindings) License: MIT OR Apache-2.0 Requires: libcsynta%{?_isa} = %{version}-%{release} Requires: pkgconfig %description -n libcsynta-devel Development header (synta.h) and pkg-config file for building C and C++ applications that use the Synta ASN.1 library through its C FFI interface. # ────────────────────────────────────────────────────────────────────────────── # libcsynta-static — C FFI static library # ────────────────────────────────────────────────────────────────────────────── %package -n libcsynta-static Summary: Static library for libcsynta (Synta C FFI bindings) License: MIT OR Apache-2.0 Requires: libcsynta-devel%{?_isa} = %{version}-%{release} %description -n libcsynta-static Static archive of the Synta C FFI library for building C and C++ applications that link libcsynta statically. # ────────────────────────────────────────────────────────────────────────────── # libcsynta-doc — C FFI documentation and C examples # ────────────────────────────────────────────────────────────────────────────── %package -n libcsynta-doc Summary: Documentation and C examples for libcsynta License: MIT OR Apache-2.0 BuildArch: noarch %description -n libcsynta-doc Documentation and C example programs for the libcsynta C FFI library, including the C API reference, memory management guide, code generation guide, and complete buildable C example programs. # ────────────────────────────────────────────────────────────────────────────── # python3-synta — Python bindings # ────────────────────────────────────────────────────────────────────────────── %package -n python3-%{crate} Summary: Python bindings for the Synta ASN.1 library License: MIT OR Apache-2.0 %{?python_provide:%python_provide python3-%{crate}} %description -n python3-%{crate} Python bindings for the Synta high-performance ASN.1 parser and encoder, providing a Python API for DER/BER decoding, DER encoding, X.509 certificate and PKI structure parsing, PKCS#7/PKCS#12 archive reading, and Kerberos V5 ASN.1 structure handling. The extension module is built with PyO3 against the stable Python ABI (abi3) and is compatible with Python 3.8 and later. # ────────────────────────────────────────────────────────────────────────────── # python3-synta-doc — Python bindings documentation # ────────────────────────────────────────────────────────────────────────────── %package -n python3-%{crate}-doc Summary: Documentation for the python3-synta Python bindings License: MIT OR Apache-2.0 BuildArch: noarch %description -n python3-%{crate}-doc User guide and reference documentation for the python3-synta Python bindings, including the Python API overview, bindings reference, and integration guide. # ────────────────────────────────────────────────────────────────────────────── # rust-synta-devel — Rust crate sources: core ASN.1 library # ────────────────────────────────────────────────────────────────────────────── %package -n rust-%{crate}-devel Summary: Rust crate sources for synta (core ASN.1 parser/encoder library) License: MIT OR Apache-2.0 BuildArch: noarch Provides: crate(synta) = %{version} Provides: crate(synta/alloc) = %{version} Provides: crate(synta/default) = %{version} Provides: crate(synta/derive) = %{version} Provides: crate(synta/serde) = %{version} Provides: crate(synta/std) = %{version} Provides: crate(synta/unchecked) = %{version} # Internal workspace members that do not have independent Fedora packages. # Add separate review requests if they are needed independently. Provides: bundled(crate(synta-bench)) = %{version} Provides: bundled(crate(synta-tools)) = %{version} %description -n rust-%{crate}-devel Rust crate sources for the core synta ASN.1 library, installed into the system Cargo registry so that other Rust packages can use it as a build-time dependency. Provides zero-copy DER/BER decoding and full DER encoding with optional derive-macro support. # ────────────────────────────────────────────────────────────────────────────── # rust-synta-doc — Rust crate documentation: core ASN.1 library # ────────────────────────────────────────────────────────────────────────────── %package -n rust-%{crate}-doc Summary: Documentation for the synta Rust crate License: MIT OR Apache-2.0 BuildArch: noarch %description -n rust-%{crate}-doc README and documentation for the synta core Rust crate. # ────────────────────────────────────────────────────────────────────────────── # rust-synta-certificate-devel — Rust crate sources: X.509 types # ────────────────────────────────────────────────────────────────────────────── %package -n rust-synta-certificate-devel Summary: Rust crate sources for synta-certificate (X.509 ASN.1 types) License: MIT OR Apache-2.0 BuildArch: noarch Provides: crate(synta-certificate) = %{version} Provides: crate(synta-certificate/alloc) = %{version} Provides: crate(synta-certificate/default) = %{version} Provides: crate(synta-certificate/deprecated-pkcs12-algorithms) = %{version} Provides: crate(synta-certificate/derive) = %{version} Provides: crate(synta-certificate/openssl) = %{version} Provides: crate(synta-certificate/serde) = %{version} Provides: crate(synta-certificate/std) = %{version} # The python feature requires pyo3 and is covered by the python3-synta binary # package. The openssl and deprecated-pkcs12-algorithms features require # openssl-sys (a C library) and are enabled in the python3-synta binary package; # downstream users of the crate sources will need openssl-devel at build time. Requires: rust-%{crate}-devel = %{version}-%{release} %description -n rust-synta-certificate-devel Rust crate sources for synta-certificate, which provides X.509 certificate, CRL, CSR, and OCSP response ASN.1 type definitions built on top of the synta core library. # ────────────────────────────────────────────────────────────────────────────── # rust-synta-certificate-doc — Rust crate documentation: X.509 types # ────────────────────────────────────────────────────────────────────────────── %package -n rust-synta-certificate-doc Summary: Documentation for the synta-certificate Rust crate License: MIT OR Apache-2.0 BuildArch: noarch %description -n rust-synta-certificate-doc README and documentation for the synta-certificate Rust crate. # ────────────────────────────────────────────────────────────────────────────── # rust-synta-krb5-devel — Rust crate sources: Kerberos V5 types # ────────────────────────────────────────────────────────────────────────────── %package -n rust-synta-krb5-devel Summary: Rust crate sources for synta-krb5 (Kerberos V5 ASN.1 types) License: MIT OR Apache-2.0 BuildArch: noarch Provides: crate(synta-krb5) = %{version} Provides: crate(synta-krb5/alloc) = %{version} Provides: crate(synta-krb5/default) = %{version} Provides: crate(synta-krb5/derive) = %{version} Provides: crate(synta-krb5/serde) = %{version} Provides: crate(synta-krb5/std) = %{version} Requires: rust-%{crate}-devel = %{version}-%{release} Requires: rust-synta-certificate-devel = %{version}-%{release} %description -n rust-synta-krb5-devel Rust crate sources for synta-krb5, which provides Kerberos V5 (RFC 4120) and GSSAPI ASN.1 structure types built on top of the synta core library. # ────────────────────────────────────────────────────────────────────────────── # rust-synta-krb5-doc — Rust crate documentation: Kerberos V5 types # ────────────────────────────────────────────────────────────────────────────── %package -n rust-synta-krb5-doc Summary: Documentation for the synta-krb5 Rust crate License: MIT OR Apache-2.0 BuildArch: noarch %description -n rust-synta-krb5-doc README and documentation for the synta-krb5 Rust crate. # ────────────────────────────────────────────────────────────────────────────── # rust-synta-derive-devel — Rust proc-macro crate sources # ────────────────────────────────────────────────────────────────────────────── %package -n rust-synta-derive-devel Summary: Rust crate sources for synta-derive (ASN.1 derive macros) License: MIT OR Apache-2.0 BuildArch: noarch Provides: crate(synta-derive) = %{version} %description -n rust-synta-derive-devel Rust crate sources for synta-derive, a procedural-macro crate that provides #[derive(Decode, Encode)] for automatically implementing the Synta ASN.1 codec traits on user-defined Rust types. # ────────────────────────────────────────────────────────────────────────────── # rust-synta-derive-doc — Rust crate documentation: derive proc-macros # ────────────────────────────────────────────────────────────────────────────── %package -n rust-synta-derive-doc Summary: Documentation for the synta-derive Rust crate License: MIT OR Apache-2.0 BuildArch: noarch %description -n rust-synta-derive-doc README and documentation for the synta-derive Rust crate. # ────────────────────────────────────────────────────────────────────────────── # rust-synta-codegen-devel — Rust crate sources: ASN.1-to-Rust code generator # ────────────────────────────────────────────────────────────────────────────── %package -n rust-synta-codegen-devel Summary: Rust crate sources for synta-codegen (ASN.1 Rust code generator) License: MIT OR Apache-2.0 BuildArch: noarch Provides: crate(synta-codegen) = %{version} %description -n rust-synta-codegen-devel Rust crate sources for the synta-codegen library and binary, which parse ASN.1 module schema files and emit Rust struct/enum type definitions that implement the synta Decode and Encode traits. # ────────────────────────────────────────────────────────────────────────────── # rust-synta-codegen-doc — Rust crate documentation: ASN.1-to-Rust code generator # ────────────────────────────────────────────────────────────────────────────── %package -n rust-synta-codegen-doc Summary: Documentation for the synta-codegen Rust crate License: MIT OR Apache-2.0 BuildArch: noarch %description -n rust-synta-codegen-doc README and documentation for the synta-codegen Rust crate. # ────────────────────────────────────────────────────────────────────────────── # rust-synta-mtc-devel — Rust crate sources: Merkle Tree Certificates # ────────────────────────────────────────────────────────────────────────────── %package -n rust-synta-mtc-devel Summary: Rust crate sources for synta-mtc (Merkle Tree Certificates) License: MIT OR Apache-2.0 BuildArch: noarch Provides: crate(synta-mtc) = %{version} Provides: crate(synta-mtc/default) = %{version} Provides: crate(synta-mtc/derive) = %{version} Provides: crate(synta-mtc/serde) = %{version} Provides: crate(synta-mtc/std) = %{version} Requires: rust-%{crate}-devel = %{version}-%{release} Requires: rust-synta-certificate-devel = %{version}-%{release} %description -n rust-synta-mtc-devel Rust crate sources for synta-mtc, which implements the Merkle Tree Certificates (MTC) draft specification on top of the synta ASN.1 library. # ────────────────────────────────────────────────────────────────────────────── # rust-synta-mtc-doc — Rust crate documentation: Merkle Tree Certificates # ────────────────────────────────────────────────────────────────────────────── %package -n rust-synta-mtc-doc Summary: Documentation and examples for the synta-mtc Rust crate License: MIT OR Apache-2.0 BuildArch: noarch %description -n rust-synta-mtc-doc README, serde integration guide, performance and security documentation, and example programs for the synta-mtc Merkle Tree Certificates Rust crate. # ══════════════════════════════════════════════════════════════════════════════ # PREP # ══════════════════════════════════════════════════════════════════════════════ %prep %autosetup -n %{name}-%{version} -p1 # Extract the vendor tarball into the source tree. # The tarball contains vendor/, vendor-config.toml, AND the Cargo.lock that # cargo vendor regenerated after synta-bench was removed from the workspace. # Extracting it here gives the build root a lock file that is exactly # consistent with the vendored crates (same resolved versions, same sources). # %%cargo_prep -v DIR writes "directory = DIR" verbatim into .cargo/config.toml; # it does not unpack a tarball itself, so the extraction must happen first. tar xf %{SOURCE1} # Write .cargo/config.toml pointing all crate lookups at vendor/ so that every # subsequent cargo invocation (%%cargo_build, cargo cbuild, maturin) stays # fully offline inside the build root. %cargo_prep -v vendor # %%cargo_prep -v vendor only writes the crates-io → vendored-sources redirect. # The packaging patch removes [patch.crates-io] from Cargo.toml because cargo # does not route [patch] git sources through [source.*] replacement — it would # try to fetch the git URL even with --offline, breaking every offline cargo # invocation including maturin's `cargo metadata` call. # # The vendor tarball's Cargo.lock may still reference git-sourced packages # (e.g. openssl from the pqc-prs branch) that were resolved when the tarball # was built. 'cargo vendor' emits [source."git+..."] → vendored-sources stanzas # in its stdout; the Makefile saves these as vendor-config.toml. Appending the # git-source sections here lets --locked builds find those packages in vendor/ # via source replacement without any network access. If vendor-config.toml # contains no git sections (e.g. after a rebuild without git-patched deps) this # awk call is a no-op. crates-io/vendored-sources stanzas are already present # from %%cargo_prep, so only git sections are extracted to avoid TOML duplicates. awk '/^\[source\."git\+/{s=1; print; next} /^\[/{s=0} s{print} /^[[:space:]]*$/{s=0}' \ vendor-config.toml >> .cargo/config.toml || : # The vendor tarball contains all crates needed by the workspace. Re-link # any crates that are already installed as system packages from the system # Cargo registry into vendor/ so that %cargo_prep -v vendor can also find # them. Any crate directory already present in vendor/ is left untouched. for dir in %{cargo_registry}/*/; do [[ -d "$dir" ]] || continue crate="${dir##%{cargo_registry}/}"; crate="${crate%/}" [[ -e "vendor/$crate" ]] || ln -s "$dir" "vendor/$crate" done # ══════════════════════════════════════════════════════════════════════════════ # GENERATE BUILD REQUIREMENTS # ══════════════════════════════════════════════════════════════════════════════ %generate_buildrequires %cargo_generate_buildrequires %pyproject_buildrequires # ══════════════════════════════════════════════════════════════════════════════ # BUILD # ══════════════════════════════════════════════════════════════════════════════ %build # ── 1. CLI tools ───────────────────────────────────────────────────────────── # Builds synta-tool and synta-codegen with Fedora's release profile flags. %{cargo_build} -p synta-tools -p synta-codegen # ── 2. C FFI shared library ─────────────────────────────────────────────────── # cargo cbuild and cargo cinstall are provided by the cargo-c package. # The --features capi flag activates the capi feature gate in synta-ffi that # exposes the #[no_mangle] extern "C" symbols. # CARGO_HOME and .cargo/config.toml are already set up by %%cargo_prep above, # so cargo cbuild uses the same vendored source tree as %%cargo_build. cargo cbuild \ --release \ --locked \ --features capi \ --manifest-path synta-ffi/Cargo.toml \ --prefix %{_prefix} \ --libdir %{_libdir} \ --includedir %{_includedir} # ── 3. Python extension (maturin) ───────────────────────────────────────────── # %%pyproject_wheel calls `maturin build --release` via the maturin backend # declared in pyproject.toml. maturin respects CARGO_HOME / .cargo/config.toml # set up by %%cargo_prep, so it uses the same vendor directory. %pyproject_wheel # ── 4. Rust API documentation ───────────────────────────────────────────────── # Generate rustdoc HTML for all published crates. --no-deps limits output to # the workspace crates only (not their transitive dependencies). Uses the same # CARGO_HOME / RUSTFLAGS / vendored-sources environment as %%cargo_build. %{__cargo} doc \ --no-deps \ --offline \ --locked \ -p synta \ -p synta-certificate \ -p synta-krb5 \ -p synta-derive \ -p synta-codegen \ -p synta-mtc # ══════════════════════════════════════════════════════════════════════════════ # INSTALL # ══════════════════════════════════════════════════════════════════════════════ %install # ── 1. CLI tools ───────────────────────────────────────────────────────────── # The binaries were already compiled by %%cargo_build into target/rpm/. # %%cargo_install re-runs cargo-install without --locked, which may attempt # dependency re-resolution offline. Install the pre-built executables directly. install -Dpm 755 target/rpm/synta-tool %{buildroot}%{_bindir}/synta-tool install -Dpm 755 target/rpm/synta-codegen %{buildroot}%{_bindir}/synta-codegen # ── 2. C FFI shared library and header ─────────────────────────────────────── cargo cinstall \ --release \ --locked \ --features capi \ --manifest-path synta-ffi/Cargo.toml \ --prefix %{_prefix} \ --libdir %{_libdir} \ --includedir %{_includedir} \ --destdir %{buildroot} # ── 3. Python extension ─────────────────────────────────────────────────────── # Install the wheel built by %%pyproject_wheel into the build root. %pyproject_install # ── 4. Rust crate sources → Cargo registry ─────────────────────────────────── # %%cargo_install_crate cannot be used here: cargo2rpm's Metadata.is_lib() # explicitly returns False when cargo metadata --no-deps returns more than one # package. cargo always returns all workspace members regardless of which # --manifest-path is given, so is-lib returns 0 for every crate in a # multi-member workspace. Install all registry entries manually: # 1. Create %%{cargo_registry}/NAME-VERSION/ # 2. Copy Cargo.toml with [*dependencies] and [features] stripped # (the same awk transform %%cargo_install applies before cargo package -l) # 3. Copy source files # 4. Write the .cargo-checksum.json sentinel # 4a. Workspace root (synta): copy only the library source files. # The workspace root also contains all sub-crate directories, vendor/, # .cargo/, python/, contrib/, etc. — those must not be copied here. %{__mkdir} -p %{buildroot}%{cargo_registry}/%{crate}-%{version} awk '/^\[((.+\.)?((dev|build)-)?dependencies|features|workspace|patch)/{f=1;next} /^\[/{f=0}; !f' \ Cargo.toml > %{buildroot}%{cargo_registry}/%{crate}-%{version}/Cargo.toml cp -a src/ build.rs %{buildroot}%{cargo_registry}/%{crate}-%{version}/ echo '{"files":{},"package":""}' > %{buildroot}%{cargo_registry}/%{crate}-%{version}/.cargo-checksum.json # 4b. Workspace member crates: each sub-directory is self-contained. # Copy all top-level entries except build artifacts and Cargo.toml # (installed above in stripped form). for crate_dir in synta-certificate synta-krb5 synta-derive synta-codegen synta-mtc; do crate_name=$(awk '/^name[[:space:]]*=/{gsub(/"/, "", $3); print $3; exit}' \ "$crate_dir/Cargo.toml") reg_dir=%{buildroot}%{cargo_registry}/${crate_name}-%{version} %{__mkdir} -p "$reg_dir" awk '/^\[((.+\.)?((dev|build)-)?dependencies|features|workspace|patch)/{f=1;next} /^\[/{f=0}; !f' \ "$crate_dir/Cargo.toml" > "$reg_dir/Cargo.toml" find "$crate_dir" -mindepth 1 -maxdepth 1 \ ! -name 'target' ! -name '.git' ! -name 'Cargo.lock' \ ! -name 'Cargo.toml.orig' ! -name 'Cargo.toml' \ -exec cp -a {} "$reg_dir/" \; echo '{"files":{},"package":""}' > "$reg_dir/.cargo-checksum.json" done # ── 5. Rust API documentation ───────────────────────────────────────────────── # Install the rustdoc HTML tree generated in %%build step 4. All crate docs # cross-link each other and share a common static.files/ asset directory, so # the complete target/doc/ tree is installed as one unit under rust-synta-doc. install -d %{buildroot}%{_docdir}/rust-%{crate}-doc/html cp -a target/doc/. %{buildroot}%{_docdir}/rust-%{crate}-doc/html/ # ── 6. Split documentation by audience ─────────────────────────────────────── # synta-doc receives the general docs/ (excluding Python-specific files) and # the Rust/ASN.1 examples (excluding Python scripts). install -d %{buildroot}%{_docdir}/%{crate}-doc/docs \ %{buildroot}%{_docdir}/%{crate}-doc/examples find docs/ -maxdepth 1 -name '*.md' \ ! -name 'PYTHON_BINDINGS.md' ! -name 'python-bindings-guide.md' \ -exec install -pm 644 {} %{buildroot}%{_docdir}/%{crate}-doc/docs/ \; find examples/ -maxdepth 1 -type f ! -name '*.py' \ -exec install -pm 644 {} %{buildroot}%{_docdir}/%{crate}-doc/examples/ \; install -pm 644 synta-tools/QUICKSTART.md %{buildroot}%{_docdir}/%{crate}-doc/ # python3-synta-doc receives the Python example scripts and the two # Python-specific documentation files from docs/. install -d %{buildroot}%{_docdir}/python3-%{crate}-doc/examples install -pm 644 examples/*.py %{buildroot}%{_docdir}/python3-%{crate}-doc/examples/ install -pm 644 \ docs/PYTHON_BINDINGS.md \ docs/python-bindings-guide.md \ %{buildroot}%{_docdir}/python3-%{crate}-doc/ # ══════════════════════════════════════════════════════════════════════════════ # CHECK # ══════════════════════════════════════════════════════════════════════════════ %check # Run the Rust unit tests for the published crates. # %%cargo_test(naf:) parses its own short flags with RPM getopts, so -p is # rejected as an unknown macro flag. The -- terminator stops macro option # parsing; everything after it lands in %* and is appended verbatim to the # cargo test invocation. --lib is a cargo flag (filter to library unit tests # only) and must appear before any second -- separator. # synta-bench is excluded (no unit tests, benchmark targets only). # synta-ffi is excluded (tested indirectly via the C integration test suite). %cargo_test -- -p synta -p synta-certificate -p synta-krb5 -p synta-mtc --lib # Run the Python test suite against the freshly installed extension. %pytest tests/ # ══════════════════════════════════════════════════════════════════════════════ # FILES # ══════════════════════════════════════════════════════════════════════════════ # ── synta (main package: CLI tools) ────────────────────────────────────────── %files %license LICENSE-MIT LICENSE-APACHE %{_bindir}/synta-tool %{_bindir}/synta-codegen # ── synta-doc ───────────────────────────────────────────────────────────────── %files doc %license LICENSE-MIT LICENSE-APACHE %doc README.md %{_docdir}/%{crate}-doc/docs/ %{_docdir}/%{crate}-doc/examples/ %{_docdir}/%{crate}-doc/QUICKSTART.md # ── libcsynta ──────────────────────────────────────────────────────────────── %files -n libcsynta %license LICENSE-MIT LICENSE-APACHE # The library soname is libcsynta.so.0 (version_suffix_components = 1 in # Cargo.toml means only the major version component is used). %{_libdir}/libcsynta.so.0* # ── libcsynta-devel ─────────────────────────────────────────────────────────── %files -n libcsynta-devel %license LICENSE-MIT LICENSE-APACHE %{_includedir}/synta.h %{_libdir}/libcsynta.so %{_libdir}/pkgconfig/csynta.pc # ── libcsynta-static ────────────────────────────────────────────────────────── %files -n libcsynta-static %license LICENSE-MIT LICENSE-APACHE %{_libdir}/libcsynta.a # ── libcsynta-doc ───────────────────────────────────────────────────────────── %files -n libcsynta-doc %license LICENSE-MIT LICENSE-APACHE %doc synta-ffi/README.md %doc synta-ffi/examples/ # ── python3-synta ───────────────────────────────────────────────────────────── %files -n python3-%{crate} %license LICENSE-MIT LICENSE-APACHE # The synta Python package directory (contains __init__.py, _synta.abi3.so, # krb5.py, cms.py, oids submodule, py.typed, etc.). %{python3_sitearch}/synta/ %{python3_sitearch}/synta-%{version}.dist-info/ # ── python3-synta-doc ───────────────────────────────────────────────────────── %files -n python3-%{crate}-doc %license LICENSE-MIT LICENSE-APACHE %doc python/README.md %{_docdir}/python3-%{crate}-doc/PYTHON_BINDINGS.md %{_docdir}/python3-%{crate}-doc/python-bindings-guide.md %{_docdir}/python3-%{crate}-doc/examples/ # ── rust-synta-devel ────────────────────────────────────────────────────────── %files -n rust-%{crate}-devel %license LICENSE-MIT LICENSE-APACHE %{cargo_registry}/%{crate}-%{version}/ # ── rust-synta-doc ──────────────────────────────────────────────────────────── %files -n rust-%{crate}-doc %license LICENSE-MIT LICENSE-APACHE %doc README.md %{_docdir}/rust-%{crate}-doc/html/ # ── rust-synta-certificate-devel ────────────────────────────────────────────── %files -n rust-synta-certificate-devel %license LICENSE-MIT LICENSE-APACHE %{cargo_registry}/synta-certificate-%{version}/ # ── rust-synta-certificate-doc ──────────────────────────────────────────────── %files -n rust-synta-certificate-doc %license LICENSE-MIT LICENSE-APACHE %doc synta-certificate/README.md # ── rust-synta-krb5-devel ───────────────────────────────────────────────────── %files -n rust-synta-krb5-devel %license LICENSE-MIT LICENSE-APACHE %{cargo_registry}/synta-krb5-%{version}/ # ── rust-synta-krb5-doc ─────────────────────────────────────────────────────── %files -n rust-synta-krb5-doc %license LICENSE-MIT LICENSE-APACHE %doc synta-krb5/README.md # ── rust-synta-derive-devel ─────────────────────────────────────────────────── %files -n rust-synta-derive-devel %license LICENSE-MIT LICENSE-APACHE %{cargo_registry}/synta-derive-%{version}/ # ── rust-synta-derive-doc ───────────────────────────────────────────────────── %files -n rust-synta-derive-doc %license LICENSE-MIT LICENSE-APACHE %doc synta-derive/README.md # ── rust-synta-codegen-devel ────────────────────────────────────────────────── %files -n rust-synta-codegen-devel %license LICENSE-MIT LICENSE-APACHE %{cargo_registry}/synta-codegen-%{version}/ # ── rust-synta-codegen-doc ──────────────────────────────────────────────────── %files -n rust-synta-codegen-doc %license LICENSE-MIT LICENSE-APACHE %doc synta-codegen/README.md # ── rust-synta-mtc-devel ────────────────────────────────────────────────────── %files -n rust-synta-mtc-devel %license LICENSE-MIT LICENSE-APACHE %{cargo_registry}/synta-mtc-%{version}/ # ── rust-synta-mtc-doc ──────────────────────────────────────────────────────── %files -n rust-synta-mtc-doc %license LICENSE-MIT LICENSE-APACHE %doc synta-mtc/README.md %doc synta-mtc/SERDE.md %doc synta-mtc/docs/ %doc synta-mtc/examples/ # ══════════════════════════════════════════════════════════════════════════════ # CHANGELOG # ══════════════════════════════════════════════════════════════════════════════ %changelog * Sun Mar 22 2026 Synta Contributors - 0.1.0-2 - synta-python: pem_to_der() always returns list[bytes]; raises ValueError for empty input (was bytes|list[bytes]) - synta-python: GeneralString.from_ascii() replaces from_latin1() (enforces U+007F ASCII limit rather than Latin-1) - synta-python: RawElement.data is now a property (was a method) - synta-python: Integer, Boolean, Null are now hashable; Real.__hash__ is Python-compatible (hash(1.0)==hash(1)) - synta-python: propagate lazy-decode errors as PyResult instead of panicking; fix pkinit integer range errors to raise OverflowError - synta-certificate: AIA URI UTF-8 errors are now surfaced instead of silently substituted - synta-mtc: emit compile_error! when validate_tbs_matches_entry is used without the derive feature * Wed Mar 11 2026 Synta Contributors - 0.1.0-1 - Initial Fedora package