src/*.c, Eterm.spec: Various build fixes

Several changes here to make it build on RHEL/CentOS 8:
 - Replace outdated MEMSET() macro with (g)libc memset()
 - Update Release field to use `git describe` just like LibAST
 - Fix `make distcheck` by adding an uninstall-hook for src/gdb.scr
 - At long last, remove the ancient RPM %changelog content
 - Fix incompatibility with my traditional choices for CFLAGS
   (-O0 -g3) and modern RHEL security/hardening goop which, due to
   being implemented in the GCC optimizer, is rendered non-functional
   by building with -O0!
 - Rename backgrounds tarball so that it doesn't have the Eterm
   version in its name since, shockingly, it never changes based on
   the version of Eterm!
This commit is contained in:
Michael Jennings 2020-02-28 17:06:54 -07:00
parent 37d7e09045
commit 5d475d0105
14 changed files with 59 additions and 141 deletions

View File

@ -1,22 +1,23 @@
%{!?_rel:%{expand:%%global _rel 0.%(git describe --abbrev=4 --always --tags --long --dirty=.1 | cut -d- -f 2- | tr '-' '.')}}
%if %{!?compression:1}0
%define compression gz
%endif
%define __os_install_post /usr/lib/rpm/brp-compress
%if %{?optflags:1}0
%define optflags ${RPM_OPT_FLAGS:--O0 -g3}
%{expand:%%define optflags %{!?el8:${RPM_OPT_FLAGS:--O0 -g3}}%{?el8:-O2 -ggdb3 -fPIC}}
%endif
Summary: Enlightened terminal emulator
Name: Eterm
Version: 0.9.7
#Release: 1
Release: 0.%(date '+%Y%m%d')
Release: %{_rel}%{?dist}
License: BSD
Group: User Interface/X
URL: http://www.eterm.org/
Source0: http://www.eterm.org/download/%{name}-%{version}.tar.%{compression}
Source1: http://www.eterm.org/download/%{name}-bg-%{version}.tar.%{compression}
Source1: http://www.eterm.org/download/%{name}-backgrounds.tar.%{compression}
#BuildSuggests: xorg-x11-devel, XFree86-devel, xorg-x11-proto-devel, libXext-devel, libXt-devel, freetype-devel
BuildRequires: libast, imlib2-devel
Requires: imlib2, imlib2-loader_jpeg, imlib2-loader_png
@ -31,9 +32,11 @@ various themes and is very configurable, in keeping with the
philosophy of Enlightenment. If you install Eterm, you'll also need to
have the Imlib2 library installed.
%prep
%setup -a 1
%build
CFLAGS="%{optflags}"
export CFLAGS
@ -46,6 +49,7 @@ export CFLAGS
--with-debugging=9 %{?acflags}
%{__make} %{?mflags}
%install
%{__rm} -rf $RPM_BUILD_ROOT
@ -74,6 +78,7 @@ Type=Application
EOF
chmod 0644 $RPM_BUILD_ROOT%{_sysconfdir}/X11/applnk/Utilities/Eterm.desktop
%post
/sbin/ldconfig || :
@ -81,12 +86,15 @@ if [ -d /usr/share/terminfo -a ! -f /usr/share/terminfo/E/Eterm ]; then
tic -o/usr/share/terminfo %{_docdir}/%{name}-%{version}/%{name}.ti || :
fi
%postun
/sbin/ldconfig || :
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-, root, root)
%doc doc/Eterm_reference.html doc/Eterm.1.html doc/Eterm.tcap doc/Eterm.ti doc/README.Escreen
@ -97,100 +105,5 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man1/*
%{_datadir}/%{name}/*
%changelog
* Tue Feb 20 2001 Tim Powers <timp@redhat.com>
- builds on Alpha now. No need to excludearch (bug 28472)
* Wed Feb 14 2001 Tim Powers <timp@redhat.com>
- removed images which are from Digital Blasphemy from the extra
images tarball, had to delete those images because they are not
allowed to be redistributed on CD, or in compressed format
* Tue Jan 9 2001 Tim Powers <timp@redhat.com>
- fixed a bunch of pre and post in/uninstall brokenness by dropping
split backgrounds package, backgrounds now included in Eterm
proper. This also makes the spec file a lot cleaner :)
* Sat Aug 19 2000 Tim Powers <timp@redhat.com>
- fix bug #15687
* Tue Aug 8 2000 Tim Powers <timp@redhat.com>
- fixed bug #15687 using Hans' patch
* Wed Aug 2 2000 Tim Powers <timp@redhat.com>
- rebuilt against libpng-1.0.8
* Mon Jul 24 2000 Prospector <prospector@redhat.com>
- rebuilt
* Sat Jul 22 2000 Tim Powers <timp@redhat.com>
- fix spec file problem with configure picking up egcs and running with it,
fixes linking bugs
* Mon Jul 10 2000 Tim Powers <timp@redhat.com>
- rebuilt
* Fri Jun 2 2000 Tim Powers <timp@redhat.com>
- no more wmconfig :) converted to applnk
- fix man page location. Now FHS compliant
- use macros wherever possible
- removed redundant defines at the top of the spec
* Mon Apr 10 2000 Tim Powers <timp@redhat.com>
- rebuilt for 7.0
* Thu Feb 03 2000 Tim Powers <timp@redhat.com>
- strip debug from libraries
* Wed Feb 02 2000 Tim Powers <timp@redhat.com>
- fixed problems when upgrading and error messages due to a faulty script in
the post section for the Eterm package
* Tue Feb 01 2000 Tim Powers <timp@redhat.com>
- applied patch from Hans de Goede <hans@highrise.nl> to fix some del, home
and end issues
* Fri Jan 29 2000 Tim Powers <timp@redhat.com>
- rebuilt for 6.2 powertools
- bzipped source to conserve space
- using percent configure so that libtoolize is run, needed for some of the
newer alphas instead of ./configure --prefix=
- stripping binaries again
* Fri Dec 10 1999 Michael Jennings <mej@eterm.org>
- Added Tim's spec file to CVS as Eterm.spec.in for 0.9
* Wed Dec 8 1999 Tim Powers <timp@redhat.com>
- using unified patch for utempter and themes from Michael Jennings
* Tue Dec 7 1999 Tim Powers <timp@redhat.com>
- added wmconfig entry
- split up into 2 packages, Eterm proper, and Eterm-backgrounds
- thanks to ewt, we no longer have to make Eterm suid root, uses utempter
instead
* Mon Dec 6 1999 Tim Powers <timp@redhat.com>
- updated to 0.8.10
- patched so that Eterm finds pix/themes in the right place
- new version fixes problems with utmp, conforms to Eterm docs.
- added RedHat.Eterm_suid which includes instructions on how to run Eterm in
order to have it seen by "w" and "who" as a regular user
* Fri Aug 20 1999 Tim Powers <timp@redhat.com>
- fixed roblem with removing all files when uninstalling Eterm.
* Tue Jul 27 1999 Tim Powers <timp@redhat.com>
- updated version to 0.8.9
- cleaned up spec
- updated patch
- includes new backgrounds
- built for 6.1
* Mon Apr 05 1999 Michael Maher <mike@redhat.com>
- update to 0.8.8
* Fri Oct 23 1998 Jeff Johnson <jbj@redhat.com>
- update to 0.8.7.
* Fri Oct 08 1998 Michael Maher <mike@redhat.com>
- built eterm

View File

@ -40,8 +40,13 @@ Eterm_LDFLAGS = -rpath $(libdir):$(pkglibdir)
Eterm_LDADD = libEterm.la
EXTRA_DIST = gdb.scr mmx_cmod.S sse2_cmod.c
MAINTAINERCLEANFILES = Makefile.in
DISTCLEANFILES = Makefile
install-exec-hook:
$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
test ! -z "$(GDB_CMD_FILE)" && $(INSTALL_DATA) $(srcdir)/gdb.scr $(DESTDIR)$(pkgdatadir)/ || :
MAINTAINERCLEANFILES=Makefile.in
-test ! -z "$(GDB_CMD_FILE)" && $(INSTALL_DATA) $(srcdir)/gdb.scr $(DESTDIR)$(pkgdatadir)/
uninstall-hook:
$(RM) $(DESTDIR)$(pkgdatadir)/gdb.scr

View File

@ -84,7 +84,7 @@ buttonbar_t *bbar_create(void)
XSetWindowAttributes xattr;
bbar = (buttonbar_t *) MALLOC(sizeof(buttonbar_t));
MEMSET(bbar, 0, sizeof(buttonbar_t));
memset(bbar, 0, sizeof(buttonbar_t));
xattr.border_pixel = BlackPixel(Xdisplay, Xscreen);
xattr.save_under = FALSE;
@ -749,7 +749,7 @@ button_t *button_create(char *text)
button_t *button;
button = (button_t *) MALLOC(sizeof(button_t));
MEMSET(button, 0, sizeof(button_t));
memset(button, 0, sizeof(button_t));
if (text) {
button->text = STRDUP(text);

View File

@ -2831,7 +2831,7 @@ matrix(int n)
return;
}
MEMSET(s, 0, TERM_WINDOW_GET_COLS());
memset(s, 0, TERM_WINDOW_GET_COLS());
#define MATRIX_HI CLEAR
#define MATRIX_LO ((4<<8)|CLEAR)
@ -3195,7 +3195,7 @@ tt_winsize(int fd)
if (fd < 0)
return;
MEMSET(&ws, 0, sizeof(struct winsize));
memset(&ws, 0, sizeof(struct winsize));
ws.ws_row = (unsigned short) TERM_WINDOW_GET_REPORTED_ROWS();
ws.ws_col = (unsigned short) TERM_WINDOW_GET_REPORTED_COLS();
@ -3725,9 +3725,9 @@ main_loop(void)
}
libast_print_warning("Moo2: %s\n", safe_print_string(outbuff, outlen));
MEMSET(outbuff + outlen, 0, sizeof(wchar_t));
memset(outbuff + outlen, 0, sizeof(wchar_t));
wcbuff = (wchar_t *) outbuff;
MEMSET(&mbs, 0, sizeof(mbstate_t));
memset(&mbs, 0, sizeof(mbstate_t));
outlen = wcsrtombs(NULL, &wcbuff, 0, &mbs) + 1;
if (outlen > 0) {
outbuff = (char *) MALLOC(outlen);

View File

@ -184,7 +184,7 @@ static enc_context_t *enc_create_context(const char *id)
enc_context_t *tmp;
tmp = (enc_context_t *) MALLOC(sizeof(enc_context_t));
MEMSET(tmp, 0, sizeof(enc_context_t));
memset(tmp, 0, sizeof(enc_context_t));
tmp->id = STRDUP(id);
return tmp;
}
@ -204,7 +204,7 @@ static enc_state_t *enc_create_state(const char *id, unsigned char lifetime)
enc_state_t *tmp;
tmp = (enc_state_t *) MALLOC(sizeof(enc_state_t));
MEMSET(tmp, 0, sizeof(enc_state_t));
memset(tmp, 0, sizeof(enc_state_t));
tmp->id = STRDUP(id);
tmp->lifetime = lifetime;
return tmp;

View File

@ -133,7 +133,7 @@ void
event_init_primary_dispatcher(void)
{
MEMSET(&primary_data, 0, sizeof(event_dispatcher_data_t));
memset(&primary_data, 0, sizeof(event_dispatcher_data_t));
EVENT_DATA_ADD_HANDLER(primary_data, KeyPress, handle_key_press);
EVENT_DATA_ADD_HANDLER(primary_data, PropertyNotify, handle_property_notify);

View File

@ -79,23 +79,23 @@ eterm_font_add(char ***plist, const char *fontname, unsigned char idx)
/* The below looks messy with all the cpp stuff, but it really just malloc's/realloc's
both etfonts and etmfonts at the same time to the same size, zeros all the new
memory space using MEMSET(), and then prints some goop. */
memory space using memset(), and then prints some goop. */
if (etfonts) {
etfonts = (char **) REALLOC(etfonts, new_size);
MEMSET(etfonts + font_cnt, 0, sizeof(char *) * (idx - font_cnt + 1));
memset(etfonts + font_cnt, 0, sizeof(char *) * (idx - font_cnt + 1));
#ifdef MULTI_CHARSET
etmfonts = (char **) REALLOC(etmfonts, new_size);
MEMSET(etmfonts + font_cnt, 0, sizeof(char *) * (idx - font_cnt + 1));
memset(etmfonts + font_cnt, 0, sizeof(char *) * (idx - font_cnt + 1));
D_FONT((" -> Reallocated font lists: %u bytes at %8p/%8p\n", new_size, etfonts, etmfonts));
#else
D_FONT((" -> Reallocated font list: %u bytes at %8p\n", new_size, etfonts));
#endif
} else {
etfonts = (char **) MALLOC(new_size);
MEMSET(etfonts, 0, new_size);
memset(etfonts, 0, new_size);
#ifdef MULTI_CHARSET
etmfonts = (char **) MALLOC(new_size);
MEMSET(etmfonts, 0, new_size);
memset(etmfonts, 0, new_size);
D_FONT((" -> Allocated font lists: %u bytes at %8p/%8p\n", new_size, etfonts, etmfonts));
#else
D_FONT((" -> Allocating font list: %u bytes at %8p\n", new_size, etfonts));
@ -751,7 +751,7 @@ parse_font_fx(char *line)
n = spiftool_num_words(line);
if (!BEG_STRCASECMP(line, "none")) {
MEMSET(&fshadow, 0, sizeof(fontshadow_t));
memset(&fshadow, 0, sizeof(fontshadow_t));
} else if (!BEG_STRCASECMP(line, "outline")) {
if (n != 2) {
return 0;

View File

@ -471,7 +471,7 @@ menu_t *menu_create(char *title)
| Button1MotionMask | Button2MotionMask | Button3MotionMask;
}
menu = (menu_t *) MALLOC(sizeof(menu_t));
MEMSET(menu, 0, sizeof(menu_t));
memset(menu, 0, sizeof(menu_t));
menu->title = STRDUP(title ? title : "");
menu->win =
@ -715,7 +715,7 @@ menuitem_t *menuitem_create(char *text)
menuitem_t *menuitem;
menuitem = (menuitem_t *) MALLOC(sizeof(menuitem_t));
MEMSET(menuitem, 0, sizeof(menuitem_t));
memset(menuitem, 0, sizeof(menuitem_t));
if (text) {
menuitem->text = STRDUP(text);

View File

@ -1731,11 +1731,11 @@ parse_image(char *buff, void *state)
return NULL;
}
if (new) {
MEMSET(images[idx].current, 0, sizeof(simage_t));
memset(images[idx].current, 0, sizeof(simage_t));
images[idx].current->pmap = (pixmap_t *) MALLOC(sizeof(pixmap_t));
images[idx].current->iml = (imlib_t *) MALLOC(sizeof(imlib_t));
MEMSET(images[idx].current->pmap, 0, sizeof(pixmap_t));
MEMSET(images[idx].current->iml, 0, sizeof(imlib_t));
memset(images[idx].current->pmap, 0, sizeof(pixmap_t));
memset(images[idx].current->iml, 0, sizeof(imlib_t));
}
} else if (!BEG_STRCASECMP(buff, "color ")) {
char *fg = spiftool_get_word(2, buff), *bg = spiftool_get_word(3, buff);
@ -2546,10 +2546,10 @@ init_defaults(void)
rs_path = NULL;
#endif
colorfgbg = DEFAULT_RSTYLE;
MEMSET(PixColors, 0, sizeof(PixColors));
memset(PixColors, 0, sizeof(PixColors));
/* Font stuff. */
MEMSET(rs_font, 0, sizeof(char *) * NFONTS);
memset(rs_font, 0, sizeof(char *) * NFONTS);
#if AUTO_ENCODING
/* Auto-encoding means the default fonts are chosen by locale. */
# ifdef MULTI_CHARSET
@ -2756,8 +2756,8 @@ post_parse(void)
simg->iml = (imlib_t *) MALLOC(sizeof(imlib_t));
simg->fg = WhitePixel(Xdisplay, Xscreen);
simg->bg = BlackPixel(Xdisplay, Xscreen);
MEMSET(simg->pmap, 0, sizeof(pixmap_t));
MEMSET(simg->iml, 0, sizeof(imlib_t));
memset(simg->pmap, 0, sizeof(pixmap_t));
memset(simg->iml, 0, sizeof(imlib_t));
images[i].mode = MODE_IMAGE & ALLOW_IMAGE;
}
images[i].current = simg;

View File

@ -357,7 +357,7 @@ image_t *create_eterm_image(void)
image_t *i;
i = (image_t *) MALLOC(sizeof(image_t));
MEMSET(i, 0, sizeof(image_t));
memset(i, 0, sizeof(image_t));
return (i);
}
@ -431,11 +431,11 @@ simage_t *create_simage(void)
simage_t *s;
s = (simage_t *) MALLOC(sizeof(simage_t));
MEMSET(s, 0, sizeof(simage_t));
memset(s, 0, sizeof(simage_t));
s->pmap = (pixmap_t *) MALLOC(sizeof(pixmap_t));
s->iml = (imlib_t *) MALLOC(sizeof(imlib_t));
MEMSET(s->pmap, 0, sizeof(pixmap_t));
MEMSET(s->iml, 0, sizeof(imlib_t));
memset(s->pmap, 0, sizeof(pixmap_t));
memset(s->iml, 0, sizeof(imlib_t));
return s;
}

