weechat/weechat.spec

270 lines
7.2 KiB
RPMSpec

#
# spec file for package weechat
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#
Name: weechat
Version: 0.4.3
Release: 0
Summary: Portable, Fast, Light and Extensible Chat Client
License: GPL-3.0+
Group: Productivity/Networking/IRC
Url: http://www.weechat.org
Source: http://www.weechat.org/files/src/weechat-%{version}.tar.bz2
Source1: weechat.desktop
# PATCH-FIX-UPSTREAM weechat-capath.patch https://savannah.nongnu.org/patch/index.php?8153 lnussel@suse.de -- use system's default certificate store
Patch0: weechat-capath.patch
# PATCH-FIX-UPSTREAM weechat-link-pthread.patch https://bugs.gentoo.org/show_bug.cgi?id=501078 gber@opensuse.org -- Link Weechat against libpthread
Patch1: weechat-link-pthread.patch
BuildRequires: cmake
BuildRequires: curl-devel
BuildRequires: gcc-c++
BuildRequires: grep
BuildRequires: guile-devel
BuildRequires: hicolor-icon-theme
BuildRequires: libgcrypt-devel
BuildRequires: libgnutls-devel
BuildRequires: libgpg-error-devel
BuildRequires: libtool
BuildRequires: lzo-devel
BuildRequires: ncurses-devel
BuildRequires: perl
BuildRequires: pkg-config
BuildRequires: python-devel
BuildRequires: ruby-devel
BuildRequires: tcl-devel
BuildRequires: update-desktop-files
Requires: hicolor-icon-theme
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} > 1220
BuildRequires: enchant-devel
%endif
%if 0%{?suse_version} > 1220
BuildRequires: lua51-devel
%else
BuildRequires: lua-devel
%endif
%if 0%{?suse_version} > 1220
BuildRequires: asciidoc
BuildRequires: docbook5-xsl-stylesheets
BuildRequires: libxslt-tools
BuildRequires: source-highlight
%endif
%description
WeeChat (Wee Enhanced Environment for Chat) is a fast and light cross-platform
chat environment. It can be entirely controlled with the keyboard, has a
plugin-based architecture and is customizable and extensible with scripts in
several scripting languages.
%lang_package
%package devel
Summary: Development Environment for %{name} Plugins
Group: Development/Libraries/C and C++
Requires: %{name} = %{version}-%{release}
%description devel
Development environment for authoring %{name} plugins.
%if 0%{?suse_version} > 1220
%package guile
Summary: Guile Scripting Support for %{name}
Group: Productivity/Networking/IRC
Requires: %{name} = %{version}-%{release}
%description guile
Support for %{name} scripts written in the Guile language.
%endif
%package lua
Summary: Lua Scripting Support for %{name}
Group: Productivity/Networking/IRC
Requires: %{name} = %{version}-%{release}
%description lua
Support for %{name} scripts written in the Lua language.
%package perl
Summary: Perl Scripting Support for %{name}
Group: Productivity/Networking/IRC
Requires: %{name} = %{version}-%{release}
%{?libperl_requires}
%description perl
Support for %{name} scripts written in the Perl language.
%package python
Summary: Python Scripting Support for %{name}
Group: Productivity/Networking/IRC
Requires: %{name} = %{version}-%{release}
%description python
Support for %{name} scripts written in the Python language.
%package tcl
Summary: Tcl Scripting Support for %{name}
Group: Productivity/Networking/IRC
Requires: %{name} = %{version}-%{release}
%description tcl
Support for %{name} scripts written in the Tcl language.
%package ruby
Summary: Ruby Scripting Support for %{name}
Group: Productivity/Networking/IRC
Requires: %{name} = %{version}-%{release}
%description ruby
Support for %{name} scripts written in the Ruby language.
%if 0%{?suse_version} > 1220
%package aspell
Summary: Aspell Spell-Checking Support for %{name}
Group: Productivity/Networking/IRC
Requires: %{name} = %{version}-%{release}
%description aspell
Spell-checking support for %{name}, using the aspell library.
%endif
%prep
%setup -q
%patch0 -p1
%patch1 -p1
modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{_sourcedir}/%{name}.changes")"
DATE="\"$(date -d "${modified}" "+%%b %%e %%Y")\""
TIME="\"$(date -d "${modified}" "+%%R")\""
find . -name '*.[ch]' |\
xargs sed -i "s/__DATE__/${DATE}/g;s/__TIME__/${TIME}/g"
%build
export CFLAGS="%{optflags}"
mkdir build
pushd build
cmake \
-DCMAKE_INSTALL_PREFIX="%{_prefix}" \
-DLIBDIR="%{_libdir}" \
-DPYTHON_LIBRARY="%{_libdir}/libpython%{py_ver}.so" \
-DENABLE_ENCHANT=ON \
-DENABLE_DOC=ON \
-DENABLE_MAN=ON \
..
make %{?_smp_flags} VERBOSE=1
popd #build
%install
pushd build
make DESTDIR=%{buildroot} install %{?_smp_mflags}
popd #build
# due to an unknown race condition cmake does not always create a compatibility
# symlink
ln -sf %{_bindir}/weechat %{buildroot}%{_bindir}/weechat-curses
install -D -m 0644 "%{SOURCE1}" "%{buildroot}%{_datadir}/applications/%{name}.desktop"
%if 0%{?suse_version}
%suse_update_desktop_file -r "%{name}" Network IRCClient
%endif
%if 0%{?suse_version} > 1220
mv "%{buildroot}%{_datadir}/doc/weechat" html
%endif
%find_lang "%{name}" --with-man
%if 0%{?suse_version} > 1220
%post
%desktop_database_post
%icon_theme_cache_post
%postun
%desktop_database_postun
%icon_theme_cache_postun
%endif
%files
%defattr(-,root,root)
%doc AUTHORS ChangeLog COPYING NEWS README
%if 0%{?suse_version} > 1220
%doc html/
%endif
%{_bindir}/weechat-curses
%{_bindir}/weechat
%dir %{_libdir}/weechat
%dir %{_libdir}/weechat/plugins
%{_libdir}/weechat/plugins/alias.so
%{_libdir}/weechat/plugins/charset.so
%{_libdir}/weechat/plugins/fifo.so
%{_libdir}/weechat/plugins/irc.so
%{_libdir}/weechat/plugins/logger.so
%{_libdir}/weechat/plugins/relay.so
%{_libdir}/weechat/plugins/rmodifier.so
%{_libdir}/weechat/plugins/script.so
%{_libdir}/weechat/plugins/xfer.so
%if 0%{?suse_version} > 1220
%{_mandir}/man1/weechat.1*
%endif
%{_datadir}/applications/weechat.desktop
%{_datadir}/icons/hicolor/*/apps/weechat.png
%files -f "%{name}.lang" lang
%defattr(-,root,root)
%files devel
%defattr(-,root,root)
%{_includedir}/weechat
%{_libdir}/pkgconfig/weechat.pc
%if 0%{?suse_version} > 1220
%files guile
%defattr(-,root,root)
%{_libdir}/weechat/plugins/guile.so
%endif
%files lua
%defattr(-,root,root)
%{_libdir}/weechat/plugins/lua.so
%files perl
%defattr(-,root,root)
%{_libdir}/weechat/plugins/perl.so
%files python
%defattr(-,root,root)
%{_libdir}/weechat/plugins/python.so
%files tcl
%defattr(-,root,root)
%{_libdir}/weechat/plugins/tcl.so
%files ruby
%defattr(-,root,root)
%{_libdir}/weechat/plugins/ruby.so
%if 0%{?suse_version} > 1220
%files aspell
%defattr(-,root,root)
%{_libdir}/weechat/plugins/aspell.so
%endif
%changelog