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