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