]> git.pld-linux.org Git - packages/fpc.git/blob - fpc.spec
- added documentation build fix from fedora
[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:        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:  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-static >= 3:2.17.50
29 BuildRequires:  gpm-devel
30 BuildRequires:  ncurses-devel
31 BuildRequires:  rpmbuild(macros) >= 1.213
32 %if %{with ide}
33 BuildRequires:  gdb-lib >= 7.2-7
34 BuildRequires:  python-static
35 BuildRequires:  readline-static
36 BuildRequires:  libselinux-static
37 BuildRequires:  libsepol-static
38 BuildRequires:  zlib-static
39 BuildRequires:  xz-static
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 %build
160 # use ld.bfd
161 [ -d our-ld ] || install -d our-ld
162 ln -sf %{_bindir}/ld.bfd our-ld/ld
163 export PATH=$(pwd)/our-ld:$PATH
164
165 PP=`pwd`/bin/lib/%{name}/%{_bver}/ppc%{_bname}
166 NEWPP=`pwd`/fpcsrc/compiler/ppc%{_bname}
167 NEWFPDOC=`pwd`/fpcsrc/utils/fpdoc/fpdoc
168
169 # DO NOT PUT $RPM_OPT_FLAGS IN OPT, IT DOES NOT WORK - baggins
170 case "%{_build_cpu}" in
171         i386) OPTF="-OG2p1" ;;
172         i486) OPTF="-OG2p1" ;;
173         i586) OPTF="-OG2p2" ;;
174         i686) OPTF="-Og2p3" ;;
175         athlon) OPTF="-Og2p3" ;;
176         *) OPTF="-O2" ;;
177 esac
178
179 %{__make} -C fpcsrc compiler_cycle \
180         OPT="$OPTF -Xs -n" \
181         RELEASE="1" \
182         BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
183         BININSTALLDIR=%{_bindir} \
184         PP="$PP" \
185         FPC="$PP" \
186         LINKSMART=YES
187
188 %{__make} -C fpcsrc OPT="$OPTF -Xs -n" \
189         RELEASE="1" \
190         BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
191         BININSTALLDIR=%{_bindir} \
192         GDBLIBDIR=%{_libdir} \
193         PP="$NEWPP" \
194         FPC="$NEWPP" \
195         FPDOC=$NEWFPDOC \
196         DATA2INC=`pwd`/utils/data2inc \
197         LINKSMART=YES \
198         NODOCS=YES \
199         rtl_clean \
200         packages_clean \
201         utils_clean \
202         %{?with_ide: ide_clean installer_clean} \
203         rtl_all \
204         packages_all \
205         utils_all %{?with_ide:ide_all installer_all}
206
207 %if %{with doc}
208 export save_size=10000
209 %{__make} -j1 -C fpcdocs \
210         FPDOC=$NEWFPDOC \
211         FPC="$NEWPP" \
212         pdf
213 %endif
214
215 %install
216 rm -rf $RPM_BUILD_ROOT
217 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir},%{_datadir}/fpcsrc,%{_examplesdir}/fpc}
218
219 cp -af fpc-src/* $RPM_BUILD_ROOT%{_datadir}/fpcsrc
220
221 NEWPP=`pwd`/fpcsrc/compiler/ppc%{_bname}
222 FPCMAKE=`pwd`/fpcsrc/utils/fpcm/fpcmake
223 %{__make} -j1 -C fpcsrc \
224         compiler_distinstall \
225         rtl_distinstall \
226         packages_distinstall \
227         %{?with_ide:ide_distinstall} \
228         utils_distinstall \
229         PP="$NEWPP" \
230         FPCMAKE="$FPCMAKE" \
231         SMARTLINK=YES \
232         INSTALL_PREFIX=$RPM_BUILD_ROOT%{_prefix} \
233         INSTALL_BINDIR=$RPM_BUILD_ROOT%{_bindir} \
234         INSTALL_LIBDIR=$RPM_BUILD_ROOT%{_libdir} \
235         INSTALL_DOCDIR=$RPM_BUILD_ROOT%{_docdir} \
236         INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir} \
237         INSTALL_BASEDIR=$RPM_BUILD_ROOT%{_libdir}/%{name}/%{version} \
238         INSTALL_EXAMPLEDIR=$RPM_BUILD_ROOT%{_examplesdir}/%{name} \
239         INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir} \
240         CODPATH=$RPM_BUILD_ROOT%{_libdir}/%{name}/lexyacc
241
242 %{__make} -j1 -C install/man installman \
243         INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir}
244
245 ln -sf ../%{_lib}/%{name}/%{version}/ppc%{_bname} $RPM_BUILD_ROOT%{_bindir}
246
247 ln -sf %{_bindir}/ld.bfd $RPM_BUILD_ROOT%{_libdir}/%{name}/%{version}/ld
248
249 sh fpc-src/compiler/utils/samplecfg $RPM_BUILD_ROOT%{_libdir}/%{name}/%{version} $RPM_BUILD_ROOT%{_sysconfdir}
250 %{__sed} -i -e "s,$RPM_BUILD_ROOT,,g" $RPM_BUILD_ROOT%{_sysconfdir}/{*.cfg,fppkg/default}
251
252 %clean
253 rm -rf $RPM_BUILD_ROOT
254
255 %files
256 %defattr(644,root,root,755)
257 %attr(755,root,root) %{_bindir}/*
258 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fpc.cfg
259 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fppkg.cfg
260 %dir %{_sysconfdir}/fppkg
261 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fppkg/default
262 %dir %{_libdir}/%{name}
263 %dir %{_libdir}/%{name}/%{version}
264 %dir %{_libdir}/%{name}/lexyacc
265 %{_libdir}/%{name}/%{version}/msg
266 %{_libdir}/%{name}/%{version}/units
267 %if %{with ide}
268 %{_libdir}/%{name}/%{version}/ide
269 %endif
270 %{_libdir}/%{name}/lexyacc/*
271 %attr(755,root,root) %{_libdir}/%{name}/%{version}/ld
272 %attr(755,root,root) %{_libdir}/%{name}/%{version}/ppc%{_bname}
273 %attr(755,root,root) %{_libdir}/%{name}/%{version}/samplecfg
274 %{_mandir}/man*/*
275
276 %files src
277 %defattr(644,root,root,755)
278 %{_datadir}/fpcsrc
279
280 %files examples
281 %defattr(644,root,root,755)
282 %{_examplesdir}/fpc
283
284 %if %{with doc}
285 %files doc
286 %defattr(644,root,root,755)
287 %doc fpcdocs/*.pdf
288 %endif
This page took 0.089151 seconds and 3 git commands to generate.