File codelite.spec of Package CodeLite

#
# spec file for package codelite
#
# 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:           codelite
Version:        2.9.0.4684
Release:        1
License:        GPLv2
Summary:        Powerful open-source, cross platform code editor for the C/C++
Url:            http://codelite.org/
Group:          Development/Tools/IDE
Source0:        http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
Source1:        %{name}.desktop
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  pkgconfig(gtk+-2.0)
BuildRequires:  update-desktop-files
%if 0%{?suse_version} <= 1130
BuildRequires:  wxGTK-devel >= 2.8.10
Requires:       wxGTK >= 2.8.10
%else
BuildRequires:  wxWidgets-wxcontainer-devel
Requires:       wxWidgets
%endif
Requires:       xterm
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
CodeLite is a powerful open-source, cross platform code editor for the C/C++ programming language. It uses a sophisticated, yet intuitive interface which allows user easily to create, build and debug complex projects.

%prep
%setup -q

%build
export CFLAGS="%{optflags}"
export CXXFLAGS="%{optflags}"
### current version doesn't support those options:
# --disable-debian --disable-desktop_icon --disable-make_symlink
# add CFLAGS configure script
sed "/\"CCFLAGS=/s:-Wall: :" -i configure
sed -e "s:optimization=\" -DREGEXP_UNICODE \":optimization=\"${CXXFLAGS} -DREGEXP_UNICODE \":" -i configure
sed -e "s:optimization=\" -O3 -DREGEXP_UNICODE \":optimization=\"${CXXFLAGS} -DREGEXP_UNICODE \":" -i configure
sed -e "s:optimization=\" -O0 \":optimization=\"${CXXFLAGS}\":g" -i configure
sed -e "s:optimization=\" -O2 \":optimization=\"${CXXFLAGS}\":g" -i configure
./configure --prefix=%{_prefix} --plugins-dir=%{_libdir}/%{name}
### Current makefile doesn't support parallel building
###make %{?_smp_mflags} \
make

%install
%make_install
### Install desktop menu entry
install -D -m 644 "%{SOURCE1}" "%{buildroot}%{_datadir}/applications/%{name}.desktop"
### Fix desktop menu icon
install -D Runtime/images/cubes.png %{buildroot}%{_datadir}/pixmaps/%{name}.png
### Search for duplicate
%fdupes %{buildroot}%{_prefix}
### Update translation in desktop menu entry
%suse_update_desktop_file %{name}
### Remove some backup files
rm %{buildroot}%{_datadir}/%{name}/templates/projects/dynamic-library-wx-enabled/dynamic-library-wx-enabled.project~
#
### Fix permissions! 666
#
chmod o-w %{buildroot}%{_datadir}/%{name}/%{name}-icons.zip

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root)
%doc about.html AUTHORS COPYING
%{_bindir}/%{name}*
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png
%{_datadir}/%{name}
%{_libdir}/%{name}

%changelog
openSUSE Build Service is sponsored by