1 |
%define debug_package %{nil} |
2 |
%define gdb_ver 7.5.1 |
3 |
|
4 |
Summary: Text Mode Free Pascal IDE with CP866 adaptation (Russian) |
5 |
Name: fp-ide-ru |
6 |
Version: 3.0.4 |
7 |
Release: %mkrel 4 |
8 |
License: GPLv2+ and LGPLv2+ with exceptions |
9 |
Group: Development/Tools |
10 |
#Url: https://sourceforge.net/projects/fp-ide-ru |
11 |
Url: https://sourceforge.net/projects/freepascal |
12 |
|
13 |
#Main source |
14 |
Source0: fpcbuild-%{version}.tar.gz |
15 |
#Icon |
16 |
Source1: %{name}.png |
17 |
#Script for running IDE |
18 |
Source2: %{name} |
19 |
#Add IDE in Desktop Menu |
20 |
Source3: %{name}.desktop |
21 |
#Only for CP866 |
22 |
Source4: video.pp |
23 |
#Only for CP866 |
24 |
Source5: local_ru.sh |
25 |
#From ftp://ftp.freepascal.org/pub/fpc/dist/%%{version}/docs |
26 |
Source6: doc-html.tar.gz |
27 |
#Unused source, but for future changes |
28 |
Source7: %{name}.xcf |
29 |
#Unused source, for finding new strings for translation in new version of IDE |
30 |
Source8: check_translations.sh |
31 |
#Configuration for sakura |
32 |
Source9: sakura_%{name}.conf |
33 |
#For printing |
34 |
Source10: fp-prn-ru |
35 |
#It's shows when IDE runs the first time and from Menu |
36 |
Source11: readme_ru.ide |
37 |
#Russian version help for Turbo Pascal 7.0 |
38 |
Source12: turbo.tph |
39 |
|
40 |
#From upstream |
41 |
Patch1: snapshot_fixes_3_2_svn20181220.patch |
42 |
#From upstream with modifications for fpc-3.0.4 |
43 |
Patch2: make_fixes_3_2_svn20181220.patch |
44 |
#For printing |
45 |
Patch3: fpide_prn_support_0.patch |
46 |
#For printing |
47 |
Patch4: fpmfile_prn_ru_support_1.patch |
48 |
#https://bugs.freepascal.org/view.php?id=34533 |
49 |
Patch5: save_as_ok_button_v2.patch |
50 |
#Fix http://bugs.freepascal.org/view.php?id=23682 |
51 |
Patch6: fpkeys.patch |
52 |
#Don't show message on mouse click |
53 |
Patch7: mouse_click.patch |
54 |
#Fix http://bugs.freepascal.org/view.php?id=25280 |
55 |
Patch8: fix_min_size.patch |
56 |
#Fix https://bugs.freepascal.org/view.php?id=34725 |
57 |
Patch9: do_not_use_messages_pos.patch |
58 |
#Fix https://bugs.freepascal.org/view.php?id=23581 |
59 |
Patch10: gdbint_pp.patch |
60 |
#From Debian, modified for our needs |
61 |
Patch11: fix_FTBFS_on_linux_not_amd64.patch |
62 |
#From Debian |
63 |
Patch12: add-arm64-support.patch |
64 |
#From Debian |
65 |
Patch13: after_patch_arm64_systems.pas.patch |
66 |
#From Debian |
67 |
Patch14: further-arm64-fixes.patch |
68 |
|
69 |
#Compiler fpc (which have Requires: gpm, ncurses, binutils) |
70 |
Requires: fpc = %{version} |
71 |
#Any terminals, which works with CP866 in all DE (see script fp-ide-ru) |
72 |
#Notice: you need sakura >= 3.1.2 with --fullscreen support, |
73 |
#but there is bug https://bugs.launchpad.net/sakura/+bug/1246333 |
74 |
#Requires: sakura >= 3.1.2 |
75 |
Requires: xfce4-terminal |
76 |
#For CP866 support |
77 |
Requires: glibc-i18ndata |
78 |
#For localedef |
79 |
Requires: glibc |
80 |
#For detecting UTF-8 in script fp-ide-ru |
81 |
Requires: enca |
82 |
#For notify-send |
83 |
Requires: libnotify |
84 |
#For work of IDE |
85 |
Requires: coreutils |
86 |
#For compiling in IDE, for ptcgraph |
87 |
Requires: glibc-devel |
88 |
Requires: gcc |
89 |
Requires: pkgconfig(x11) |
90 |
Requires: pkgconfig(xrandr) |
91 |
Requires: pkgconfig(xxf86vm) |
92 |
Requires: pkgconfig(xext) |
93 |
Requires: pkgconfig(xxf86dga) |
94 |
|
95 |
#For svn tools in IDE |
96 |
Recommends: subversion |
97 |
#For grep in IDE |
98 |
Recommends: grep |
99 |
#gdb in not in fp binary |
100 |
Recommends: gdb |
101 |
|
102 |
#Fundamental for building |
103 |
BuildRequires: fpc |
104 |
BuildRequires: gcc |
105 |
#For iconv in spec |
106 |
BuildRequires: glibc |
107 |
#For libexpat.so when build is linking |
108 |
BuildRequires: pkgconfig(expat) |
109 |
#For libncurses.so when build is linking |
110 |
BuildRequires: pkgconfig(ncurses) |
111 |
#For libz.a (for gdb >= 7.5.1) |
112 |
BuildRequires: pkgconfig(zlib) |
113 |
#For gdb building |
114 |
BuildRequires: termcap-devel |
115 |
|
116 |
%description |
117 |
Text Mode Free Pascal IDE with CP866 adaptation (Russian) |
118 |
|
119 |
%post |
120 |
#Adding CP866 in distro |
121 |
localedef -i ru_RU -f IBM866 ru_RU.CP866 |
122 |
|
123 |
%prep |
124 |
%setup -q -n fpcbuild-%{version} |
125 |
%patch1 -p1 |
126 |
%patch2 -p1 |
127 |
%patch11 -p1 |
128 |
%patch12 -p1 |
129 |
%patch13 -p1 |
130 |
%patch14 -p1 |
131 |
sed -i 's|(error No libgdb.a found, supply NOGDB=1 to disable debugger support)|(warning _OK_)|g' Makefile |
132 |
sed -i 's|(error No libgdb.a found, supply NOGDB=1 to disable debugger support)|(warning _OK_)|g' Makefile.fpc |
133 |
cd fpcsrc |
134 |
ln -s ide packages/ide |
135 |
#ln -s packages/ide ide |
136 |
%patch3 -p0 |
137 |
%patch4 -p0 |
138 |
%patch5 -p0 |
139 |
%patch6 -p0 |
140 |
%patch7 -p0 |
141 |
%patch8 -p0 |
142 |
%patch9 -p0 |
143 |
%patch10 -p0 |
144 |
cp -f %{SOURCE4} ./packages/rtl-console/src/unix/ |
145 |
cp -f %{SOURCE5} ./ |
146 |
tar -xf %{SOURCE6} |
147 |
|
148 |
#Convert to CP866 |
149 |
iconv -c -s -f UTF-8 -t CP866 ./compiler/msg/errorru.msg > ./compiler/msg/errorru_cp866.msg |
150 |
|
151 |
#Fix for better result |
152 |
sed -i -e "s|Write(' Press any key to return to IDE');|Writeln(' Press any key to return to IDE');|g" ./ide/fpide.pas |
153 |
|
154 |
#Fix for Russian "ё" in CP866 |
155 |
sed -i -e "s|'_', #241|'_'|g" ./ide/fpcalc.pas |
156 |
sed -i -e "s|#241|'_'|g" ./ide/fpcalc.pas |
157 |
|
158 |
#Fix for Russian "п, о" in CP866 |
159 |
sed -i -e "s|#175, #174|#62, #60|g" ./packages/fv/src/views.pas |
160 |
|
161 |
#Fix symbols for CP866 |
162 |
iconv -c -s -f CP850 -t UTF-8 ./ide/fpviews.pas > ./ide/fpviews.pas.tmp |
163 |
sed -i -e "s|'Bérczi Gábor'|'Berczi Gabor'|g" ./ide/fpviews.pas.tmp |
164 |
sed -i -e "s|'Florian Klämpfl'|'Florian Klampfl'|g" ./ide/fpviews.pas.tmp |
165 |
sed -i -e "s|'Michäel Van Canneyt'|'Michael Van Canneyt'|g" ./ide/fpviews.pas.tmp |
166 |
iconv -c -s -f UTF-8 -t CP850 ./ide/fpviews.pas.tmp > ./ide/fpviews.pas |
167 |
rm -f ./ide/fpviews.pas.tmp |
168 |
|
169 |
#Fix symbols in html |
170 |
iconv -c -s -f ISO-8859-15 -t UTF-8 ./doc/user/user.html > ./doc/user/user.html.tmp |
171 |
sed -i -e "s|>ël Van Canneyt<|>el Van Canneyt<|g" ./doc/user/user.html.tmp |
172 |
sed -i -e "s|>ämpfl<|>ampfl<|g" ./doc/user/user.html.tmp |
173 |
iconv -c -s -f UTF-8 -t ISO-8859-15 ./doc/user/user.html.tmp > ./doc/user/user.html |
174 |
rm -f ./doc/user/user.html.tmp |
175 |
iconv -c -s -f ISO-8859-15 -t UTF-8 ./doc/prog/prog.html > ./doc/prog/prog.html.tmp |
176 |
sed -i -e "s|>ël Van Canneyt<|>el Van Canneyt<|g" ./doc/prog/prog.html.tmp |
177 |
iconv -c -s -f UTF-8 -t ISO-8859-15 ./doc/prog/prog.html.tmp > ./doc/prog/prog.html |
178 |
rm -f ./doc/prog/prog.html.tmp |
179 |
iconv -c -s -f ISO-8859-15 -t UTF-8 ./doc/ref/ref.html > ./doc/ref/ref.html.tmp |
180 |
sed -i -e "s|>ël Van Canneyt<|>el Van Canneyt<|g" ./doc/ref/ref.html.tmp |
181 |
iconv -c -s -f UTF-8 -t ISO-8859-15 ./doc/ref/ref.html.tmp > ./doc/ref/ref.html |
182 |
rm -f ./doc/ref/ref.html.tmp |
183 |
iconv -c -s -f ISO-8859-15 -t UTF-8 ./doc/fpdoc/fpdoc.html > ./doc/fpdoc/fpdoc.html.tmp |
184 |
sed -i -e "s|>ël Van Canneyt<|>el Van Canneyt<|g" ./doc/fpdoc/fpdoc.html.tmp |
185 |
iconv -c -s -f UTF-8 -t ISO-8859-15 ./doc/fpdoc/fpdoc.html.tmp > ./doc/fpdoc/fpdoc.html |
186 |
rm -f ./doc/fpdoc/fpdoc.html.tmp |
187 |
|
188 |
#Add IDE's path |
189 |
sed -i -e "s|SystemIDEDir:=FExpand(DirOf(system.paramstr(0))+'../lib/fpc/'+version_string+'/ide/text');|SystemIDEDir:='%{_datadir}/%{name}';|g" ./ide/fpini.pas |
190 |
sed -i -e "s|SystemIDEDir:=FExpand(DirOf(system.paramstr(0))+'../lib64/fpc/'+version_string+'/ide/text');|SystemIDEDir:='%{_datadir}/%{name}';|g" ./ide/fpini.pas |
191 |
sed -i -e "s|SystemIDEDir:='/usr/lib/fpc/'+version_string+'/ide/text';|SystemIDEDir:='%{_datadir}/%{name}';|g" ./ide/fpini.pas |
192 |
|
193 |
#Add path for readme.ide and adding readme.ide into Help menu instead of "Using help" |
194 |
sed -i -e "s|'readme.ide'|'%{_datadir}/%{name}/readme.ide'|g" ./ide/fpconst.pas |
195 |
sed -i -e "s|Help(0,hcUsingHelp,false);|ShowReadme;|g" ./ide/fpmhelp.inc |
196 |
sed -i -e "s|'~U~sing help'|'~W~elcome'|g" ./ide/fpide.pas |
197 |
sed -i -e "s|'~U~sing help'|'~W~elcome'|g" ./packages/fv/src/strtxt.inc |
198 |
sed -i -e "s|'How to use Online Help'|'Show file readme.ide'|g" ./ide/fphelp.pas |
199 |
|
200 |
#Don't use background, correcting interface of IDE |
201 |
sed -i -e "s|'fp.ans'|'fpans'|g" ./ide/fpconst.pas |
202 |
|
203 |
#Configuring configs |
204 |
sed -i -e "s|#ENDIF|\n -Fr%{_datadir}/%{name}/errorru_cp866.msg\n#ENDIF|g" ./utils/fpcmkcfg/fpinc.cfg |
205 |
echo '' >> ./utils/fpcmkcfg/fpinc.ini |
206 |
echo '[Help]' >> ./utils/fpcmkcfg/fpinc.ini |
207 |
echo 'Files="%{_docdir}/%{name}/fpctoc.html|Free Pascal IDE"' >> ./utils/fpcmkcfg/fpinc.ini |
208 |
sed -i -e "s|%fpctargetos%|Linux|g" ./utils/fpcmkcfg/fpinc.cfg |
209 |
sed -i -e 's|%basepath%|%{_libdir}/fpc/$fpcversion|g' ./utils/fpcmkcfg/fpinc.cfg |
210 |
sed -i -e 's|\\|/|g' ./utils/fpcmkcfg/fpinc.cfg |
211 |
GCC_LIB=`gcc -print-libgcc-file-name` |
212 |
GCC_LIB_PATH=`dirname $GCC_LIB` |
213 |
sed -i -e "s|%GCCLIBPATH%| -Fl$GCC_LIB_PATH|g" ./utils/fpcmkcfg/fpinc.cfg |
214 |
|
215 |
#Fix http://bugs.freepascal.org/view.php?id=25279 |
216 |
sed -i -e "/NewItem(menu_debug_output,'', kbNoKey, cmUserScreenWindow, hcUserScreenWindow,/d" ./ide/fpide.pas |
217 |
sed -i -e "s|))))))))))))))))),|)))))))))))))))),|g" ./ide/fpide.pas |
218 |
|
219 |
#Russian localization |
220 |
bash ./local_ru.sh |
221 |
|
222 |
%build |
223 |
%ifarch aarch64 |
224 |
# update Makefiles to support aarch64 |
225 |
fpcmake $(find . -name "Makefile.fpc") |
226 |
%endif |
227 |
%make_build all GDBMI=1 %{?_smp_mflags} |
228 |
|
229 |
%install |
230 |
cd fpcsrc |
231 |
install -dm 755 %{buildroot}%{_datadir}/applications |
232 |
install -m 0644 %{SOURCE3} %{buildroot}%{_datadir}/applications/ |
233 |
install -dm 755 %{buildroot}%{_datadir}/pixmaps |
234 |
install -m 0644 %{SOURCE1} %{buildroot}%{_datadir}/pixmaps/ |
235 |
install -dm 755 %{buildroot}%{_bindir} |
236 |
install -m 755 %{SOURCE2} %{buildroot}%{_bindir}/ |
237 |
install -m 755 %{SOURCE10} %{buildroot}%{_bindir}/ |
238 |
install -dm 755 %{buildroot}%{_datadir}/%{name} |
239 |
cp -f ./ide/bin/*/fp %{buildroot}%{_datadir}/%{name}/%{name} |
240 |
install -dm 755 %{buildroot}%{_docdir}/%{name} |
241 |
cp -pfR ./doc/* %{buildroot}%{_docdir}/%{name}/ |
242 |
install -m 0644 %{SOURCE11} %{buildroot}%{_datadir}/%{name}/readme.ide |
243 |
install -m 0644 %{SOURCE12} %{buildroot}%{_docdir}/%{name}/ |
244 |
cp -pfR ./ide/*.pt %{buildroot}%{_datadir}/%{name}/ |
245 |
cp -pfR ./ide/*.tdf %{buildroot}%{_datadir}/%{name}/ |
246 |
cp -f ./compiler/msg/errorru_cp866.msg %{buildroot}%{_datadir}/%{name}/ |
247 |
install -m 0644 ./utils/fpcmkcfg/fpinc.cfg %{buildroot}%{_datadir}/%{name}/fp.cfg |
248 |
install -m 0644 ./utils/fpcmkcfg/fpinc.ini %{buildroot}%{_datadir}/%{name}/fp.ini |
249 |
install -m 0644 %{SOURCE9} %{buildroot}%{_datadir}/%{name}/ |
250 |
|
251 |
%files |
252 |
%{_datadir}/applications/%{name}.desktop |
253 |
%{_datadir}/pixmaps/%{name}.png |
254 |
%{_bindir}/%{name} |
255 |
%{_bindir}/fp-prn-ru |
256 |
%{_docdir}/%{name} |
257 |
%{_datadir}/%{name}/%{name} |
258 |
%{_datadir}/%{name}/*.pt |
259 |
%{_datadir}/%{name}/*.tdf |
260 |
%{_datadir}/%{name}/*.msg |
261 |
%{_datadir}/%{name}/fp.cfg |
262 |
%{_datadir}/%{name}/fp.ini |
263 |
%{_datadir}/%{name}/sakura_%{name}.conf |
264 |
%{_datadir}/%{name}/readme.ide |