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: 3.0.4 |
7 |
Release: %mkrel 1 |
8 |
License: GPLv2+ and LGPLv2+ with exceptions |
9 |
Group: Development/Tools |
10 |
#Url: https://sourceforge.net/projects/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 running IDE |
18 |
Source2: %{name} |
19 |
#Add IDE in Desktop Menu |
20 |
Source3: %{name}.desktop |
21 |
#From ftp://ftp.freepascal.org/pub/fpc/dist/_fpc_version_/docs |
22 |
Source4: doc-html.tar.gz |
23 |
#For printing |
24 |
Source5: fp-prn-en |
25 |
#It's shows when IDE runs the first time and from Menu |
26 |
Source6: readme_en.ide |
27 |
|
28 |
#From upstream |
29 |
Patch1: snapshot_fixes_3_2_svn20181220.patch |
30 |
#From upstream with modifications for fpc-3.0.4 |
31 |
Patch2: make_fixes_3_2_svn20181220.patch |
32 |
#For printing |
33 |
Patch3: fpide_prn_support_0.patch |
34 |
#For printing |
35 |
Patch4: fpmfile_prn_en_support_1.patch |
36 |
#https://bugs.freepascal.org/view.php?id=34533 |
37 |
Patch5: save_as_ok_button_v2.patch |
38 |
#Fix http://bugs.freepascal.org/view.php?id=23682 |
39 |
Patch6: fpkeys.patch |
40 |
#Don't show message on mouse click |
41 |
Patch7: mouse_click.patch |
42 |
#Fix http://bugs.freepascal.org/view.php?id=25280 |
43 |
Patch8: fix_min_size.patch |
44 |
#Fix https://bugs.freepascal.org/view.php?id=34725 |
45 |
Patch9: do_not_use_messages_pos.patch |
46 |
#Fix https://bugs.freepascal.org/view.php?id=23581 |
47 |
Patch10: gdbint_pp.patch |
48 |
|
49 |
#Compiler fpc (which have Requires: gpm, ncurses, binutils) |
50 |
Requires: fpc = %{version} |
51 |
#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) |
52 |
#Requires: libnotify |
53 |
#For work of IDE |
54 |
Requires: coreutils |
55 |
#For compiling in IDE, for ptcgraph |
56 |
Requires: glibc-devel |
57 |
Requires: gcc |
58 |
Requires: pkgconfig(x11) |
59 |
Requires: pkgconfig(xrandr) |
60 |
Requires: pkgconfig(xxf86vm) |
61 |
Requires: pkgconfig(xext) |
62 |
Requires: pkgconfig(xxf86dga) |
63 |
|
64 |
#For svn tools in IDE |
65 |
Recommends: subversion |
66 |
#For grep in IDE |
67 |
Recommends: grep |
68 |
#gdb in not in fp binary |
69 |
Recommends: gdb |
70 |
|
71 |
#Fundamental for building |
72 |
BuildRequires: fpc |
73 |
BuildRequires: gcc |
74 |
#For iconv in spec |
75 |
BuildRequires: glibc |
76 |
#For libexpat.so when build is linking |
77 |
BuildRequires: pkgconfig(expat) |
78 |
#For libncurses.so when build is linking |
79 |
BuildRequires: pkgconfig(ncurses) |
80 |
#For libz.a (for gdb >= 7.5.1) |
81 |
BuildRequires: pkgconfig(zlib) |
82 |
#For gdb building |
83 |
BuildRequires: termcap-devel |
84 |
|
85 |
%description |
86 |
Text Mode Free Pascal IDE (English) |
87 |
|
88 |
%prep |
89 |
%setup -q -n fpcbuild-%{version} |
90 |
%patch1 -p1 |
91 |
%patch2 -p1 |
92 |
sed -i 's|(error No libgdb.a found, supply NOGDB=1 to disable debugger support)|(warning _OK_)|g' Makefile |
93 |
cd fpcsrc |
94 |
%patch3 -p0 |
95 |
%patch4 -p0 |
96 |
%patch5 -p0 |
97 |
%patch6 -p0 |
98 |
%patch7 -p0 |
99 |
%patch8 -p0 |
100 |
%patch9 -p0 |
101 |
%patch10 -p0 |
102 |
tar -xf %{SOURCE4} |
103 |
|
104 |
#Fix for better result |
105 |
sed -i -e "s|Write(' Press any key to return to IDE');|Writeln(' Press any key to return to IDE');|g" ./ide/fpide.pas |
106 |
|
107 |
#Fix symbols in html |
108 |
iconv -c -s -f ISO-8859-15 -t UTF-8 ./doc/user/user.html > ./doc/user/user.html.tmp |
109 |
sed -i -e "s|>ël Van Canneyt<|>el Van Canneyt<|g" ./doc/user/user.html.tmp |
110 |
sed -i -e "s|>ämpfl<|>ampfl<|g" ./doc/user/user.html.tmp |
111 |
iconv -c -s -f UTF-8 -t ISO-8859-15 ./doc/user/user.html.tmp > ./doc/user/user.html |
112 |
rm -f ./doc/user/user.html.tmp |
113 |
iconv -c -s -f ISO-8859-15 -t UTF-8 ./doc/prog/prog.html > ./doc/prog/prog.html.tmp |
114 |
sed -i -e "s|>ël Van Canneyt<|>el Van Canneyt<|g" ./doc/prog/prog.html.tmp |
115 |
iconv -c -s -f UTF-8 -t ISO-8859-15 ./doc/prog/prog.html.tmp > ./doc/prog/prog.html |
116 |
rm -f ./doc/prog/prog.html.tmp |
117 |
iconv -c -s -f ISO-8859-15 -t UTF-8 ./doc/ref/ref.html > ./doc/ref/ref.html.tmp |
118 |
sed -i -e "s|>ël Van Canneyt<|>el Van Canneyt<|g" ./doc/ref/ref.html.tmp |
119 |
iconv -c -s -f UTF-8 -t ISO-8859-15 ./doc/ref/ref.html.tmp > ./doc/ref/ref.html |
120 |
rm -f ./doc/ref/ref.html.tmp |
121 |
iconv -c -s -f ISO-8859-15 -t UTF-8 ./doc/fpdoc/fpdoc.html > ./doc/fpdoc/fpdoc.html.tmp |
122 |
sed -i -e "s|>ël Van Canneyt<|>el Van Canneyt<|g" ./doc/fpdoc/fpdoc.html.tmp |
123 |
iconv -c -s -f UTF-8 -t ISO-8859-15 ./doc/fpdoc/fpdoc.html.tmp > ./doc/fpdoc/fpdoc.html |
124 |
rm -f ./doc/fpdoc/fpdoc.html.tmp |
125 |
|
126 |
#Add IDE's path |
127 |
sed -i -e "s|SystemIDEDir:=FExpand(DirOf(system.paramstr(0))+'../lib/fpc/'+version_string+'/ide/text');|SystemIDEDir:='%{_datadir}/%{name}';|g" ./ide/fpini.pas |
128 |
sed -i -e "s|SystemIDEDir:=FExpand(DirOf(system.paramstr(0))+'../lib64/fpc/'+version_string+'/ide/text');|SystemIDEDir:='%{_datadir}/%{name}';|g" ./ide/fpini.pas |
129 |
sed -i -e "s|SystemIDEDir:='/usr/lib/fpc/'+version_string+'/ide/text';|SystemIDEDir:='%{_datadir}/%{name}';|g" ./ide/fpini.pas |
130 |
|
131 |
#Add path for readme.ide and adding readme.ide into Help menu instead of "Using help" |
132 |
sed -i -e "s|'readme.ide'|'%{_datadir}/%{name}/readme.ide'|g" ./ide/fpconst.pas |
133 |
sed -i -e "s|Help(0,hcUsingHelp,false);|ShowReadme;|g" ./ide/fpmhelp.inc |
134 |
sed -i -e "s|'~U~sing help'|'~W~elcome'|g" ./ide/fpide.pas |
135 |
sed -i -e "s|'~U~sing help'|'~W~elcome'|g" ./packages/fv/src/strtxt.inc |
136 |
sed -i -e "s|'How to use Online Help'|'Show file readme.ide'|g" ./ide/fphelp.pas |
137 |
|
138 |
#Don't use background, correcting interface of IDE |
139 |
sed -i -e "s|'fp.ans'|'fpans'|g" ./ide/fpconst.pas |
140 |
|
141 |
#Configuring configs |
142 |
echo '' >> ./utils/fpcmkcfg/fpinc.ini |
143 |
echo '[Help]' >> ./utils/fpcmkcfg/fpinc.ini |
144 |
echo 'Files="%{_docdir}/%{name}/fpctoc.html|Free Pascal IDE"' >> ./utils/fpcmkcfg/fpinc.ini |
145 |
sed -i -e "s|%fpctargetos%|Linux|g" ./utils/fpcmkcfg/fpinc.cfg |
146 |
sed -i -e 's|%basepath%|%{_libdir}/fpc/$fpcversion|g' ./utils/fpcmkcfg/fpinc.cfg |
147 |
sed -i -e 's|\\|/|g' ./utils/fpcmkcfg/fpinc.cfg |
148 |
GCC_LIB=`gcc -print-libgcc-file-name` |
149 |
GCC_LIB_PATH=`dirname $GCC_LIB` |
150 |
sed -i -e "s|%GCCLIBPATH%| -Fl$GCC_LIB_PATH|g" ./utils/fpcmkcfg/fpinc.cfg |
151 |
|
152 |
#Fix http://bugs.freepascal.org/view.php?id=25279 |
153 |
sed -i -e "/NewItem(menu_debug_output,'', kbNoKey, cmUserScreenWindow, hcUserScreenWindow,/d" ./ide/fpide.pas |
154 |
sed -i -e "s|))))))))))))))))),|)))))))))))))))),|g" ./ide/fpide.pas |
155 |
|
156 |
%build |
157 |
%make all GDBMI=1 %{?_smp_mflags} |
158 |
|
159 |
%install |
160 |
cd fpcsrc |
161 |
install -dm 755 %{buildroot}%{_datadir}/applications |
162 |
install -m 0644 %{SOURCE3} %{buildroot}%{_datadir}/applications/ |
163 |
install -dm 755 %{buildroot}%{_datadir}/pixmaps |
164 |
install -m 0644 %{SOURCE1} %{buildroot}%{_datadir}/pixmaps/ |
165 |
install -dm 755 %{buildroot}%{_bindir} |
166 |
install -m 755 %{SOURCE2} %{buildroot}%{_bindir}/ |
167 |
install -m 755 %{SOURCE5} %{buildroot}%{_bindir}/ |
168 |
install -dm 755 %{buildroot}%{_datadir}/%{name} |
169 |
cp -f ./ide/bin/*/fp %{buildroot}%{_datadir}/%{name}/%{name} |
170 |
install -dm 755 %{buildroot}%{_docdir}/%{name} |
171 |
cp -pfR ./doc/* %{buildroot}%{_docdir}/%{name}/ |
172 |
install -m 0644 %{SOURCE6} %{buildroot}%{_datadir}/%{name}/readme.ide |
173 |
cp -pfR ./ide/*.pt %{buildroot}%{_datadir}/%{name}/ |
174 |
cp -pfR ./ide/*.tdf %{buildroot}%{_datadir}/%{name}/ |
175 |
install -m 0644 ./utils/fpcmkcfg/fpinc.cfg %{buildroot}%{_datadir}/%{name}/fp.cfg |
176 |
install -m 0644 ./utils/fpcmkcfg/fpinc.ini %{buildroot}%{_datadir}/%{name}/fp.ini |
177 |
|
178 |
%files |
179 |
%{_datadir}/applications/%{name}.desktop |
180 |
%{_datadir}/pixmaps/%{name}.png |
181 |
%{_bindir}/%{name} |
182 |
%{_bindir}/fp-prn-en |
183 |
%{_docdir}/%{name} |
184 |
%{_datadir}/%{name}/%{name} |
185 |
%{_datadir}/%{name}/*.pt |
186 |
%{_datadir}/%{name}/*.tdf |
187 |
%{_datadir}/%{name}/fp.cfg |
188 |
%{_datadir}/%{name}/fp.ini |
189 |
%{_datadir}/%{name}/readme.ide |