]> git.pld-linux.org Git - packages/fpc.git/blob - fpc.spec
- tabs in preamble
[packages/fpc.git] / fpc.spec
1 # TODO:
2 # - check why it builds all static..
3 # - doesn't build on ppc/sparc :/ hgw why
4 Summary:        32-bit compiler for the i386 and m68k processors
5 Summary(pl.UTF-8):      32 bitowy kompilator dla procesorów i386 i m68k
6 Summary(ru.UTF-8):      Свободный компилятор Pascal
7 Summary(uk.UTF-8):      Вільний компілятор Pascal
8 Name:           fpc
9 Version:        2.0.4
10 Release:        2
11 License:        GPL
12 Group:          Development/Languages
13 Source0:        ftp://ftp.freepascal.org/pub/fpc/dist/source-%{version}/%{name}build-%{version}.tar.gz
14 # Source0-md5:  1ff8b80d1f5f564983bb4e1550b8b53a
15 Source1:        ftp://ftp.freepascal.org/pub/fpc/dist/i386-linux-%{version}/%{name}-%{version}.i386-linux.tar
16 # Source1-md5:  d826aab69c98b9efe30398ff63e4c9d9
17 Source2:        ftp://ftp.freepascal.org/pub/fpc/dist/x86_64-linux-%{version}/%{name}-%{version}.x86_64-linux.tar
18 # Source2-md5:  3bbfe4c061ebd40502789eccef069d7c
19 Source3:        ftp://ftp.freepascal.org/pub/fpc/dist/powerpc-linux-%{version}/%{name}-%{version}.powerpc-linux.tar
20 # Source3-md5:  6ec5302fe446d94e5aaa1e159b0d65df
21 # no 2.0.4 binary for sparc, 2.0.0 only
22 Source4:        ftp://ftp.freepascal.org/pub/fpc/dist/sparc-linux-2.0.0/%{name}-2.0.0.sparc-linux.tar
23 # Source4-md5:  dd8925ce8ce93309456c3072e6e4d14d
24 Patch0:         %{name}-skip-dev-dot.patch
25 Patch1:         %{name}-makedocs.patch
26 Patch2:         %{name}-gdb65.patch
27 Patch3:         %{name}-avoid-RE.patch
28 URL:            http://www.freepascal.org/
29 BuildRequires:  binutils-static >= 3:2.17.50
30 BuildRequires:  gdb-lib
31 BuildRequires:  gpm-devel
32 BuildRequires:  ncurses-devel
33 BuildRequires:  rpmbuild(macros) >= 1.213
34 BuildRequires:  tetex-fonts-jknappen
35 BuildRequires:  tetex-format-pdflatex
36 BuildRequires:  tetex-makeindex
37 BuildRequires:  tetex-metafont
38 Requires:       binutils
39 Provides:       fpc-bootstrap
40 ExclusiveArch:  %{ix86} %{x8664} ppc sparc
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 Requires:       %{name} = %{version}-%{release}
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}_exp
108 %patch0 -p1
109 %patch1 -p1
110 %patch2 -p1
111 %patch3 -p1
112 %ifarch %{ix86}
113 tar xf %{SOURCE1}
114 %define _bver %{version}
115 %define _bname 386
116 %endif
117 %ifarch %{x8664}
118 tar xf %{SOURCE2}
119 %define _bver %{version}
120 %define _bname x64
121 %endif
122 %ifarch ppc
123 tar xf %{SOURCE3}
124 %define _bver %{version}
125 %define _bname ppc
126 %endif
127 %ifarch sparc
128 tar xf %{SOURCE4}
129 %define _bver 2.0.0
130 %define _bname sparc
131 %endif
132
133 tar xf binary.*-linux.tar
134
135 mkdir bin
136 cd bin
137 for i in ../*.tar.gz ; do
138         tar xzf $i
139 done
140 ln -sf `pwd`/lib/%{name}/%{_bver}/ppc* bin
141
142 %build
143 # save for fpc-src
144 install -d fpc-src
145 cp -af fpcsrc/* fpc-src
146
147 PP=`pwd`/bin/lib/%{name}/%{_bver}/ppc%{_bname}
148 NEWPP=`pwd`/fpcsrc/compiler/ppc%{_bname}
149 NEWFPDOC=`pwd`/fpcsrc/utils/fpdoc/fpdoc
150
151 # DO NOT PUT $RPM_OPT_FLAGS IN OPT, IT DOES NOT WORK - baggins
152 case "%{_build_cpu}" in
153         i386,i486)
154                 OPTF="-OG2p1" ;;
155         i586)
156                 OPTF="-OG2p2" ;;
157         i686,athlon)
158                 OPTF="-Og2p3" ;;
159         *)
160                 OPTF="-O2" ;;
161 esac
162
163 %{__make} -C fpcsrc compiler_cycle \
164         OPT="$OPTF -Xs -n" \
165         RELEASE="1" \
166         BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
167         BININSTALLDIR=%{_bindir} \
168         PP="$PP" \
169         FPC="$PP" \
170         SMARTLINK=YES
171
172 %{__make} -C fpcsrc OPT="$OPTF -Xs -n" \
173         RELEASE="1" \
174         BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
175         BININSTALLDIR=%{_bindir} \
176         GDBLIBDIR=%{_libdir} \
177         PP="$NEWPP" \
178         FPC="$NEWPP" \
179         DATA2INC=`pwd`/utils/data2inc \
180         SMARTLINK=YES \
181         rtl_clean rtl_smart \
182         packages_base_smart \
183         fcl_smart \
184         fv_smart \
185         packages_extra_smart \
186         ide_all \
187         utils_all
188
189 export save_size=10000
190 %{__make} -C fpcdocs \
191         FPDOC=$NEWFPDOC \
192         FPC="$NEWPP" \
193         pdf
194
195 %install
196 rm -rf $RPM_BUILD_ROOT
197 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir},%{_datadir}/fpcsrc,%{_examplesdir}/fpc}
198
199 cp -af fpc-src/* $RPM_BUILD_ROOT%{_datadir}/fpcsrc
200
201 NEWPP=`pwd`/fpcsrc/compiler/ppc%{_bname}
202 FPCMAKE=`pwd`/fpcsrc/utils/fpcm/fpcmake
203 %{__make} -C fpcsrc \
204         compiler_distinstall \
205         rtl_distinstall \
206         fcl_distinstall \
207         fv_distinstall \
208         packages_distinstall \
209         ide_distinstall \
210         utils_distinstall \
211         PP="$NEWPP" \
212         FPCMAKE="$FPCMAKE" \
213         SMARTLINK=YES \
214         INSTALL_PREFIX=$RPM_BUILD_ROOT%{_prefix} \
215         INSTALL_BINDIR=$RPM_BUILD_ROOT%{_bindir} \
216         INSTALL_LIBDIR=$RPM_BUILD_ROOT%{_libdir} \
217         INSTALL_DOCDIR=$RPM_BUILD_ROOT%{_docdir} \
218         INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir} \
219         INSTALL_BASEDIR=$RPM_BUILD_ROOT%{_libdir}/%{name}/%{version} \
220         INSTALL_EXAMPLEDIR=$RPM_BUILD_ROOT%{_examplesdir}/%{name} \
221         INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir} \
222         CODPATH=$RPM_BUILD_ROOT%{_libdir}/%{name}/lexyacc
223
224 %{__make} -C install/man installman \
225         INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir}
226
227 ln -sf %{_libdir}/%{name}/%{version}/ppc%{_bname} $RPM_BUILD_ROOT%{_bindir}
228
229 sh fpcsrc/compiler/utils/samplecfg %{_libdir}/%{name}/%{version} $RPM_BUILD_ROOT%{_sysconfdir}
230
231 %clean
232 rm -rf $RPM_BUILD_ROOT
233
234 %files
235 %defattr(644,root,root,755)
236 %attr(755,root,root) %{_bindir}/*
237 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fpc.cfg
238 %dir %{_libdir}/%{name}
239 %dir %{_libdir}/%{name}/%{version}
240 %dir %{_libdir}/%{name}/lexyacc
241 %{_libdir}/%{name}/%{version}/msg
242 %{_libdir}/%{name}/%{version}/units
243 %{_libdir}/%{name}/%{version}/ide
244 %{_libdir}/%{name}/lexyacc/*
245 %attr(755,root,root) %{_libdir}/%{name}/%{version}/ppc%{_bname}
246 %attr(755,root,root) %{_libdir}/%{name}/%{version}/samplecfg
247 %{_mandir}/man*/*
248
249 %files src
250 %defattr(644,root,root,755)
251 %{_datadir}/fpcsrc
252
253 %files examples
254 %defattr(644,root,root,755)
255 %{_examplesdir}/fpc
256
257 %files doc
258 %defattr(644,root,root,755)
259 %doc fpcdocs/*.pdf
This page took 0.592978 seconds and 3 git commands to generate.