]> git.pld-linux.org Git - packages/fpc.git/blob - fpc.spec
- removed all Group fields translations (oure rpm now can handle translating
[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 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 Requires:       %{name} = %{version}
38
39 %description examples
40 Free Pascal Compiler exaple programs.
41
42 %description -l pl examples
43 Przyk³adowe programy do kompilatora Free Pascal.
44
45 %package doc
46 Summary:        Free Pascal Compiler documentation
47 Summary(pl):    Dokumentacja do kompilatora Free Pascal
48 Group:          Documentation
49 Requires:       %{name} = %{version}
50
51 %description doc
52 Documentation for fpc in PDF format.
53
54 %description -l pl doc
55 Dokumentacja do fpc w formacie PDF.
56
57 %prep
58 %setup -q -c
59 tar xf sources.tar
60 tar xf binary.tar
61
62 for i in *.tar.gz ; do
63         tar xzf $i
64 done
65
66 mkdir -p src/%{name}-%{version}/doc
67 mv doc/%{name}-%{version}/* src/%{name}-%{version}/doc
68 mkdir -p src/%{name}-%{version}/man && echo ".PHONY:    all install installman" > src/%{name}-%{version}/man/Makefile
69
70 cd src/%{name}-%{version}
71 %patch0 -p0
72 %patch1 -p0
73
74 %build
75 if [ "%{_build_cpu}" = "m68k" ]; then
76         CPU=M68K
77 else
78         CPU=I386
79 fi
80
81 # DO NOT PUT $RPM_OPT_FLAGS IN OPT, IT DOES NOT WORK - baggins
82 case "%{_build_cpu}" in
83         i386)
84                 OPTF="-OG2p1" ;;
85         i586)
86                 OPTF="-OG2p2" ;;
87         i686)
88                 OPTF="-Og2p3" ;;
89         *)
90                 OPTF="-O2" ;;
91 esac
92
93 PP=`pwd`/lib/fpc/%{version}/ppc386
94 NEWPP=`pwd`/src/fpc-%{version}/compiler/ppc386
95
96 # -O- optimalization to workaround bug in PP compiler in 1.0.4
97 %{__make} -C src/%{name}-%{version} \
98         OPT="-O- -Xs -n" \
99         RELEASE="" \
100         BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
101         BININSTALLDIR=%{_bindir} \
102         PP="$PP" \
103         FPC="$PP" \
104         compiler_cycle
105
106 %{__make} -C src/%{name}-%{version} \
107         OPT="$OPTF -Xs -n" \
108         RELEASE="" \
109         BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
110         BININSTALLDIR=%{_bindir} \
111         PP="$NEWPP" \
112         FPC="$NEWPP" \
113         rtl_all api_all fcl_all packages_all utils_all
114
115 %install
116 rm -rf $RPM_BUILD_ROOT
117 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir},%{_examplesdir}/fpc}
118
119 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/ppc386.cfg
120
121 # workaround for 1.0.4
122 (cd src/fpc-%{version}; ln -s fcl/linux linux)
123
124 NEWPP=`pwd`/src/fpc-%{version}/compiler/ppc386
125 %{__make} -C src/%{name}-%{version} \
126         PREFIXINSTALLDIR=$RPM_BUILD_ROOT%{_prefix} \
127         PP="$NEWPP" \
128         compiler_install \
129         rtl_install api_install fcl_install packages_install utils_install
130
131 cp -a man/* $RPM_BUILD_ROOT%{_mandir}
132 cp -a src/%{name}-%{version}/doc/examples/* $RPM_BUILD_ROOT%{_examplesdir}/fpc
133
134 ln -sf ../lib/%{name}/%{version}/ppc386 $RPM_BUILD_ROOT%{_bindir}/ppc386
135 ln -sf ppc386 $RPM_BUILD_ROOT%{_bindir}/fpc
136
137 gzip -9nf src/%{name}-%{version}/doc/{copying*,*.txt}
138
139 mv -f src/%{name}-%{version}/doc/faq.htm src/%{name}-%{version}/doc/faq.html
140
141 %clean
142 rm -rf $RPM_BUILD_ROOT
143
144 %post
145 umask 022
146 GCCSPEC=`(gcc -v 2>&1)| head -n 1| awk '{ print $4 } '`
147 GCCDIR=`dirname $GCCSPEC`
148 echo "Found libgcc.a in $GCCDIR"
149 sed -e "s#\$GCCDIR#$GCCDIR#" %{_sysconfdir}/ppc386.cfg > %{_sysconfdir}/ppc386.cfg.new
150 sed -e "s#\$1#%{_libdir}/%{name}/%{version}#" %{_sysconfdir}/ppc386.cfg.new > %{_sysconfdir}/ppc386.cfg
151 rm -f %{_sysconfdir}/ppc386.cfg.new
152
153 %files
154 %defattr(644,root,root,755)
155 %attr(755,root,root) %{_bindir}/*
156 %doc src/%{name}-%{version}/doc/{copying*,*.txt}.gz
157 %doc src/%{name}-%{version}/doc/faq.html
158 %config %verify(not md5 size mtime) %{_sysconfdir}/ppc386.cfg
159 %dir %{_libdir}/%{name}
160 %dir %{_libdir}/%{name}/%{version}
161 %dir %{_libdir}/%{name}/lexyacc
162 %{_libdir}/%{name}/%{version}/msg
163 %{_libdir}/%{name}/%{version}/units
164 %{_libdir}/%{name}/lexyacc/*
165 %attr(755,root,root) %{_libdir}/%{name}/%{version}/ppc386
166 %attr(755,root,root) %{_libdir}/%{name}/%{version}/samplecfg
167 %{_mandir}/man*/*
168
169 %files examples
170 %defattr(644,root,root,755)
171 %doc %{_examplesdir}/fpc
172
173 %files doc
174 %defattr(644,root,root,755)
175 %doc src/%{name}-%{version}/doc/*.pdf
This page took 0.105167 seconds and 4 git commands to generate.