From f76bbdc5026dfcea6cd8d4fecc955667f7f777a8082db77984aa01629865c1f1 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 28 Dec 2024 02:59:23 +0000 Subject: [PATCH 1/2] - 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 OBS-URL: https://build.opensuse.org/package/show/server:mail/compface?expand=0&rev=14 --- .gitattributes | 23 +++++++ .gitignore | 1 + Makefile.patch | 79 +++++++++++++++++++++++ compface-1.5.2-destdir.diff | 81 +++++++++++++++++++++++ compface-1.5.2.diff | 41 ++++++++++++ compface-1.5.2.tar.gz | 3 + compface-test.xbm | 23 +++++++ compface.changes | 107 ++++++++++++++++++++++++++++++ compface.spec | 96 +++++++++++++++++++++++++++ config.patch | 12 ++++ debian.patch | 125 ++++++++++++++++++++++++++++++++++++ libcompface_1.5.2-5.diff.gz | 3 + xbm2face | 16 +++++ 13 files changed, 610 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 Makefile.patch create mode 100644 compface-1.5.2-destdir.diff create mode 100644 compface-1.5.2.diff create mode 100644 compface-1.5.2.tar.gz create mode 100644 compface-test.xbm create mode 100644 compface.changes create mode 100644 compface.spec create mode 100644 config.patch create mode 100644 debian.patch create mode 100644 libcompface_1.5.2-5.diff.gz create mode 100644 xbm2face diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/Makefile.patch b/Makefile.patch new file mode 100644 index 0000000..1b33dbf --- /dev/null +++ b/Makefile.patch @@ -0,0 +1,79 @@ +o Build shared library, link tools against it +o Make it possible to prevent stripping +o Add DESTDIR support + +--- 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@ + SHELL = /bin/sh ++STRIP = strip + + NAME = compface + UNNAME = uncompface +@@ -24,6 +25,7 @@ + EXECUTABLE = $(BINDIR)/$(NAMEEXE) + UNEXECUTABLE = $(BINDIR)/$(UNNAMEEXE) + LIBNAME = lib$(NAME).a ++SHLIBNAME = lib$(NAME).so + LIBRARY = $(LIBDIR)/$(LIBNAME) + MAN1DIR = $(MANDIR)/man1 + MAN3DIR = $(MANDIR)/man3 +@@ -45,11 +47,11 @@ + + all: $(NAMEEXE) $(UNNAMEEXE) + +-$(NAMEEXE) : cmain.o compface.o $(LIBNAME) +- $(CC) $(LDFLAGS) -o $@ cmain.o compface.o $(LIBNAME) ++$(NAMEEXE) : cmain.o compface.o $(SHLIBNAME) ++ $(CC) $(LDFLAGS) -o $@ cmain.o compface.o -L. -l$(NAME) + +-$(UNNAMEEXE) : uncmain.o $(LIBNAME) +- $(CC) $(LDFLAGS) -o $@ uncmain.o $(LIBNAME) ++$(UNNAMEEXE) : uncmain.o $(SHLIBNAME) ++ $(CC) $(LDFLAGS) -o $@ uncmain.o -L. -l$(NAME) + + $(LIBNAME) : $(OBJECTS) + ar rc $(LIBNAME) $(OBJECTS) +@@ -74,24 +76,27 @@ + $(RM) -rf `cat .fname` .fname + + install: $(NAMEEXE) $(UNNAMEEXE) $(LIBNAME) +- $(INSTALL_PROGRAM) -d $(BINDIR) $(LIBDIR) $(MAN1DIR) $(MAN3DIR) $(INCLUDEDIR) +- $(INSTALL_PROGRAM) $(srcdir)/$(NAMEEXE) $(EXECUTABLE) +- -chmod 0755 $(EXECUTABLE) +- -strip $(EXECUTABLE) +- $(INSTALL_PROGRAM) $(srcdir)/$(UNNAMEEXE) $(UNEXECUTABLE) +- -chmod 0755 $(UNEXECUTABLE) +- -strip $(UNEXECUTABLE) +- $(INSTALL_DATA) $(srcdir)/$(NAME).1 $(MAN1DIR)/$(NAME).1 +- cd $(MAN1DIR) && $(RM) ./$(UNNAME).1 && $(LN_S) $(NAME).1 $(UNNAME).1 +- $(INSTALL_DATA) $(srcdir)/$(NAME).3 $(MAN3DIR)/$(NAME).3 +- 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_PROGRAM) -d $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(MAN1DIR) $(DESTDIR)$(MAN3DIR) $(DESTDIR)$(INCLUDEDIR) ++ $(INSTALL_PROGRAM) $(srcdir)/$(NAMEEXE) $(DESTDIR)$(EXECUTABLE) ++ -$(STRIP) $(DESTDIR)$(EXECUTABLE) ++ $(INSTALL_PROGRAM) $(srcdir)/$(UNNAMEEXE) $(DESTDIR)$(UNEXECUTABLE) ++ -$(STRIP) $(DESTDIR)$(UNEXECUTABLE) ++ $(INSTALL_DATA) $(srcdir)/$(NAME).1 $(DESTDIR)$(MAN1DIR)/$(NAME).1 ++ cd $(DESTDIR)$(MAN1DIR) && $(RM) ./$(UNNAME).1 && $(LN_S) $(NAME).1 $(UNNAME).1 ++ $(INSTALL_DATA) $(srcdir)/$(NAME).3 $(DESTDIR)$(MAN3DIR)/$(NAME).3 ++ cd $(DESTDIR)$(MAN3DIR) && $(RM) ./$(UNNAME).3 && $(LN_S) $(NAME).3 $(UNNAME).3 ++ for hdr in $(INSTALLHEADERS); do $(INSTALL_DATA) $(srcdir)/$${hdr} $(DESTDIR)$(INCLUDEDIR)/$${hdr}; done ++ $(INSTALL_PROGRAM) $(srcdir)/$(SHLIBNAME) $(DESTDIR)$(LIBDIR)/$(SHLIBNAME).1.0.0 ++ $(LN_S) $(SHLIBNAME).1.0.0 $(DESTDIR)$(LIBDIR)/$(SHLIBNAME).1 ++ $(LN_S) $(SHLIBNAME).1 $(DESTDIR)$(LIBDIR)/$(SHLIBNAME) + + shar : + shar.script $(OTHERS) $(HDRS) $(SOURCES) > $(NAME).sh + compress $(NAME).sh + ++$(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-destdir.diff b/compface-1.5.2-destdir.diff new file mode 100644 index 0000000..dc99248 --- /dev/null +++ b/compface-1.5.2-destdir.diff @@ -0,0 +1,81 @@ +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 +@@ -15,6 +15,7 @@ + INSTALL_PROGRAM = @INSTALL_PROGRAM@ + INSTALL_DATA = @INSTALL_DATA@ + SHELL = /bin/sh ++STRIP = strip + + NAME = compface + UNNAME = uncompface +@@ -25,6 +26,7 @@ + UNEXECUTABLE = $(BINDIR)/$(UNNAMEEXE) + LIBNAME = lib$(NAME).a + LIBRARY = $(LIBDIR)/$(LIBNAME) ++SHLIBNAME = lib$(NAME).so + MAN1DIR = $(MANDIR)/man1 + MAN3DIR = $(MANDIR)/man3 + OBJECTS = arith.o file.o compress.o gen.o uncompface.o +@@ -45,11 +47,11 @@ + + all: $(NAMEEXE) $(UNNAMEEXE) + +-$(NAMEEXE) : cmain.o compface.o $(LIBNAME) +- $(CC) $(LDFLAGS) -o $@ cmain.o compface.o $(LIBNAME) ++$(NAMEEXE) : cmain.o compface.o $(SHLIBNAME) ++ $(CC) $(LDFLAGS) -o $@ cmain.o compface.o -L. -l$(NAME) + +-$(UNNAMEEXE) : uncmain.o $(LIBNAME) +- $(CC) $(LDFLAGS) -o $@ uncmain.o $(LIBNAME) ++$(UNNAMEEXE) : uncmain.o $(SHLIBNAME) ++ $(CC) $(LDFLAGS) -o $@ uncmain.o -L. -l$(NAME) + + $(LIBNAME) : $(OBJECTS) + ar rc $(LIBNAME) $(OBJECTS) +@@ -73,25 +75,28 @@ + tar chzf `cat .fname`.tar.gz `cat .fname` + $(RM) -rf `cat .fname` .fname + +-install: $(NAMEEXE) $(UNNAMEEXE) $(LIBNAME) +- $(INSTALL_PROGRAM) -d $(BINDIR) $(LIBDIR) $(MAN1DIR) $(MAN3DIR) $(INCLUDEDIR) +- $(INSTALL_PROGRAM) $(srcdir)/$(NAMEEXE) $(EXECUTABLE) +- -chmod 0755 $(EXECUTABLE) +- -strip $(EXECUTABLE) +- $(INSTALL_PROGRAM) $(srcdir)/$(UNNAMEEXE) $(UNEXECUTABLE) +- -chmod 0755 $(UNEXECUTABLE) +- -strip $(UNEXECUTABLE) +- $(INSTALL_DATA) $(srcdir)/$(NAME).1 $(MAN1DIR)/$(NAME).1 +- cd $(MAN1DIR) && $(RM) ./$(UNNAME).1 && $(LN_S) $(NAME).1 $(UNNAME).1 +- $(INSTALL_DATA) $(srcdir)/$(NAME).3 $(MAN3DIR)/$(NAME).3 +- 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) ++ -$(STRIP) $(DESTDIR)$(EXECUTABLE) ++ $(INSTALL_PROGRAM) $(srcdir)/$(UNNAMEEXE) $(DESTDIR)$(UNEXECUTABLE) ++ -$(STRIP) $(DESTDIR)$(UNEXECUTABLE) ++ $(INSTALL_DATA) $(srcdir)/$(NAME).1 $(DESTDIR)$(MAN1DIR)/$(NAME).1 ++ cd $(DESTDIR)$(MAN1DIR) && $(RM) ./$(UNNAME).1 && $(LN_S) $(NAME).1 $(UNNAME).1 ++ $(INSTALL_DATA) $(srcdir)/$(NAME).3 $(DESTDIR)$(MAN3DIR)/$(NAME).3 ++ cd $(DESTDIR)$(MAN3DIR) && $(RM) ./$(UNNAME).3 && $(LN_S) $(NAME).3 $(UNNAME).3 ++ for hdr in $(INSTALLHEADERS); do $(INSTALL_DATA) $(srcdir)/$${hdr} $(DESTDIR)$(INCLUDEDIR)/$${hdr}; done ++ $(INSTALL_PROGRAM) $(srcdir)/$(SHLIBNAME) $(DESTDIR)$(LIBDIR)/$(SHLIBNAME).1.0.0 ++ $(LN_S) $(SHLIBNAME).1.0.0 $(DESTDIR)$(LIBDIR)/$(SHLIBNAME).1 ++ $(LN_S) $(SHLIBNAME).1 $(DESTDIR)$(LIBDIR)/$(SHLIBNAME) + + shar : + shar.script $(OTHERS) $(HDRS) $(SOURCES) > $(NAME).sh + compress $(NAME).sh + ++$(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 new file mode 100644 index 0000000..c4e21b4 --- /dev/null +++ b/compface-1.5.2.diff @@ -0,0 +1,41 @@ +--- 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-1.5.2.tar.gz b/compface-1.5.2.tar.gz new file mode 100644 index 0000000..aa7d88e --- /dev/null +++ b/compface-1.5.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a6998245f530217b800f33e01656be8d1f0445632295afa100e5c1611e4f6825 +size 46970 diff --git a/compface-test.xbm b/compface-test.xbm new file mode 100644 index 0000000..68b4b46 --- /dev/null +++ b/compface-test.xbm @@ -0,0 +1,23 @@ +#define noname_width 48 +#define noname_height 48 +static char noname_bits[] = { + 0xFC,0xFF,0xFF,0xFF,0xFF,0x7F,0xFC,0xFF,0xFF,0xFF,0xFF,0x7F,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xDF,0x56,0x95,0x24,0x00,0xE0, + 0xBF,0xBD,0x55,0xD5,0x6E,0xE5,0xEF,0xF7,0xFF,0x6F,0xBB,0xEB,0xAF,0xFF,0xFF, + 0xFF,0xFF,0xE7,0xDF,0xFF,0xDF,0xFE,0xFF,0xE7,0xFF,0xFF,0x0F,0x00,0xE0,0xEF, + 0xAF,0xFF,0x07,0x00,0xE0,0xE3,0xEF,0xFF,0x07,0x00,0xE0,0xE7,0xDF,0xFF,0x03, + 0x00,0xE0,0xE7,0xDF,0xFF,0x07,0x00,0xE0,0xEF,0xFF,0xFF,0x03,0x00,0xF0,0xE7, + 0xCF,0xFF,0x03,0x88,0xFC,0xE7,0xFF,0xFF,0x03,0xFC,0xFF,0xE7,0x8F,0xFF,0x03, + 0xFE,0xFF,0xE7,0xFF,0xFF,0x03,0xD4,0xFF,0xE7,0xD7,0xFF,0x03,0x00,0xFE,0xE7, + 0xEF,0xFF,0x01,0x00,0xFF,0xE7,0xCF,0xFF,0x01,0x00,0xFE,0xE7,0xDF,0xFF,0x01, + 0x00,0xFE,0xE7,0xDF,0xFF,0x01,0x00,0xFF,0xE7,0xEF,0xFF,0x00,0xA0,0xFF,0xE3, + 0xCF,0xFF,0x80,0xFF,0xFF,0xE7,0xDF,0xFF,0x00,0xFF,0xFF,0xE7,0xDF,0xFF,0x80, + 0xFF,0xFF,0xE7,0xEF,0xFF,0x80,0xFF,0xFF,0xC3,0xCF,0x7F,0x80,0xFF,0xFF,0xE7, + 0xAF,0xFF,0x80,0xFF,0xFF,0xE7,0xDF,0x7F,0x80,0xFF,0xFF,0xE7,0xAF,0x7F,0xC0, + 0xFF,0xFF,0xC3,0xD7,0x7F,0xC0,0xFF,0xFF,0xE7,0xEF,0x7F,0xC0,0xFF,0xFF,0xC7, + 0xCF,0x3F,0xC0,0xFF,0xFF,0xE7,0xAF,0x3F,0xC0,0xFF,0xFF,0xC3,0xDF,0x3F,0xE0, + 0xFF,0xFF,0xE7,0xCF,0x3F,0xC0,0xFF,0xFF,0xC7,0xDF,0x7F,0xF0,0xFF,0xFF,0xC7, + 0xCF,0xFF,0xFF,0xFF,0xFF,0xE3,0x9F,0xFF,0xFF,0xFF,0xFF,0xC7,0xAF,0x52,0x55, + 0x95,0x00,0xE0,0x2F,0x02,0x00,0x00,0x04,0xC0,0x4F,0x49,0x2A,0x01,0x10,0xE0, + 0xFF,0xFF,0xFF,0xFF,0xF7,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0xFF,0xFF, + 0xFF,0xFF,0x7F}; diff --git a/compface.changes b/compface.changes new file mode 100644 index 0000000..d4135bb --- /dev/null +++ b/compface.changes @@ -0,0 +1,107 @@ +------------------------------------------------------------------- +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 + +------------------------------------------------------------------- +Mon Feb 26 10:49:49 UTC 2024 - Dominique Leuenberger + +- Use %patch -P N instead of deprecated %patchN. + +------------------------------------------------------------------- +Wed Oct 8 12:45:25 UTC 2014 - tchvatal@suse.com + +- Grab patches from debian to actually work correctly + * added compface-1.5.2-destdir.diff + * added libcompface_1.5.2-5.diff.gz + * modified compface-1.5.2.diff +- Create test to verify the thing works + * added compface-test.xbm +- Use shared library +- Cleanup the specfile + +------------------------------------------------------------------- +Tue Mar 27 08:08:10 UTC 2012 - cfarrell@suse.com + +- license update: MIT + Use SPDX license + +------------------------------------------------------------------- +Fri Dec 2 07:46:55 UTC 2011 - coolo@suse.com + +- add automake as buildrequire to avoid implicit dependency + +------------------------------------------------------------------- +Fri Dec 18 15:48:31 CET 2009 - jengelh@medozas.de + +- enable parallel building + +------------------------------------------------------------------- +Mon May 22 17:46:25 CEST 2006 - schwab@suse.de + +- Don't strip binaries. + +------------------------------------------------------------------- +Wed Jan 25 21:35:09 CET 2006 - mls@suse.de + +- converted neededforbuild to BuildRequires + +------------------------------------------------------------------- +Wed Oct 5 09:49:40 CEST 2005 - schwab@suse.de + +- Update to compface 1.5.2. + +------------------------------------------------------------------- +Mon Jan 10 15:34:06 CET 2005 - schwab@suse.de + +- Update to compface 1.5. + +------------------------------------------------------------------- +Sat Sep 11 20:19:52 CEST 2004 - schwab@suse.de + +- Update to compface 1.4. + +------------------------------------------------------------------- +Mon May 12 21:08:28 CEST 2003 - schwab@suse.de + +- Fix filelist. + +------------------------------------------------------------------- +Wed Apr 2 16:50:57 CEST 2003 - schwab@suse.de + +- Remove useless %ifarch ix86. + +------------------------------------------------------------------- +Wed Apr 2 10:04:31 CEST 2003 - sf@suse.de + +- add -fPIC for #ifnarch ix86 + +------------------------------------------------------------------- +Fri Nov 29 11:00:44 CET 2002 - schwab@suse.de + +- Fix use of errno. + +------------------------------------------------------------------- +Thu Apr 18 10:17:54 CEST 2002 - schwab@suse.de + +- Properly use %{_libdir}. + +------------------------------------------------------------------- +Tue Jan 29 21:08:16 CET 2002 - schwab@suse.de + +- Use %{_libdir}. + +------------------------------------------------------------------- +Mon Nov 26 14:39:54 CET 2001 - mfabian@suse.de + +- add two small utilities 'xbm2face' and 'xbm2xface.pl' to + create an X-Face: header from an xbm file +- bzip2 sources + +------------------------------------------------------------------- +Fri Sep 29 18:05:29 CEST 2000 - schwab@suse.de + +- Initial version 1.3. + diff --git a/compface.spec b/compface.spec new file mode 100644 index 0000000..9211f31 --- /dev/null +++ b/compface.spec @@ -0,0 +1,96 @@ +# +# spec file for package compface +# +# 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 +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +Name: compface +Version: 1.5.2 +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 +Source: http://ftp.xemacs.org/pub/xemacs/aux/compface-%{version}.tar.gz +Source1: xbm2face +Source2: compface-test.xbm +Patch0: config.patch +Patch1: debian.patch +Patch2: Makefile.patch +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: libtool +BuildRoot: %{_tmppath}/%{name}-%{version}-build + +%description +The programs compface and uncompface convert 48x48x1 images to and from +a compressed format. The purpose of the programs is to allow the +inclusion of face images within mail headers using the field name +"X-face:". They make use of a library that allows the compression and +decompression algorithms to be used in other programs, such as mail +dispatchers and mail notification daemons. + +%package devel +Summary: Library and development files for handling X-Face data +Group: Development/Libraries +Requires: %{name} = %{version} + +%description devel +These files are needed when building software that uses the Compface +library. + +%prep +%setup -q +%patch -P 0 -p1 +%patch -P 1 -p1 +%patch -P 2 -p1 + +# do not strip +sed -i "/strip/d" Makefile.in + +%build +autoreconf -fi +CFLAGS="%{optflags} -fPIC" \ +%configure +make %{?_smp_mflags} + +%install +%make_install +sed -i 's/\r//' xbm2xface.pl +install -m 755 xbm2xface.pl %{buildroot}%{_bindir}/xbm2xface +install -m 755 $RPM_SOURCE_DIR/xbm2face %{buildroot}%{_prefix}/bin + +%check +export LD_LIBRARY_PATH=%{buildroot}%{_libdir}:$LD_LIBRARY_PATH +./compface %{SOURCE2} | ./uncompface -X > __test.xbm +cmp %{SOURCE2} __test.xbm + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files +%defattr(-, root, root) +%doc README +%{_bindir}/* +%{_libdir}/*.so.* +%doc %{_mandir}/man?/* + +%files devel +%defattr(-, root, root) +%{_includedir}/compface.h +%{_libdir}/libcompface.so + +%changelog 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 new file mode 100644 index 0000000..c4daf63 --- /dev/null +++ b/libcompface_1.5.2-5.diff.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0587f531d09aa229618e4f648ca085a816a8d35cb4d35e216446c7462ffef733 +size 13673 diff --git a/xbm2face b/xbm2face new file mode 100644 index 0000000..6884065 --- /dev/null +++ b/xbm2face @@ -0,0 +1,16 @@ +#!/bin/sh +# +# xbm2face +# convert an X11 bitmap to a Blit ikon bitmap, and then to a face +# compressed bitmap for use in the mail X-Face header. Requires some +# bitmap filters from the pbmplus package, and the compface program +# from the faces package. +# +# Anthony Thyssen 17 Dec 1993 anthony@cit.gu.edu.au +# +xbmtopbm "$@" | pbmtoicon | +sed -e 1,2d -e '$s/$/,/' | +tr -d '\011\012' | tr ',' '\012' | +pr -l1 -t -w22 -3 -s, | +sed -e 's/$/,/' -e 's/\(0x....\)\(0x....\)\(0x....\),/\1,\2,\3,/' | +compface From 029b5bcb2173c6d3fc6ef2a2ad7073fa8357b5f723e380bf35fa6be8df09d963 Mon Sep 17 00:00:00 2001 From: Ana Guerrero Date: Mon, 30 Dec 2024 06:45:10 +0000 Subject: [PATCH 2/2] - Fix build with GCC 14, add patch config.patch and remove compface-1.5.2.diff OBS-URL: https://build.opensuse.org/package/show/server:mail/compface?expand=0&rev=15 --- compface.changes | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compface.changes b/compface.changes index d4135bb..13d2069 100644 --- a/compface.changes +++ b/compface.changes @@ -3,7 +3,8 @@ 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 +- 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