]> git.pld-linux.org Git - packages/fpc.git/blob - fpc.spec
6ded53681ea71804063227e983a9ea8608e86a7d
[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 Vendor:         Michael Van Canneyt <michael@tfdec1.fys.kuleuven.ac.be>
9 Source0:        ftp://ftp.freepascal.org/pub/fpc/dist/Linux/%{name}-%{version}.ELF.tar
10 Source1:        %{name}-sample.cfg
11 Patch0:         %{name}-poptasm.patch
12 Patch1:         %{name}-glibc.patch
13 URL:            http://www.freepascal.org/
14 Requires:       gcc >= 2.95.2
15 BuildRequires:  bin86
16 BuildRequires:  zlib-devel
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 Requires:       %{name} = %{version}
39
40 %description examples
41 Free Pascal Compiler exaple programs.
42
43 %description examples -l pl
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 Requires:       %{name} = %{version}
51
52 %description doc
53 Documentation for fpc in PDF format.
54
55 %description doc -l pl
56 Dokumentacja do fpc w formacie PDF.
57
58 %prep
59 %setup -q -c
60 tar xf sources.tar
61 tar xf binary.tar
62
63 for i in *.tar.gz ; do
64         tar xzf $i
65 done
66
67 mkdir -p src/%{name}-%{version}/doc
68 mv doc/%{name}-%{version}/* src/%{name}-%{version}/doc
69 mkdir -p src/%{name}-%{version}/man && echo ".PHONY:    all install installman" > src/%{name}-%{version}/man/Makefile
70
71 cd src/%{name}-%{version}
72 %patch0 -p0
73 %patch1 -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.088062 seconds and 3 git commands to generate.