From e6efa5c7a2cf72db80d29f4bb3ab1fb60d70d003 Mon Sep 17 00:00:00 2001 From: robert Date: Thu, 1 Jul 2004 21:53:16 +0000 Subject: [PATCH] Import of scrot-0.8 scrot is a commandline screen capture util like "import", but using imlib2. It has lots of options for autogenerating filenames, and can do fun stuff like taking screenshots of multiple displays and glueing them together. from Victor Sahlstedt ; ok naddy@ --- graphics/scrot/Makefile | 26 +++++++ graphics/scrot/distinfo | 3 + graphics/scrot/patches/patch-Makefile.in | 12 ++++ graphics/scrot/patches/patch-src_Makefile_in | 44 ++++++++++++ graphics/scrot/patches/patch-src_main_c | 75 ++++++++++++++++++++ graphics/scrot/patches/patch-src_options_c | 26 +++++++ graphics/scrot/pkg/DESCR | 4 ++ graphics/scrot/pkg/PLIST | 8 +++ 8 files changed, 198 insertions(+) create mode 100644 graphics/scrot/Makefile create mode 100644 graphics/scrot/distinfo create mode 100644 graphics/scrot/patches/patch-Makefile.in create mode 100644 graphics/scrot/patches/patch-src_Makefile_in create mode 100644 graphics/scrot/patches/patch-src_main_c create mode 100644 graphics/scrot/patches/patch-src_options_c create mode 100644 graphics/scrot/pkg/DESCR create mode 100644 graphics/scrot/pkg/PLIST diff --git a/graphics/scrot/Makefile b/graphics/scrot/Makefile new file mode 100644 index 00000000000..632e9c02805 --- /dev/null +++ b/graphics/scrot/Makefile @@ -0,0 +1,26 @@ +# $OpenBSD: Makefile,v 1.1.1.1 2004/07/01 21:53:16 robert Exp $ + +COMMENT= "commandline screen capture util" + +DISTNAME= scrot-0.8 +CATEGORIES= graphics + +HOMEPAGE= http://www.linuxbrit.co.uk/scrot/ + +MAINTAINER= Victor Sahlstedt + +# BSD +PERMIT_PACKAGE_CDROM= Yes +PERMIT_PACKAGE_FTP= Yes +PERMIT_DISTFILES_CDROM= Yes +PERMIT_DISTFILES_FTP= Yes + +MASTER_SITES= http://www.linuxbrit.co.uk/downloads/ + +LIB_DEPENDS= giblib.1::devel/giblib \ + Imlib2.1::graphics/imlib2 + +USE_X11= Yes +CONFIGURE_STYLE= gnu + +.include diff --git a/graphics/scrot/distinfo b/graphics/scrot/distinfo new file mode 100644 index 00000000000..8349f8411d1 --- /dev/null +++ b/graphics/scrot/distinfo @@ -0,0 +1,3 @@ +MD5 (scrot-0.8.tar.gz) = ccae904d225609571bdd3b03445c1e88 +RMD160 (scrot-0.8.tar.gz) = e082ee2dedea50756df0b53d212f9270ca201533 +SHA1 (scrot-0.8.tar.gz) = 674fcb4860f1dcfa02cde7d82414e1e1c731aa75 diff --git a/graphics/scrot/patches/patch-Makefile.in b/graphics/scrot/patches/patch-Makefile.in new file mode 100644 index 00000000000..0dca18bb466 --- /dev/null +++ b/graphics/scrot/patches/patch-Makefile.in @@ -0,0 +1,12 @@ +$OpenBSD: patch-Makefile.in,v 1.1.1.1 2004/07/01 21:53:16 robert Exp $ +--- Makefile.in.orig Thu May 20 04:43:58 2004 ++++ Makefile.in Thu May 20 04:44:08 2004 +@@ -82,7 +82,7 @@ INCLUDES = -I/usr/X11R6/include $(X_CFLA + man_MANS = scrot.1 + + docs_DATA = README AUTHORS ChangeLog TODO +-docsdir = $(prefix)/doc/scrot ++docsdir = $(prefix)/share/doc/scrot + + EXTRA_DIST = scrot.spec scrot.1 $(docs_DATA) + diff --git a/graphics/scrot/patches/patch-src_Makefile_in b/graphics/scrot/patches/patch-src_Makefile_in new file mode 100644 index 00000000000..66a93465fb1 --- /dev/null +++ b/graphics/scrot/patches/patch-src_Makefile_in @@ -0,0 +1,44 @@ +$OpenBSD: patch-src_Makefile_in,v 1.1.1.1 2004/07/01 21:53:16 robert Exp $ +--- src/Makefile.in.orig Mon Jun 23 14:13:34 2003 ++++ src/Makefile.in Mon Jun 28 15:42:33 2004 +@@ -73,13 +73,13 @@ + + MAINTAINERCLEANFILES = Makefile.in + +-LDFLAGS = -L/usr/X11R6/lib +-INCLUDES = -g -O3 -Wall -I/usr/X11R6/include $(X_CFLAGS) -I$(prefix)/include -I$(includedir) -I. -DPREFIX=\""$(prefix)"\" @GIBLIB_CFLAGS@ ++LDFLAGS = -L${X11BASE}/lib ++INCLUDES = -Wall -I${X11BASE}/include $(X_CFLAGS) -I$(prefix)/include -I$(includedir) -I. -DPREFIX=\""$(prefix)"\" @GIBLIB_CFLAGS@ + + LIBOBJS = @LIBOBJS@ + + bin_PROGRAMS = scrot +-scrot_SOURCES = main.c getopt.c getopt1.c getopt.h scrot.h options.c options.h debug.h imlib.c structs.h ++scrot_SOURCES = main.c scrot.h options.c options.h debug.h imlib.c structs.h + + scrot_LDADD = -lX11 @GIBLIB_LIBS@ + mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +@@ -91,7 +91,7 @@ + DEFS = @DEFS@ -I. -I$(srcdir) -I. + CPPFLAGS = @CPPFLAGS@ + LIBS = @LIBS@ +-scrot_OBJECTS = main.o getopt.o getopt1.o options.o imlib.o ++scrot_OBJECTS = main.o options.o imlib.o + scrot_DEPENDENCIES = + scrot_LDFLAGS = + CFLAGS = @CFLAGS@ +@@ -239,11 +239,9 @@ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +-getopt.o: getopt.c config.h +-getopt1.o: getopt1.c config.h getopt.h +-imlib.o: imlib.c scrot.h getopt.h config.h structs.h debug.h options.h +-main.o: main.c scrot.h getopt.h config.h structs.h debug.h options.h +-options.o: options.c scrot.h getopt.h config.h structs.h debug.h \ ++imlib.o: imlib.c scrot.h config.h structs.h debug.h options.h ++main.o: main.c scrot.h config.h structs.h debug.h options.h ++options.o: options.c scrot.h config.h structs.h debug.h \ + options.h + + info-am: diff --git a/graphics/scrot/patches/patch-src_main_c b/graphics/scrot/patches/patch-src_main_c new file mode 100644 index 00000000000..2f26e965895 --- /dev/null +++ b/graphics/scrot/patches/patch-src_main_c @@ -0,0 +1,75 @@ +$OpenBSD: patch-src_main_c,v 1.1.1.1 2004/07/01 21:53:16 robert Exp $ +--- src/main.c.orig Thu Jul 1 23:19:39 2004 ++++ src/main.c Thu Jul 1 23:21:16 2004 +@@ -426,28 +426,28 @@ + switch (*c) { + case 'f': + if (filename_im) +- strcat(ret, filename_im); ++ strlcat(ret, filename_im, sizeof(ret)); + break; + case 'm': /* t was allready taken, so m as in mini */ + if (filename_thumb) +- strcat(ret, filename_thumb); ++ strlcat(ret, filename_thumb, sizeof(ret)); + break; + case 'n': + if (filename_im) { + tmp = strrchr(filename_im, '/'); + if (tmp) +- strcat(ret, tmp + 1); ++ strlcat(ret, tmp + 1, sizeof(ret)); + else +- strcat(ret, filename_im); ++ strlcat(ret, filename_im, sizeof(ret)); + } + break; + case 'w': + snprintf(buf, sizeof(buf), "%d", gib_imlib_image_get_width(im)); +- strcat(ret, buf); ++ strlcat(ret, buf, sizeof(ret)); + break; + case 'h': + snprintf(buf, sizeof(buf), "%d", gib_imlib_image_get_height(im)); +- strcat(ret, buf); ++ strlcat(ret, buf, sizeof(ret)); + break; + case 's': + if (filename_im) { +@@ -456,22 +456,22 @@ + + size = st.st_size; + snprintf(buf, sizeof(buf), "%d", size); +- strcat(ret, buf); ++ strlcat(ret, buf, sizeof(ret)); + } else +- strcat(ret, "[err]"); ++ strlcat(ret, "[err]", sizeof(ret)); + } + break; + case 'p': + snprintf(buf, sizeof(buf), "%d", + gib_imlib_image_get_width(im) * + gib_imlib_image_get_height(im)); +- strcat(ret, buf); ++ strlcat(ret, buf, sizeof(ret)); + break; + case 't': +- strcat(ret, gib_imlib_image_format(im)); ++ strlcat(ret, gib_imlib_image_format(im), sizeof(ret)); + break; + case '$': +- strcat(ret, "$"); ++ strlcat(ret, "$", sizeof(ret)); + break; + default: + strncat(ret, c, 1); +@@ -482,7 +482,7 @@ + switch (*c) { + case 'n': + if (filename_im) +- strcat(ret, "\n"); ++ strlcat(ret, "\n", sizeof(ret)); + break; + default: + strncat(ret, c, 1); diff --git a/graphics/scrot/patches/patch-src_options_c b/graphics/scrot/patches/patch-src_options_c new file mode 100644 index 00000000000..6f5918c3726 --- /dev/null +++ b/graphics/scrot/patches/patch-src_options_c @@ -0,0 +1,26 @@ +$OpenBSD: patch-src_options_c,v 1.1.1.1 2004/07/01 21:53:16 robert Exp $ +--- src/options.c.orig Mon Jun 23 14:09:08 2003 ++++ src/options.c Thu Jul 1 23:22:32 2004 +@@ -141,6 +141,7 @@ + + length = strlen(name) + 7; + new_title = gib_emalloc(length); ++ memset(new_title, 0, sizeof(new_title)); + + dot_pos = strrchr(name, '.'); + if (dot_pos) +@@ -148,11 +149,11 @@ + diff = (dot_pos - name) / sizeof(char); + + strncpy(new_title, name, diff); +- strcat(new_title, "-thumb"); +- strcat(new_title, dot_pos); ++ strlcat(new_title, "-thumb", length); ++ strlcat(new_title, dot_pos, length); + } + else +- sprintf(new_title, "%s-thumb", name); ++ snprintf(new_title, length, "%s-thumb", name); + + return new_title; + } diff --git a/graphics/scrot/pkg/DESCR b/graphics/scrot/pkg/DESCR new file mode 100644 index 00000000000..78f0f407e18 --- /dev/null +++ b/graphics/scrot/pkg/DESCR @@ -0,0 +1,4 @@ +scrot is a commandline screen capture util like "import", but using +imlib2. It has lots of options for autogenerating filenames, and can +do fun stuff like taking screenshots of multiple displays and glueing +them together. diff --git a/graphics/scrot/pkg/PLIST b/graphics/scrot/pkg/PLIST new file mode 100644 index 00000000000..ba740832e9a --- /dev/null +++ b/graphics/scrot/pkg/PLIST @@ -0,0 +1,8 @@ +@comment $OpenBSD: PLIST,v 1.1.1.1 2004/07/01 21:53:16 robert Exp $ +bin/scrot +man/man1/scrot.1 +share/doc/scrot/AUTHORS +share/doc/scrot/ChangeLog +share/doc/scrot/README +share/doc/scrot/TODO +@dirrm share/doc/scrot