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