File codelite.spec of Package CodeLite

#
# spec file for package codelite
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2012-2019 Mariusz Fik <fisiu@opensuse.org>.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#

# Only available on x86_64 and %%arm (see lldb package)
  %ifarch %{arm} x86_64
    %bcond_without lldb
  %endif
# Not available on ppc
  %ifnarch ppc
    %bcond_without clang
  %endif
Name:           codelite
Version:        0
Release:        0
Summary:        Code editor for C, C++, PHP and Node.js
# parts of package contain LGPL-3.0 licenced code thus license needs to be GPL-3.0
License:        GPL-3.0-only
Group:          Development/Tools/IDE
URL:            http://codelite.org/
Source0:        %{name}-%{version}.tar.xz
# Template files are identified by RPMLint as Development-Files --> Ignore this errors
Source1:        %{name}-rpmlintrc
Patch0:         0000-libdir.patch
Patch1:         0001-disable-ccache.patch
Patch2:         0002-shebang.patch
Patch5:         0005-use-system-libyaml.patch
Patch6:         0006-use-system-libcjson.patch
Patch10:        0010-remove-bundled-software.patch
Patch12:        0012-remove-bundled-unittest++.patch
Patch20:        0020-disable-version-check-on-startup.patch
BuildRequires:  bison
BuildRequires:  cmake
BuildRequires:  ctags
BuildRequires:  fdupes
BuildRequires:  flex
BuildRequires:  gcc-c++
BuildRequires:  hicolor-icon-theme
BuildRequires:  pkgconfig
BuildRequires:  update-desktop-files
BuildRequires:  wxGTK3-3_2-devel
BuildRequires:  pkgconfig(gtk+-3.0)
BuildRequires:  pkgconfig(hunspell)
BuildRequires:  pkgconfig(libcjson)
BuildRequires:  pkgconfig(libpq)
BuildRequires:  pkgconfig(libssh)
BuildRequires:  pkgconfig(mysqlclient)
BuildRequires:  pkgconfig(sqlite3)
BuildRequires:  pkgconfig(yaml-cpp)
Recommends:     llama.cpp
Recommends:     universal-ctags
Recommends:     valgrind
Requires:       xterm-bin
%if %{with lldb}
BuildRequires:  lldb-devel
%endif
%if %{with clang}
BuildRequires:  llvm-clang-devel
%endif

%description
CodeLite is a code editor for the C, C++, PHP and Node.js programming languages.
It uses an interface with which users can create, build and debug projects.

%prep
%autosetup -p1

%build
%cmake \
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_INSTALL_LIBDIR=%{_lib} \
  -DCMAKE_INSTALL_MANDIR=%{_mandir} \
  -DWITH_CHATAI=1 \
  -DWITH_MYSQL=1 \
  -DWITH_POSTGRES=1 \
  -DBUILD_TESTING=0

%cmake_build

%install
%cmake_install
# Remove tests.
%__rm -f %{buildroot}%{_bindir}/CxxLocalVariables
%__rm -f %{buildroot}%{_bindir}/ctagsd-tests
# Strip plugins manually.
%__strip %{buildroot}%{_libdir}/%{name}/*.so
%__strip %{buildroot}%{_libdir}/%{name}/debuggers/*.so
# Fix line endings.
%__sed -i 's/\r$//g' %{buildroot}%{_bindir}/codelite_open_helper.py
# Add mime types.
%__mkdir_p %{buildroot}%{_datadir}/mime/packages/
%__cp -p %{name}.xml %{buildroot}%{_datadir}/mime/packages/
%__rm -f %{buildroot}%{_datadir}/applications/codelite-url-handler.desktop
# Handle man pages
%__mkdir_p %{buildroot}%{_mandir}/man1/
%__cp -p %{buildroot}%{_datadir}/%{name}/man/man1/%{name}*.1 %{buildroot}%{_mandir}/man1/
%__gzip -9 %{buildroot}%{_mandir}/man1/%{name}*.1
# Update desktop file.
%suse_update_desktop_file %{name} IDE
# Fix duplicated files.
%fdupes %{buildroot}%{_prefix}
%find_lang %{name}

%files -f %{name}.lang
%license COPYING
%doc about.html AUTHORS
%{_bindir}/%{name}*
%{_bindir}/cc-wrapper
%{_bindir}/ctagsd
%{_libdir}/%{name}
%{_datadir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/32x32/apps/%{name}.png
%{_datadir}/icons/hicolor/64x64/apps/%{name}.png
%{_datadir}/icons/hicolor/128x128/apps/%{name}.png
%{_datadir}/icons/hicolor/256x256/apps/%{name}.png
%exclude %{_datadir}/icons/hicolor/32x32@2x/apps/%{name}.png
%exclude %{_datadir}/icons/hicolor/64x64@2x/apps/%{name}.png
%exclude %{_datadir}/icons/hicolor/128x128@2x/apps/%{name}.png
%exclude %{_datadir}/icons/hicolor/256x256@2x/apps/%{name}.png
%exclude %{_datadir}/%{name}/man
%exclude %{_datadir}/%{name}/LICENSE
%{_mandir}/man1/%{name}*.1%{?ext_man}
%{_datadir}/mime/packages/%{name}.xml
%dir %{_datadir}/metainfo/
%{_datadir}/metainfo/org.%{name}.%{name}.metainfo.xml

%changelog
openSUSE Build Service is sponsored by