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