diff --git a/_service b/_service new file mode 100644 index 0000000..700112d --- /dev/null +++ b/_service @@ -0,0 +1,14 @@ + + + https://github.com/openSUSE/xli.git + git + enable + xli + 1.17+git%cd.%h + + + *.tar + xz + + + diff --git a/xli-1.17+git20170726.0bb4fb4.tar.xz b/xli-1.17+git20170726.0bb4fb4.tar.xz new file mode 100644 index 0000000..4a4bff1 --- /dev/null +++ b/xli-1.17+git20170726.0bb4fb4.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c8c4e67af04d489615a956ccb69371579d0f9da35e74a5810166368351224ff8 +size 162656 diff --git a/xli-1.17.0-8bit_palette.patch b/xli-1.17.0-8bit_palette.patch deleted file mode 100644 index b83a214..0000000 --- a/xli-1.17.0-8bit_palette.patch +++ /dev/null @@ -1,144 +0,0 @@ -Index: pcx.c -=================================================================== ---- pcx.c.orig -+++ pcx.c -@@ -5,6 +5,8 @@ - ** Adapted from code by Jef Poskanzer (see Copyright below). - ** - ** Version 0.1 -- 4/25/91 -- Initial cut -+** Version 0.2 -- 2001-12-15 -- Support 8bit color images with palette. -+** (Alexandre Duret-Lutz ) - ** - ** Copyright (c) 1991 Tim Northrup - ** (see file "tgncpyrght.h" for complete copyright information) -@@ -33,7 +35,9 @@ - - #define PCX_MAGIC 0x0a /* first byte in a PCX image file */ - --static boolean PCX_LoadImage(ZFILE *zf, int in_bpr, int img_bpr, Image *image, int rows); /* Routine to load a PCX file */ -+/* Routine to load a PCX file */ -+static boolean PCX_LoadImage(ZFILE *zf, int in_bpr, int img_bpr, -+ Image *image, int rows, boolean readpal); - - - /* -@@ -129,35 +133,43 @@ Image *pcxLoad (char *fullname, ImageOpt - xmax = xmax - xmin + 1; - ymax = ymax - ymin + 1; - in_bpr = pcxhd[66] + ( 256 * pcxhd[67] ); -- img_bpr = (xmax + 7)/8; /* assumes monochrome image */ -+ img_bpr = (xmax * pcxhd[3] + 7)/8; /* Recompute the number of bytes -+ per lines. */ - - /* double check image */ - if (xmax < 0 || ymax < 0 || in_bpr < img_bpr) { - zclose(zf); - return((Image *)NULL); -- } -+ } - - if (verbose) - printf("%s is a %dx%d PC Paintbrush image\n",name,xmax,ymax); - -- if (pcxhd[65] > 1) { -- fprintf(stderr,"pcxLoad: %s - Unable to handle Color PCX image\n",name); -+ /* Only monochorme or 8bits paletized images are supported. */ -+ if (pcxhd[65] > 1 || !(pcxhd[3] == 1 || pcxhd[3] == 8)) { -+ fprintf(stderr, -+ "pcxLoad: %s - Unsuported PCX type\n", -+ name); -+ - zclose(zf); - return((Image *)NULL); -- } -+ } - - znocache(zf); - -- /* Allocate pbm array. */ -- image = newBitImage(xmax,ymax); -+ /* Allocate image. */ -+ if (pcxhd[3] == 1) -+ image = newBitImage(xmax, ymax); -+ else -+ image = newRGBImage(xmax, ymax, pcxhd[3]); - image->title = dupString(name); - - /* Read compressed bitmap. */ -- if (!PCX_LoadImage( zf, in_bpr, img_bpr, image, ymax )) { -+ if (!PCX_LoadImage(zf, in_bpr, img_bpr, image, ymax, pcxhd[3] == 8)) { - fprintf(stderr,"pcxLoad: %s - Short read of PCX file\n",name); - zclose(zf); - return(image); -- } -+ } - - read_trail_opt(image_ops,zf,image,verbose); - zclose(zf); -@@ -173,7 +185,8 @@ Image *pcxLoad (char *fullname, ImageOpt - ** Returns FALSE if there was a short read. - */ - --static boolean PCX_LoadImage (ZFILE *zf, int in_bpr, int img_bpr, Image *image, int rows) -+static boolean PCX_LoadImage (ZFILE *zf, int in_bpr, int img_bpr, -+ Image *image, int rows, boolean readpal) - { - /* Goes like this: Read a byte. If the two high bits are set, - ** then the low 6 bits contain a repeat count, and the byte to -@@ -185,10 +198,12 @@ static boolean PCX_LoadImage (ZFILE *zf, - int row = 0; - int bytes_this_row = 0; - int b, i, cnt; -+ /* For binary image we need to reverse all bits. */ -+ int xor_mask = (image->type == IBITMAP) ? 0xff : 0; - - ptr = &(image->data[0]); - -- while ((b = zgetc(zf)) != EOF) { -+ while (row < rows && (b = zgetc(zf)) != EOF) { - - if ((b & 0xC0) == 0xC0) { - /* have a repetition count -- mask flag bits */ -@@ -201,12 +216,14 @@ static boolean PCX_LoadImage (ZFILE *zf, - cnt = 1; /* no repeating this one */ - } - -+ b ^= xor_mask; -+ - for ( i = 0; i < cnt; i++ ) { - if ( row >= rows ) { -- return TRUE; -+ break; - } - if (bytes_this_row < img_bpr) -- *ptr++ = (unsigned char) (255 - b); -+ *ptr++ = (unsigned char) b; - if (++bytes_this_row == in_bpr) { - /* start of a new line */ - row++; -@@ -214,6 +231,25 @@ static boolean PCX_LoadImage (ZFILE *zf, - } - } - } -+ /* Read a palette if needed. */ -+ if (readpal) { -+ /* The palette is separated from the pixels data by dummy -+ byte equal to 12. */ -+ if ((b = zgetc(zf)) == EOF || b != 12) -+ return FALSE; -+ -+ for (cnt = 0; cnt < 256; ++cnt) { -+ int r, g, b; -+ if ((r = zgetc(zf)) == EOF -+ || (g = zgetc(zf)) == EOF -+ || (b = zgetc(zf)) == EOF) -+ return FALSE; -+ image->rgb.red[cnt] = r << 8; -+ image->rgb.green[cnt] = g << 8; -+ image->rgb.blue[cnt] = b << 8; -+ } -+ image->rgb.used = 256; -+ } - - return TRUE; - } diff --git a/xli-1.17.0-configfile.patch b/xli-1.17.0-configfile.patch deleted file mode 100644 index 46cee88..0000000 --- a/xli-1.17.0-configfile.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: Imakefile -=================================================================== ---- Imakefile.orig -+++ Imakefile -@@ -19,7 +19,7 @@ JPEG_LDFLAGS = - PNG_INCLUDES = - PNG_LDFLAGS = - --SYSPATHFILE = $(XAPPLOADDIR)/Xli -+SYSPATHFILE = $(RPM_BUILD_ROOT)/usr/lib/X11/Xli - DEPLIBS = $(DEPXLIB) - LOCAL_LIBRARIES = $(XLIB) $(JPEG_LDFLAGS) $(PNG_LDFLAGS) -ljpeg -lpng -lz - SYS_LIBRARIES = -lm diff --git a/xli-1.17.0-overflow.patch b/xli-1.17.0-overflow.patch deleted file mode 100644 index fb3bb93..0000000 --- a/xli-1.17.0-overflow.patch +++ /dev/null @@ -1,92 +0,0 @@ -Index: ddxli.h -=================================================================== ---- ddxli.h.orig -+++ ddxli.h -@@ -36,11 +36,13 @@ - - /* equate bcopy with memcpy and bzero with memset where appropriate. */ - #ifdef HAS_MEMCPY -+#ifndef __linux__ - #ifndef bcopy - #define bcopy(S,D,N) memcpy((char *)(D),(char *)(S),(N)) - #endif - #ifndef bzero - #define bzero(P,N) memset((P),'\0',(N)) -+#endif /* __linux__ */ - #endif - #ifndef bfill - #define bfill(P,N,C) memset((P),(C),(N)) -Index: faces.c -=================================================================== ---- faces.c.orig -+++ faces.c -@@ -56,9 +56,15 @@ isFaces(ZFILE *zf, char *name, char *fna - if (! strcmp(buf, "\n")) - break; - if (!strncmp(buf, "FirstName:", 10)) -- strcpy(fname, buf + 11); -+ { -+ strncpy(fname, buf + 11, BUFSIZ - 1); -+ fname[BUFSIZ - 1] = '\0'; -+ } - else if (!strncmp(buf, "LastName:", 9)) -- strcpy(lname, buf + 10); -+ { -+ strncpy(lname, buf + 10, BUFSIZ - 1); -+ lname[BUFSIZ - 1] = '\0'; -+ } - else if (!strncmp(buf, "Image:", 6)) { - if (sscanf(buf + 7, "%d%d%d", &iw, &ih, &id) != 3) { - fprintf(stderr,"facesLoad: %s - Bad image\n", name); -Index: reduce.c -=================================================================== ---- reduce.c.orig -+++ reduce.c -@@ -178,7 +178,8 @@ Image *reduce(Image *image, unsigned col - /* get destination image */ - depth = colorsToDepth(OutColors); - new_image = newRGBImage(image->width, image->height, depth); -- sprintf(buf, "%s (%d colors)", image->title, OutColors); -+ snprintf(buf, BUFSIZ, "%s (%d colors)", image->title, OutColors); -+ buf[BUFSIZ-1] = '\0'; - new_image->title = dupString(buf); - new_image->gamma = image->gamma; - -Index: zoom.c -=================================================================== ---- zoom.c.orig -+++ zoom.c -@@ -52,28 +52,29 @@ Image *zoom(Image *oimage, unsigned int - if (verbose) - printf(" Zooming image Y axis by %d%%...", yzoom); - if (changetitle) -- sprintf(buf, "%s (Y zoom %d%%)", oimage->title, yzoom); -+ snprintf(buf, BUFSIZ, "%s (Y zoom %d%%)", oimage->title, yzoom); - } - else if (!yzoom) { - if (verbose) - printf(" Zooming image X axis by %d%%...", xzoom); - if (changetitle) -- sprintf(buf, "%s (X zoom %d%%)", oimage->title, xzoom); -+ snprintf(buf, BUFSIZ, "%s (X zoom %d%%)", oimage->title, xzoom); - } - else if (xzoom == yzoom) { - if (verbose) - printf(" Zooming image by %d%%...", xzoom); - if (changetitle) -- sprintf(buf, "%s (%d%% zoom)", oimage->title, xzoom); -+ snprintf(buf, BUFSIZ, "%s (%d%% zoom)", oimage->title, xzoom); - } - else { - if (verbose) - printf(" Zooming image X axis by %d%% and Y axis by %d%%...", - xzoom, yzoom); - if (changetitle) -- sprintf(buf, "%s (X zoom %d%% Y zoom %d%%)", oimage->title, -+ snprintf(buf, BUFSIZ, "%s (X zoom %d%% Y zoom %d%%)", oimage->title, - xzoom, yzoom); - } -+ buf[BUFSIZ-1] = '\0'; - if (!changetitle) - strcpy(buf,oimage->title); - diff --git a/xli-1.17.0.patch b/xli-1.17.0.patch deleted file mode 100644 index 9239032..0000000 --- a/xli-1.17.0.patch +++ /dev/null @@ -1,79 +0,0 @@ -Index: ddxli.h -=================================================================== ---- ddxli.h.orig -+++ ddxli.h -@@ -14,7 +14,7 @@ - #include - #include - --#if defined(SYSV) || defined(VMS) -+#if defined(SYSV) || defined(VMS) || defined __GLIBC__ - #include - #ifndef index /* some SysV's do this for you */ - #define index strchr -Index: Imakefile -=================================================================== ---- Imakefile.orig -+++ Imakefile -@@ -9,7 +9,7 @@ - # -DHAVE_BOOLEAN if your system declares 'boolean' somewhere - # -DHAVE_BUNZIP2 if you have bzip2 and want to handle .bz2 files - --#ifdef HPArchitecture -+#if defined(HPArchitecture) && !defined(LinuxArchitecture) - CCOPTIONS = -Aa -D_HPUX_SOURCE - #endif - -@@ -38,8 +38,8 @@ ComplexProgramTarget_2(xlito,,) - - install:: $(SYSPATHFILE) - $(RM) $(BINDIR)/xview $(BINDIR)/xsetbg -- $(LN) $(BINDIR)/xli $(BINDIR)/xview -- $(LN) $(BINDIR)/xli $(BINDIR)/xsetbg -+ $(LN) xli $(BINDIR)/xview -+ $(LN) xli $(BINDIR)/xsetbg - - $(SYSPATHFILE): - @echo "*** Creating default $(SYSPATHFILE) since you" -Index: root.c -=================================================================== ---- root.c.orig -+++ root.c -@@ -55,8 +55,8 @@ static void freePrevious(Display * dpy, - Pixmap *pm; - Atom actual_type; /* NOTUSED */ - int format; -- int nitems; -- int bytes_after; -+ unsigned long nitems; -+ unsigned long bytes_after; - - /* intern the property name */ - Atom atom = XInternAtom(dpy, RETAIN_PROP_NAME, 0); -@@ -64,8 +64,7 @@ static void freePrevious(Display * dpy, - /* look for existing resource allocation */ - if ((XGetWindowProperty(dpy, w, atom, 0, 1, 1 /*delete */ , - AnyPropertyType, &actual_type, &format, -- (unsigned long *) &nitems, -- (unsigned long *) &bytes_after, -+ &nitems, &bytes_after, - (unsigned char **) &pm) == Success) && - nitems == 1) { - if ((actual_type == XA_PIXMAP) && (format == 32) && -@@ -162,14 +161,13 @@ void imageOnRoot(DisplayInfo * dinfo, Im - for (i = 0; i < numChildren; i++) { - Atom actual_type; - int actual_format; -- long nitems, bytesafter; -+ unsigned long nitems, bytesafter; - Window *newRoot = NULL; - - if (XGetWindowProperty(disp, children[i], __SWM_VROOT, - 0, 1, FALSE, XA_WINDOW, &actual_type, - &actual_format, -- (unsigned long *) &nitems, -- (unsigned long *) &bytesafter, -+ &nitems, &bytesafter, - (unsigned char **) &newRoot) - == Success && newRoot) { - root = *newRoot; diff --git a/xli-2006-11-10.tar.bz2 b/xli-2006-11-10.tar.bz2 deleted file mode 100644 index 352fbbc..0000000 --- a/xli-2006-11-10.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1ad147bb1bfb5acee734057db2f902639ddd3c424e32948df6b391dc95b8a012 -size 171655 diff --git a/xli-png_check_sig.patch b/xli-png_check_sig.patch deleted file mode 100644 index 1e1837b..0000000 --- a/xli-png_check_sig.patch +++ /dev/null @@ -1,22 +0,0 @@ -Index: png.c -=================================================================== ---- png.c.orig -+++ png.c -@@ -11,7 +11,7 @@ - - #define TITLE_KEYWORD "Title" - --/* check to see if a file is a png file using png_check_sig() */ -+/* check to see if a file is a png file using png_sig_cmp() */ - static int check_png(char *file_name) - { - ZFILE *zfp; -@@ -27,7 +27,7 @@ static int check_png(char *file_name) - if (ret != 8) - return 0; - -- ret = png_check_sig(buf, 8); -+ ret = !png_sig_cmp(buf, 0, 8); - - return (ret); - } diff --git a/xli.changes b/xli.changes index 4e5dc06..1fefc62 100644 --- a/xli.changes +++ b/xli.changes @@ -1,3 +1,34 @@ +------------------------------------------------------------------- +Wed Jul 26 09:45:23 UTC 2017 - tchvatal@suse.com + +- Drop patches merged in the git repo: + * xli-1.17.0-8bit_palette.patch + * xli-1.17.0-configfile.patch + * xli-1.17.0-overflow.patch + * xli-1.17.0.patch + * xli-png-alpha.patch + * xli-png_check_sig.patch +- Update to version 1.17+git20170726.0bb4fb4: + * Respect destdir during install + * Symlink with relative path in makefile + * Add support for 8bit pallete + * Make xli handle arrow keys to move image + * Add temp files and patches to gitignore + * Implement zoom functionality + * Adds support for the special "None" colour in XPMs + * Document zooming control + * Add a -forall option + * A bug with all merging + * Do not read past buffer end + +------------------------------------------------------------------- +Wed Jul 26 08:25:08 UTC 2017 - tchvatal@suse.com + +- Allow xli to load up on alpha backgrounded png, if there would be + upstream this should be upstreamed: + * xli-png-alpha.patch +- Cleanup a bit with spec-cleaner + ------------------------------------------------------------------- Mon Nov 3 04:05:46 UTC 2014 - crrodriguez@opensuse.org diff --git a/xli.spec b/xli.spec index eef1452..0ede493 100644 --- a/xli.spec +++ b/xli.spec @@ -1,7 +1,7 @@ # # spec file for package xli # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,22 +17,17 @@ Name: xli -Version: 20061110 +Version: 1.17+git20170726.0bb4fb4 Release: 0 Summary: X11 Image Loading Utility License: MIT Group: System/X11/Utilities -Url: http://pantransit.reptiles.org/prog -Source: xli-2006-11-10.tar.bz2 -Patch0: xli-1.17.0.patch -Patch1: xli-1.17.0-overflow.patch -Patch2: xli-1.17.0-8bit_palette.patch -Patch3: xli-1.17.0-configfile.patch -Patch4: xli-png_check_sig.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-build +Url: https://github.com/openSUSE/xli +Source: %{name}-%{version}.tar.xz BuildRequires: imake BuildRequires: libjpeg-devel BuildRequires: libpng-devel +BuildRequires: pkgconfig BuildRequires: pkgconfig(x11) BuildRequires: pkgconfig(xext) Provides: xli115 @@ -45,38 +40,28 @@ This utility will view several types of images under X11, or load images onto the X11 root window. %prep -%setup -q -n xli-2006-11-10 -%patch0 -%patch1 -%patch2 -%patch3 -%patch4 +%setup -q %build xmkmf -a -make %{?_smp_mflags} all CCOPTIONS="$RPM_OPT_FLAGS" +make %{?_smp_mflags} all CCOPTIONS="%{optflags}" %install -mkdir -p $RPM_BUILD_ROOT/usr/lib/X11 -make BINDIR=$RPM_BUILD_ROOT%{_bindir} install -make DESTDIR=$RPM_BUILD_ROOT install.man -ln -s xli $RPM_BUILD_ROOT%{_bindir}/xloadimage -ln -s xli.1x.gz $RPM_BUILD_ROOT%{_mandir}/man1/xloadimage.1x.gz - -%clean -rm -rf $RPM_BUILD_ROOT +%make_install install.man +ln -s xli %{buildroot}%{_bindir}/xloadimage +ln -s xli.1x %{buildroot}%{_mandir}/man1/xloadimage.1x %files -%defattr(-,root,root) -%doc README* ABOUTGAMMA -%doc %{_mandir}/man1/xli.1x.gz -%doc %{_mandir}/man1/xlito.1x.gz -%doc %{_mandir}/man1/xloadimage.1x.gz +%doc README* ABOUTGAMMA LICENSE +%{_mandir}/man1/xli.1x%{ext_man} +%{_mandir}/man1/xlito.1x%{ext_man} +%{_mandir}/man1/xloadimage.1x%{ext_man} %{_bindir}/xli %{_bindir}/xlito %{_bindir}/xloadimage %{_bindir}/xsetbg %{_bindir}/xview -/usr/lib/X11/Xli +%dir %{_datadir}/X11/app-defaults +%{_datadir}/X11/app-defaults/Xli %changelog