a215e4f
%if 0%{?fedora} || 0%{?rhel} >= 8
f03fc53
%bcond_without check
db8e434
%else
a215e4f
# no cpputest in EL7
a215e4f
%bcond_with check
a215e4f
%endif
09776c7
09776c7
%if 0%{?fedora} || 0%{?rhel} < 8
09776c7
%bcond_without docs
09776c7
%else
09776c7
# TODO: package rubygem-asciidoctor
09776c7
%bcond_with docs
09776c7
%endif
09776c7
09776c7
%if 0%{?rhel} && 0%{?rhel} < 9
d668475
%undefine __cmake_in_source_build
09776c7
%endif
0231c01
%global __provides_exclude_from ^%{_libdir}/weechat/plugins/.*$
8c83e96
ee1fe90
%if %{?_pkgdocdir:1}0
eb2f9fd
%if 0%{?rhel}
eb2f9fd
%global _doc %{name}-%{version}
eb2f9fd
%else
ee1fe90
%global _doc %{name}
eb2f9fd
%endif
ee1fe90
%else
ee1fe90
%global _doc %{name}-%{version}
ee1fe90
%global _pkgdocdir %{_docdir}/%{_doc}
ee1fe90
%endif
ee1fe90
2750bc8
Name:      weechat
578fee3
Version:   4.2.2
51f7cd3
Release:   %autorelease
2750bc8
Summary:   Portable, fast, light and extensible IRC client
2750bc8
Group:     Applications/Communications
e16edd3
URL:       http://weechat.org
305de2e
License:   GPLv3
a4e272a
22eaf47
Source:    http://weechat.org/files/src/%{name}-%{version}.tar.xz
9bfa102
# /usr/bin/ld: CMakeFiles/charset.dir/charset.o:
9bfa102
# relocation R_X86_64_PC32 against symbol `weechat_charset_plugin'
7c9cee6
# can not be used when making a shared object; recompile with -fPIC
045b4c8
Patch0:    weechat-3.4-tests-fPIC.patch
f03fc53
# this fails on too many tests, we want to let them finish anyway
045b4c8
Patch1:    weechat-3.4-disable-memleak-detection.patch
5751936
Vasiliy Glazov 521efd3
BuildRequires: gcc
09776c7
%if %{with check}
bae502f
BuildRequires: cpputest-devel
f03fc53
BuildRequires: glibc-langpack-en
bae502f
%endif
09776c7
%if %{with docs}
8b54436
BuildRequires: asciidoctor
8b54436
%endif
b9acb0e
BuildRequires: ca-certificates
a4e272a
BuildRequires: cmake
a4e272a
BuildRequires: docbook-style-xsl
a4e272a
BuildRequires: enchant-devel
a4e272a
BuildRequires: gettext
a4e272a
BuildRequires: gnutls-devel
d04d0c3
%if 0%{?fedora} >= 30 || 0%{?rhel} > 8
d04d0c3
BuildRequires: guile22-devel
d04d0c3
%else
b9acb0e
BuildRequires: guile-devel
d04d0c3
%endif
a4e272a
BuildRequires: libcurl-devel
a4e272a
BuildRequires: libgcrypt-devel
a4e272a
BuildRequires: lua-devel
a4e272a
BuildRequires: ncurses-devel
a4e272a
BuildRequires: perl-ExtUtils-Embed
a4e272a
BuildRequires: perl-devel
a4e272a
BuildRequires: pkgconfig
cfd17ee
BuildRequires: python3-devel
a4e272a
BuildRequires: ruby
a4e272a
BuildRequires: ruby-devel
b9acb0e
BuildRequires: source-highlight
a4e272a
BuildRequires: tcl-devel
b6d9a25
BuildRequires: libzstd-devel
a4e272a
BuildRequires: zlib-devel
2c61421
%if 0%{?rhel}
2c61421
BuildRequires: cmake3
2c61421
%endif
2750bc8
4e57752
Requires:      hicolor-icon-theme
4e57752
2750bc8
%description
2750bc8
WeeChat (Wee Enhanced Environment for Chat) is a portable, fast, light and
2750bc8
extensible IRC client. Everything can be done with a keyboard.
2750bc8
It is customizable and extensible with scripts.
2750bc8
e16edd3
%package devel
e16edd3
Summary: Development files for weechat
b9acb0e
Requires: %{name}%{?_isa} = %{version}-%{release}
a4e272a
Requires: pkgconfig
e16edd3
e16edd3
%description devel
e16edd3
WeeChat (Wee Enhanced Environment for Chat) is a portable, fast, light and
e16edd3
extensible IRC client. Everything can be done with a keyboard.
e16edd3
It is customizable and extensible with scripts.
e16edd3
e16edd3
This package contains include files and pc file for weechat.
e16edd3
a4e272a
2750bc8
%prep
22eaf47
%autosetup -p1 -n %{name}-%{version}
ee1fe90
find doc/ -type f -name 'CMakeLists.txt' \
ee1fe90
    -exec sed -i -e 's#${PROJECT_NAME}#%{_doc}#g' '{}' \;
