xterm.spec revision 894e0ac8
1# $XTermId: xterm.spec,v 1.72 2014/06/19 19:58:13 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: 308
9Release: 1
10License: X11
11Group: User Interface/X
12Source: xterm-%{version}.tgz
13URL: ftp://invisible-island.net/xterm/
14Provides: x-terminal-emulator
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 desktop_vendor  dickey
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 \
110	--with-icon-theme \
111	--with-icondir=%{_iconsdir} \
112%endif
113	--with-app-class=%{my_class} \
114	--disable-imake \
115	--enable-256-color \
116	--enable-88-color \
117	--enable-dabbrev \
118	--enable-dec-locator \
119	--enable-exec-xterm \
120	--enable-hp-fkeys \
121	--enable-load-vt-fonts \
122	--enable-logfile-exec \
123	--enable-logging \
124	--enable-mini-luit \
125	--enable-paste64 \
126	--enable-sco-fkeys \
127	--enable-sixel-graphics \
128	--enable-tcap-fkeys \
129	--enable-tcap-query \
130	--enable-toolbar \
131	--enable-wide-chars \
132	--enable-xmc-glitch \
133	--with-app-defaults=%{_xresdir} \
134	--with-pixmapdir=%{_pixmapsdir} \
135	--with-own-terminfo=%{_datadir}/terminfo \
136	--with-terminal-type=xterm-new \
137	--with-utempter \
138	--with-icon-name=mini.xterm \
139	--with-xpm
140make
141
142chmod u+w XTerm.ad
143cat >>XTerm.ad <<EOF
144*backarrowKeyIsErase: true
145*ptyInitialErase: true
146EOF
147ls -l *.ad
148
149%install
150rm -rf $RPM_BUILD_ROOT
151
152# Usually do not use install-ti, since that will conflict with ncurses.
153make install-bin install-man install-app install-icon \
154%if "%{install_ti}" == "yes"
155	install-ti \
156%endif
157	DESTDIR=$RPM_BUILD_ROOT \
158	TERMINFO=%{_datadir}/terminfo
159
160	mkdir -p $RPM_BUILD_ROOT%{my_docdir}
161	cp \
162		ctlseqs.txt \
163		README.i18n \
164		THANKS \
165		xterm.log.html \
166	$RPM_BUILD_ROOT%{my_docdir}/
167
168	cp -r vttests \
169	$RPM_BUILD_ROOT%{my_docdir}/
170
171	# The scripts are readable, but not executable, to let find-requires
172	# know that they do not depend on Perl packages.
173	chmod 644 $RPM_BUILD_ROOT%{my_docdir}/vttests/*.pl
174
175%if "%{desktop_utils}"
176make install-desktop \
177	DESKTOP_FLAGS="--vendor='%{desktop_vendor}' --dir $RPM_BUILD_ROOT%{_datadir}/applications"
178
179test -n "%{my_suffix}" && \
180( cd $RPM_BUILD_ROOT%{_datadir}/applications
181	for p in *.desktop
182	do
183		mv $p `basename $p .desktop`%{my_suffix}.desktop
184	done
185)
186%endif
187
188%post
189%if "%{icon_theme}"
190touch --no-create %{_iconsdir}/hicolor
191if [ -x %{_bindir}/gtk-update-icon-cache ]; then
192  %{_bindir}/gtk-update-icon-cache %{_iconsdir}/hicolor || :
193fi
194%endif
195# find-requires does not care about at this point
196chmod +x %{my_docdir}/vttests/*.*
197
198%postun
199%if "%{icon_theme}"
200touch --no-create %{_iconsdir}/hicolor
201if [ -x %{_bindir}/gtk-update-icon-cache ]; then
202  %{_bindir}/gtk-update-icon-cache %{_iconsdir}/hicolor || :
203fi
204%endif
205
206%clean
207rm -rf $RPM_BUILD_ROOT
208
209%files
210%defattr(-,root,root,-)
211%{_bindir}/koi8r%{fullname}
212%{_bindir}/%{fullname}
213%{_bindir}/u%{fullname}
214%{_bindir}/resize%{my_suffix}
215%{_mandir}/*/*
216%{my_docdir}/*
217%{_xresdir}/*XTerm*
218
219%if "%{install_ti}" == "yes"
220%{_datadir}/terminfo/*
221%endif
222
223%if "%{desktop_utils}"
224%config(missingok) %{_datadir}/applications/%{desktop_vendor}-%{fullname}.desktop
225%config(missingok) %{_datadir}/applications/%{desktop_vendor}-u%{fullname}.desktop
226%endif
227
228%if "%{icon_theme}"
229%{_iconsdir}/hicolor/48x48/apps/%{fullname}*.png
230%{_iconsdir}/hicolor/scalable/apps/%{fullname}*.svg
231%endif
232%{_pixmapsdir}/*%{fullname}*.xpm
233
234# files added by --with-icon-symlink
235%if "%{icon_theme}"
236%{_iconsdir}/hicolor/xterm.png
237%{_iconsdir}/hicolor/xterm.svg
238%endif
239%{_pixmapsdir}/xterm.xpm
240
241%changelog
242
243* Mon May 27 2013 Thomas E. Dickey
244- use --with-icon-symlink
245
246* Mon Oct 08 2012 Thomas E. Dickey
247- added to pixmapsdir
248
249* Fri Jun 15 2012 Thomas E. Dickey
250- modify to support icon theme
251
252* Fri Oct 22 2010 Thomas E. Dickey
253- initial version.
254