]> git.pld-linux.org Git - packages/fpc.git/blame - fpc.spec
- fetch 3.0.2 sources
[packages/fpc.git] / fpc.spec
CommitLineData
d59a3c01
BZ
1#
2# Conditional build:
3e9a31c5
JB
3%bcond_without ide # FPC IDE
4%bcond_without doc # documentation
d59a3c01 5
3e9a31c5
JB
6Summary: Free Pascal - 32-bit Pascal compiler
7Summary(pl.UTF-8): Free Pascal - 32-bitowy kompilator języka Pascal
1d1a4bc8
ER
8Summary(ru.UTF-8): Свободный компилятор Pascal
9Summary(uk.UTF-8): Вільний компілятор Pascal
e8f622a3 10Name: fpc
089b75e2
JR
11Version: 3.0.2
12Release: 1
3c782031 13License: GPL v2+
e8f622a3 14Group: Development/Languages
7ab23651 15Source0: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/source/%{name}build-%{version}.tar.gz
089b75e2 16# Source0-md5: c0fc1662dbe45c1e3f66ed780a443849
7ab23651 17Source1: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/i386-linux/%{name}-%{version}.i386-linux.tar
089b75e2 18# Source1-md5: a58c3a2d7f8625d434abe9518e4ca38c
7ab23651 19Source2: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/x86_64-linux/%{name}-%{version}.x86_64-linux.tar
089b75e2 20# Source2-md5: e5721c1843cff301c5b46abfee17c890
786da423 21Patch0: %{name}-skip-dev-dot.patch
938b52f5 22Patch1: %{name}-link.patch
04dae7e9 23Patch2: %{name}-gdb.patch
1ac879da
JR
24Patch3: fpc-r32374.patch
25Patch4: fpcdocs-r1260.patch
0946044b 26Patch5: fpc-man.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
1ac879da 52ExclusiveArch: %{ix86} %{x8664}
0946044b
JB
53# TODO:
54# %{arm} ftp://ftp.freepascal.org/pub/fpc/dist/3.0.0/arm-linux/fpc-3.0.0.arm-linux-raspberry1wq.tar
55# ppc64 ftp://ftp.freepascal.org/pub/fpc/dist/3.0.0/powerpc64-linux/fpc-3.0.0.powerpc64-linux.tar
e7e4f882 56BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
e8f622a3
AM
57
58%description
3e9a31c5
JB
59Free Pascal is a 32-bit Pascal compiler. Free Pascal is designed to
60be, as much as possible, source compatible with Turbo Pascal 7.0 and
61Delphi 4 (although this goal is not yet attained), but it also
62enhances these languages with elements like function overloading. And,
63unlike these ancestors, it supports multiple platforms.
e8f622a3 64
6b989699 65%description -l pl.UTF-8
3e9a31c5
JB
66Free Pascal to 32-bitowy kompilator języka Pascal. Free Pascal został
67zaprojektowany by być (na ile to tylko możliwe) kompatybilnym z Turbo
68Pascalem 7.0 oraz Delphi 4. Free Pascal również rozszerza te języki
69elementami takimi jak przeciążanie funkcji.
e8f622a3 70
6b989699
JR
71%description -l ru.UTF-8
72FPC -- 32-битный компилятор Pascal, совместимый с Turbo Pascal 7.0 и
73Delphi. Поставляется с RTL (библиотекой времени исполнения), FCL
74(библиотекой свободных компонент), интерфейсами к gtk, ncurses, zlib,
3c3a6271 75mysql, postgres, ibase.
def44520 76
6b989699
JR
77%description -l uk.UTF-8
78FPC -- 32-бітний компілятор Pascal, сумісний із Turbo Pascal 7.0 та
79Delphi. Постачається із RTL (бібліотекою часу виконання), FCL
80(бібліотекою вільних компонент), інтерфейсами до gtk, ncurses, zlib,
3c3a6271 81mysql, postgres, ibase.
def44520 82
3e9a31c5
JB
83%package ide
84Summary: Free Pascal IDE (integrated development environment)
85Summary(pl.UTF-8): Zintegrowane środowisko programistyczne (IDE) Free Pascala
86Group: Development/Tools
87Requires: %{name} = %{version}-%{release}
88
89%description ide
90Free Pascal IDE (integrated development environment).
91
92%description ide -l pl.UTF-8
93Zintegrowane środowisko programistyczne (IDE) Free Pascala.
94
412a5ed9
KK
95%package src
96Summary: Free Pascal Compiler source files
1d1a4bc8 97Summary(pl.UTF-8): Pliki źródłowe kompilatora Free Pascal
412a5ed9 98Group: Development
412a5ed9 99Requires: %{name} = %{version}-%{release}
41cff313 100Provides: fpcsrc
412a5ed9
KK
101
102%description src
103Free Pascal Compiler source files.
104
6b989699
JR
105%description src -l pl.UTF-8
106Pliki źródłowe kompilatora Free Pascal.
412a5ed9 107
1eee4a0c
JR
108%package examples
109Summary: Free Pascal Compiler exaple programs
1d1a4bc8 110Summary(pl.UTF-8): Przykładowe programy do kompilatora Free Pascal
1eee4a0c 111Group: Documentation
3f331815 112Requires: %{name} = %{version}-%{release}
1eee4a0c
JR
113
114%description examples
115Free Pascal Compiler exaple programs.
116
6b989699
JR
117%description examples -l pl.UTF-8
118Przykładowe programy do kompilatora Free Pascal.
1eee4a0c 119
786da423
JR
120%package doc
121Summary: Free Pascal Compiler documentation
1d1a4bc8 122Summary(pl.UTF-8): Dokumentacja do kompilatora Free Pascal
786da423 123Group: Documentation
7ab23651 124# doesn't require base
786da423
JR
125
126%description doc
127Documentation for fpc in PDF format.
128
6b989699 129%description doc -l pl.UTF-8
786da423
JR
130Dokumentacja do fpc w formacie PDF.
131
e8f622a3 132%prep
d59a3c01 133%setup -q -n %{name}build-%{version}
786da423 134%patch0 -p1
938b52f5 135%patch1 -p1
04dae7e9 136%patch2 -p1
ff731c41 137%patch3 -p0
089b75e2 138#%patch4 -p0
0946044b 139%patch5 -p1
d59a3c01 140
d3e9323d 141%ifarch %{ix86}
786da423 142tar xf %{SOURCE1}
4e71325a 143%define _bver %{version}
d3e9323d 144%define _bname 386
04dae7e9 145%define _barch i386
d3e9323d 146%endif
3f331815 147%ifarch %{x8664}
786da423 148tar xf %{SOURCE2}
4e71325a 149%define _bver %{version}
d3e9323d 150%define _bname x64
04dae7e9 151%define _barch x86_64
d3e9323d 152%endif
0946044b
JB
153%ifarch %{arm}
154%define _bver %{version}
155%define _bname arm
156%define _barch arm
157%endif
158%ifarch ppc
159%define _bver ?
160%define _bname ppc
161%define _barch powerpc
162%endif
163%ifarch ppc64
164%define _bver %{version}
165%define _bname ppc64
166%define _barch powerpc64
167%endif
168%ifarch sparc sparcv9
169%define _bver ?
170%define _bname sparc
171%define _barch sparc
172%endif
d3e9323d 173
04dae7e9 174cd %{name}-%{version}.%{_barch}-linux
786da423 175tar xf binary.*-linux.tar
04dae7e9 176cd ..
786da423
JR
177
178mkdir bin
179cd bin
04dae7e9 180for i in ../%{name}-%{version}.%{_barch}-linux/*.tar.gz ; do
786da423
JR
181 tar xzf $i
182done
4e71325a 183ln -sf `pwd`/lib/%{name}/%{_bver}/ppc* bin
938b52f5 184cd ..
786da423 185
25d5e663
JR
186find fpcsrc -name Makefile -o -name fpcmake.ini -o -name fpmkunit.pp | \
187 xargs %{__sed} -i -e 's|/usr/lib/|%{_libdir}/|g'
188
0946044b
JB
189# remove precompiled objects from fpc-src
190%{__rm} fpcsrc/rtl/palmos/m68k/{libcrt.a,*.o}
191
412a5ed9
KK
192# save for fpc-src
193install -d fpc-src
194cp -af fpcsrc/* fpc-src
add634ff 195rm -r fpc-src/{ide,tests}
412a5ed9 196
008ddcda 197%if 0%{?debug:1}
25d5e663 198find fpcsrc -name Makefile | xargs %{__sed} -i -e 's/-Xs//'
008ddcda
JB
199%endif
200
938b52f5
JR
201%build
202# use ld.bfd
203[ -d our-ld ] || install -d our-ld
204ln -sf %{_bindir}/ld.bfd our-ld/ld
205export PATH=$(pwd)/our-ld:$PATH
206
4e71325a 207PP=`pwd`/bin/lib/%{name}/%{_bver}/ppc%{_bname}
80841e72 208NEWPP=`pwd`/fpcsrc/compiler/ppc%{_bname}
1ac879da
JR
209NEWFPDOC=`pwd`/fpcsrc/utils/fpdoc/bin/%{_barch}-linux/fpdoc
210DATA2INC=`pwd`/fpcsrc/utils/bin/%{_barch}-linux/data2inc
d3e9323d 211
ca161524 212# DO NOT PUT $RPM_OPT_FLAGS IN OPT, IT DOES NOT WORK - baggins
213case "%{_build_cpu}" in
0946044b 214 i386|i486) OPTF="-OG2p1" ;;
d59a3c01 215 i586) OPTF="-OG2p2" ;;
0946044b 216 i686|athlon|pentium3|pentium4|x86_64|amd64|ia32e) OPTF="-Og2p3" ;;
d59a3c01 217 *) OPTF="-O2" ;;
ca161524 218esac
219
80841e72 220%{__make} -C fpcsrc compiler_cycle \
008ddcda 221 OPT="$OPTF %{!?debug:-Xs} -n" \
d88793f7 222 RELEASE="1" \
e8f622a3
AM
223 BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
224 BININSTALLDIR=%{_bindir} \
9a6604f5 225 DATA2INC="$DATA2INC" \
1eee4a0c 226 PP="$PP" \
94c54379 227 FPC="$PP" \
d59a3c01 228 LINKSMART=YES
94c54379 229
008ddcda 230%{__make} -C fpcsrc OPT="$OPTF %{!?debug:-Xs} -n" \
d88793f7 231 RELEASE="1" \
5edb3786
SZ
232 BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
233 BININSTALLDIR=%{_bindir} \
fee73cf5 234 GDBLIBDIR=%{_libdir} \
9a6604f5 235 DATA2INC="$DATA2INC" \
5edb3786 236 PP="$NEWPP" \
94c54379 237 FPC="$NEWPP" \
d59a3c01 238 FPDOC=$NEWFPDOC \
d59a3c01
BZ
239 LINKSMART=YES \
240 NODOCS=YES \
241 rtl_clean \
242 packages_clean \
243 utils_clean \
244 %{?with_ide: ide_clean installer_clean} \
245 rtl_all \
246 packages_all \
938b52f5 247 utils_all %{?with_ide:ide_all installer_all}
f5681e7a 248
d59a3c01 249%if %{with doc}
786da423 250export save_size=10000
cbfcda9f 251%{__make} -j1 -C fpcdocs \
786da423
JR
252 FPDOC=$NEWFPDOC \
253 FPC="$NEWPP" \
254 pdf
d59a3c01 255%endif
786da423 256
e8f622a3
AM
257%install
258rm -rf $RPM_BUILD_ROOT
412a5ed9
KK
259install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir},%{_datadir}/fpcsrc,%{_examplesdir}/fpc}
260
261cp -af fpc-src/* $RPM_BUILD_ROOT%{_datadir}/fpcsrc
e8f622a3 262
80841e72 263NEWPP=`pwd`/fpcsrc/compiler/ppc%{_bname}
1ac879da 264FPCMAKE=`pwd`/fpcsrc/utils/fpcm/bin/%{_barch}-linux/fpcmake
7be7bd7e 265%{__make} -j1 -C fpcsrc \
f5681e7a 266 compiler_distinstall \
267 rtl_distinstall \
f5681e7a 268 packages_distinstall \
d59a3c01 269 %{?with_ide:ide_distinstall} \
f5681e7a 270 utils_distinstall \
d3e9323d 271 PP="$NEWPP" \
272 FPCMAKE="$FPCMAKE" \
f5681e7a 273 SMARTLINK=YES \
25d5e663 274 FPCDIR=%{_libdir}/%{name}/%{version} \
8bf0c9cb 275 INSTALL_PREFIX=$RPM_BUILD_ROOT%{_prefix} \
276 INSTALL_BINDIR=$RPM_BUILD_ROOT%{_bindir} \
277 INSTALL_LIBDIR=$RPM_BUILD_ROOT%{_libdir} \
278 INSTALL_DOCDIR=$RPM_BUILD_ROOT%{_docdir} \
279 INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir} \
d88793f7 280 INSTALL_BASEDIR=$RPM_BUILD_ROOT%{_libdir}/%{name}/%{version} \
f5681e7a 281 INSTALL_EXAMPLEDIR=$RPM_BUILD_ROOT%{_examplesdir}/%{name} \
7da7a711 282 INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir} \
d88793f7 283 CODPATH=$RPM_BUILD_ROOT%{_libdir}/%{name}/lexyacc
d3e9323d 284
7be7bd7e 285%{__make} -j1 -C install/man installman \
80841e72 286 INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir}
9a679a53 287
fcc93709
JR
288ln -sf ../%{_lib}/%{name}/%{version}/ppc%{_bname} $RPM_BUILD_ROOT%{_bindir}
289
290ln -sf %{_bindir}/ld.bfd $RPM_BUILD_ROOT%{_libdir}/%{name}/%{version}/ld
e8f622a3 291
2844e15a
JR
292sh fpc-src/compiler/utils/samplecfg $RPM_BUILD_ROOT%{_libdir}/%{name}/%{version} $RPM_BUILD_ROOT%{_sysconfdir}
293%{__sed} -i -e "s,$RPM_BUILD_ROOT,,g" $RPM_BUILD_ROOT%{_sysconfdir}/{*.cfg,fppkg/default}
e588518e 294
25d5e663 295%if "%{_lib}" != "lib"
902dd00e 296%{__mv} $RPM_BUILD_ROOT%{_prefix}/lib/%{name}/lexyacc $RPM_BUILD_ROOT%{_libdir}/%{name}
25d5e663
JR
297%endif
298
e996f6a1
JR
299# Fix examples, make seems to ignore INSTALL_EXAMPLEDIR
300%{__mv} $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/* $RPM_BUILD_ROOT%{_examplesdir}/fpc/
301
0946044b
JB
302%ifnarch %{ix86}
303%{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/ppc386.1
304%endif
305%ifnarch %{arm}
306%{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/ppcarm.1
307%endif
308%ifnarch ppc ppc64
309%{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/ppcppc.1
310%endif
311%ifnarch sparc sparcv9
312%{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/ppcsparc.1
313%endif
314%ifnarch %{x8664}
315%{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/ppcx64.1
316%endif
317
e8f622a3
AM
318%clean
319rm -rf $RPM_BUILD_ROOT
320
e8f622a3
AM
321%files
322%defattr(644,root,root,755)
0946044b
JB
323%attr(755,root,root) %{_bindir}/bin2obj
324%attr(755,root,root) %{_bindir}/chmcmd
325%attr(755,root,root) %{_bindir}/chmls
326%attr(755,root,root) %{_bindir}/cldrparser
327%attr(755,root,root) %{_bindir}/data2inc
328%attr(755,root,root) %{_bindir}/delp
329%attr(755,root,root) %{_bindir}/fd2pascal
0946044b
JB
330%attr(755,root,root) %{_bindir}/fpc*
331%attr(755,root,root) %{_bindir}/fpdoc
332%attr(755,root,root) %{_bindir}/fppkg
333%attr(755,root,root) %{_bindir}/fprcp
334%attr(755,root,root) %{_bindir}/grab_vcsa
335%attr(755,root,root) %{_bindir}/h2pas
336%attr(755,root,root) %{_bindir}/h2paspp
337%attr(755,root,root) %{_bindir}/instantfpc
338%attr(755,root,root) %{_bindir}/makeskel
339%attr(755,root,root) %{_bindir}/mkarmins
340%attr(755,root,root) %{_bindir}/mkinsadd
341%attr(755,root,root) %{_bindir}/mkx86ins
342%attr(755,root,root) %{_bindir}/pas2fpm
343%attr(755,root,root) %{_bindir}/pas2jni
344%attr(755,root,root) %{_bindir}/pas2ut
345%attr(755,root,root) %{_bindir}/plex
346%attr(755,root,root) %{_bindir}/postw32
347%attr(755,root,root) %{_bindir}/ppc%{_bname}
348%attr(755,root,root) %{_bindir}/ppdep
349%attr(755,root,root) %{_bindir}/ppudump
350%attr(755,root,root) %{_bindir}/ppufiles
351%attr(755,root,root) %{_bindir}/ppumove
352%attr(755,root,root) %{_bindir}/ptop
353%attr(755,root,root) %{_bindir}/pyacc
354%attr(755,root,root) %{_bindir}/rmcvsdir
355%attr(755,root,root) %{_bindir}/rstconv
356%attr(755,root,root) %{_bindir}/unihelper
357%attr(755,root,root) %{_bindir}/unitdiff
3e9a31c5 358# TODO: move the below files to data dir
0946044b
JB
359# - JSON resources(?)
360%{_bindir}/makeskel.rsj
361%{_bindir}/ptop.rsj
3c3a6271 362%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fpc.cfg
2844e15a
JR
363%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fppkg.cfg
364%dir %{_sysconfdir}/fppkg
365%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fppkg/default
e8f622a3
AM
366%dir %{_libdir}/%{name}
367%dir %{_libdir}/%{name}/%{version}
d88793f7 368%dir %{_libdir}/%{name}/lexyacc
e8f622a3 369%{_libdir}/%{name}/%{version}/msg
1eee4a0c 370%{_libdir}/%{name}/%{version}/units
1ac879da 371%{_libdir}/%{name}/%{version}/fpmkinst
d88793f7 372%{_libdir}/%{name}/lexyacc/*
fcc93709 373%attr(755,root,root) %{_libdir}/%{name}/%{version}/ld
d3e9323d 374%attr(755,root,root) %{_libdir}/%{name}/%{version}/ppc%{_bname}
1eee4a0c 375%attr(755,root,root) %{_libdir}/%{name}/%{version}/samplecfg
0946044b
JB
376%{_mandir}/man1/bin2obj.1*
377%{_mandir}/man1/chmcmd.1*
378%{_mandir}/man1/chmls.1*
379%{_mandir}/man1/data2inc.1*
380%{_mandir}/man1/delp.1*
381%{_mandir}/man1/fd2pascal.1*
382%{_mandir}/man1/fp.1*
383%{_mandir}/man1/fpc*.1*
384%{_mandir}/man1/fpdoc.1*
385%{_mandir}/man1/fppkg.1*
386%{_mandir}/man1/fprcp.1*
387%{_mandir}/man1/grab_vcsa.1*
388%{_mandir}/man1/h2pas.1*
389%{_mandir}/man1/h2paspp.1*
390%{_mandir}/man1/makeskel.1*
391%{_mandir}/man1/pas2fpm.1*
392%{_mandir}/man1/pas2jni.1*
393%{_mandir}/man1/pas2ut.1*
394%{_mandir}/man1/plex.1*
395%{_mandir}/man1/postw32.1*
396%ifarch ppc64
397%{_mandir}/man1/ppcppc.1*
398%else
399%{_mandir}/man1/ppc%{_bname}.1*
400%endif
401%{_mandir}/man1/ppdep.1*
402%{_mandir}/man1/ppudump.1*
403%{_mandir}/man1/ppufiles.1*
404%{_mandir}/man1/ppumove.1*
405%{_mandir}/man1/ptop.1*
406%{_mandir}/man1/pyacc.1*
407%{_mandir}/man1/rmcvsdir.1*
408%{_mandir}/man1/rstconv.1*
409%{_mandir}/man1/unitdiff.1*
410%{_mandir}/man5/fpc.cfg.5*
411%{_mandir}/man5/fpcmake.5*
412%{_mandir}/man5/ptop.cfg.5*
1eee4a0c 413
3e9a31c5
JB
414%if %{with ide}
415%files ide
416%defattr(644,root,root,755)
417%attr(755,root,root) %{_bindir}/fp
418# TODO: move the below files to data dir
419# - ANSI art file used by fp binary
420%{_bindir}/fp.ans
421# - IDE command templates
422%{_bindir}/cvsco.tdf
423%{_bindir}/cvsdiff.tdf
424%{_bindir}/cvsup.tdf
425%{_bindir}/grep.tdf
426%{_bindir}/tpgrep.tdf
427# - Pascal code skeletons
428%{_bindir}/gplprog.pt
429%{_bindir}/gplunit.pt
430%{_bindir}/program.pt
431%{_bindir}/unit.pt
432%{_libdir}/%{name}/%{version}/ide
433%endif
434
412a5ed9
KK
435%files src
436%defattr(644,root,root,755)
437%{_datadir}/fpcsrc
438
1eee4a0c
JR
439%files examples
440%defattr(644,root,root,755)
f5681e7a 441%{_examplesdir}/fpc
786da423 442
d59a3c01 443%if %{with doc}
786da423
JR
444%files doc
445%defattr(644,root,root,755)
446%doc fpcdocs/*.pdf
d59a3c01 447%endif
This page took 0.103434 seconds and 4 git commands to generate.