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