xterm.spec revision 4419d26b
1# $XTermId: xterm.spec,v 1.149 2022/03/04 21:39:26 tom Exp $
2Summary: X terminal emulator (development version)
3%global my_middle xterm
4%global my_suffix -dev
5%global fullname %{my_middle}%{my_suffix}
6%global my_class XTermDev
7Name: %{fullname}
8Version: 372
9Release: 1
10License: X11
11Group: User Interface/X
12Source: xterm-%{version}.tgz
13URL: https://invisible-island.net/xterm/
14Provides: x-terminal-emulator >= %{version}
15
16# This part (the build-requires) would be useful if the various distributions
17# had provided stable package-naming, or virtual packages to cover transitions. 
18# However, they have not done this in the past.
19%define use_x_manpage %(test "x$_use_x_manpage" = xyes && echo 1 || echo 0)
20%if "%{use_x_manpage}"
21
22%global is_mandriva %(test -f /etc/mandriva-release && echo %{use_x_manpage} || echo 0)
23%global is_redhat   %(test -f /etc/redhat-release && echo %{use_x_manpage} || echo 0)
24%global is_suse     %(test -f /etc/SuSE-release && echo %{use_x_manpage} || echo 0)
25
26%if %{is_mandriva}
27BuildRequires: x11-docs
28%else
29%if %{is_redhat}
30BuildRequires: xorg-x11-docs
31%else
32%if %{is_suse}
33BuildRequires: xorg-docs
34%endif
35%endif
36%endif
37
38%endif
39
40%description
41xterm is the standard terminal emulator for the X Window System.
42It provides DEC VT102 and Tektronix 4014 compatible terminals for
43programs that cannot use the window system directly.  This version
44implements ISO/ANSI colors, Unicode, and most of the control sequences
45used by DEC VT220 terminals.
46
47This package provides four commands:
48 a) %{fullname}, which is the actual terminal emulator
49 b) u%{fullname}, which is a wrapper around %{fullname}
50    which sets %{fullname} to use UTF-8 encoding when
51    the user's locale supports this,
52 c) koi8r%{fullname}, a wrapper similar to u%{fullname}
53    for locales that use the KOI8-R character set, and
54 d) resize%{my_suffix}.
55
56A complete list of control sequences supported by the X terminal emulator
57is provided in /usr/share/doc/%{fullname}.
58
59The %{fullname} program uses bitmap images provided by the xbitmaps package.
60
61Those interested in using koi8r%{fullname} will likely want to install the
62xfonts-cyrillic package as well.
63
64This package is configured to use "%{fullname}" and "%{my_class}"
65for the program and its resource class, to avoid conflict with other packages.
66
67%prep
68
69%global target_appdata %{fullname}.appdata.xml
70
71%define desktop_utils   %(if which desktop-file-install 2>&1 >/dev/null ; then echo 1 || echo 0 ; fi)
72%define icon_theme  %(test -d /usr/share/icons/hicolor && echo 1 || echo 0)
73%define apps_x11r6  %(test -d /usr/X11R6/lib/X11/app-defaults && echo 1 || echo 0)
74%define apps_shared %(test -d /usr/share/X11/app-defaults && echo 1 || echo 0)
75%define apps_syscnf %(test -d /etc/X11/app-defaults && echo 1 || echo 0)
76
77%if %{apps_x11r6}
78%define _xresdir    %{_prefix}/X11R6/lib/X11/app-defaults
79%else
80%if %{apps_shared}
81%define _xresdir    %{_datadir}/X11/app-defaults
82%else
83%define _xresdir    %{_sysconfdir}/X11/app-defaults
84%endif
85%endif
86
87%define _iconsdir   %{_datadir}/icons
88%define _pixmapsdir %{_datadir}/pixmaps
89%define my_docdir   %{_datadir}/doc/%{fullname}
90
91# no need for debugging symbols...
92%define debug_package %{nil}
93
94%setup -q -n xterm-%{version}
95
96%build
97CPPFLAGS="-DMISC_EXP -DEXP_HTTP_HEADERS" \
98%configure \
99        --target %{_target_platform} \
100        --prefix=%{_prefix} \
101        --bindir=%{_bindir} \
102        --datadir=%{_datadir} \
103        --mandir=%{_mandir} \
104%if "%{my_suffix}" != ""
105        --program-suffix=%{my_suffix} \
106        --without-xterm-symlink \
107%endif
108%if "%{icon_theme}"
109        --with-icon-symlink=%{fullname} \
110        --with-icon-theme \
111        --with-icondir=%{_iconsdir} \
112%endif
113        --with-app-class=%{my_class} \
114        --disable-imake \
115        --enable-dabbrev \
116        --enable-dec-locator \
117        --enable-exec-xterm \
118        --enable-hp-fkeys \
119        --enable-load-vt-fonts \
120        --enable-logfile-exec \
121        --enable-logging \
122        --enable-mini-luit \
123        --enable-regis-graphics \
124        --enable-sco-fkeys \
125        --enable-toolbar \
126        --enable-xmc-glitch \
127        --with-app-defaults=%{_xresdir} \
128        --with-pixmapdir=%{_pixmapsdir} \
129        --with-own-terminfo=%{_datadir}/terminfo \
130        --with-terminal-type=xterm-new \
131        --with-utempter \
132        --with-icon-name=mini.xterm \
133        --with-xpm
134make
135
136chmod u+w XTerm.ad
137cat >>XTerm.ad <<EOF
138*backarrowKeyIsErase: true
139*ptyInitialErase: true
140EOF
141ls -l *.ad
142
143%install
144rm -rf $RPM_BUILD_ROOT
145
146# Usually do not use install-ti, since that will conflict with ncurses.
147make install-bin install-man install-app install-icon \
148%if "%{install_ti}" == "yes"
149        install-ti \
150%endif
151        DESTDIR=$RPM_BUILD_ROOT \
152        TERMINFO=%{_datadir}/terminfo
153
154        mkdir -p $RPM_BUILD_ROOT%{my_docdir}
155        cp \
156                ctlseqs.txt \
157                README.i18n \
158                THANKS \
159                xterm.log.html \
160        $RPM_BUILD_ROOT%{my_docdir}/
161
162        cp -r vttests \
163        $RPM_BUILD_ROOT%{my_docdir}/
164
165        # The scripts are readable, but not executable, to let find-requires
166        # know that they do not depend on Perl packages.
167        chmod 644 $RPM_BUILD_ROOT%{my_docdir}/vttests/*.pl
168
169%if "%{desktop_utils}"
170make install-desktop \
171        DESKTOP_FLAGS="--dir $RPM_BUILD_ROOT%{_datadir}/applications"
172
173test -n "%{my_suffix}" && \
174( cd $RPM_BUILD_ROOT%{_datadir}/applications
175        for p in *.desktop
176        do
177                mv $p `basename $p .desktop`%{my_suffix}.desktop
178        done
179)
180
181mkdir -p $RPM_BUILD_ROOT%{_datadir}/appdata && \
182install -m 644 xterm.appdata.xml $RPM_BUILD_ROOT%{_datadir}/appdata/%{target_appdata} && \
183( cd $RPM_BUILD_ROOT%{_datadir}/appdata
184  sed -i \
185      -e 's/>xterm\.desktop</>%{fullname}.desktop</' \
186      -e 's/>XTerm</>%{my_class}</' \
187      %{target_appdata}
188)
189diff -u xterm.appdata.xml $RPM_BUILD_ROOT%{_datadir}/appdata/%{target_appdata} && \
190%endif
191
192%post
193%if "%{icon_theme}"
194touch --no-create %{_iconsdir}/hicolor
195if [ -x %{_bindir}/gtk-update-icon-cache ]; then
196  %{_bindir}/gtk-update-icon-cache %{_iconsdir}/hicolor || :
197fi
198%endif
199# find-requires does not care about at this point
200chmod +x %{my_docdir}/vttests/*.*
201
202%postun
203%if "%{icon_theme}"
204touch --no-create %{_iconsdir}/hicolor
205if [ -x %{_bindir}/gtk-update-icon-cache ]; then
206  %{_bindir}/gtk-update-icon-cache %{_iconsdir}/hicolor || :
207fi
208%endif
209
210%clean
211if rm -rf $RPM_BUILD_ROOT; then
212  echo OK
213else
214  find $RPM_BUILD_ROOT -type f | grep -F -v /.nfs && exit 1
215fi
216exit 0
217
218%files
219%defattr(-,root,root,-)
220%{_bindir}/koi8r%{fullname}
221%{_bindir}/%{fullname}
222%{_bindir}/u%{fullname}
223%{_bindir}/resize%{my_suffix}
224%{_mandir}/*/*
225%{my_docdir}/*
226%{_xresdir}/*XTerm*
227
228%if "%{install_ti}" == "yes"
229%{_datadir}/terminfo/*
230%endif
231
232%if "%{desktop_utils}"
233%config(missingok) %{_datadir}/appdata/%{target_appdata}
234%config(missingok) %{_datadir}/applications/%{fullname}.desktop
235%config(missingok) %{_datadir}/applications/u%{fullname}.desktop
236%endif
237
238%if "%{icon_theme}"
239%{_iconsdir}/hicolor/*.png
240%{_iconsdir}/hicolor/*.svg
241%{_iconsdir}/hicolor/48x48/apps/*.png
242%{_iconsdir}/hicolor/scalable/apps/*.svg
243%endif
244%{_pixmapsdir}/*.xpm
245
246%changelog
247
248* Thu Feb 24 2022 Thomas E. Dickey
249- double-buffer is not enabled by default
250
251* Sat Jul 25 2020 Thomas E. Dickey
252- sixels are enabled by default
253
254* Sun Mar 08 2020 Thomas E. Dickey
255- remove "--vendor" option from desktop-file-install
256
257* Sun Nov 17 2019 Thomas E. Dickey
258- install appdata.xml file
259
260* Wed May 02 2018 Thomas E. Dickey
261- install all icons
262
263* Fri Jan 29 2016 Thomas E. Dickey
264- use --enable-screen-dumps
265
266* Mon May 27 2013 Thomas E. Dickey
267- use --with-icon-symlink
268
269* Mon Oct 08 2012 Thomas E. Dickey
270- added to pixmapsdir
271
272* Fri Jun 15 2012 Thomas E. Dickey
273- modify to support icon theme
274
275* Fri Oct 22 2010 Thomas E. Dickey
276- initial version.
277