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