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