LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File codelite.spec of Package codelite (Project devel:tools)

# spec file for package codelite
# Copyright (c) 2012-2013 Mariusz Fik <fisiu@opensuse.org>.
# Copyright (c) 2012 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:        5.1
Release:        0
License:        GPL-2.0+
Summary:        Powerful open-source, cross platform code editor for the C/C++
Url:            http://codelite.org/
Group:          Development/Tools/IDE
Source0:        %{name}-%{version}-gtk.src.tar.gz
Source1:        %{name}.desktop
# PATCH-FIX-OPENSUSE codelite-date-time-usage-fix.patch fisiu@opensuse.org -- It removes usage of __DATE__ and __TIME__
Patch0:         %{name}-date-time-usage-fix.patch
# PATCH-FEATURE-OPENSUSE codelite-disable-new-version-check.patch fisiu@opensuse.org -- Disable 'new version' check on startup
Patch1:         %{name}-disable-new-version-check.patch
BuildRequires:  cmake
BuildRequires:  dos2unix
BuildRequires:  gcc-c++
%if 0%{?suse_version}
BuildRequires:  fdupes
BuildRequires:  update-desktop-files
BuildRequires:  wxWidgets-devel >= 2.9.4
BuildRequires:  pkgconfig(gtk+-2.0)
%define _use_internal_dependency_generator 0
%define __find_requires %wx_requires
Requires:       xterm
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

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.

%setup -q
%patch0 -p0
%patch1 -p0
mkdir build

pushd build
export CFLAGS="%{optflags}"
export CXXFLAGS="%{optflags}"

cmake .. \
    -DWITH_WXC=0 \

make %{?_smp_mflags}

pushd build

### 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

### Add mime types
mkdir -p %{buildroot}%{_datadir}/mime/packages/
cp -p %{name}.xml %{buildroot}%{_datadir}/mime/packages/
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/32x32/mimetypes/
cp -p %{buildroot}%{_datadir}/%{name}/images/cubes.png %{buildroot}%{_datadir}/icons/hicolor/32x32/mimetypes/application-x-%{name}-workspace.png
cp -p %{buildroot}%{_datadir}/%{name}/images/cubes.png %{buildroot}%{_datadir}/icons/hicolor/32x32/mimetypes/application-x-%{name}-project.png

%if 0%{?suse_version}
### Search for duplicates
%fdupes %{buildroot}%{_prefix}
### Update translation in desktop menu entry
%suse_update_desktop_file %{name}

### Fix for wrong-script-end-of-line-encoding
dos2unix %{buildroot}%{_bindir}/%{name}_kill_children

### Fix unstripped-binary-or-object warning for SLE
%if 0%{?sles_version} == 11
strip -s -v %{buildroot}%{_bindir}/%{name}{,_indexer,_cppcheck,gcc,-clang}
strip -s -v %{buildroot}%{_libdir}/%{name}/*.so
strip -s -v %{buildroot}%{_libdir}/%{name}/debuggers/*.so

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

%doc about.html AUTHORS 
### TODO Shoould we put it in separate -lang package?

update-mime-database %{_datadir}/mime &> /dev/null || :
update-desktop-database &> /dev/null || :
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :

update-mime-database %{_datadir}/mime &> /dev/null || :
update-desktop-database &> /dev/null || :
if [ $1 -eq 0 ] ; then
    touch --no-create %{_datadir}/icons/hicolor &>/dev/null
    gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :

gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :