diff --git a/compface-1.5.2-build.patch b/compface-1.5.2-build.patch new file mode 100644 index 0000000..ab47cef --- /dev/null +++ b/compface-1.5.2-build.patch @@ -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-stack-smashing.patch b/compface-1.5.2-stack-smashing.patch new file mode 100644 index 0000000..8b18cf2 --- /dev/null +++ b/compface-1.5.2-stack-smashing.patch @@ -0,0 +1,26 @@ +Prevent sscanf stack smashing, and fix two GCC warnings. + +diff -Nur compface-1.5.2-prepped/file.c compface-1.5.2-modified/file.c +--- compface-1.5.2-prepped/file.c 2006-08-04 18:58:17.000000000 +0200 ++++ compface-1.5.2-modified/file.c 2006-08-04 18:59:30.000000000 +0200 +@@ -80,7 +80,7 @@ + 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 inc = 0; /* optionally swap nimmles */ ++ register int inc = 0; /* optionally swap nimmles */ + int bits; + + t = s = fbuf; +@@ -91,9 +91,9 @@ + char type1[128]; + char type2[128]; + while (*s && *s++ != '\n'); +- if (sscanf(s, "#define %*s %d", &bits) == 1) if (bits == 48) { ++ if ((sscanf(s, "#define %*s %d", &bits) == 1) && (bits == 48)) { + while (*s && *s++ != '\n'); +- if (sscanf(s, "static %s %s", type1,type2)==2 && ++ if (sscanf(s, "static %127s %127s", type1,type2)==2 && + (!strcmp(type1, "char") || + !strcmp(type2, "char"))) { + while (*s && *s++ != '\n'); diff --git a/compface-1.5.2.tar.gz b/compface-1.5.2.tar.gz new file mode 100644 index 0000000..b9d9020 Binary files /dev/null and b/compface-1.5.2.tar.gz differ diff --git a/compface-README.copyright b/compface-README.copyright new file mode 100644 index 0000000..4e2d405 --- /dev/null +++ b/compface-README.copyright @@ -0,0 +1,80 @@ +Extracted from Debian GNU/Linux's package: + +[...] + +Compface - 48x48x1 image compression and decompression +Copyright (c) James Ashton 1990. +Written 89/11/11 + +Feel free to distribute this source at will so long as the above +message and this message are included in full. + +This copyright message dosn't specify whether modified version is allowed, +but the following mail from the author does allow them: + +> From: James Ashton +> Subject: Re: Bug#72019: compface not DFSG +> Date: Wed, 20 Sep 2000 09:48:34 +1100 (EST) +> +> >On Tue, Sep 19, 2000 at 08:58:43AM -0400, Raul Miller wrote: +> >> Package: compface +> >> Version: 1989.11.11-17.1 +> >> Severity: important +> >> +> >> compface's copyright doesn't grant permission to +> >> distribute modified versions +> > +> >The compface copyright says: +> > +> >Feel free to distribute this source at will so long as the above +> >message and this message are included in full. +> > +> > +> >Which could be interpretated as it is allowed to distribute modified +> >versions of it. James Ashton is the original author, would you care to +> >clairify the matter, mr Ashton? +> +> I don't mind modified versions being distributed. Please included the +> original copyright notices as specified and also prominently note, if +> it is a modified version, the nature and author(s) of the +> modifications. +> -- +> James Ashton VK1XJA System Administrator +> http://wwwsyseng.anu.edu.au/~jaa Department of Systems Engineering +> Voice +61 2 6279 8675 Research School of Information Sciences and Engineering +> FAX +61 2 6279 8688 Australian National University +> Email James.Ashton@anu.edu.au Canberra ACT 0200 Australia +> + +Another peoblem with the copyright of this source code is that the +copyright message in the source files and in the readme file is conflicting. +The following mail from the author should clear that up: + +> From: James Ashton +> Subject: Re: libcompface license (again) +> Date: Thu, 22 Feb 2001 09:32:23 +1100 (EST) +> +> >Hi, +> >I'm maintaining the debian pkg of your compface lib, and I've talket to you +> >before about it's license. And now ouer legal people have found another +> >problem. The sourcefiles contains a diffrent copyright notice than the +> >redmefile. They say: +> > +> >> * Permission is given to distribute these sources, as long as the +> >> * copyright messages are not removed, and no monies are exchanged.=20 +> > +> >The problem is the last part "no monies are exchanged". As you probably=20 +> >know we do allow third party companies to produce debian CDs and sell them. +> >So this statement would inmply that we can't have your libcompface in +> debian +> >at all. +> +> I'm happy to remove the phrase no monies are exchanged' from the +> source and allow distribution as per the README file. Do you need more +> from me than just this email? +> -- +> James Ashton VK1XJA System Administrator +> http://wwwsyseng.anu.edu.au/~jaa Department of Systems Engineering +> Voice +61 2 6125 8675 Research School of Information Sciences and Engineering +> FAX +61 2 6125 8660 Australian National University +> Email James.Ashton@anu.edu.au Canberra ACT 0200 Australia diff --git a/compface-test.xbm b/compface-test.xbm new file mode 100644 index 0000000..5ac4670 --- /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,0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FF,0xFF, + 0xFF,0xFF,0x7F}; diff --git a/compface.spec b/compface.spec new file mode 100644 index 0000000..e937d17 --- /dev/null +++ b/compface.spec @@ -0,0 +1,204 @@ +Name: compface +Version: 1.5.2 +Release: 32 +Summary: Library and tools for handling X-Face data + +License: MIT +URL: http://ftp.xemacs.org/pub/xemacs/aux/ +Source0: http://ftp.xemacs.org/pub/xemacs/aux/%{name}-%{version}.tar.gz +Source1: compface-test.xbm +Source2: compface-README.copyright +Patch0: libcompface_1.5.2-4.diff.gz +Patch1: compface-1.5.2-stack-smashing.patch +Patch2: compface-1.5.2-build.patch + +BuildRequires: diffutils +BuildRequires: gcc +BuildRequires: make + +%description +This is the Compface image compression and decompression library and its +user tools. Compface converts 48x48 .xbm format (X bitmap) images to a +compressed format that can be placed in the X-Face: mail header. Some mail +programs are able to display such images when opening messages. + +%package devel +Summary: Library and development files for handling X-Face data +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +These files are needed when building software that uses the Compface +library. + + +%prep +%setup -q +%patch0 -p1 +%patch1 -p1 -b .stack-smashing +%patch2 -p0 + + +%build +CFLAGS="$RPM_OPT_FLAGS -fPIC" %configure +make %{?_smp_mflags} + + +%install +make install DESTDIR=$RPM_BUILD_ROOT STRIP=/bin/true +mkdir -p _extdoc && install -p -m 0644 %{SOURCE2} _extdoc/README.copyright + + +%check +export LD_LIBRARY_PATH=$RPM_BUILD_ROOT%{_libdir}:$LD_LIBRARY_PATH +./compface %{SOURCE1} | ./uncompface -X > __test.xbm +cmp %{SOURCE1} __test.xbm + + +%files +%doc ChangeLog README xbm2xface.pl +%doc _extdoc/README.copyright +%{_bindir}/compface +%{_bindir}/uncompface +%{_libdir}/libcompface.so.* +%{_mandir}/man1/compface.1* +%{_mandir}/man1/uncompface.1* + +%files devel +%{_includedir}/compface.h +%{_libdir}/libcompface.so +%{_mandir}/man3/compface.3* +%{_mandir}/man3/uncompface.3* + + +%changelog +* Thu May 27 2021 yaozc7 - 1.5.2-32 +- Package init + +* Tue Jan 26 2021 Fedora Release Engineering - 1.5.2-31 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Mon Jul 27 2020 Fedora Release Engineering - 1.5.2-30 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Tue Jan 28 2020 Fedora Release Engineering - 1.5.2-29 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Wed Jul 24 2019 Fedora Release Engineering - 1.5.2-28 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Thu Jan 31 2019 Fedora Release Engineering - 1.5.2-27 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Thu Jul 12 2018 Fedora Release Engineering - 1.5.2-26 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Wed Feb 07 2018 Fedora Release Engineering - 1.5.2-25 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Wed Aug 02 2017 Fedora Release Engineering - 1.5.2-24 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 1.5.2-23 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Fri Feb 10 2017 Fedora Release Engineering - 1.5.2-22 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Wed Feb 03 2016 Fedora Release Engineering - 1.5.2-21 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Wed Jun 17 2015 Fedora Release Engineering - 1.5.2-20 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Sat Feb 21 2015 Till Maas - 1.5.2-19 +- Rebuilt for Fedora 23 Change + https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code + +* Sat Aug 16 2014 Fedora Release Engineering - 1.5.2-18 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Sat Jun 07 2014 Fedora Release Engineering - 1.5.2-17 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Sat Aug 03 2013 Fedora Release Engineering - 1.5.2-16 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Wed Feb 13 2013 Fedora Release Engineering - 1.5.2-15 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Wed Jul 18 2012 Fedora Release Engineering - 1.5.2-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Fri Jan 6 2012 Michael Schwendt - 1.5.2-13 +- rebuild for GCC 4.7 as requested +- drop obsolete items from spec file, plus use %%?dist and %%?_isa + +* Tue Feb 08 2011 Fedora Release Engineering - 1.5.2-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Fri Jul 24 2009 Fedora Release Engineering - 1.5.2-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Fri May 15 2009 Michael Schwendt - 1.5.2-10 +- Minor spec updates. +- Sync with Debian's most recent 1.5.2-4 patchset, although it doesn't + add anything for us compared with 1.5.2-3. + +* Tue Feb 24 2009 Fedora Release Engineering - 1.5.2-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Sat May 31 2008 Michael Schwendt - 1.5.2-8 +- Drop "|| :" from check section. It failed to build for mdomsch + in Rawhide today. + +* Fri Feb 08 2008 Michael Schwendt - 1.5.2-7 +- rebuilt for GCC 4.3 as requested by Fedora Release Engineering + +* Tue Aug 21 2007 Michael Schwendt - 1.5.2-6 +- rebuilt + +* Thu Jan 4 2007 Michael Schwendt - 1.5.2-5 +- rebuilt +- Update summaries and url. + +* Mon Aug 28 2006 Michael Schwendt - 1.5.2-4 +- rebuilt + +* Sat Aug 5 2006 Michael Schwendt - 1.5.2-3 +- Add licence terms clarification from Debian's patch. + +* Fri Aug 4 2006 Michael Schwendt - 1.5.2-2 +- Add patch to prevent sscanf stack smashing through Debian's patch. +- Fix two GCC warnings in the same patch. +- Add one test to the %%check section and BR diffutils. + +* Wed Aug 2 2006 Ville Skyttä - 1.5.2-1 +- Update to 1.5.2, apply Debian's 1.5.2-3 patchset. +- Crudely patch to build a shared lib (inspired by Debian), drop static one. +- Split -devel subpackage. + +* Mon Jul 31 2006 Ville Skyttä - 1.4-7 +- Ensure proper doc file permissions. + +* Mon Feb 13 2006 Ville Skyttä - 1.4-6 +- Rebuild. + +* Fri Apr 7 2005 Michael Schwendt - 1.4-5 +- rebuilt + +* Fri Dec 17 2004 Ville Skyttä - 0:1.4-4 +- Let rpmbuild take care of stripping binaries. + +* Fri May 30 2003 Ville Skyttä - 0:1.4-0.fdr.3 +- Add URL, other minor specfile tweaks (#63). + +* Sat May 3 2003 Ville Skyttä - 0:1.4-0.fdr.2 +- Fix build on RH9 (#63). +- Save .spec in UTF-8. +- Provide -devel to ease possible future 'shared lib'ification. + +* Sat Mar 22 2003 Ville Skyttä - 0:1.4-0.fdr.1 +- Update to current Fedora guidelines. + +* Fri Feb 7 2003 Ville Skyttä - 1.4-1.fedora.1 +- First Fedora release. diff --git a/libcompface_1.5.2-4.diff.gz b/libcompface_1.5.2-4.diff.gz new file mode 100644 index 0000000..fbd2387 Binary files /dev/null and b/libcompface_1.5.2-4.diff.gz differ