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