]> git.pld-linux.org Git - packages/fpc.git/blame - fpc.spec
- release 6 (by relup.sh)
[packages/fpc.git] / fpc.spec
CommitLineData
d59a3c01
BZ
1#
2# Conditional build:
938b52f5 3%bcond_without ide # build with ide
d59a3c01
BZ
4%bcond_without doc # build without doc
5
e8f622a3 6Summary: 32-bit compiler for the i386 and m68k processors
1d1a4bc8
ER
7Summary(pl.UTF-8): 32 bitowy kompilator dla procesorów i386 i m68k
8Summary(ru.UTF-8): Свободный компилятор Pascal
9Summary(uk.UTF-8): Вільний компілятор Pascal
e8f622a3 10Name: fpc
9a6604f5 11Version: 2.6.4
b413f5b0 12Release: 6
3c782031 13License: GPL v2+
e8f622a3 14Group: Development/Languages
7ab23651 15Source0: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/source/%{name}build-%{version}.tar.gz
9a6604f5 16# Source0-md5: 403da132aed194fd841d46c3b33b022a
7ab23651 17Source1: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/i386-linux/%{name}-%{version}.i386-linux.tar
9a6604f5 18# Source1-md5: 915f799dd58b5429f06a48d4bd84a9c2
7ab23651 19Source2: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/x86_64-linux/%{name}-%{version}.x86_64-linux.tar
9a6604f5 20# Source2-md5: ffc3cae4a72b60efb6873b9ce5c8a0f2
e7da2251 21Source3: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/powerpc-linux/%{name}-%{version}.powerpc-linux.tar
9a6604f5 22# Source3-md5: 28eb428bfaa8a72e49be05ed0efa0081
786da423 23Patch0: %{name}-skip-dev-dot.patch
938b52f5 24Patch1: %{name}-link.patch
04dae7e9 25Patch2: %{name}-gdb.patch
ff731c41 26Patch3: %{name}-r22920.patch
e8f622a3 27URL: http://www.freepascal.org/
3c782031 28BuildRequires: binutils-devel >= 3:2.17.50
f5681e7a 29BuildRequires: gpm-devel
41cff313 30BuildRequires: ncurses-devel
3f331815 31BuildRequires: rpmbuild(macros) >= 1.213
938b52f5 32%if %{with ide}
9a6604f5 33BuildRequires: babeltrace-devel
3c782031 34BuildRequires: expat-devel
7c170f2b 35BuildRequires: gdb-lib >= 7.2-7
9a6604f5 36BuildRequires: guile-devel
3c782031
JB
37BuildRequires: python-devel
38BuildRequires: readline-devel
39BuildRequires: libselinux-devel
40BuildRequires: xz-devel
41BuildRequires: zlib-devel
938b52f5
JR
42%endif
43%if %{with doc}
44BuildRequires: tetex-fonts-jknappen
45BuildRequires: tetex-format-pdflatex
46BuildRequires: tetex-makeindex
47BuildRequires: tetex-metafont
48BuildRequires: texlive-xetex
49%endif
7da7a711 50Requires: binutils
41cff313 51Provides: fpc-bootstrap
0ba63043 52ExclusiveArch: %{ix86} %{x8664} ppc
e7e4f882 53BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
e8f622a3
AM
54
55%description
5da97089 56Free Pascal is a 32-bit compiler for the i386 and m68k processors.
57Free Pascal is designed to be, as much as possible, source compatible
58with Turbo Pascal 7.0 and Delphi 4 (although this goal is not yet
59attained), but it also enhances these languages with elements like
60function overloading. And, unlike these ancestors, it supports
61multiple platforms.
e8f622a3 62
6b989699
JR
63%description -l pl.UTF-8
64Free Pascal to 32 bitowy kompilator dla procesorów i386 oraz m86k.
65Free Pascal został zaprojektowany by być (jak tylko to możliwe)
66kompatybilnym z Turbo Pascal 7.0 oraz Delphi 4. Free Pascal również
67rozszerza te języki elementami takimi jak przeciążanie funkcji.
e8f622a3 68
6b989699
JR
69%description -l ru.UTF-8
70FPC -- 32-битный компилятор Pascal, совместимый с Turbo Pascal 7.0 и
71Delphi. Поставляется с RTL (библиотекой времени исполнения), FCL
72(библиотекой свободных компонент), интерфейсами к gtk, ncurses, zlib,
3c3a6271 73mysql, postgres, ibase.
def44520 74
6b989699
JR
75%description -l uk.UTF-8
76FPC -- 32-бітний компілятор Pascal, сумісний із Turbo Pascal 7.0 та
77Delphi. Постачається із RTL (бібліотекою часу виконання), FCL
78(бібліотекою вільних компонент), інтерфейсами до gtk, ncurses, zlib,
3c3a6271 79mysql, postgres, ibase.
def44520 80
412a5ed9
KK
81%package src
82Summary: Free Pascal Compiler source files
1d1a4bc8 83Summary(pl.UTF-8): Pliki źródłowe kompilatora Free Pascal
412a5ed9 84Group: Development
412a5ed9 85Requires: %{name} = %{version}-%{release}
41cff313 86Provides: fpcsrc
412a5ed9
KK
87
88%description src
89Free Pascal Compiler source files.
90
6b989699
JR
91%description src -l pl.UTF-8
92Pliki źródłowe kompilatora Free Pascal.
412a5ed9 93
1eee4a0c
JR
94%package examples
95Summary: Free Pascal Compiler exaple programs
1d1a4bc8 96Summary(pl.UTF-8): Przykładowe programy do kompilatora Free Pascal
1eee4a0c 97Group: Documentation
3f331815 98Requires: %{name} = %{version}-%{release}
1eee4a0c
JR
99
100%description examples
101Free Pascal Compiler exaple programs.
102
6b989699
JR
103%description examples -l pl.UTF-8
104Przykładowe programy do kompilatora Free Pascal.
1eee4a0c 105
786da423
JR
106%package doc
107Summary: Free Pascal Compiler documentation
1d1a4bc8 108Summary(pl.UTF-8): Dokumentacja do kompilatora Free Pascal
786da423 109Group: Documentation
7ab23651 110# doesn't require base
786da423
JR
111
112%description doc
113Documentation for fpc in PDF format.
114
6b989699 115%description doc -l pl.UTF-8
786da423
JR
116Dokumentacja do fpc w formacie PDF.
117
e8f622a3 118%prep
d59a3c01 119%setup -q -n %{name}build-%{version}
786da423 120%patch0 -p1
938b52f5 121%patch1 -p1
04dae7e9 122%patch2 -p1
ff731c41 123%patch3 -p0
d59a3c01 124
d3e9323d 125%ifarch %{ix86}
786da423 126tar xf %{SOURCE1}
4e71325a 127%define _bver %{version}
d3e9323d 128%define _bname 386
04dae7e9 129%define _barch i386
d3e9323d 130%endif
3f331815 131%ifarch %{x8664}
786da423 132tar xf %{SOURCE2}
4e71325a 133%define _bver %{version}
d3e9323d 134%define _bname x64
04dae7e9 135%define _barch x86_64
d3e9323d 136%endif
add5738b 137%ifarch ppc
786da423 138tar xf %{SOURCE3}
4e71325a 139%define _bver %{version}
add5738b 140%define _bname ppc
04dae7e9 141%define _barch powepc
add5738b 142%endif
d3e9323d 143
04dae7e9 144cd %{name}-%{version}.%{_barch}-linux
786da423 145tar xf binary.*-linux.tar
04dae7e9 146cd ..
786da423
JR
147
148mkdir bin
149cd bin
04dae7e9 150for i in ../%{name}-%{version}.%{_barch}-linux/*.tar.gz ; do
786da423
JR
151 tar xzf $i
152done
4e71325a 153ln -sf `pwd`/lib/%{name}/%{_bver}/ppc* bin
938b52f5 154cd ..
786da423 155
25d5e663
JR
156find fpcsrc -name Makefile -o -name fpcmake.ini -o -name fpmkunit.pp | \
157 xargs %{__sed} -i -e 's|/usr/lib/|%{_libdir}/|g'
158
412a5ed9
KK
159# save for fpc-src
160install -d fpc-src
161cp -af fpcsrc/* fpc-src
add634ff 162rm -r fpc-src/{ide,tests}
412a5ed9 163
008ddcda 164%if 0%{?debug:1}
25d5e663 165find fpcsrc -name Makefile | xargs %{__sed} -i -e 's/-Xs//'
008ddcda
JB
166%endif
167
938b52f5
JR
168%build
169# use ld.bfd
170[ -d our-ld ] || install -d our-ld
171ln -sf %{_bindir}/ld.bfd our-ld/ld
172export PATH=$(pwd)/our-ld:$PATH
173
4e71325a 174PP=`pwd`/bin/lib/%{name}/%{_bver}/ppc%{_bname}
80841e72 175NEWPP=`pwd`/fpcsrc/compiler/ppc%{_bname}
176NEWFPDOC=`pwd`/fpcsrc/utils/fpdoc/fpdoc
9a6604f5 177DATA2INC=`pwd`/fpcsrc/utils/data2inc
d3e9323d 178
ca161524 179# DO NOT PUT $RPM_OPT_FLAGS IN OPT, IT DOES NOT WORK - baggins
180case "%{_build_cpu}" in
d59a3c01
BZ
181 i386) OPTF="-OG2p1" ;;
182 i486) OPTF="-OG2p1" ;;
183 i586) OPTF="-OG2p2" ;;
184 i686) OPTF="-Og2p3" ;;
185 athlon) OPTF="-Og2p3" ;;
186 *) OPTF="-O2" ;;
ca161524 187esac
188
80841e72 189%{__make} -C fpcsrc compiler_cycle \
008ddcda 190 OPT="$OPTF %{!?debug:-Xs} -n" \
d88793f7 191 RELEASE="1" \
e8f622a3
AM
192 BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
193 BININSTALLDIR=%{_bindir} \
9a6604f5 194 DATA2INC="$DATA2INC" \
1eee4a0c 195 PP="$PP" \
94c54379 196 FPC="$PP" \
d59a3c01 197 LINKSMART=YES
94c54379 198
008ddcda 199%{__make} -C fpcsrc OPT="$OPTF %{!?debug:-Xs} -n" \
d88793f7 200 RELEASE="1" \
5edb3786
SZ
201 BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
202 BININSTALLDIR=%{_bindir} \
fee73cf5 203 GDBLIBDIR=%{_libdir} \
9a6604f5 204 DATA2INC="$DATA2INC" \
5edb3786 205 PP="$NEWPP" \
94c54379 206 FPC="$NEWPP" \
d59a3c01 207 FPDOC=$NEWFPDOC \
d59a3c01
BZ
208 LINKSMART=YES \
209 NODOCS=YES \
210 rtl_clean \
211 packages_clean \
212 utils_clean \
213 %{?with_ide: ide_clean installer_clean} \
214 rtl_all \
215 packages_all \
938b52f5 216 utils_all %{?with_ide:ide_all installer_all}
f5681e7a 217
d59a3c01 218%if %{with doc}
786da423 219export save_size=10000
cbfcda9f 220%{__make} -j1 -C fpcdocs \
786da423
JR
221 FPDOC=$NEWFPDOC \
222 FPC="$NEWPP" \
223 pdf
d59a3c01 224%endif
786da423 225
e8f622a3
AM
226%install
227rm -rf $RPM_BUILD_ROOT
412a5ed9
KK
228install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir},%{_datadir}/fpcsrc,%{_examplesdir}/fpc}
229
230cp -af fpc-src/* $RPM_BUILD_ROOT%{_datadir}/fpcsrc
e8f622a3 231
80841e72 232NEWPP=`pwd`/fpcsrc/compiler/ppc%{_bname}
233FPCMAKE=`pwd`/fpcsrc/utils/fpcm/fpcmake
7be7bd7e 234%{__make} -j1 -C fpcsrc \
f5681e7a 235 compiler_distinstall \
236 rtl_distinstall \
f5681e7a 237 packages_distinstall \
d59a3c01 238 %{?with_ide:ide_distinstall} \
f5681e7a 239 utils_distinstall \
d3e9323d 240 PP="$NEWPP" \
241 FPCMAKE="$FPCMAKE" \
f5681e7a 242 SMARTLINK=YES \
25d5e663 243 FPCDIR=%{_libdir}/%{name}/%{version} \
8bf0c9cb 244 INSTALL_PREFIX=$RPM_BUILD_ROOT%{_prefix} \
245 INSTALL_BINDIR=$RPM_BUILD_ROOT%{_bindir} \
246 INSTALL_LIBDIR=$RPM_BUILD_ROOT%{_libdir} \
247 INSTALL_DOCDIR=$RPM_BUILD_ROOT%{_docdir} \
248 INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir} \
d88793f7 249 INSTALL_BASEDIR=$RPM_BUILD_ROOT%{_libdir}/%{name}/%{version} \
f5681e7a 250 INSTALL_EXAMPLEDIR=$RPM_BUILD_ROOT%{_examplesdir}/%{name} \
7da7a711 251 INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir} \
d88793f7 252 CODPATH=$RPM_BUILD_ROOT%{_libdir}/%{name}/lexyacc
d3e9323d 253
7be7bd7e 254%{__make} -j1 -C install/man installman \
80841e72 255 INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir}
9a679a53 256
fcc93709
JR
257ln -sf ../%{_lib}/%{name}/%{version}/ppc%{_bname} $RPM_BUILD_ROOT%{_bindir}
258
259ln -sf %{_bindir}/ld.bfd $RPM_BUILD_ROOT%{_libdir}/%{name}/%{version}/ld
e8f622a3 260
2844e15a
JR
261sh fpc-src/compiler/utils/samplecfg $RPM_BUILD_ROOT%{_libdir}/%{name}/%{version} $RPM_BUILD_ROOT%{_sysconfdir}
262%{__sed} -i -e "s,$RPM_BUILD_ROOT,,g" $RPM_BUILD_ROOT%{_sysconfdir}/{*.cfg,fppkg/default}
e588518e 263
25d5e663
JR
264# I have no idea why some units are installed to /usr/lib - baggins
265%if "%{_lib}" != "lib"
266cd $RPM_BUILD_ROOT/usr/lib/%{name}/%{version}/units
267for d in * ; do
268 %{__mv} $d/* $RPM_BUILD_ROOT%{_libdir}/%{name}/%{version}/units/$d/
269done
270%endif
271
e8f622a3
AM
272%clean
273rm -rf $RPM_BUILD_ROOT
274
e8f622a3
AM
275%files
276%defattr(644,root,root,755)
277%attr(755,root,root) %{_bindir}/*
3c3a6271 278%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fpc.cfg
2844e15a
JR
279%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fppkg.cfg
280%dir %{_sysconfdir}/fppkg
281%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fppkg/default
e8f622a3
AM
282%dir %{_libdir}/%{name}
283%dir %{_libdir}/%{name}/%{version}
d88793f7 284%dir %{_libdir}/%{name}/lexyacc
e8f622a3 285%{_libdir}/%{name}/%{version}/msg
1eee4a0c 286%{_libdir}/%{name}/%{version}/units
d59a3c01 287%if %{with ide}
f5681e7a 288%{_libdir}/%{name}/%{version}/ide
d59a3c01 289%endif
d88793f7 290%{_libdir}/%{name}/lexyacc/*
fcc93709 291%attr(755,root,root) %{_libdir}/%{name}/%{version}/ld
d3e9323d 292%attr(755,root,root) %{_libdir}/%{name}/%{version}/ppc%{_bname}
1eee4a0c 293%attr(755,root,root) %{_libdir}/%{name}/%{version}/samplecfg
7da7a711 294%{_mandir}/man*/*
1eee4a0c 295
412a5ed9
KK
296%files src
297%defattr(644,root,root,755)
298%{_datadir}/fpcsrc
299
1eee4a0c
JR
300%files examples
301%defattr(644,root,root,755)
f5681e7a 302%{_examplesdir}/fpc
786da423 303
d59a3c01 304%if %{with doc}
786da423
JR
305%files doc
306%defattr(644,root,root,755)
307%doc fpcdocs/*.pdf
d59a3c01 308%endif
This page took 0.155572 seconds and 4 git commands to generate.