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