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