]> git.pld-linux.org Git - packages/fpc.git/blob - fpc.spec
e82b5d59bb28118db2cbfa52aa8f6e28714e0096
[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 Summary(ru):    ó×ÏÂÏÄÎÙÊ ËÏÍÐÉÌÑÔÏÒ Pascal
4 Summary(uk):    ÷¦ÌØÎÉÊ ËÏÍЦÌÑÔÏÒ Pascal
5 Name:           fpc
6 Version:        1.0.10
7 Release:        2
8 License:        GPL
9 Group:          Development/Languages
10 Vendor:         Michael Van Canneyt <michael@tfdec1.fys.kuleuven.ac.be>
11 Source0:        ftp://ftp.us.freepascal.org/pub/fpc/dist/source-%{version}/%{name}-%{version}-src.tar.gz
12 # Source0-md5:  da2ec003500584649cb31288613c33fa
13 Source1:        ftp://ftp.us.freepascal.org/pub/fpc/dist/Linux/i386/separate/binary.tar
14 # Source1-md5:  62c7ac6c21c44276b5e14bf34265d185
15 Source2:        %{name}-sample.cfg
16 URL:            http://www.freepascal.org/
17 BuildRequires:  bin86
18 BuildRequires:  zlib-devel
19 Requires:       gcc >= 2.95.2
20 ExclusiveArch:  %{ix86} m68k
21 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
22
23 %description
24 Free Pascal is a 32-bit compiler for the i386 and m68k processors.
25 Free Pascal is designed to be, as much as possible, source compatible
26 with Turbo Pascal 7.0 and Delphi 4 (although this goal is not yet
27 attained), but it also enhances these languages with elements like
28 function overloading. And, unlike these ancestors, it supports
29 multiple platforms.
30
31 %description -l pl
32 Free Pascal to 32 bitowy kompilator dla procesorów i386 oraz m86k.
33 Free Pascal zosta³ zaprojektowany by byæ (jak tylko to mo¿liwe)
34 kompatybilnym z Turbo Pascal 7.0 oraz Delphi 4. Free Pascal równie¿
35 rozszerza te jêzyki elementami takimi jak przeci±¿anie funkcji.
36
37 %description -l ru
38 FPC -- 32-ÂÉÔÎÙÊ ËÏÍÐÉÌÑÔÏÒ Pascal, ÓÏ×ÍÅÓÔÉÍÙÊ Ó Turbo Pascal 7.0 É Delphi.
39 ðÏÓÔÁ×ÌÑÅÔÓÑ Ó RTL (ÂÉÂÌÉÏÔÅËÏÊ ×ÒÅÍÅÎÉ ÉÓÐÏÌÎÅÎÉÑ), FCL (ÂÉÂÌÉÏÔÅËÏÊ Ó×ÏÂÏÄÎÙÈ
40 ËÏÍÐÏÎÅÎÔ), ÉÎÔÅÒÆÅÊÓÁÍÉ Ë gtk, ncurses, zlib, mysql, postgres, ibase.
41
42 %description -l uk
43 FPC -- 32-¦ÔÎÉÊ ËÏÍЦÌÑÔÏÒ Pascal, ÓÕͦÓÎÉÊ ¦Ú Turbo Pascal 7.0 ÔÁ Delphi.
44 ðÏÓÔÁÞÁ¤ÔØÓÑ ¦Ú RTL (¦Â̦ÏÔÅËÏÀ ÞÁÓÕ ×ÉËÏÎÁÎÎÑ), FCL (¦Â̦ÏÔÅËÏÀ ×¦ÌØÎÉÈ
45 ËÏÍÐÏÎÅÎÔ), ¦ÎÔÅÒÆÅÊÓÁÍÉ ÄÏ gtk, ncurses, zlib, mysql, postgres, ibase.
46
47 %package examples
48 Summary:        Free Pascal Compiler exaple programs
49 Summary(pl):    Przyk³adowe programy do kompilatora Free Pascal
50 Group:          Documentation
51 Requires:       %{name} = %{version}
52
53 %description examples
54 Free Pascal Compiler exaple programs.
55
56 %description examples -l pl
57 Przyk³adowe programy do kompilatora Free Pascal.
58
59 %package doc
60 Summary:        Free Pascal Compiler documentation
61 Summary(pl):    Dokumentacja do kompilatora Free Pascal
62 Group:          Documentation
63 Requires:       %{name} = %{version}
64
65 %description doc
66 Documentation for fpc in PDF format.
67
68 %description doc -l pl
69 Dokumentacja do fpc w formacie PDF.
70
71 %prep
72 %setup -q -c -T -a1
73
74 for i in *.tar.gz ; do
75         tar xzf $i
76 done
77
78 mkdir -p src/%{name}-%{version}/doc
79 mv doc/%{name}-%{version}/* src/%{name}-%{version}/doc
80 mkdir -p src/%{name}-%{version}/man && echo ".PHONY:    all install installman" > src/%{name}-%{version}/man/Makefile
81
82 cd src/%{name}-%{version}
83 tar xzf %{SOURCE0}
84
85 %build
86 if [ "%{_build_cpu}" = "m68k" ]; then
87         CPU=M68K
88 else
89         CPU=I386
90 fi
91
92 # DO NOT PUT $RPM_OPT_FLAGS IN OPT, IT DOES NOT WORK - baggins
93 case "%{_build_cpu}" in
94         i386)
95                 OPTF="-OG2p1" ;;
96         i586)
97                 OPTF="-OG2p2" ;;
98         i686)
99                 OPTF="-Og2p3" ;;
100         *)
101                 OPTF="-O2" ;;
102 esac
103
104 PP=`pwd`/lib/fpc/%{version}/ppc386
105 NEWPP=`pwd`/src/fpc-%{version}/compiler/ppc386
106 NEWFPDOC=`pwd`/src/fpc-%{version}/utils/fpdoc/fpdoc
107
108 # ppc386 binary cuts PATH - sometimes before /usr/bin with needed as and ld
109 export PATH="/usr/bin:/bin"
110
111 %{__make} -C src/%{name}-%{version} \
112         OPT="$OPTF -Xs -n" \
113         RELEASE="" \
114         BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
115         BININSTALLDIR=%{_bindir} \
116         PP="$PP" \
117         FPC="$PP" \
118         compiler_cycle
119
120 %{__make} -C src/%{name}-%{version} \
121         OPT="$OPTF -Xs -n" \
122         RELEASE="" \
123         BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
124         BININSTALLDIR=%{_bindir} \
125         PP="$NEWPP" \
126         FPC="$NEWPP" \
127         rtl_clean rtl_smart packages_base_smart fcl_smart packages_extra_smart utils_all
128
129 %{__make} -C src/%{name}-%{version}/docs pdf FPDOC=${NEWFPDOC}
130
131 %install
132 rm -rf $RPM_BUILD_ROOT
133 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir},%{_examplesdir}/fpc}
134
135 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/fpc.cfg
136
137 # new ppc386 cuts PATH too (how to fix it???)
138 export PATH="/usr/bin:/bin"
139
140 NEWPP=`pwd`/src/fpc-%{version}/compiler/ppc386
141 %{__make} -C src/%{name}-%{version} \
142         INSTALL_PREFIX=$RPM_BUILD_ROOT%{_prefix} \
143         INSTALL_BINDIR=$RPM_BUILD_ROOT%{_bindir} \
144         INSTALL_LIBDIR=$RPM_BUILD_ROOT%{_libdir} \
145         INSTALL_DOCDIR=$RPM_BUILD_ROOT%{_docdir} \
146         INSTALL_MANDIR=$RPM_BUILD_ROOT%{_mandir} \
147         PP="$NEWPP" \
148         compiler_distinstall \
149         rtl_distinstall \
150         packages_distinstall \
151         fcl_distinstall \
152         utils_distinstall \
153         man_install
154
155 %{__make} -C src/%{name}-%{version}/docs pdfinstall DOCINSTALLDIR=$RPM_BUILD_ROOT%{_docdir}
156
157 mv -f src/%{name}-%{version}/doc/examples/* $RPM_BUILD_ROOT%{_examplesdir}/fpc
158
159 ln -sf ../lib/%{name}/%{version}/ppc386 $RPM_BUILD_ROOT%{_bindir}/ppc386
160 ln -sf ppc386 $RPM_BUILD_ROOT%{_bindir}/fpc
161
162 mv -f src/%{name}-%{version}/doc/faq.htm src/%{name}-%{version}/doc/faq.html
163
164 ln -sf %{_bindir}/{as,ld} $RPM_BUILD_ROOT%{_libdir}/%{name}/%{version}
165
166 %clean
167 rm -rf $RPM_BUILD_ROOT
168
169 %post
170 umask 022
171 GCCSPEC=`(gcc -v 2>&1)| head -n 1| awk '{ print $4 } '`
172 GCCDIR=`dirname $GCCSPEC`
173 echo "Found libgcc.a in $GCCDIR"
174 sed -e "s#\$GCCDIR#$GCCDIR#" %{_sysconfdir}/fpc.cfg > %{_sysconfdir}/fpc.cfg.new
175 sed -e "s#\$1#%{_libdir}/%{name}/%{version}#" %{_sysconfdir}/fpc.cfg.new > %{_sysconfdir}/fpc.cfg
176 rm -f %{_sysconfdir}/fpc.cfg.new
177
178 %files
179 %defattr(644,root,root,755)
180 %attr(755,root,root) %{_bindir}/*
181 %doc src/%{name}-%{version}/doc/{copying*,*.txt}
182 %doc src/%{name}-%{version}/doc/faq.html
183 %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/fpc.cfg
184 %dir %{_libdir}/%{name}
185 %dir %{_libdir}/%{name}/%{version}
186 %dir %{_libdir}/%{name}/lexyacc
187 %{_libdir}/%{name}/%{version}/msg
188 %{_libdir}/%{name}/%{version}/units
189 %{_libdir}/%{name}/%{version}/as
190 %{_libdir}/%{name}/%{version}/ld
191 %{_libdir}/%{name}/lexyacc/*
192 %attr(755,root,root) %{_libdir}/%{name}/%{version}/ppc386
193 %attr(755,root,root) %{_libdir}/%{name}/%{version}/samplecfg
194 %{_mandir}/man*/*
195
196 %files examples
197 %defattr(644,root,root,755)
198 %{_examplesdir}/fpc
199
200 %files doc
201 %defattr(644,root,root,755)
202 %doc src/%{name}-%{version}/doc/*.pdf
This page took 0.075052 seconds and 3 git commands to generate.