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