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