diff --git a/compface-1.5.2-destdir.diff b/Makefile.patch similarity index 87% rename from compface-1.5.2-destdir.diff rename to Makefile.patch index dc99248..1b33dbf 100644 --- a/compface-1.5.2-destdir.diff +++ b/Makefile.patch @@ -2,8 +2,8 @@ o Build shared library, link tools against it o Make it possible to prevent stripping o Add DESTDIR support ---- Makefile.in~ 2005-10-04 15:59:49.000000000 +0300 -+++ Makefile.in 2006-08-02 22:23:07.000000000 +0300 +--- compface-1.5.2/Makefile.in.orig 2024-12-27 14:50:46.540723529 +0100 ++++ compface-1.5.2/Makefile.in 2024-12-27 15:47:57.403241428 +0100 @@ -15,6 +15,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ @@ -12,14 +12,14 @@ o Add DESTDIR support NAME = compface UNNAME = uncompface -@@ -25,6 +26,7 @@ +@@ -24,6 +25,7 @@ + EXECUTABLE = $(BINDIR)/$(NAMEEXE) UNEXECUTABLE = $(BINDIR)/$(UNNAMEEXE) LIBNAME = lib$(NAME).a - LIBRARY = $(LIBDIR)/$(LIBNAME) +SHLIBNAME = lib$(NAME).so + LIBRARY = $(LIBDIR)/$(LIBNAME) MAN1DIR = $(MANDIR)/man1 MAN3DIR = $(MANDIR)/man3 - OBJECTS = arith.o file.o compress.o gen.o uncompface.o @@ -45,11 +47,11 @@ all: $(NAMEEXE) $(UNNAMEEXE) @@ -36,11 +36,10 @@ o Add DESTDIR support $(LIBNAME) : $(OBJECTS) ar rc $(LIBNAME) $(OBJECTS) -@@ -73,25 +75,28 @@ - tar chzf `cat .fname`.tar.gz `cat .fname` +@@ -74,24 +76,27 @@ $(RM) -rf `cat .fname` .fname --install: $(NAMEEXE) $(UNNAMEEXE) $(LIBNAME) + install: $(NAMEEXE) $(UNNAMEEXE) $(LIBNAME) - $(INSTALL_PROGRAM) -d $(BINDIR) $(LIBDIR) $(MAN1DIR) $(MAN3DIR) $(INCLUDEDIR) - $(INSTALL_PROGRAM) $(srcdir)/$(NAMEEXE) $(EXECUTABLE) - -chmod 0755 $(EXECUTABLE) @@ -54,9 +53,8 @@ o Add DESTDIR support - cd $(MAN3DIR) && $(RM) ./$(UNNAME).3 && $(LN_S) $(NAME).3 $(UNNAME).3 - for hdr in $(INSTALLHEADERS); do $(INSTALL_DATA) $(srcdir)/$${hdr} $(INCLUDEDIR)/$${hdr}; done - $(INSTALL_DATA) $(srcdir)/$(LIBNAME) $(LIBRARY) -+install: $(NAMEEXE) $(UNNAMEEXE) $(SHLIBNAME) + $(INSTALL_PROGRAM) -d $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(MAN1DIR) $(DESTDIR)$(MAN3DIR) $(DESTDIR)$(INCLUDEDIR) -+ $(INSTALL_PROGRAM) $(srcdir)/$(NAMEEXE) $(DESTDIR)$(EXECUTABLE) ++ $(INSTALL_PROGRAM) $(srcdir)/$(NAMEEXE) $(DESTDIR)$(EXECUTABLE) + -$(STRIP) $(DESTDIR)$(EXECUTABLE) + $(INSTALL_PROGRAM) $(srcdir)/$(UNNAMEEXE) $(DESTDIR)$(UNEXECUTABLE) + -$(STRIP) $(DESTDIR)$(UNEXECUTABLE) @@ -74,7 +72,7 @@ o Add DESTDIR support compress $(NAME).sh +$(SHLIBNAME): $(OBJECTS) -+ $(CC) -shared -Wl,-soname,$(SHLIBNAME).1 $(LDFLAGS) -o $(SHLIBNAME) $(OBJECTS) ++ $(CC) -shared -Wl,-soname,$(SHLIBNAME).1 $(LDFLAGS) -o $(SHLIBNAME) $(OBJECTS) + .c.o: $(CC) -c $(CPPFLAGS) $(DEFS) $(CFLAGS) $< diff --git a/compface-1.5.2.diff b/compface-1.5.2.diff deleted file mode 100644 index c4e21b4..0000000 --- a/compface-1.5.2.diff +++ /dev/null @@ -1,41 +0,0 @@ ---- config.h -+++ config.h -@@ -30,3 +30,7 @@ - #endif - - #include -+ -+#ifdef HAVE_UNISTD_H -+#include -+#endif ---- configure.ac -+++ configure.ac -@@ -13,7 +13,7 @@ - - dnl Checks for header files. - AC_HEADER_STDC --AC_CHECK_HEADERS(errno.h fcntl.h strings.h) -+AC_CHECK_HEADERS(errno.h fcntl.h strings.h unistd.h) - - dnl Checks for typedefs, structures, and compiler characteristics. - AC_CHECK_FUNCS(strerror) ---- file.c -+++ file.c -@@ -141,7 +141,7 @@ - t = fbuf; - bits = digits = words = i = 0; - if (compface_xbitmap) { -- sprintf(t,"#define noname_width 48\n#define noname_height 48\nstatic char noname_bits[] = {\n "); -+ strcpy(t,"#define noname_width 48\n#define noname_height 48\nstatic char noname_bits[] = {\n "); - while (*t) t++; - digsperword = 2; - wordsperline = 15; -@@ -189,7 +189,7 @@ - } - } - if (compface_xbitmap) { -- sprintf(t, "};\n"); -+ strcpy(t, "};\n"); - while (*t) t++; - } - *(t++) = '\0'; diff --git a/compface.changes b/compface.changes index f0534b0..13d2069 100644 --- a/compface.changes +++ b/compface.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Fri Dec 27 11:23:56 UTC 2024 - Ana Guerrero + +- Update to use Debian patches directly, add debian.patch +- Rename compface-1.5.2-destdir.diff to Makefile.patch +- Fix build with GCC 14, add patch config.patch and remove + compface-1.5.2.diff + ------------------------------------------------------------------- Mon Feb 26 10:49:49 UTC 2024 - Dominique Leuenberger diff --git a/compface.spec b/compface.spec index b3aa387..9211f31 100644 --- a/compface.spec +++ b/compface.spec @@ -1,7 +1,7 @@ # # spec file for package compface # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,7 +12,7 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # @@ -22,13 +22,13 @@ Release: 0 Summary: Library and tools for handling X-Face data License: MIT Group: Productivity/Graphics/Convertors -Url: http://www.xemacs.org/Download/optLibs.html +URL: http://www.xemacs.org/Download/optLibs.html Source: http://ftp.xemacs.org/pub/xemacs/aux/compface-%{version}.tar.gz Source1: xbm2face Source2: compface-test.xbm -Patch0: http://ftp.debian.org/debian/pool/main/libc/libcompface/libcompface_1.5.2-5.diff.gz -Patch1: compface-1.5.2.diff -Patch2: compface-1.5.2-destdir.diff +Patch0: config.patch +Patch1: debian.patch +Patch2: Makefile.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: libtool @@ -54,8 +54,8 @@ library. %prep %setup -q %patch -P 0 -p1 -%patch -P 1 -%patch -P 2 +%patch -P 1 -p1 +%patch -P 2 -p1 # do not strip sed -i "/strip/d" Makefile.in diff --git a/config.patch b/config.patch new file mode 100644 index 0000000..63ce7e8 --- /dev/null +++ b/config.patch @@ -0,0 +1,12 @@ +diff --git a/config.h b/config.h +index 57fce54..633c79b 100644 +--- a/config.h ++++ b/config.h +@@ -1,6 +1,7 @@ + #ifdef STDC_HEADERS + #include + #include ++#include + #else /* Not STDC_HEADERS */ + #ifdef HAVE_STRINGS_H + #include diff --git a/debian.patch b/debian.patch new file mode 100644 index 0000000..7d920bb --- /dev/null +++ b/debian.patch @@ -0,0 +1,125 @@ +--- libcompface-1.5.2.orig/compface.1 ++++ libcompface-1.5.2/compface.1 +@@ -51,8 +51,9 @@ characters (in the range ``!'' to ``~'' + The first line contains 72 characters and following lines contain + 79 characters except that the last line may be short. + .LP +-If the -X option is given to uncompface, it generates XBM format +-directly. ++This version of compface has been patched to also be able to handle ++normal XBM images. uncompface will produce XBM output only if the -X ++switch is applied. + .LP + The amount of compression obtained varies between face image files but + the output of +--- libcompface-1.5.2.orig/compface.3 ++++ libcompface-1.5.2/compface.3 +@@ -39,6 +39,10 @@ characters (in the range ``!'' to ``~'' + The first line contains 72 characters and following lines contain + 79 characters except that the last line may be short. + .LP ++This version of compface has been patched to also be able to handle ++normal XBM images. uncompface will produce XBM output only if the -X ++switch is applied. ++.LP + The amount of compression obtained varies between face image files but + the output of + .I compface +--- libcompface-1.5.2.orig/compface.c ++++ libcompface-1.5.2/compface.c +@@ -19,7 +19,7 @@ + #include "config.h" + #endif + +-#include "compface_private.h" ++#include "compface.h" + + int + compface(fbuf) +--- libcompface-1.5.2.orig/compface.h ++++ libcompface-1.5.2/compface.h +@@ -143,7 +143,6 @@ int AllBlack P((char *, int, int)) ; + int AllWhite P((char *, int, int)) ; + int BigPop P((Prob *)) ; + int compface P((char *)) ; +-int main P((int, char *[])) ; + int ReadBuf P(()) ; + int Same P((char *, int, int)) ; + int uncompface P((char *)) ; +--- libcompface-1.5.2.orig/file.c ++++ libcompface-1.5.2/file.c +@@ -77,8 +77,42 @@ char *fbuf; + { + register int c, i; + register char *s, *t; ++ static char table_inv[] = { 0,8,4,12,2,10,6,14,1,9, 5,13, 3,11, 7,15 }; ++ static char table_nop[] = { 0,1,2, 3,4, 5,6, 7,8,9,10,11,12,13,14,15 }; ++ char *table = table_nop; /* optionally invert bits in nibble */ ++ register int inc = 0; /* optionally swap nimmles */ ++ int bits; ++ int len; + + t = s = fbuf; ++ ++ /* Does this look like an X bitmap ? */ ++ if (sscanf(s, "#define %*s %d", &bits) == 1) { ++ if (bits == 48) { ++ char type1[256]; ++ char type2[256]; ++ while (*s && *s++ != '\n'); ++ if (sscanf(s, "#define %*s %d", &bits) == 1) if (bits == 48) { ++ while (*s && *s++ != '\n'); ++ for (len=0; s[len] && s[len]!='\n'; len++); ++ if (len<255) { ++ if (sscanf(s, "static %s %s", type1,type2)==2 && ++ (!strcmp(type1, "char") || ++ !strcmp(type2, "char"))) { ++ while (*s && *s++ != '\n'); ++ inc = 1; ++ table = table_inv; ++ } ++ else fprintf(stderr, "warning: xbitmap line 3 not static [unsigned] short ...\n"); ++ } else fprintf(stderr, "warning: xbitmap line 3 too long\n"); ++ } ++ else fprintf(stderr, "warning: xbitmaps must be 48x48\n"); ++ } ++ else fprintf(stderr, "warning: xbitmaps must be 48x48\n"); ++ } ++ /* Ensure s is reset if it was not an X bitmap ... */ ++ if (! inc) s = fbuf; ++ + for(i = strlen(s); i > 0; i--) + { + c = (int)*(s++); +@@ -89,7 +123,7 @@ char *fbuf; + status = ERR_EXCESS; + break; + } +- *(t++) = c - '0'; ++ (t++)[inc] = table[c - '0']; inc = - inc; + } + else if ((c >= 'A') && (c <= 'F')) + { +@@ -98,7 +132,7 @@ char *fbuf; + status = ERR_EXCESS; + break; + } +- *(t++) = c - 'A' + 10; ++ (t++)[inc] = table[c - 'A' + 10]; inc = - inc; + } + else if ((c >= 'a') && (c <= 'f')) + { +@@ -107,10 +141,10 @@ char *fbuf; + status = ERR_EXCESS; + break; + } +- *(t++) = c - 'a' + 10; ++ (t++)[inc] = table[c - 'a' + 10]; inc = - inc; + } +- else if (((c == 'x') || (c == 'X')) && (t > fbuf) && (*(t-1) == 0)) +- t--; ++ else if (((c == 'x') || (c == 'X')) && (t > fbuf) && ++ ((t-1)[-inc] == table[0])) { t--; inc = -inc; } + } + if (t < fbuf + DIGITS) + longjmp(comp_env, ERR_INSUFF); diff --git a/libcompface_1.5.2-5.diff.gz b/libcompface_1.5.2-5.diff.gz deleted file mode 100644 index c4daf63..0000000 --- a/libcompface_1.5.2-5.diff.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0587f531d09aa229618e4f648ca085a816a8d35cb4d35e216446c7462ffef733 -size 13673