2011-04-08 18:38:33 +00:00
|
|
|
#
|
|
|
|
# spec file for package lazarus
|
|
|
|
#
|
2009-11-25 09:21:51 +00:00
|
|
|
# Copyright (c) 2008-2009 oc2pus
|
|
|
|
# This file and all modifications and additions to the pristine
|
|
|
|
# package are under the same license as the package itself.
|
|
|
|
#
|
|
|
|
|
|
|
|
# norootforbuild
|
|
|
|
|
|
|
|
Name: lazarus
|
2012-09-29 19:08:42 +00:00
|
|
|
Version: 1.0.0
|
2011-04-08 18:38:33 +00:00
|
|
|
Release: 0
|
2009-11-25 09:21:51 +00:00
|
|
|
Summary: Lazarus Component Library and IDE
|
|
|
|
Group: Development/Languages/Other
|
|
|
|
License: GPL and modified LGPL
|
|
|
|
Url: http://www.lazarus.freepascal.org/
|
2012-09-29 19:08:42 +00:00
|
|
|
Source0: %{name}-%{version}.tar.bz2
|
2009-11-25 09:21:51 +00:00
|
|
|
Source1: %{name}.desktop
|
|
|
|
Source90: %{name}-rpmlintrc
|
|
|
|
Patch: %{name}-Makefile_patch.diff
|
2011-04-08 18:38:33 +00:00
|
|
|
|
2009-11-25 09:21:51 +00:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2011-04-08 18:38:33 +00:00
|
|
|
|
|
|
|
BuildRequires: ImageMagick
|
2009-11-25 09:21:51 +00:00
|
|
|
BuildRequires: dos2unix
|
2012-09-29 19:08:42 +00:00
|
|
|
BuildRequires: fpc >= 2.6.0
|
|
|
|
BuildRequires: fpc-src >= 2.6.0
|
2011-04-08 18:38:33 +00:00
|
|
|
BuildRequires: gtk2
|
|
|
|
BuildRequires: gtk2-devel
|
|
|
|
%if 0%{?suse_version}
|
|
|
|
PreReq: shared-mime-info
|
|
|
|
BuildRequires: fdupes
|
2009-11-25 09:21:51 +00:00
|
|
|
BuildRequires: glib2-devel
|
|
|
|
BuildRequires: update-desktop-files
|
2012-09-29 19:08:42 +00:00
|
|
|
BuildRequires: libdb-4_5-devel
|
2009-11-25 09:21:51 +00:00
|
|
|
Requires: glib2-devel
|
|
|
|
Requires: gtk2-devel
|
2011-04-08 18:38:33 +00:00
|
|
|
%endif
|
|
|
|
Requires: gdb
|
|
|
|
Requires: fpc
|
2009-11-25 09:21:51 +00:00
|
|
|
|
2011-04-08 18:38:33 +00:00
|
|
|
%if 0%{?fedora_version}
|
|
|
|
Requires: fpc-src
|
|
|
|
Requires(post): desktop-file-utils
|
|
|
|
Requires(postun): desktop-file-utils
|
2009-11-25 09:21:51 +00:00
|
|
|
%endif
|
2007-10-12 11:28:26 +00:00
|
|
|
|
|
|
|
%description
|
2009-11-25 09:21:51 +00:00
|
|
|
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.
|
|
|
|
|
|
|
|
%debug_package
|
2007-10-12 11:28:26 +00:00
|
|
|
|
|
|
|
%prep
|
2009-11-25 09:21:51 +00:00
|
|
|
%setup -q -n %{name}
|
|
|
|
%patch -p1
|
|
|
|
|
|
|
|
# remove the files for building debian-repositories
|
|
|
|
%__rm -rf debian
|
|
|
|
%__rm -rf tools/install/cross_unix/debian_crosswin32
|
|
|
|
%__rm tools/install/cross_unix/create_linux_cross_win32_deb.sh
|
|
|
|
%__rm tools/install/cross_unix/HowToCreate_fpc_crosswin32_deb.txt
|
|
|
|
|
2011-04-08 18:38:33 +00:00
|
|
|
# remove the files for installing on macosx
|
|
|
|
%__rm -rf tools/install/macosx/
|
|
|
|
|
2009-11-25 09:21:51 +00:00
|
|
|
# remove scripts vulnerable to symlink-attacks (bug 460642)
|
|
|
|
%__rm tools/install/build_fpc_snaphot_rpm.sh
|
|
|
|
%__rm tools/install/check_fpc_dependencies.sh
|
|
|
|
%__rm tools/install/create_fpc_deb.sh
|
|
|
|
%__rm tools/install/create_fpc_export_tgz.sh
|
|
|
|
%__rm tools/install/create_fpc_rpm.sh
|
|
|
|
%__rm tools/install/create_fpc-src_rpm.sh
|
|
|
|
%__rm tools/install/create_fpc_tgz_from_local_dir.sh
|
|
|
|
%__rm tools/install/create_lazarus_export_tgz.sh
|
|
|
|
|
|
|
|
# fix lineencodings
|
|
|
|
dos2unix examples/gridexamples/grid_semaphor/example/table0*.stb
|
|
|
|
dos2unix examples/trayicon/frmtest.*
|
|
|
|
dos2unix examples/trayicon/wndtray.*
|
2007-10-12 11:28:26 +00:00
|
|
|
|
|
|
|
%build
|
2012-09-29 19:08:42 +00:00
|
|
|
|
2009-11-25 09:21:51 +00:00
|
|
|
export FPCDIR=%{_datadir}/fpcsrc/
|
|
|
|
fpcmake -Tall
|
|
|
|
|
|
|
|
MAKEOPTS="-gl -Fl/usr/%{_lib}"
|
2007-10-12 11:28:26 +00:00
|
|
|
if [ -n "$FPCCfg" ]; then
|
2012-09-29 19:08:42 +00:00
|
|
|
MAKEOPTS="$MAKEOPTS -n @$FPCCfg"
|
|
|
|
fi
|
|
|
|
#CHMHELP:MAKEOPTS="$MAKEOPTS -dUseCHMHelp"
|
|
|
|
make bigide OPT="$MAKEOPTS" USESVN2REVISIONINC=0
|
|
|
|
export LCL_PLATFORM=
|
|
|
|
strip lazarus
|
|
|
|
strip startlazarus
|
|
|
|
strip lazbuild
|
|
|
|
strip tools/lazres
|
|
|
|
strip tools/updatepofiles
|
|
|
|
strip tools/lrstolfm
|
|
|
|
strip tools/svn2revisioninc
|
|
|
|
if [ -f components/chmhelp/lhelp/lhelp ]; then
|
|
|
|
strip components/chmhelp/lhelp/lhelp
|
2007-10-12 11:28:26 +00:00
|
|
|
fi
|
2009-11-25 09:21:51 +00:00
|
|
|
|
2011-04-08 18:38:33 +00:00
|
|
|
# build Qt4 interface
|
2012-09-29 19:08:42 +00:00
|
|
|
make -C lcl/interfaces/qt all LCL_PLATFORM=qt OPT="-dQT_NATIVE_DIALOGS"
|
2007-10-12 11:28:26 +00:00
|
|
|
|
|
|
|
%install
|
2012-09-29 19:08:42 +00:00
|
|
|
|
|
|
|
install -dm 755 %{buildroot}%{_libdir}/%{name}
|
|
|
|
make install \
|
|
|
|
INSTALL_PREFIX=%{buildroot}%{_prefix} \
|
|
|
|
INSTALL_LIBDIR=%{buildroot}%{_libdir} INSTALL_BINDIR=%{buildroot}%{_bindir} \
|
|
|
|
LAZARUS_INSTALL_DIR=%{buildroot}%{_libdir}/%{name} \
|
2009-11-25 09:21:51 +00:00
|
|
|
|
|
|
|
# convenience links
|
2012-09-29 19:08:42 +00:00
|
|
|
for f in lazarus lazbuild startlazarus; do
|
|
|
|
rm -f %{buildroot}%{_bindir}/$f
|
|
|
|
ln -sf ../%{_lib}/%{name}/$f %{buildroot}%{_bindir}/$f
|
|
|
|
done
|
|
|
|
rm -f %{buildroot}%{_bindir}/lazarus-ide
|
|
|
|
ln -sf ../%{_lib}/%{name}/lazarus %{buildroot}%{_bindir}/lazarus-ide
|
|
|
|
for f in lazres lrstolfm updatepofiles; do
|
|
|
|
ln -sf ../%{_lib}/%{name}/tools/$f %{buildroot}%{_bindir}/$f
|
|
|
|
cat %{buildroot}%{_libdir}/%{name}/install/man/man1/${f}.1 | gzip > %{buildroot}%{_mandir}/man1/${f}.1.gz
|
|
|
|
done
|
2011-04-08 18:38:33 +00:00
|
|
|
|
2009-11-25 09:21:51 +00:00
|
|
|
# collect docs and samples
|
2012-09-29 19:08:42 +00:00
|
|
|
install -dm 755 %{buildroot}%{_defaultdocdir}/%{name}
|
|
|
|
mv %{buildroot}%{_libdir}/%{name}/examples %{buildroot}%{_defaultdocdir}/%{name}
|
|
|
|
ln -s %{_defaultdocdir}/%{name}/examples %{buildroot}%{_libdir}/%{name}/examples
|
|
|
|
mv %{buildroot}%{_libdir}/%{name}/docs %{buildroot}%{_defaultdocdir}/%{name}
|
|
|
|
ln -s %{_defaultdocdir}/%{name}/docs %{buildroot}%{_libdir}/%{name}/docs
|
|
|
|
mv %{buildroot}%{_libdir}/%{name}/COPYING* %{buildroot}%{_libdir}/%{name}/README* %{buildroot}%{_defaultdocdir}/%{name}
|
2009-11-25 09:21:51 +00:00
|
|
|
|
|
|
|
# icon
|
2012-09-29 19:08:42 +00:00
|
|
|
install -dm 755 %{buildroot}%{_datadir}/pixmaps
|
|
|
|
install -m 644 images/icons/lazarus128x128.png %{buildroot}%{_datadir}/pixmaps/%{name}.png
|
2009-11-25 09:21:51 +00:00
|
|
|
|
|
|
|
# menu-entry
|
2012-09-29 19:08:42 +00:00
|
|
|
install -dm 755 %{buildroot}%{_datadir}/applications
|
|
|
|
install -m 644 %{SOURCE1} %{buildroot}%{_datadir}/applications/%{name}.desktop
|
2011-04-08 18:38:33 +00:00
|
|
|
%if 0%{?suse_version}
|
2009-11-25 09:21:51 +00:00
|
|
|
%suse_update_desktop_file -n %{name} Development IDE
|
2011-04-08 18:38:33 +00:00
|
|
|
%endif
|
2009-11-25 09:21:51 +00:00
|
|
|
|
|
|
|
# mime info
|
2012-09-29 19:08:42 +00:00
|
|
|
install -dm 755 %{buildroot}%{_datadir}/mime/packages
|
|
|
|
install -m 644 install/%{name}-mime.xml %{buildroot}%{_datadir}/mime/packages/%{name}.xml
|
2009-11-25 09:21:51 +00:00
|
|
|
|
|
|
|
# configs
|
2012-09-29 19:08:42 +00:00
|
|
|
install -dm 755 %{buildroot}%{_sysconfdir}/%{name}
|
|
|
|
install -m 644 tools/install/linux/editoroptions.xml \
|
2009-11-25 09:21:51 +00:00
|
|
|
%{buildroot}%{_sysconfdir}/%{name}/editoroptions.xml
|
2012-09-29 19:08:42 +00:00
|
|
|
cat tools/install/linux/environmentoptions.xml | sed -e "s#__LAZARUSDIR__#$LAZARUSDIR/#" -e "s#__FPCSRCDIR__#%{_datadir}/fpcsrc/#" > %{buildroot}%{_sysconfdir}/%{name}/environmentoptions.xml
|
2009-11-25 09:21:51 +00:00
|
|
|
|
2011-04-08 18:38:33 +00:00
|
|
|
# cleanup
|
2012-09-29 19:08:42 +00:00
|
|
|
rm -rf %{buildroot}%{_libdir}/%{name}/install/man
|
2011-04-08 18:38:33 +00:00
|
|
|
%if 0%{?suse_version}
|
2009-11-25 09:21:51 +00:00
|
|
|
%fdupes -s %{buildroot}
|
2011-04-08 18:38:33 +00:00
|
|
|
%endif
|
2007-10-12 11:28:26 +00:00
|
|
|
|
|
|
|
%clean
|
2012-09-29 19:08:42 +00:00
|
|
|
[ -d "%{buildroot}" -a "%{buildroot}" != "" ] && rm -rf "%{buildroot}"
|
2007-10-12 11:28:26 +00:00
|
|
|
|
|
|
|
%post
|
2011-04-08 18:38:33 +00:00
|
|
|
if [ -x %{_bindir}/update-mime-database ]; then
|
|
|
|
%{_bindir}/update-mime-database %{_datadir}/mime &> /dev/null || :
|
|
|
|
fi
|
2007-10-12 11:28:26 +00:00
|
|
|
|
|
|
|
%postun
|
2011-04-08 18:38:33 +00:00
|
|
|
if [ -x %{_bindir}/update-mime-database ]; then
|
|
|
|
%{_bindir}/update-mime-database %{_datadir}/mime &> /dev/null || :
|
|
|
|
fi
|
|
|
|
%if 0%{?fedora_version}
|
|
|
|
update-desktop-database &> /dev/null ||:
|
|
|
|
%endif
|
2007-10-12 11:28:26 +00:00
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root,-)
|
2009-11-25 09:21:51 +00:00
|
|
|
%doc %{_mandir}/*/*
|
|
|
|
%doc %{_defaultdocdir}/%{name}
|
|
|
|
%dir %{_sysconfdir}/%{name}
|
|
|
|
%config(noreplace) %{_sysconfdir}/%{name}/editoroptions.xml
|
|
|
|
%config(noreplace) %{_sysconfdir}/%{name}/environmentoptions.xml
|
|
|
|
%{_bindir}/%{name}
|
|
|
|
%{_bindir}/%{name}-ide
|
|
|
|
%{_bindir}/lazbuild
|
|
|
|
%{_bindir}/startlazarus
|
2012-09-29 19:08:42 +00:00
|
|
|
%{_bindir}/lazres
|
|
|
|
%{_bindir}/lrstolfm
|
|
|
|
%{_bindir}/updatepofiles
|
2009-11-25 09:21:51 +00:00
|
|
|
%dir %{_libdir}/%{name}
|
|
|
|
%{_libdir}/%{name}/*
|
|
|
|
%{_datadir}/pixmaps/%{name}.png
|
|
|
|
%{_datadir}/applications/%{name}.desktop
|
|
|
|
%{_datadir}/mime/packages/%{name}.xml
|
2007-10-12 11:28:26 +00:00
|
|
|
|
|
|
|
%changelog
|