2011-04-08 18:38:33 +00:00
#
# spec file for package lazarus
#
2016-11-18 11:38:35 +00:00
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
2009-11-25 09:21:51 +00:00
# Copyright (c) 2008-2009 oc2pus
2012-10-05 14:59:18 +00:00
#
# 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/
2009-11-25 09:21:51 +00:00
#
2011-04-08 18:38:33 +00:00
2012-10-05 14:59:18 +00:00
Name : lazarus
2016-11-18 11:38:35 +00:00
Version : 1.6.2
2012-10-05 14:59:18 +00:00
Release : 0
2013-01-01 21:44:21 +00:00
# Please note that the LGPL is modified and this is not multi-licensed, but each component has a separate license chosen.
License : GPL-2.0 and LGPL-2.0 and MPL-1.1
Summary : FreePascal RAD IDE and Component Library
2012-10-05 14:59:18 +00:00
Url : http://www.lazarus.freepascal.org/
Group : Development/Languages/Other
2013-08-10 04:01:34 +00:00
Source0 : http://downloads.sourceforge.net/%{name} /%{name} -%{version} -0.tar.gz
2017-02-13 12:48:31 +00:00
# PATCH-FEATURE-UPSTREAM http://mantis.freepascal.org/view.php?id=31364
Source1 : https://raw.githubusercontent.com/hughsie/fedora-appstream/developerapps/appdata-extra/desktop/lazarus.appdata.xml
2012-10-05 14:59:18 +00:00
Source90 : %{name} -rpmlintrc
# PATCH-FIX-OPENSUSE lazarus-Makefile_patch.diff -- Change installation path from /usr/share/lazarus to /usr/lib(64)/lazarus
Patch0 : %{name} -Makefile_patch.diff
2013-08-10 04:01:34 +00:00
# PATCH-FIX-OPENSUSE lazarus.desktop.patch -- Fix desktop file
Patch1 : lazarus.desktop.patch
%if 0%{?suse_version} > 1210
BuildRequires : desktop-file-utils
%else
BuildRequires : update-desktop-files
%endif
2009-11-25 09:21:51 +00:00
BuildRequires : dos2unix
2011-04-08 18:38:33 +00:00
BuildRequires : fdupes
2016-06-27 22:06:27 +00:00
BuildRequires : fpc >= 3.0.0
BuildRequires : fpc-src >= 3.0.0
2013-08-10 04:01:34 +00:00
%if 0%{?suse_version} >= 1140
BuildRequires : hicolor-icon-theme
%endif
%if 0%{?sles_version} >= 11
BuildRequires : glib2-devel
BuildRequires : gtk2-devel
2012-10-31 21:53:43 +00:00
%else
2013-08-10 04:01:34 +00:00
BuildRequires : pkgconfig(glib-2.0)
BuildRequires : pkgconfig(gtk+-2.0)
2012-10-31 21:53:43 +00:00
%endif
2011-04-08 18:38:33 +00:00
Requires : fpc
2012-12-11 05:29:29 +00:00
Requires : fpc-src
2012-10-05 14:59:18 +00:00
Requires : gdb
2013-08-10 04:01:34 +00:00
%if 0%{?sles_version} >= 11
Requires : glib2-devel
Requires : gtk2-devel
%else
Requires : pkgconfig(glib-2.0)
Requires : pkgconfig(gtk+-2.0)
%endif
Requires(post) : desktop-file-utils
2012-10-05 14:59:18 +00:00
Requires(post) : shared-mime-info
2013-08-10 04:01:34 +00:00
Requires(postun) : desktop-file-utils
2012-10-05 14:59:18 +00:00
Requires(postun) : shared-mime-info
BuildRoot : %{_tmppath} /%{name} -%{version} -build
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.
2007-10-12 11:28:26 +00:00
%prep
2009-11-25 09:21:51 +00:00
%setup -q -n %{name}
2012-10-05 14:59:18 +00:00
%patch0 -p1
2013-08-10 04:01:34 +00:00
%patch1 -p1
2012-10-05 14:59:18 +00:00
# remove unneeded files
rm -rf debian
rm -rf tools/install/cross_unix/debian_crosswin32/
rm -f tools/install/cross_unix/*deb.*
rm -rf tools/install/debian_*
rm -rf tools/install/freebsd_*
rm -rf tools/install/macosx/
rm -rf tools/install/slacktgz/
rm -rf tools/install/win/
rm -f tools/install/*slacktgz.*
2011-04-08 18:38:33 +00:00
2009-11-25 09:21:51 +00:00
# remove scripts vulnerable to symlink-attacks (bug 460642)
2012-10-05 14:59:18 +00:00
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
2009-11-25 09:21:51 +00:00
# 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
2012-10-05 14:59:18 +00:00
# fix rpmlint error "spurious-executable-perm"
chmod 644 docs/booth/ProdProgEntwMitOpenSourceSystems2007.odp
2017-05-02 21:52:16 +00:00
if [[ $SOURCE_DATE_EPOCH ]] ; then
datestr=$(date -u " - d @ $ S O U R C E _ D A T E _ E P O C H " +%Y/%m/%d)
sed -i -e " s ! { \ $ I % % d a t e % % } ! ' $ d a t e s t r ' ! " \
ide/ideinfodlg.pas ide/aboutfrm.pas ide/idefpcinfo.pas
touch -d@$SOURCE_DATE_EPOCH ide/ideinfodlg.pas ide/aboutfrm.pas ide/idefpcinfo.pas # reset source timestamps because they are embedded in compiled files
fi
2012-09-29 19:08:42 +00:00
2012-10-05 14:59:18 +00:00
%build
2012-10-17 01:15:37 +00:00
# Don't use -gs (use explicitly "stabs" debuginfo) for compiling lhelp but -g (use the default debuginfo type "dwarf") as in the rest of package's Makefiles
# Fixes the "Stabs debuginfo not supported" error when extracting debug info from the package
sed -i " s / \ - g s / \ - g / " components/chmhelp/lhelp/Makefile
2009-11-25 09:21:51 +00:00
export FPCDIR=%{_datadir} /fpcsrc/
fpcmake -Tall
MAKEOPTS=" - g l - F l / u s r / % { _ l i b } "
2013-01-01 21:44:21 +00:00
make bigide OPT=" $ M A K E O P T S "
2012-10-17 01:15:37 +00:00
2012-09-29 19:08:42 +00:00
export LCL_PLATFORM=
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=" - d Q T _ N A T I V E _ D I A L O G S "
2007-10-12 11:28:26 +00:00
%install
2012-09-29 19:08:42 +00:00
make install \
INSTALL_PREFIX=%{buildroot} %{_prefix} \
2013-08-10 04:01:34 +00:00
INSTALL_LIBDIR=%{buildroot} %{_libdir} \
INSTALL_BINDIR=%{buildroot} %{_bindir} \
2012-09-29 19:08:42 +00:00
LAZARUS_INSTALL_DIR=%{buildroot} %{_libdir} /%{name} \
2013-08-10 04:01:34 +00:00
_LIB=%{_lib}
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
2013-08-10 04:01:34 +00:00
# icons
for f in 16 32 48 64 128 256; do
install -Dpm 0644 images/icons/lazarus${f}x${f}.png %{buildroot} %{_datadir} /icons/hicolor/${f}x${f}/apps/%{name} .png
done
2009-11-25 09:21:51 +00:00
# menu-entry
2013-08-10 04:01:34 +00:00
%if 0%{?suse_version} > 1210
desktop-file-install install/lazarus.desktop
%else
install -Dpm 0644 install/lazarus.desktop %{buildroot} %{_datadir} /applications/%{name} .desktop
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
2013-08-10 04:01:34 +00:00
install -Dpm 0644 install/%{name} -mime.xml %{buildroot} %{_datadir} /mime/packages/%{name} .xml
2009-11-25 09:21:51 +00:00
2017-02-13 12:48:31 +00:00
# software gallery metadata
install -Dpm 0644 %{S:1} %{buildroot} %{_datadir} /appdata/%{name} .appdata.xml
2009-11-25 09:21:51 +00:00
# configs
2013-08-10 04:01:34 +00:00
install -Dpm 0644 tools/install/linux/editoroptions.xml %{buildroot} %{_sysconfdir} /%{name} /editoroptions.xml
2012-10-05 14:59:18 +00:00
cat tools/install/linux/environmentoptions.xml | sed -e " s # _ _ L A Z A R U S D I R _ _ # %{_libdir} / %{name} / # " -e " s # _ _ F P C S R C D I R _ _ # %{_datadir} / f p c s r c / # " > %{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
2014-07-10 17:02:10 +00:00
rm -f %{buildroot} %{_libdir} /%{name} /Makefile.fpc.orig
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
%post
2013-08-10 04:01:34 +00:00
%if 0%{?suse_version} >= 1140
%mime_database_post
%icon_theme_cache_post
%desktop_database_post
%else
2012-10-05 14:59:18 +00:00
/usr/bin/update-mime-database %{_datadir} /mime &> /dev/null || :
2013-08-10 04:01:34 +00:00
%endif
2007-10-12 11:28:26 +00:00
%postun
2013-08-10 04:01:34 +00:00
%if 0%{?suse_version} >= 1140
%mime_database_postun
%icon_theme_cache_postun
%desktop_database_postun
%else
2012-10-05 14:59:18 +00:00
/usr/bin/update-mime-database %{_datadir} /mime &> /dev/null || :
2013-08-10 04:01:34 +00:00
%endif
2007-10-12 11:28:26 +00:00
%files
%defattr (-,root,root,-)
2013-08-10 04:01:34 +00:00
%doc %{_mandir} /man1/*
2009-11-25 09:21:51 +00:00
%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
2012-10-05 14:59:18 +00:00
%{_libdir} /%{name} /
2017-02-13 12:48:31 +00:00
# license is problematic
%exclude %{_libdir} /%{name} /components/aggpas/gpc
2009-11-25 09:21:51 +00:00
%{_datadir} /applications/%{name} .desktop
2013-08-10 04:01:34 +00:00
%{_datadir} /icons/hicolor/*/apps/%{name} .png
2015-04-23 04:45:17 +00:00
%{_datadir} /icons/hicolor/48x48/mimetypes/*.png
%{_datadir} /pixmaps/lazarus.png
2009-11-25 09:21:51 +00:00
%{_datadir} /mime/packages/%{name} .xml
2017-02-13 12:48:31 +00:00
%dir %{_datadir} /appdata/
%{_datadir} /appdata/%{name} .appdata.xml
2007-10-12 11:28:26 +00:00
%changelog