Name: lazarus
Version: 0.9.26.2
Release: alt3

Summary: Lazarus Component Library and IDE
License: GPL and modified LGPL
Group: Development/Other
Url: http://www.lazarus.freepascal.org/

Packager: Alexey Shentzev <ashen@altlinux.ru>

Source: %name-%version.tar
##Patch1: %name-%version-alt-changes.patch
Patch0: %name-0.9.22-alt-relax-onwine.patch
Patch3: %name-0.9.24-alt-fix-idebar-windowtype.patch

BuildRequires: fpc >= 2.2.4 fpc-utils glibc-devel gdk-pixbuf-devel gtk+-devel libgtk+2-devel libXi-devel desktop-file-utils libXext-devel
Requires: fpc fpc-src gdb
Requires: glibc-devel glib-devel gdk-pixbuf-devel gtk+-devel libXi-devel libXext-devel libgtk+2-devel
Requires: fonts-bitmap-terminus %name-tools

%add_findreq_skiplist %_libdir/%name/examples/*

%description
Lazarus is a free and open source Rapid Application Development tool
for the FreePascal compiler using the Lazarus component library - LCL.
The LCL is included in this package.

%description -l ru_RU.UTF8
Lazarus - свободно-распространяемая, с открытым исходным кодом,
среда для быстрой разработки прикладных программ (Rapid Application
Development tool) на FreePascal, использующая библиотеки компонет LCL
(Lazarus component library).  LCL входят в состав данного пакета.

%package docs
Summary: Lazarus docs
Group: Development/Other
Requires: %name = %version-%release

%description docs
Lazarus docs

%description docs -l ru_RU.UTF8
Документация по Lazarus

%package examples
Summary: Lazarus examples
Group: Development/Other
Requires: %name = %version-%release

%description examples
Lazarus examples

%description examples -l ru_RU.UTF8
Примеры программ, созданных с помощью Lazarus

%package tools
Summary: Lazarus tools
Group: Development/Other
Requires: %name = %version-%release

%description tools
Lazarus tools

%description tools -l ru_RU.UTF8
Вспомогательный инструментарий для Lazarus

%prep
%setup -n %name
##%patch0 -p1
%patch1 -p1
%patch3 -p1

# rx and rxfpc components don't build on x86-64
#%__subst '/-C rx/d' components/Makefile.fpc

%build
if [ -n "$FPCCfg" ]; then
	  MAKEOPTS=" -n @$FPCCfg"
fi
export LCL_PLATFORM=gtk2
export FPCDIR=%_libdir/fpc
fpcmake -pwr
fpcmake -pwr tools/Makefile.fpc
fpcmake -pwr ide/Makefile.fpc
make bigide 
make tools OPT="$MAKEOPTS"
make lazbuilder OPT="$MAKEOPTS"
make lcl ideintf packager/registration bigide OPT="$MAKEOPTS"

# FIXME: is explicit one really needed in face of brp-strip?
strip lazarus startlazarus lazbuild

%install
mkdir -p %buildroot{%_bindir,%_libdir/%name,%_datadir/gnome/apps/Development}

cp -aRf * %buildroot%_libdir/%name/

#install -pDm644 docs/lazbuild.1 %buildroot%_man1dir/lazbuild.1
install -pDm644 images/ide_icon48x48.png %buildroot%_pixmapsdir/lazarus.png
install -pDm644 install/lazarus.desktop %buildroot%_desktopdir/lazarus.desktop
install -D -p -m 0644 %name/tools/install/linux/editoroptions.xml %buildroot%_sysconfdir/%name/editoroptions.xml
install -D -p -m 0644 %name/tools/install/linux/environmentoptions.xml %buildroot%_sysconfdir/%name/environmentoptions.xml

ln -sf ../%_lib/%name/lazarus %buildroot%_bindir/lazarus
ln -sf ../%_lib/%name/startlazarus %buildroot%_bindir/startlazarus
ln -sf ../%_lib/%name/lazbuild %buildroot%_bindir/lazbuild

%buildroot%_libdir/%name/lazbuild %buildroot%_libdir/%name/tools/lazdatadesktop/lazdatadesktop.lpr
strip %buildroot%_libdir/%name/tools/lazdatadesktop/lazdatadesktop
strip %buildroot%_libdir/%name/tools/apiwiz/apiwizz %buildroot%_libdir/%name/tools/lazres %buildroot%_libdir/%name/tools/lrstolfm 
strip %buildroot%_libdir/%name/tools/svn2revisioninc %buildroot%_libdir/%name/tools/updatepofiles

find . -type d -exec strip *.o {} \;

# fix bug 13256
mkdir -p %buildroot%_datadir/fpcsrc/packages/fcl-base
mkdir -p %buildroot%_datadir/fpcsrc/rtl/inc

%files
%_sysconfdir/%name/*
%_libdir/%name/
%_bindir/*
%_pixmapsdir/lazarus.png
%_desktopdir/lazarus.desktop
#_man1dir/*
%exclude %_libdir/%name/docs
%exclude %_libdir/%name/examples
%exclude %_libdir/%name/tools
%exclude %_libdir/%name/debian
# fix bug 13256
%dir %_datadir/fpcsrc/rtl/inc
%dir %_datadir/fpcsrc/packages/fcl-base

%files docs
%_libdir/%name/docs

%files examples
%_libdir/%name/examples

%files tools
%_libdir/%name/tools
%exclude %_libdir/%name/tools/install

%changelog
* Wed Aug 05 2009 Grigory Batalov <bga@altlinux.ru> 0.9.26.2-alt2
- Fix build on x86_64.

* Thu Jul 02 2009 Alexey Shentzev <ashen@altlinux.ru> 0.9.26.2-alt1.1
- update spec

* Sun Apr 19 2009 Afanasov Dmitry <ender@altlinux.org> 0.9.26.2-alt1
- 0.9.26.2
- require fpc >= 2.2.2.
- patch:
  + merge fix-desktop and alt-font patches to alt-changes patch
- spec changes:
  + force english messages when compiling
  + pack sources as tar
- don't install absent manpages

* Sun Apr 05 2009 Alexey Rusakov <ktirf@altlinux.org> 0.9.24-alt3.4
- finally closing ALT Bug 17531
- fixed ALT Bug 16207
- fixed Repocop-reported bugs in the .desktop file.
- catch-up to alt3.3 changelog:
  + rx components are not built since their build fails on x86_64

* Tue Mar 31 2009 Alexey Rusakov <ktirf@altlinux.org> 0.9.24-alt3.3
- NMU (thanks to mike@):
  + fixed #19350 (suppressed extra requirements of examples subpackage)
  + spec cleanup

* Sat Oct 11 2008 Alexey Shentzev <ashen@altlinux.ru> 0.9.24-alt3.2
- fix bug 17531

* Wed Sep 10 2008 Alexey Shentzev <ashen@altlinux.ru> 0.9.24-alt3.1
- add BuildRequires libXext-devel

* Tue Apr 08 2008 Alexey Shentzev <ashen@altlinux.ru> 0.9.24-alt3
- build with bigide

* Thu Apr 03 2008 Alexey Shentzev <ashen@altlinux.ru> 0.9.24-alt2.3.2
- add russian descriptions
- fix bugs #14516, #14390

* Fri Dec 14 2007 Stanislav Ievlev <inger@altlinux.org> 0.9.24-alt2.3.1
- fix optimization flags (s,OG,O1, s,Og,Os,)

* Fri Dec 07 2007 Alexey Shentzev <ashen@altlinux.ru> 0.9.24-alt2.3
- add call fpcmake -r
- Thanks Slava Dubrovskiy <dubrsl@altlinux.org> for help

* Mon Dec 03 2007 Alexey Shentzev <ashen@altlinux.ru> 0.9.24-alt2.2
- really added requirement on fpc-src

* Mon Dec 03 2007 Alexey Shentzev <ashen@altlinux.ru> 0.9.24-alt2.1
- restore require for fpc-src

* Wed Nov 28 2007 Alexey Shentzev <ashen@altlinux.ru> 0.9.24-alt1
- New version build
- fixed bugs 13256
- Thanks Sergey Bolshakov <sbolshakov@altlinux.ru> for help and patching

* Mon Oct 15 2007 Alexey Shentzev <ashen@altlinux.ru> 0.9.22-alt1.1
- fixed bug #13052

* Wed Aug 08 2007 Alexey Shentzev <ashen@altlinux.ru> 0.9.22-alt1
- first buid for sisyphus
- Thanks Slava Dubrovskiy <dubrsl@altlinux.org> for help
