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