1 |
%define debug_package %{nil} |
2 |
%define gdb_ver 7.5.1 |
3 |
|
4 |
Summary: Text Mode Free Pascal IDE (English) |
5 |
Name: fp-ide-en |
6 |
Version: 2.6.4 |
7 |
Release: %mkrel 2 |
8 |
License: GPLv2+ and LGPLv2+ with exceptions |
9 |
Group: Development/Tools |
10 |
#Url: http://code.google.com/p/fp-ide-en |
11 |
Url: http://sourceforge.net/projects/freepascal |
12 |
|
13 |
#Main source |
14 |
Source0: fpcbuild-%{version}.tar.gz |
15 |
#Icon |
16 |
Source1: %{name}.png |
17 |
#Script for run IDE |
18 |
Source2: %{name} |
19 |
#Add IDE in Menu |
20 |
Source3: %{name}.desktop |
21 |
#From ftp://ftp.freepascal.org/pub/fpc/dist/ |
22 |
Source6: doc-html.tar.gz |
23 |
#It's works with renamed *.a |
24 |
Source9: gdbint.pp |
25 |
#For printing |
26 |
Source10: fp-prn-en |
27 |
#It's shows when IDE runs the first time |
28 |
Source11: readme_en.ide |
29 |
#Don't change this source, because you will need adaptation sources and patches |
30 |
Source13: gdb-%{gdb_ver}.tar.bz2 |
31 |
|
32 |
#For printing |
33 |
Patch1: fpide_prn_support_0.patch |
34 |
#For printing |
35 |
Patch2: fpmfile_prn_en_support_1.patch |
36 |
#Fix http://bugs.freepascal.org/view.php?id=23682 |
37 |
Patch4: fpkeys.patch |
38 |
#Fix http://bugs.freepascal.org/view.php?id=23683 |
39 |
Patch5: process_window_info.patch |
40 |
#Don't show message on mouse click |
41 |
Patch7: mouse_click.patch |
42 |
#For correctly link *.a |
43 |
Patch8: gdb_link.patch |
44 |
#Fix http://bugs.freepascal.org/view.php?id=25230 |
45 |
Patch9: fix_incorrect_hints.patch |
46 |
#Fix http://bugs.freepascal.org/view.php?id=25239 |
47 |
Patch11: help_buttons.patch |
48 |
#Fix http://bugs.freepascal.org/view.php?id=25280 |
49 |
Patch12: fix_min_size.patch |
50 |
|
51 |
#Compiler fpc (which have Requires: gpm, ncurses, binutils) |
52 |
Requires: fpc = %{version} |
53 |
#No Requires for gdb, because there is gdb in fp binary |
54 |
#Requires: gdb = %{gdb_ver} |
55 |
#For notify-send; you don't need notify-send, because fp-ide-en uses notify-send from package fp-ide-ru (if fp-ide-ru is not installed, then no messages) |
56 |
#Requires: libnotify |
57 |
#For work of IDE |
58 |
Requires: coreutils |
59 |
#For compiling in IDE, for ptcgraph |
60 |
Requires: glibc-devel |
61 |
Requires: gcc |
62 |
Requires: pkgconfig(x11) |
63 |
Requires: pkgconfig(xrandr) |
64 |
Requires: pkgconfig(xxf86vm) |
65 |
Requires: pkgconfig(xext) |
66 |
Requires: pkgconfig(xxf86dga) |
67 |
|
68 |
#For svn tools in IDE |
69 |
Suggests: subversion |
70 |
#For grep in IDE |
71 |
Suggests: grep |
72 |
|
73 |
#Fundamental for building |
74 |
BuildRequires: fpc |
75 |
BuildRequires: gcc |
76 |
#For iconv in spec |
77 |
BuildRequires: glibc |
78 |
#For libexpat.so when build linking |
79 |
BuildRequires: pkgconfig(expat) |
80 |
#For libncurses.so when build linking |
81 |
BuildRequires: pkgconfig(ncurses) |
82 |
#For libz.a (for gdb >= 7.5.1) |
83 |
BuildRequires: pkgconfig(zlib) |
84 |
#For building gdb |
85 |
BuildRequires: termcap-devel |
86 |
|
87 |
%description |
88 |
Text Mode Free Pascal IDE (English) |
89 |
|
90 |
%prep |
91 |
%setup -q -n fpcbuild-%{version} |
92 |
cd fpcsrc |
93 |
%patch9 -p0 |
94 |
%patch1 -p0 |
95 |
%patch2 -p0 |
96 |
%patch4 -p0 |
97 |
%patch5 -p0 |
98 |
%patch7 -p0 |
99 |
%patch8 -p0 |
100 |
%patch11 -p0 |
101 |
%patch12 -p0 |
102 |
cp -f %{SOURCE9} ./packages/gdbint/src/ |
103 |
tar -xf %{SOURCE6} |
104 |
|
105 |
#Fix for better result |
106 |
sed -i -e "s|Write(' Press any key to return to IDE');|Writeln(' Press any key to return to IDE');|g" ./ide/fpide.pas |
107 |
|
108 |
#Fix symbols in html |
109 |
iconv -c -s -f ISO-8859-15 -t UTF-8 ./doc/user/user.html > ./doc/user/user.html.tmp |
110 |
sed -i -e "s|>ël Van Canneyt<|>el Van Canneyt<|g" ./doc/user/user.html.tmp |
111 |
sed -i -e "s|>ämpfl<|>ampfl<|g" ./doc/user/user.html.tmp |
112 |
iconv -c -s -f UTF-8 -t ISO-8859-15 ./doc/user/user.html.tmp > ./doc/user/user.html |
113 |
rm -f ./doc/user/user.html.tmp |
114 |
iconv -c -s -f ISO-8859-15 -t UTF-8 ./doc/prog/prog.html > ./doc/prog/prog.html.tmp |
115 |
sed -i -e "s|>ël Van Canneyt<|>el Van Canneyt<|g" ./doc/prog/prog.html.tmp |
116 |
iconv -c -s -f UTF-8 -t ISO-8859-15 ./doc/prog/prog.html.tmp > ./doc/prog/prog.html |
117 |
rm -f ./doc/prog/prog.html.tmp |
118 |
iconv -c -s -f ISO-8859-15 -t UTF-8 ./doc/ref/ref.html > ./doc/ref/ref.html.tmp |
119 |
sed -i -e "s|>ël Van Canneyt<|>el Van Canneyt<|g" ./doc/ref/ref.html.tmp |
120 |
iconv -c -s -f UTF-8 -t ISO-8859-15 ./doc/ref/ref.html.tmp > ./doc/ref/ref.html |
121 |
rm -f ./doc/ref/ref.html.tmp |
122 |
iconv -c -s -f ISO-8859-15 -t UTF-8 ./doc/fpdoc/fpdoc.html > ./doc/fpdoc/fpdoc.html.tmp |
123 |
sed -i -e "s|>ël Van Canneyt<|>el Van Canneyt<|g" ./doc/fpdoc/fpdoc.html.tmp |
124 |
iconv -c -s -f UTF-8 -t ISO-8859-15 ./doc/fpdoc/fpdoc.html.tmp > ./doc/fpdoc/fpdoc.html |
125 |
rm -f ./doc/fpdoc/fpdoc.html.tmp |
126 |
|
127 |
#Add IDE's path |
128 |
sed -i -e "s|SystemIDEDir:=FExpand(DirOf(system.paramstr(0))+'../lib/fpc/'+version_string+'/ide/text');|SystemIDEDir:='%{_datadir}/%{name}';|g" ./ide/fpini.pas |
129 |
sed -i -e "s|SystemIDEDir:=FExpand(DirOf(system.paramstr(0))+'../lib64/fpc/'+version_string+'/ide/text');|SystemIDEDir:='%{_datadir}/%{name}';|g" ./ide/fpini.pas |
130 |
sed -i -e "s|SystemIDEDir:='/usr/lib/fpc/'+version_string+'/ide/text';|SystemIDEDir:='%{_datadir}/%{name}';|g" ./ide/fpini.pas |
131 |
|
132 |
#Add path for readme.ide and added readme.ide into Help menu instead "Using help" |
133 |
sed -i -e "s|'readme.ide'|'%{_datadir}/%{name}/readme.ide'|g" ./ide/fpconst.pas |
134 |
sed -i -e "s|Help(0,hcUsingHelp,false);|ShowReadme;|g" ./ide/fpmhelp.inc |
135 |
sed -i -e "s|'~U~sing help'|'~W~elcome'|g" ./ide/fpide.pas |
136 |
sed -i -e "s|'~U~sing help'|'~W~elcome'|g" ./packages/fv/src/strtxt.inc |
137 |
sed -i -e "s|'How to use Online Help'|'Show file readme.ide'|g" ./ide/fphelp.pas |
138 |
|
139 |
#Don't use background, correcting interface of IDE |
140 |
sed -i -e "s|'fp.ans'|'fpans'|g" ./ide/fpconst.pas |
141 |
|
142 |
#Configure configs |
143 |
echo '' >> ./utils/fpcmkcfg/fpinc.ini |
144 |
echo '[Help]' >> ./utils/fpcmkcfg/fpinc.ini |
145 |
echo 'Files="%{_docdir}/%{name}/fpctoc.html|Free Pascal IDE"' >> ./utils/fpcmkcfg/fpinc.ini |
146 |
sed -i -e "s|%fpctargetos%|Linux|g" ./utils/fpcmkcfg/fpinc.cfg |
147 |
sed -i -e 's|%basepath%|/usr/lib/fpc/$fpcversion|g' ./utils/fpcmkcfg/fpinc.cfg |
148 |
sed -i -e 's|\\|/|g' ./utils/fpcmkcfg/fpinc.cfg |
149 |
GCC_LIB=`gcc -print-libgcc-file-name` |
150 |
GCC_LIB_PATH=`dirname $GCC_LIB` |
151 |
sed -i -e "s|%GCCLIBPATH%| -Fl$GCC_LIB_PATH|g" ./utils/fpcmkcfg/fpinc.cfg |
152 |
|
153 |
#Fix http://bugs.freepascal.org/view.php?id=25279 |
154 |
sed -i -e "/NewItem(menu_debug_output,'', kbNoKey, cmUserScreenWindow, hcUserScreenWindow,/d" ./ide/fpide.pas |
155 |
sed -i -e "s|))))))))))))))))),|)))))))))))))))),|g" ./ide/fpide.pas |
156 |
|
157 |
#Fix for new docs |
158 |
sed -i -e "s|http://www.freepascal.org/down/docs/docs.html|ftp://ftp.freepascal.org/pub/fpc/dist/|g" ./ide/wconstse.inc |
159 |
|
160 |
cd $RPM_BUILD_DIR |
161 |
tar -xf %{SOURCE13} |
162 |
|
163 |
%build |
164 |
#Build gdb |
165 |
cd $RPM_BUILD_DIR |
166 |
cd ./gdb-%{gdb_ver} |
167 |
./configure --prefix=/usr --disable-nls --without-python --disable-werror --disable-tui |
168 |
%make |
169 |
%make -C gdb libgdb.a |
170 |
#Rename *.a and move them into one directory for future linking |
171 |
rm -rf ./libgdb |
172 |
mkdir ./libgdb |
173 |
cp -f ./bfd/libbfd.a ./libgdb/libbfd_fpc.a |
174 |
cp -f ./libdecnumber/libdecnumber.a ./libgdb/libdecnumber_fpc.a |
175 |
cp -f ./gdb/libgdb.a ./libgdb/libgdb.a |
176 |
cp -f ./gdb/build-gnulib/import/libgnu.a ./libgdb/libgnu_fpc.a |
177 |
cp -f ./readline/libhistory.a ./libgdb/libhistory_fpc.a |
178 |
cp -f ./libiberty/libiberty.a ./libgdb/libiberty_fpc.a |
179 |
cp -f ./opcodes/libopcodes.a ./libgdb/libopcodes_fpc.a |
180 |
cp -f ./readline/libreadline.a ./libgdb/libreadline_fpc.a |
181 |
cp -f %{_libdir}/libz.a ./libgdb/libz_fpc.a |
182 |
|
183 |
#Build fpc |
184 |
cd $RPM_BUILD_DIR |
185 |
cd ./fpcbuild-%{version} |
186 |
ln -s "$RPM_BUILD_DIR/gdb-%{gdb_ver}/libgdb/libgdb.a" "$RPM_BUILD_DIR/fpcbuild-%{version}/fpcsrc/packages/gdbint/src/libgdb.a" |
187 |
%make all GDBVNATUREDIR="-Fl$RPM_BUILD_DIR/gdb-%{gdb_ver}/libgdb" LIBGDBFILE="$RPM_BUILD_DIR/gdb-%{gdb_ver}/libgdb/libgdb.a" LD_LIBRARY_PATH="$RPM_BUILD_DIR/gdb-%{gdb_ver}/libgdb" %{?_smp_mflags} |
188 |
|
189 |
%install |
190 |
cd fpcsrc |
191 |
install -dm 755 %{buildroot}%{_datadir}/applications |
192 |
install -m 0644 %{SOURCE3} %{buildroot}%{_datadir}/applications/ |
193 |
install -dm 755 %{buildroot}%{_datadir}/pixmaps |
194 |
install -m 0644 %{SOURCE1} %{buildroot}%{_datadir}/pixmaps/ |
195 |
install -dm 755 %{buildroot}%{_bindir} |
196 |
install -m 755 %{SOURCE2} %{buildroot}%{_bindir}/ |
197 |
install -m 755 %{SOURCE10} %{buildroot}%{_bindir}/ |
198 |
install -dm 755 %{buildroot}%{_datadir}/%{name} |
199 |
cp -f ./ide/fp %{buildroot}%{_datadir}/%{name}/%{name} |
200 |
install -dm 755 %{buildroot}%{_docdir}/%{name} |
201 |
cp -pfR ./doc/* %{buildroot}%{_docdir}/%{name}/ |
202 |
install -m 0644 %{SOURCE11} %{buildroot}%{_datadir}/%{name}/readme.ide |
203 |
cp -pfR ./ide/*.pt %{buildroot}%{_datadir}/%{name}/ |
204 |
cp -pfR ./ide/*.tdf %{buildroot}%{_datadir}/%{name}/ |
205 |
install -m 0644 ./utils/fpcmkcfg/fpinc.cfg %{buildroot}%{_datadir}/%{name}/fp.cfg |
206 |
install -m 0644 ./utils/fpcmkcfg/fpinc.ini %{buildroot}%{_datadir}/%{name}/fp.ini |
207 |
|
208 |
%files |
209 |
%{_datadir}/applications/%{name}.desktop |
210 |
%{_datadir}/pixmaps/%{name}.png |
211 |
%{_bindir}/%{name} |
212 |
%{_bindir}/fp-prn-en |
213 |
%{_docdir}/%{name} |
214 |
%{_datadir}/%{name}/%{name} |
215 |
%{_datadir}/%{name}/*.pt |
216 |
%{_datadir}/%{name}/*.tdf |
217 |
%{_datadir}/%{name}/fp.cfg |
218 |
%{_datadir}/%{name}/fp.ini |
219 |
%{_datadir}/%{name}/readme.ide |