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