View File

@ -109,7 +109,7 @@ blank_line(text_t *et, rend_t *er, int width, rend_t efs)
register unsigned int i = width;
rend_t *r = er, fs = efs;
MEMSET(et, ' ', i);
memset(et, ' ', i);
for (; i--;)
*r++ = fs;
}
@ -126,7 +126,7 @@ blank_screen_mem(text_t **tp, rend_t **rp, int row, rend_t efs)
tp[row] = MALLOC(sizeof(text_t) * (TERM_WINDOW_GET_REPORTED_COLS() + 1));
rp[row] = MALLOC(sizeof(rend_t) * TERM_WINDOW_GET_REPORTED_COLS());
}
MEMSET(tp[row], ' ', i);
memset(tp[row], ' ', i);
tp[row][i] = 0;
for (r = rp[row]; i--;)
*r++ = fs;
@ -355,7 +355,7 @@ scr_poweron(void)
D_SCREEN(("scr_poweron()\n"));
/* Reset all character sets to Latin1 */
MEMSET(charsets, 'B', sizeof(charsets));
memset(charsets, 'B', sizeof(charsets));
rvideo = 0;
/* Reset the rendering style to the default colors/style */
scr_rendition(0, ~RS_None);
@ -1304,7 +1304,7 @@ void
scr_set_tab(int mode)
{
if (mode < 0)
MEMSET(tabs, 0, (unsigned int) TERM_WINDOW_GET_REPORTED_COLS());
memset(tabs, 0, (unsigned int) TERM_WINDOW_GET_REPORTED_COLS());
else if (screen.col < TERM_WINDOW_GET_REPORTED_COLS())
tabs[screen.col] = (mode ? 1 : 0);
@ -1510,7 +1510,7 @@ scr_expose(int x, int y, int width, int height)
rect_end.col, rect_end.row));
for (i = rect_beg.row; i <= rect_end.row; i++) {
MEMSET(&(drawn_text[i][rect_beg.col]), 0, rect_end.col - rect_beg.col + 1);
memset(&(drawn_text[i][rect_beg.col]), 0, rect_end.col - rect_beg.col + 1);
}
}

