]> git.pld-linux.org Git - packages/fpc.git/blob - fpc.spec
- new %%doc
[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:        3
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 BuildRequires:  glibc-static
17 BuildRequires:  zlib-devel
18 ExclusiveArch:  %{ix86} m68k
19 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
20
21 %description
22 Free Pascal is a 32-bit compiler for the i386 and m68k processors.
23 Free Pascal is designed to be, as much as possible, source compatible
24 with Turbo Pascal 7.0 and Delphi 4 (although this goal is not yet
25 attained), but it also enhances these languages with elements like
26 function overloading. And, unlike these ancestors, it supports
27 multiple platforms.
28
29 %description -l pl
30 Free Pascal to 32 bitowy kompilator dla procesorów i386 oraz m86k.
31 Free Pascal zosta³ zaprojektowany by byæ (jak tylko to mo¿liwe)
32 kompatybilnym z Turbo Pascal 7.0 oraz Delphi 4. Free Pascal równie¿
33 rozszerza te jêzyki elementami takimi jak prze³adowywanie funkcji.
34
35 %package examples
36 Summary:        Free Pascal Compiler exaple programs
37 Summary(pl):    Przyk³adowe programy do kompilatora Free Pascal
38 Group:          Documentation
39 Requires:       %{name} = %{version}
40
41 %description examples
42 Free Pascal Compiler exaple programs.
43
44 %description examples -l pl
45 Przyk³adowe programy do kompilatora Free Pascal.
46
47 %package doc
48 Summary:        Free Pascal Compiler documentation
49 Summary(pl):    Dokumentacja do kompilatora Free Pascal
50 Group:          Documentation
51 Requires:       %{name} = %{version}
52
53 %description doc
54 Documentation for fpc in PDF format.
55
56 %description doc -l pl
57 Dokumentacja do fpc w formacie PDF.
58
59 %prep
60 %setup -q -c
61 tar xf sources.tar
62 tar xf binary.tar
63
64 for i in *.tar.gz ; do
65         tar xzf $i
66 done
67
68 mkdir -p src/%{name}-%{version}/doc
69 mv doc/%{name}-%{version}/* src/%{name}-%{version}/doc
70 mkdir -p src/%{name}-%{version}/man && echo ".PHONY:    all install installman" > src/%{name}-%{version}/man/Makefile
71
72 cd src/%{name}-%{version}
73 %patch0 -p0
74 %patch1 -p0
75
76 %build
77 if [ "%{_build_cpu}" = "m68k" ]; then
78         CPU=M68K
79 else
80         CPU=I386
81 fi
82
83 # DO NOT PUT $RPM_OPT_FLAGS IN OPT, IT DOES NOT WORK - baggins
84 case "%{_build_cpu}" in
85         i386)
86                 OPTF="-OG2p1" ;;
87         i586)
88                 OPTF="-OG2p2" ;;
89         i686)
90                 OPTF="-Og2p3" ;;
91         *)
92                 OPTF="-O2" ;;
93 esac
94
95 PP=`pwd`/lib/fpc/%{version}/ppc386
96 NEWPP=`pwd`/src/fpc-%{version}/compiler/ppc386
97
98 # -O- optimalization to workaround bug in PP compiler in 1.0.4
99 %{__make} -C src/%{name}-%{version} \
100         OPT="-O- -Xs -n" \
101         RELEASE="" \
102         BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
103         BININSTALLDIR=%{_bindir} \
104         PP="$PP" \
105         FPC="$PP" \
106         compiler_cycle
107
108 %{__make} -C src/%{name}-%{version} \
109         OPT="$OPTF -Xs -n" \
110         RELEASE="" \
111         BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
112         BININSTALLDIR=%{_bindir} \
113         PP="$NEWPP" \
114         FPC="$NEWPP" \
115         rtl_all api_all fcl_all packages_all utils_all
116
117 %install
118 rm -rf $RPM_BUILD_ROOT
119 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir},%{_examplesdir}/fpc}
120
121 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/ppc386.cfg
122
123 # workaround for 1.0.4
124 (cd src/fpc-%{version}; ln -s fcl/linux linux)
125
126 NEWPP=`pwd`/src/fpc-%{version}/compiler/ppc386
127 %{__make} -C src/%{name}-%{version} \
128         PREFIXINSTALLDIR=$RPM_BUILD_ROOT%{_prefix} \
129         PP="$NEWPP" \
130         compiler_install \
131         rtl_install api_install fcl_install packages_install utils_install
132
133 cp -a man/* $RPM_BUILD_ROOT%{_mandir}
134 cp -a src/%{name}-%{version}/doc/examples/* $RPM_BUILD_ROOT%{_examplesdir}/fpc
135
136 ln -sf ../lib/%{name}/%{version}/ppc386 $RPM_BUILD_ROOT%{_bindir}/ppc386
137 ln -sf ppc386 $RPM_BUILD_ROOT%{_bindir}/fpc
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}
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.056107 seconds and 4 git commands to generate.