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