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

Name:           ultimatepp
Version:        3211
Release:        1
License:        BSD
Summary:        C++ cross-platform rapid application development framework (known as U++)
Url:            http://www.ultimatepp.org
Group:          Development/Languages/C and C++
Source0:        http://downloads.sourceforge.net/project/upp/upp/%{version}/upp-x11-src-%{version}.tar.gz
Source1:        http://upp-mirror.googlecode.com/svn-history/r2791/trunk/uppbox/lpbuild/theide.1
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

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

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

%build
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
%endif

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" \
     %{?_smp_mflags}

%install
# 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/{texi2pod.pl,configure,gcctestsuite.sh}
chmod +x %{buildroot}/%{_datadir}/upp/bazaar/maxpdf_frontend/maxpdf

# We create our own GCC.bm
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/GCC.bm << EOF
BUILDER         = "GCC";
COMPILER        = "g++";
DEBUG_INFO      = "2";
DEBUG_BLITZ     = "1";
DEBUG_LINKMODE  = "1";
DEBUG_OPTIONS   = "-O0";
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_FLAGS   = "";
RELEASE_LINK    = "-Wl,--gc-sections";
DEBUGGER        = "gdb";
PATH            = "";
INCLUDE = "$INCLUDEDIR";
LIB     = "$LIBDIR";
REMOTE_HOST     = "";
REMOTE_OS       = "";
REMOTE_TRANSFER = "";
REMOTE_MAP      = "";
LINKMODE_LOCK   = "0";
EOF
chmod 644 %{buildroot}/%{_datadir}/upp/GCC.bm
# set /lib → /lib64 for x86_64 in GCC.bm
%ifarch x86_64
sed "/INCLUDE/s#/lib/#/lib64/#g" -i %{buildroot}/%{_datadir}/upp/GCC.bm
%endif

# 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


%clean
rm -rf %{buildroot}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc uppsrc/ide/Copying
%dir %{_datadir}/upp
%{_datadir}/upp/GCC.bm
%{_datadir}/upp/bazaar/
%{_datadir}/upp/examples/
%{_datadir}/upp/reference/
%{_datadir}/upp/tutorial/
%{_datadir}/upp/uppsrc/

%files -n theide
%defattr(-,root,root)
%doc uppsrc/ide/Copying
%{_bindir}/theide
%{_datadir}/applications/theide.desktop
%{_datadir}/icons/hicolor/48x48/apps/theide.png
%{_datadir}/pixmaps/theide.png
%{_mandir}/man1/theide.1.gz

%changelog
openSUSE Build Service is sponsored by