diff --git a/anda/langs/python/magika/anda.hcl b/anda/langs/python/magika/anda.hcl new file mode 100644 index 0000000000..23786b6973 --- /dev/null +++ b/anda/langs/python/magika/anda.hcl @@ -0,0 +1,5 @@ +project pkg { + rpm { + spec = "magika.spec" + } +} diff --git a/anda/langs/python/magika/magika.spec b/anda/langs/python/magika/magika.spec new file mode 100644 index 0000000000..c3ba75a795 --- /dev/null +++ b/anda/langs/python/magika/magika.spec @@ -0,0 +1,59 @@ +%global pypi_name magika +%global _desc A tool to determine the content type of a file with deep learning. + +%undefine __brp_mangle_shebangs %{python3_sitelib}/magika/cli/ + +Name: python-%{pypi_name} +Version: 1.1.0 +Release: 1%{?dist} +Summary: A tool to determine the content type of a file with deep learning +License: Apache-2.0 +URL: https://securityresearch.google/magika/introduction/overview +Source0: https://github.com/google/magika/archive/refs/tags/cli/v%{version}.tar.gz + +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +BuildRequires: python3-hatchling +BuildRequires: maturin +BuildRequires: pkgconfig(openssl) +BuildRequires: gcc-c++ +BuildRequires: libstdc++-devel + +Packager: Owen Zimmerman + +%description +%_desc + +%package -n python3-%{pypi_name} +Summary: %{summary} +%{?python_provide:%python_provide python3-%{pypi_name}} + +%description -n python3-%{pypi_name} +%_desc + +%prep +%autosetup -n %{pypi_name}-cli-v%{version} + +%pyproject_patch_dependency onnxruntime:drop_constraints + +%build +pushd python +%pyproject_wheel +popd + +%install +pushd python +%pyproject_install +%pyproject_save_files %{pypi_name} +popd + +%files -n python3-%{pypi_name} -f %{pyproject_files} +%doc README.md +%doc python/README.md +%license LICENSE +%{_bindir}/magika + +%changelog +* Mon Jun 29 2026 Owen Zimmerman +- Initial commit diff --git a/anda/langs/python/magika/update.rhai b/anda/langs/python/magika/update.rhai new file mode 100644 index 0000000000..76d9a735f3 --- /dev/null +++ b/anda/langs/python/magika/update.rhai @@ -0,0 +1 @@ +rpm.version(gh("google/magika"));