%global baserelease 1 Summary: Programming language for maintaining robust, optimal, and reusable software Name: zig Version: 0.7.1 Release: %{baserelease} License: MIT and NCSA and LGPLv2+ and LGPLv2+ with exceptions and GPLv2+ and GPLv2+ with exceptions and BSD and Inner-Net and ISC and Public Domain and GFDL and ZPLv2.1 Group: Development/Languages URL: https://github.com/ziglang/zig Source: https://github.com/ziglang/zig/archive/%{version}.tar.gz BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: cmake BuildRequires: llvm-devel BuildRequires: clang-devel BuildRequires: lld-devel # for documentation generation BuildRequires: help2man # for testing BuildRequires: elfutils-libelf-devel BuildRequires: libstdc++-static Requires: %{name}-libs = %{version} # These packages are bundled as source # NCSA Provides: bundled(compiler-rt) = 11.0.0 # LGPLv2+, LGPLv2+ with exceptions, GPLv2+, GPLv2+ with exceptions, BSD, Inner-Net, ISC, Public Domain and GFDL Provides: bundled(glibc) = 2.31 # NCSA Provides: bundled(libcxx) = 11.0.0 # NCSA Provides: bundled(libcxxabi) = 11.0.0 # NCSA Provides: bundled(libunwind) = 11.0.0 # BSD, LGPG, ZPL Provides: bundled(mingw) = 8.0.0 # MIT Provides: bundled(musl) = 1.2.1 # lld not available on that arch ExcludeArch: s390x # Not supported upstream, see https://github.com/ziglang/zig/issues/7686 ExcludeArch: ppc64le %{arm} %ix86 %description Zig is an open-source programming language designed for robustness, optimality, and clarity. This package provides the zig compiler and the associated runtime. %package libs Summary: zig standard library BuildArch: noarch %description libs Standard Zig library %package doc Summary: Documentation for %{name} BuildArch: noarch Requires: %{name} = %{version} %description doc Documentation for %{name}. For more information, visit %{url} %prep %autosetup -n zig-%{version} -p1 %build %cmake \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DZIG_PREFER_CLANG_CPP_DYLIB=ON \ -DZIG_VERSION:STRING="%{version}" %cmake_build # generate standard library documentation %{__cmake_builddir}/zig build-exe doc/docgen.zig ./docgen %{__cmake_builddir}/zig doc/langref.html.in langref.html # Zig has no official manpage, see https://github.com/ziglang/zig/issues/715 help2man --no-discard-stderr "%{__cmake_builddir}/zig" --version-option=version --output=%{name}.1 %install %cmake_install mkdir -p %{buildroot}/%{_mandir}/man1 install -m 0644 %{name}.1 %{buildroot}%{_mandir}/man1/ mkdir -p %{buildroot}/%{_pkgdocdir} install -m 0644 langref.html %{buildroot}%{_pkgdocdir}/ %check %{_vpath_builddir}/zig build test %files %license LICENSE %{_bindir}/%{name} %{_mandir}/man1/%{name}.1.gz %files libs %{_prefix}/lib/%{name} %files doc %doc README.md %doc %{_pkgdocdir}/langref.html %changelog * Tue Jan 5 2021 sguelton@redhat.com - 0.7.1-1 - Rebuild for Fedora # Inspired by an original version from https://pagure.io/zig-spec/blob/fedora/f/zig.spec # by Jan Drögehoff