File wxlua.spec of Package wxlua

# spec file for package wxlua
# Copyright (c) 2016 SUSE LINUX 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

Name:           wxlua
Release:        0
Summary:        Lua IDE with a GUI debugger and binding generator
License:        SUSE-wxWidgets-3.1
Group:          Development/Languages/Other
Source:         %{name}-%{version}.tar.bz2
Patch0:         wxlstate.patch
BuildRequires:  cmake >= 2.8.3
BuildRequires:  desktop-file-utils
BuildRequires:  hicolor-icon-theme
BuildRequires:  gcc-c++
BuildRequires:  pkgconfig(glu)
BuildRequires:  lua51-devel
BuildRequires:  wxWidgets-devel >= 3
BuildRequires:  ncurses-devel
BuildRequires:  readline-devel
BuildRequires:  doxygen
%if 0%{?suse_version} > 1320
BuildRequires:  cppcheck

This package contains Integrated Development Environments (IDE, written in
wxLua) with a GUI debugger, a binding generator and wxWidgets bindings usable
as a module.

%package -n lib%{name}
Summary:        Set of Lua bindings to the C++ wxWidgets cross-platform GUI library
Group:          System/Libraries

%description -n lib%{name}
wxLua is a set of bindings to the C++ wxWidgets cross-platform GUI library for
the Lua programming language. Nearly all of the functionality of wxWidgets is
exposed to Lua, meaning that your programs can have windows, dialogs, menus,
toolbars, controls, image loading and saving, drawing, sockets, streams,
printing, clipboard access... and much more.

%package devel
Summary:        Development files of lib%{name}
Group:          Development/Languages/C and C++
Requires:       lib%{name} = %{version}

%description devel
This package contains files to be used in your C++ programs to embed a Lua
interpreter with the wxWidgets API.

%setup -q
%patch0 -p0
sed -r -i 's|LIBRARY DESTINATION .*$|LIBRARY DESTINATION %{_lib}|' CMakeLists.txt

%cmake \
	-DwxWidgets_CONFIG_EXECUTABLE=%{_bindir}/wx-config \
	-DwxLua_LUA_INCLUDE_DIR=%{_includedir} \
	-DwxLua_LUA_LIBRARY=%{_libdir}/ \
make %{?_smp_mflags}


mkdir -p %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/
install -p art/wxlualogo.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/
chmod -x %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/wxlualogo.svg

mkdir -p %{buildroot}%{_datadir}/icons/hicolor/128x128/apps/
install -p art/wxlualogo.png %{buildroot}%{_datadir}/icons/hicolor/128x128/apps/

mkdir -p %{buildroot}%{_datadir}/applications/
install -p distrib/autopackage/%{name}.desktop %{buildroot}%{_datadir}/applications/
sed -r -i "s|wxluaedit|wxLuaEdit|" %{buildroot}%{_datadir}/applications/%{name}.desktop
sed -r -i "s|wxlualogo.xpm|wxlualogo|" %{buildroot}%{_datadir}/applications/%{name}.desktop
desktop-file-install --dir %{buildroot}%{_datadir}/applications \
	--remove-category=Application \
	--add-category=IDE \

install -Dm644 distrib/autopackage/wxlua.xml %{buildroot}%{_datadir}/mime/packages/wxlua.xml

# packaged in separate package wxstedit
rm -rf %{buildroot}%{_datadir}/wxstedit
rm -rf %{buildroot}%{_datadir}/wxStEdit
rm -rf %{buildroot}%{_includedir}/wx/stedit/
rm -rf %{buildroot}%{_prefix}/lib/libwxstedit*.so

mkdir -p %{buildroot}%{_libdir}/lua/5.1/
mv %{buildroot}%{_libdir}/ %{buildroot}%{_libdir}/lua/5.1/



%post -n lib%{name} -p /sbin/ldconfig
%postun -n lib%{name} -p /sbin/ldconfig


%files -n lib%{name}

%files devel

openSUSE Build Service is sponsored by