b9acb0e
a4e272a
2750bc8
%build
2c61421
%cmake3 \
17d3ce2
  -DPREFIX=%{_prefix} \
17d3ce2
  -DLIBDIR=%{_libdir} \
872a3c8
  -DENABLE_ENCHANT=ON \
2c450d8
  -DENABLE_PHP=OFF \
09776c7
%if %{with check}
09776c7
  -DENABLE_TESTS=ON \
09776c7
%else
09776c7
  -DENABLE_TESTS=OFF \
09776c7
%endif
09776c7
%if %{with docs}
b9acb0e
  -DENABLE_DOC=ON \
2c450d8
  -DENABLE_DOC_INCOMPLETE=ON \
b9acb0e
  -DENABLE_MAN=ON \
8b54436
%else
8b54436
  -DENABLE_DOC=OFF \
8b54436
  -DENABLE_MAN=OFF \
8b54436
%endif
b491abf
  -DCA_FILE=/etc/pki/tls/certs/ca-bundle.crt \
d668475
  %{nil}
a215e4f
%cmake3_build
2750bc8
a4e272a
2750bc8
%install
a215e4f
%cmake3_install
2750bc8
2750bc8
%find_lang %name
2750bc8
e16edd3
09776c7
%if %{with check}
a215e4f
%ctest3 -- -V
09776c7
%endif
09776c7
09776c7
2750bc8
%files -f %{name}.lang
979d3b2
%doc AUTHORS.adoc ChangeLog.adoc Contributing.adoc
Vasiliy Glazov 521efd3
%doc README.adoc ReleaseNotes.adoc
Vasiliy Glazov 521efd3
%license COPYING
2750bc8
%{_bindir}/%{name}-curses
e254ac6
%{_bindir}/%{name}
Vasiliy Glazov 521efd3
%{_bindir}/%{name}-headless
Vasiliy Glazov 521efd3
%{_libdir}/%{name}
745be8b
%{_datadir}/icons/hicolor/32x32/apps/%{name}.png
e69670e
%{_datadir}/applications/%{name}.desktop
e69670e
%{_datadir}/icons/hicolor/128x128/apps/%{name}.png
e69670e
%{_datadir}/icons/hicolor/16x16/apps/%{name}.png
e69670e
%{_datadir}/icons/hicolor/256x256/apps/%{name}.png
e69670e
%{_datadir}/icons/hicolor/512x512/apps/%{name}.png
e69670e
%{_datadir}/icons/hicolor/64x64/apps/%{name}.png
8b54436
%if 0%{?fedora} || 0%{?rhel} < 8
4e911f3
%{_pkgdocdir}/weechat_*.html
b9acb0e
%{_mandir}/man1/weechat.1*
5bfa7fe
%{_mandir}/*/man1/weechat.1*
Vasiliy Glazov 521efd3
%{_mandir}/man1/%{name}-headless.1*
Vasiliy Glazov 521efd3
%{_mandir}/*/man1/%{name}-headless.1*
8b54436
%endif
b9acb0e
e16edd3
%files devel
e16edd3
%dir %{_includedir}/%{name}
1c849d0
%{_includedir}/%{name}/weechat-plugin.h
e16edd3
%{_libdir}/pkgconfig/*.pc
e16edd3
b9acb0e
2750bc8
%changelog
51f7cd3
%autochangelog