File wxformbuilder.spec of Package wxFormBuilder

# spec file for package wxformbuilder
# Copyright (c) 2011 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

Name:           wxformbuilder
Version:        3.1.70
Release:        1
License:        GPLv2
Summary:        The OpenSource wxWidgets Designer, GUI Builder, and RAD Tool
Group:          Development/Tools/GUI Builders
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  update-desktop-files
%if 0%{?suse_version} <= 1130
BuildRequires:  wxGTK-devel
BuildRequires:  wxWidgets-wxcontainer-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

wxFormBuilder aims to be an application that as well as enabling visual development and generating the corresponding code, allow the inclusion of non-graphical components, as well as providing facilities for extending the set of widgets easily via plugins, like other applications such as qt-designer.

%setup -q -n %{name}

%ifarch x86_64
  sed -i "s|output/lib/|output/lib64/|" premake.lua
  sed -i "s|output/lib/|output/lib64/|" src/premake.lua
  sed -i "s|output/lib/|output/lib64/|" plugins/containers/premake.lua
  sed -i "s|output/lib/|output/lib64/|" plugins/wxAdditions/premake.lua
  sed -i "s|output/lib/|output/lib64/|" plugins/additional/premake.lua
  sed -i "s|output/lib/|output/lib64/|" plugins/common/premake.lua
  sed -i "s|output/lib/|output/lib64/|" plugins/layout/premake.lua
  sed -i "s|/lib|/lib64|" install/linux/

export CFLAGS="%{optflags}"
export CXXFLAGS="%{optflags}"
# first convert from win to unix format
sed -i -e 's/\r$//'
# add optflags to premake's Makefile
sed -e "/CFLAGS/s:-Os -Wall:${CFLAGS}:" -i sdk/premake/build/Makefile

# test
sed -e "/package.config[\"Release\"].buildflags =/s:\"optimize-speed\":\"extra-warnings\", \"optimize-speed\":" -i src/premake.lua
make %{?_smp_mflags}

sed -i -e 's/\r$//' install/linux/
./install/linux/ %{buildroot}%{_prefix}
install -Dm 644 install/linux/data/%{name}.1 %{buildroot}/%{_mandir}/man1/%{name}.1
install -Dm 644 install/linux/data/gnome/usr/share/pixmaps/%{name}.png %{buildroot}/%{_datadir}/pixmaps/%{name}.png
install -Dm 644 install/linux/data/gnome/usr/share/applications/%{name}.desktop %{buildroot}/%{_datadir}/applications/%{name}.desktop

sed -i -s 's:Icon=wxformbuilder.png:Icon=wxformbuilder:' %{buildroot}/%{_datadir}/applications/%{name}.desktop
%suse_update_desktop_file -r %{name} Development GUIDesigner
chmod -x README.txt
sed -i -e 's/\r$//' README.txt
chmod -x COPYING
%fdupes %{buildroot}

%{?buildroot:rm -rf %{buildroot}}

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%dir %{_libdir}/%{name}
%dir %{_datadir}/%{name}/

openSUSE Build Service is sponsored by