]> git.pld-linux.org Git - packages/fpc.git/blob - fpc.spec
- rewrite, works now
[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.00
5 Release:        1
6 License:        GPL
7 Group:          Development/Languages
8 Group(pl):      Programowanie/Jêzyki
9 Vendor:         Michael Van Canneyt <michael@tfdec1.fys.kuleuven.ac.be>
10 Source0:        ftp://ftp.freepascal.org/pub/fpc/dist/Linux/%{name}-%{version}.ELF.tar
11 Source1:        fpc-sample.cfg
12 URL:            http://www.freepascal.org/
13 ExclusiveArch:  %{ix86} m68k
14 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
15
16 %description
17 Free Pascal is a 32-bit compiler for the i386 and m68k processors.
18 Free Pascal is designed to be, as much as possible, source compatible
19 with Turbo Pascal 7.0 and Delphi 4 (although this goal is not yet
20 attained), but it also enhances these languages with elements like
21 function overloading. And, unlike these ancestors, it supports
22 multiple platforms.
23
24 %description -l pl
25 Free Pascal to 32 bitowy kompilator dla procesorów i386 oraz m86k.
26 Free Pascal zosta³ zaprojektowany by byæ (jak tylko to mo¿liwe)
27 kompatybilnym z Turbo Pascal 7.0 oraz Delphi 4. Free Pascal równie¿
28 rozszerza te jêzyki elementami takimi jak prze³adowywanie funkcji.
29
30 %package examples
31 Summary:        Free Pascal Compiler exaple programs
32 Summary(pl):    Przyk³adowe programy do kompilatora Free Pascal
33 Group:          Documentation
34 Group(pl):      Dokumentacja
35 Requires:       %{name} = %{version}
36
37 %description examples
38 Free Pascal Compiler exaple programs.
39
40 %description -l pl examples
41 Przyk³adowe programy do kompilatora Free Pascal.
42
43 %package doc
44 Summary:        Free Pascal Compiler documentation
45 Summary(pl):    Dokumentacja do kompilatora Free Pascal
46 Group:          Documentation
47 Group(pl):      Dokumentacja
48 Requires:       %{name} = %{version}
49
50 %description doc
51 Documentation for fpc in PDF format.
52
53 %description -l pl doc
54 Dokumentacja do fpc w formacie PDF.
55
56 %prep
57 %setup -q -c
58 tar xf sources.tar
59 tar xf binary.tar
60
61 for i in *.tar.gz ; do
62         tar xzf $i
63 done
64
65 mkdir -p src/%{name}-%{version}/doc
66 mv doc/%{name}-%{version}/* src/%{name}-%{version}/doc
67 mkdir -p src/%{name}-%{version}/man && echo ".PHONY:    all install installman" > src/%{name}-%{version}/man/Makefile
68
69 %build
70 PP=`pwd`/lib/fpc/%{version}/ppc386
71
72 if [ "%{_target_cpu}" = "m68k" ]; then
73         CPU=M68K
74 else
75         CPU=I386
76 fi
77
78 # DO NOT PUT $RPM_OPT_FLAGS IN OPT, IT DOES NOT WORK - baggins
79 %{__make} -C src/%{name}-%{version} \
80         OPT="-O2" \
81         RELEASE=1 \
82         BASEINSTALLDIR=%{_libdir}/%{name}/%{version} \
83         BININSTALLDIR=%{_bindir} \
84         PP="$PP" \
85         all
86
87 %install
88 rm -rf $RPM_BUILD_ROOT
89 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir},%{_examplesdir}/fpc}
90
91 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/ppc386.cfg
92
93 PP=`pwd`/src/fpc-%{version}/compiler/ppc386
94 make -C src/%{name}-%{version} \
95         PREFIXINSTALLDIR=$RPM_BUILD_ROOT%{_prefix} \
96         PP="$PP" \
97         install
98
99 cp -a man/* $RPM_BUILD_ROOT%{_mandir}
100 cp -a src/%{name}-%{version}/doc/examples/* $RPM_BUILD_ROOT%{_examplesdir}/fpc
101
102 ln -sf ../lib/%{name}/%{version}/ppc386 $RPM_BUILD_ROOT%{_bindir}/ppc386
103
104 strip --strip-unneeded $RPM_BUILD_ROOT%{_bindir}/*
105 strip --strip-unneeded $RPM_BUILD_ROOT%{_libdir}/%{name}/%{version}/ppc386
106
107 gzip -9nf src/%{name}-%{version}/doc/{copying*,*.txt} \
108         $RPM_BUILD_ROOT%{_mandir}/man*/*
109
110 mv -f src/%{name}-%{version}/doc/faq.htm src/%{name}-%{version}/doc/faq.html
111
112 %clean
113 rm -rf $RPM_BUILD_ROOT
114
115 %post
116 umask 022
117 GCCSPEC=`(gcc -v 2>&1)| head -n 1| awk '{ print $4 } '`
118 GCCDIR=`dirname $GCCSPEC`
119 echo "Found libgcc.a in $GCCDIR"
120 sed -e "s#\$GCCDIR#$GCCDIR#" %{_sysconfdir}/ppc386.cfg > %{_sysconfdir}/ppc386.cfg.new
121 sed -e "s#\$1#%{_libdir}/%{name}/%{version}#" %{_sysconfdir}/ppc386.cfg.new > %{_sysconfdir}/ppc386.cfg
122 rm -f %{_sysconfdir}/ppc386.cfg.new
123
124 %files
125 %defattr(644,root,root,755)
126 %attr(755,root,root) %{_bindir}/*
127 %doc src/%{name}-%{version}/doc/{copying*,*.txt}.gz
128 %doc src/%{name}-%{version}/doc/faq.html
129 %config %verify(not md5 size mtime) %{_sysconfdir}/ppc386.cfg
130 %dir %{_libdir}/%{name}
131 %dir %{_libdir}/%{name}/%{version}
132 %dir %{_libdir}/%{name}/lexyacc
133 %{_libdir}/%{name}/%{version}/msg
134 %{_libdir}/%{name}/%{version}/units
135 %{_libdir}/%{name}/lexyacc/*
136 %attr(755,root,root) %{_libdir}/%{name}/%{version}/ppc386
137 %attr(755,root,root) %{_libdir}/%{name}/%{version}/samplecfg
138 %{_mandir}/man*/*
139
140 %files examples
141 %defattr(644,root,root,755)
142 %doc %{_examplesdir}/fpc
143
144 %files doc
145 %defattr(644,root,root,755)
146 %doc src/%{name}-%{version}/doc/*.pdf
This page took 0.065032 seconds and 3 git commands to generate.