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