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 http://bugs.opensuse.org/
#

Name:           wxformbuilder
Version:        3.1.70
Release:        1
License:        GPLv2
Summary:        The OpenSource wxWidgets Designer, GUI Builder, and RAD Tool
Url:            http://wxformbuilder.org/
Group:          Development/Tools/GUI Builders
Source:         http://downloads.sourceforge.net/project/%{name}/%{name}/%{version}/wxFormBuilder_v%{version}-src.tar.bz2
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  update-desktop-files
%if 0%{?suse_version} <= 1130
BuildRequires:  wxGTK-devel
%else
BuildRequires:  wxWidgets-wxcontainer-devel
%endif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
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.

%prep
%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/wxfb_export.sh
%endif

%build
export CFLAGS="%{optflags}"
export CXXFLAGS="%{optflags}"
# first convert from win to unix format
sed -i -e 's/\r$//' create_build_files.sh
# 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
./create_build_files.sh
make %{?_smp_mflags}

%install
sed -i -e 's/\r$//' install/linux/wxfb_export.sh
./install/linux/wxfb_export.sh %{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}

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

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

%files
%defattr(-,root,root)
%doc COPYING README.txt
%{_bindir}/%{name}
%dir %{_libdir}/%{name}
%{_libdir}/%{name}/*.so
%dir %{_datadir}/%{name}/
%{_datadir}/%{name}/*
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png
%{_mandir}/man1/%{name}.1.gz

%changelog
openSUSE Build Service is sponsored by