Name: cangjie-lts-compiler Version: 1.0.7 Release: 1%{?dist} Summary: Cangjie program language compiler (LTS Channel) Packager: OpenCJ License: APSL-2.0 URL: https://cangjie-lang.cn Source0: https://github.com/cangjielanguage/cangjie_compiler/archive/refs/tags/v%{version}.tar.gz BuildRequires: tar BuildRequires: unzip BuildRequires: wget BuildRequires: curl BuildRequires: libcurl BuildRequires: expat BuildRequires: openssl BuildRequires: make BuildRequires: gcc > 7.3.0 BuildRequires: gcc-c++ BuildRequires: gettext BuildRequires: nfs-utils BuildRequires: libtool BuildRequires: sqlite BuildRequires: zlib-devel BuildRequires: openssl-devel BuildRequires: cmake > 3.16.5 BuildRequires: ninja-build > 1.10 BuildRequires: libcurl-devel BuildRequires: autoconf BuildRequires: rapidjson-devel BuildRequires: texinfo BuildRequires: binutils > 2.38 BuildRequires: expat-devel BuildRequires: elfutils-libelf-devel BuildRequires: libdwarf-devel BuildRequires: openssh-clients BuildRequires: dos2unix BuildRequires: libXext-devel BuildRequires: libXtst-devel BuildRequires: libXt-devel BuildRequires: cups-devel BuildRequires: clang BuildRequires: clang-tools-extra BuildRequires: libedit-devel BuildRequires: libXrender-devel BuildRequires: zip BuildRequires: bzip2 BuildRequires: openmpi-devel BuildRequires: vim BuildRequires: gdb BuildRequires: lldb BuildRequires: clang-devel BuildRequires: gtest-devel BuildRequires: rpm BuildRequires: patch BuildRequires: cpio BuildRequires: ncurses-compat-libs BuildRequires: ncurses-devel BuildRequires: strace BuildRequires: net-tools BuildRequires: python3 > 3.7 BuildRequires: clang15-devel BuildRequires: clang15 BuildRequires: git Requires: binutils > 2.38 Requires: glibc-devel Requires: libstdc++-devel Requires: gcc > 7.3.0 %description Cangjie is a modern programming language developed by Huawei. This package provides the Cangjie compiler (cjc), debugger (cjdb), and core development tools for building Cangjie applications on Linux systems. The compiler supports native Linux compilation with LLVM backend and includes full debugging capabilities through cjdb/lldb integration. %global debug_package %{nil} %prep %autosetup -n cangjie_compiler-%{version} %build # Setup build environment export PATH=/usr/lib/llvm-15/bin:$PATH export OPENSSL_PATH=%{_libdir} export CANGJIE_VERSION=%{version} # Determine architecture %ifarch x86_64 export ARCH=x86_64 export SDK_NAME=linux-x64 %endif %ifarch aarch64 export ARCH=aarch64 export SDK_NAME=linux-aarch64 %endif # Build compiler and debugger python3 build.py clean python3 build.py build -t release --no-test --build-cjdb %install # Run compiler installation to output directory python3 build.py install # Create installation directories mkdir -p %{buildroot}/opt/cangjie-lts mkdir -p %{buildroot}%{_bindir} mkdir -p %{buildroot}/etc/profile.d cp -r output/* %{buildroot}/opt/cangjie-lts/ # Create symlinks in /usr/bin for common commands ln -sf ../../opt/cangjie-lts/bin/cjc %{buildroot}%{_bindir}/cjc ln -sf ../../opt/cangjie-lts/bin/cjdb %{buildroot}%{_bindir}/cjdb # Create environment setup script in /etc/profile.d # cat > %{buildroot}/etc/profile.d/cangjie-lts.sh << 'EOF' # # Cangjie LTS environment setup # export CANGJIE_HOME=/opt/cangjie-lts # export PATH=$CANGJIE_HOME/bin:$PATH # export LD_LIBRARY_PATH=$CANGJIE_HOME/lib:$LD_LIBRARY_PATH # EOF %files # Main Cangjie installation directory /opt/cangjie-lts/bin/ /opt/cangjie-lts/lib/ /opt/cangjie-lts/third_party/ %dir /opt/cangjie-lts/modules/ # Symlinks in /usr/bin %{_bindir}/cjc %{_bindir}/cjdb # Environment setup script # /etc/profile.d/cangjie-lts.sh # Subpackage for compiler headers %package -n cangjie-lts-compiler-include Summary: Cangjie compiler development headers Requires: cangjie-lts-compiler = %{version} %description -n cangjie-lts-compiler-include This package contains the development headers for the Cangjie compiler. It is required for building Cangjie programs that integrate with the compiler. %files -n cangjie-lts-compiler-include # Compiler headers /opt/cangjie-lts/include/ %post echo "================================================================" echo "Cangjie LTS Compiler %{version} has been installed successfully!" echo "" echo "To use Cangjie compiler, please either:" echo " 1. Logout and login again to load the environment, or" echo " 2. Run: source /etc/profile.d/cangjie-lts.sh" echo "" echo "Then verify the installation with: cjc -v" echo "================================================================" %postun if [ $1 -eq 0 ]; then # This is a complete uninstall echo "Cangjie LTS Compiler has been removed from your system." fi %changelog * Thu Nov 28 2025 yms - Added cangjie-lts-compiler-include subpackage for development headers - Moved include directory to separate package for modular installation * Thu Nov 27 2025 yms - Initial RPM package for Cangjie LTS Compiler version 1.0.7 - Include cjc compiler and cjdb debugger - Setup environment configuration in /etc/profile.d - Create convenient symlinks in /usr/bin