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