]> git.pld-linux.org Git - packages/fpc.git/blob - fpc.spec
- removed %%doc from examples - all files in %%{_examplesdir} are docs implicitly
[packages/fpc.git] / fpc.spec
1 Summary:        32-bit compiler for the i386 and m68k processors
2 Summary(pl):    32 bitowy kompilator dla procesorów i386 i m68k
3 Summary(ru_RU.KOI8-R):  ó×ÏÂÏÄÎÙÊ ËÏÍÐÉÌÑÔÏÒ Pascal
4 Summary(uk_UA.KOI8-U):  ÷¦ÌØÎÉÊ ËÏÍЦÌÑÔÏÒ Pascal
5 Name:           fpc
6 Version:        1.0.4
7 Release:        3
8 License:        GPL
9 Group:          Development/Languages
10 Vendor:         Michael Van Canneyt <michael@tfdec1.fys.kuleuven.ac.be>
11 Source0:        ftp://ftp.freepascal.org/pub/fpc/dist/Linux/%{name}-%{version}.ELF.tar
12 # Source0-md5:  ab89dc1f02cbf76389d739add843927d
13 Source1:        %{name}-sample.cfg
14 Patch0:         %{name}-poptasm.patch
15 Patch1:         %{name}-glibc.patch
16 URL:            http://www.freepascal.org/
17 Requires:       gcc >= 2.95.2
18 BuildRequires:  bin86
19 BuildRequires:  glibc-static
20 BuildRequires:  zlib-devel
21 ExclusiveArch:  %{ix86} m68k
22 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
23
24 %description
25 Free Pascal is a 32-bit compiler for the i386 and m68k processors.
26 Free Pascal is designed to be, as much as possible, source compatible
27 with Turbo Pascal 7.0 and Delphi 4 (although this goal is not yet
28 attained), but it also enhances these languages with elements like
29 function overloading. And, unlike these ancestors, it supports
30 multiple platforms.
31
32 %description -l pl
33 Free Pascal to 32 bitowy kompilator dla procesorów i386 oraz m86k.
34 Free Pascal zosta³ zaprojektowany by byæ (jak tylko to mo¿liwe)
35 kompatybilnym z Turbo Pascal 7.0 oraz Delphi 4. Free Pascal równie¿
36 rozszerza te jêzyki elementami takimi jak prze³adowywanie funkcji.
37
38 %description -l ru_RU.KOI8-R
39 FPC -- 32-ÂÉÔÎÙÊ ËÏÍÐÉÌÑÔÏÒ Pascal, ÓÏ×ÍÅÓÔÉÍÙÊ Ó Turbo Pascal 7.0 É Delphi.
40 ðÏÓÔÁ×ÌÑÅÔÓÑ Ó RTL (ÂÉÂÌÉÏÔÅËÏÊ ×ÒÅÍÅÎÉ ÉÓÐÏÌÎÅÎÉÑ), FCL (ÂÉÂÌÉÏÔÅËÏÊ Ó×ÏÂÏÄÎÙÈ
41 ËÏÍÐÏÎÅÎÔ), ÉÎÔÅÒÆÅÊÓÁÍÉ Ë gtk, ncurses, zlib, mysql, postgres, ibase.
42
43 %description -l uk_UA.KOI8-U
44 FPC -- 32-¦ÔÎÉÊ ËÏÍЦÌÑÔÏÒ Pascal, ÓÕͦÓÎÉÊ ¦Ú Turbo Pascal 7.0 ÔÁ Delphi.
45 ðÏÓÔÁÞÁ¤ÔØÓÑ ¦Ú RTL (¦Â̦ÏÔÅËÏÀ ÞÁÓÕ ×ÉËÏÎÁÎÎÑ), FCL (¦Â̦ÏÔÅËÏÀ ×¦ÌØÎÉÈ
46 ËÏÍÐÏÎÅÎÔ), ¦ÎÔÅÒÆÅÊÓÁÍÉ ÄÏ gtk, ncurses, zlib, mysql, postgres, ibase.
47
48 %package examples
49 Summary:        Free Pascal Compiler exaple programs
50 Summary(pl):    Przyk³adowe programy do kompilatora Free Pascal
51 Group:          Documentation
52 Requires:       %{name} = %{version}
53
54 %description examples
55 Free Pascal Compiler exaple programs.
56
57 %description examples -l pl
58 Przyk³adowe programy do kompilatora Free Pascal.
59
60 %package doc
61 Summary:        Free Pascal Compiler documentation
62 Summary(pl):    Dokumentacja do kompilatora Free Pascal
63 Group:          Documentation
64 Requires:       %{name} = %{version}
65
66 %description doc
67 Documentation for fpc in PDF format.
68
69 %description doc -l pl
70 Dokumentacja do fpc w formacie PDF.
71
72 %prep
73 %setup -q -c
74 tar xf sources.tar
75 tar xf binary.tar
76
77 for i in *.tar.gz ; do
78         tar xzf $i
79 done
80
81 mkdir -p src/%{name}-%{version}/doc
82 mv doc/%{name}-%{version}/* src/%{name}-%{version}/doc
83 mkdir -p src/%{name}-%{version}/man && echo ".PHONY:    all install installman" > src/%{name}-%{version}/man/Makefile
84
85 cd src/%{name}-%{version}
86 %patch0 -p0
87 %patch1 -p0
88
89 %build
90 if [ "%{_build_cpu}" = "m68k" ]; then
91         CPU=M68K
92 else
93         CPU=I386
94 fi
95
96 # DO NOT PUT $RPM_OPT_FLAGS IN OPT, IT DOES NOT WORK - baggins
97 case "%{_build_cpu}" in
98         i386)
99                 OPTF="-OG2p1" ;;
100         i586)
101                 OPTF="-OG2p2" ;;
102         i686)
103                 OPTF="-Og2p3" ;;
104         *)
105                 OPTF="-O2" ;;
106 esac
107
108 PP=`pwd`/lib/fpc/%{version}/ppc386
109 NEWPP=`pwd`/src/fpc-%{version}/compiler/ppc386
110
111 # -O- optimalization to workaround bug in PP compiler in 1.0.4
112 %{__make} -C src/%{name}-%{version} \
113         OPT="-O- -Xs -n" \
114         RELEASE="" \
115         BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
116         BININSTALLDIR=%{_bindir} \
117         PP="$PP" \
118         FPC="$PP" \
119         compiler_cycle
120
121 %{__make} -C src/%{name}-%{version} \
122         OPT="$OPTF -Xs -n" \
123         RELEASE="" \
124         BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
125         BININSTALLDIR=%{_bindir} \
126         PP="$NEWPP" \
127         FPC="$NEWPP" \
128         rtl_all api_all fcl_all packages_all utils_all
129
130 %install
131 rm -rf $RPM_BUILD_ROOT
132 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir},%{_examplesdir}/fpc}
133
134 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/ppc386.cfg
135
136 # workaround for 1.0.4
137 (cd src/fpc-%{version}; ln -s fcl/linux linux)
138
139 NEWPP=`pwd`/src/fpc-%{version}/compiler/ppc386
140 %{__make} -C src/%{name}-%{version} \
141         PREFIXINSTALLDIR=$RPM_BUILD_ROOT%{_prefix} \
142         PP="$NEWPP" \
143         compiler_install \
144         rtl_install api_install fcl_install packages_install utils_install
145
146 cp -a man/* $RPM_BUILD_ROOT%{_mandir}
147 cp -a src/%{name}-%{version}/doc/examples/* $RPM_BUILD_ROOT%{_examplesdir}/fpc
148
149 ln -sf ../lib/%{name}/%{version}/ppc386 $RPM_BUILD_ROOT%{_bindir}/ppc386
150 ln -sf ppc386 $RPM_BUILD_ROOT%{_bindir}/fpc
151
152 mv -f src/%{name}-%{version}/doc/faq.htm src/%{name}-%{version}/doc/faq.html
153
154 %clean
155 rm -rf $RPM_BUILD_ROOT
156
157 %post
158 umask 022
159 GCCSPEC=`(gcc -v 2>&1)| head -n 1| awk '{ print $4 } '`
160 GCCDIR=`dirname $GCCSPEC`
161 echo "Found libgcc.a in $GCCDIR"
162 sed -e "s#\$GCCDIR#$GCCDIR#" %{_sysconfdir}/ppc386.cfg > %{_sysconfdir}/ppc386.cfg.new
163 sed -e "s#\$1#%{_libdir}/%{name}/%{version}#" %{_sysconfdir}/ppc386.cfg.new > %{_sysconfdir}/ppc386.cfg
164 rm -f %{_sysconfdir}/ppc386.cfg.new
165
166 %files
167 %defattr(644,root,root,755)
168 %attr(755,root,root) %{_bindir}/*
169 %doc src/%{name}-%{version}/doc/{copying*,*.txt}
170 %doc src/%{name}-%{version}/doc/faq.html
171 %config %verify(not md5 size mtime) %{_sysconfdir}/ppc386.cfg
172 %dir %{_libdir}/%{name}
173 %dir %{_libdir}/%{name}/%{version}
174 %dir %{_libdir}/%{name}/lexyacc
175 %{_libdir}/%{name}/%{version}/msg
176 %{_libdir}/%{name}/%{version}/units
177 %{_libdir}/%{name}/lexyacc/*
178 %attr(755,root,root) %{_libdir}/%{name}/%{version}/ppc386
179 %attr(755,root,root) %{_libdir}/%{name}/%{version}/samplecfg
180 %{_mandir}/man*/*
181
182 %files examples
183 %defattr(644,root,root,755)
184 %{_examplesdir}/fpc
185
186 %files doc
187 %defattr(644,root,root,755)
188 %doc src/%{name}-%{version}/doc/*.pdf
This page took 0.073252 seconds and 4 git commands to generate.