File ultimatepp.spec of Package ultimatepp

# spec file for package ultimatepp
# 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:           ultimatepp
Version:        3211
Release:        1
License:        BSD
Summary:        C++ cross-platform rapid application development framework (known as U++)
Group:          Development/Languages/C and C++
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  pkgconfig(gtk+-2.0)
BuildRequires:  pkgconfig(libnotify)
BuildRequires:  update-desktop-files
BuildRequires:  xorg-x11-devel
Requires:       gcc-c++
Requires:       theide
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

Ultimate++ is a radical and innovative GUI toolkit whose number one priority
is programmer productivity. C++ is a great programming language but
C++ programmers are sometimes hampered by the lack of effective libraries.
U++ libraries enable genuine productivity gains with shorter development
times and greatly reduced application source code size.

%package -n theide
Summary:        Modern IDE designed for developping large U++/C++ applications
Group:          Development/Tools/IDE
Requires:       %{name} = %{version}

%description -n theide
TheIDE introduces modular concepts to C++ programming. It features
BLITZ-build technology to speedup C++ rebuilds up to 4 times, Visual
designers for U++ libraries, Topic++ system for documenting code
and creating rich text resources for applications (like help and code
documentation) and Assist++ - a powerful C++ code analyzer that provides
features like code completion, navigation and transformation.

%setup -q -n upp-x11-src-%{version}

export CFLAGS="%{optflags}"  
export CXXFLAGS="%{optflags}"  
export LDFLAGS="%{optflags}" 
sed "/IDE_VERSION/s#%{version}#%{version}-openSUSE#" -i uppsrc/ide/version.h
%ifarch x86_64
sed "/LIBPATH/s#/lib#/lib64#g" -i uppsrc/Makefile

make -C uppsrc \
     -e LIBPATH=$(pkg-config --libs-only-L x11 freetype2 gtk+-2.0 glib-2.0 cairo pango atk)     \
     -e CINC=" -I. $(pkg-config --cflags x11 freetype2 gtk+-2.0 glib-2.0 cairo pango atk)" \
     -e UPPOUT="../_out/" \
     -e OutFile="../_out/theide" \

# put bin file in the right place
install -Dm 755 _out/theide %{buildroot}/%{_bindir}/theide
# put manual in the right place
install -Dm 644 %{S:1} %{buildroot}/%{_mandir}/man1/theide.1
# install desktop file and icons
install -Dm 644 uppsrc/ide/theide-48.png %{buildroot}/%{_datadir}/icons/hicolor/48x48/apps/theide.png
install -Dm 644 uppsrc/ide/theide-48.png %{buildroot}/%{_datadir}/pixmaps/theide.png
install -Dm 644 uppsrc/ide/theide.desktop %{buildroot}/%{_datadir}/applications/theide.desktop
# install other stuff like tutorial, reference, source, etc
install -dm 755 %{buildroot}/%{_datadir}/upp
cp -r bazaar %{buildroot}/%{_datadir}/upp
cp -r examples %{buildroot}/%{_datadir}/upp
cp -r reference %{buildroot}/%{_datadir}/upp
cp -r tutorial %{buildroot}/%{_datadir}/upp
cp -r uppsrc %{buildroot}/%{_datadir}/upp
# add +x rights for some bazaar scripts
chmod +x %{buildroot}/%{_datadir}/upp/bazaar/Tcc/lib/{,configure,}
chmod +x %{buildroot}/%{_datadir}/upp/bazaar/maxpdf_frontend/maxpdf

# We create our own
INCLUDEDIR=$( pkg-config --cflags x11 freetype2 gtk+-2.0 glib-2.0 cairo pango atk | awk ' { gsub ( / /, "" ) ; gsub ( /-I/, ";" ) ; sub ( /;/, "" ) ; sub ( /-pthread/, "" ) ; print $0 }' )  
LIBDIR=$( pkg-config --libs-only-L x11 freetype2 gtk+-2.0 glib-2.0 cairo pango atk | awk ' { gsub ( / /, "" ) ; gsub ( /-I/, ";" ) ; sub ( /;/, "" ) ; print $0 }' )

cat > %{buildroot}/%{_datadir}/upp/ << EOF
BUILDER         = "GCC";
COMPILER        = "g++";
DEBUG_INFO      = "2";
DEBUG_BLITZ     = "1";
DEBUG_FLAGS     = "";
RELEASE_BLITZ           = "0";
RELEASE_LINKMODE        = "1";
RELEASE_OPTIONS         = "-O3 -ffunction-sections -fdata-sections";
RELEASE_SIZE_OPTIONS    = "-Os -finline-limit=20 -ffunction-sections -fdata-sections";
RELEASE_LINK    = "-Wl,--gc-sections";
DEBUGGER        = "gdb";
PATH            = "";
LIB     = "$LIBDIR";
REMOTE_HOST     = "";
REMOTE_OS       = "";
REMOTE_MAP      = "";
chmod 644 %{buildroot}/%{_datadir}/upp/
# set /lib → /lib64 for x86_64 in
%ifarch x86_64
sed "/INCLUDE/s#/lib/#/lib64/#g" -i %{buildroot}/%{_datadir}/upp/

# parse desktop file
%suse_update_desktop_file -r -G "C++ IDE" theide Development IDE
# check for duplicates
%fdupes %{buildroot}
# fix wrong file encoding
sed -i 's/\r//' uppsrc/ide/Copying

rm -rf %{buildroot}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%doc uppsrc/ide/Copying
%dir %{_datadir}/upp

%files -n theide
%doc uppsrc/ide/Copying

openSUSE Build Service is sponsored by