View File

@ -73,7 +73,7 @@ void
scrollbar_event_init_dispatcher(void)
{
MEMSET(&scrollbar_event_data, 0, sizeof(event_dispatcher_data_t));
memset(&scrollbar_event_data, 0, sizeof(event_dispatcher_data_t));
EVENT_DATA_ADD_HANDLER(scrollbar_event_data, EnterNotify, sb_handle_enter_notify);
EVENT_DATA_ADD_HANDLER(scrollbar_event_data, LeaveNotify, sb_handle_leave_notify);

View File

@ -137,7 +137,7 @@ eterm_bootstrap(int argc, char *argv[])
get_modifiers(); /* Set up modifier masks before parsing config files. */
/* Get all our properties set up. */
MEMSET(props, 0, sizeof(props));
memset(props, 0, sizeof(props));
props[PROP_TEXT] = XInternAtom(Xdisplay, "TEXT", False);
props[PROP_COMPOUND_TEXT] = XInternAtom(Xdisplay, "COMPOUND_TEXT", False);
props[PROP_UTF8_STRING] = XInternAtom(Xdisplay, "UTF8_STRING", False);

View File

@ -97,10 +97,10 @@ add_utmp_entry(const char *pty, const char *hostname, int fd)
# ifdef HAVE_UTMPX_H
struct utmpx utmp;
struct utmp utmp2;
MEMSET(&utmp, 0, sizeof(struct utmpx));
memset(&utmp, 0, sizeof(struct utmpx));
# else
struct utmp utmp;
MEMSET(&utmp, 0, sizeof(struct utmp));
memset(&utmp, 0, sizeof(struct utmp));
# endif
# ifdef WITH_DMALLOC
@ -336,7 +336,7 @@ add_utmp_entry(const char *pty, const char *hostname, int fd)
struct passwd *pwent = getpwuid(my_ruid);
struct utmp utmp;
MEMSET(&utmp, 0, sizeof(struct utmp));
memset(&utmp, 0, sizeof(struct utmp));
if (!strncmp(pty, "/dev/", 5))
pty += 5; /* skip /dev/ prefix */
@ -386,7 +386,7 @@ remove_utmp_entry(void)
privileges(INVOKE);
if (!ut_id[0] && (fd = fopen(UTMP_FILENAME, "r+"))) {
struct utmp utmp;
MEMSET(&utmp, 0, sizeof(struct utmp));
memset(&utmp, 0, sizeof(struct utmp));
fseek(fd, utmp_pos, 0);
fwrite(&utmp, sizeof(struct utmp), 1, fd);