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