Hi!

The following diff update scrot to what seems to be the most recent source
repository of it https://github.com/slabua/scrot

Upstream seens dead, the HOMEPAGE doesn't exist anymore.

I reviewed manually the commits since our version, I found nothing appearing
harmful. What's interesting in this latest version is the addition of the -r
flag to move/resize the selection square when using -s option.

I added a pledge support too. It requires to be enabled after X11 stuff because
of shmget not being in plegde, so that fail whatever if the pledge happens
before the X11 stuff.

I used a commit id as the last release is from 2013 which is more recent than
our current version but lack some commits like for the -r flag. I can host the
tarball if required, I already host a tarball for games/tome4, I have a server
ready for that.

Some WANTLIB changed has reported to port-lib-depends-check

I had to patch Makefile.in as install_docsDATA wasn't a valid target and was
failing, I also removed the docs files as they are useless (licence is
outdated, todo is a useless one line) and that we don't usually include those
kind of files in ports.

The -r flag isnt' recognized with the short flag, I added a patch to add it to
the opts parsing, the --resize works with the original source. I will try to
send it upstream.

The man page is slightly modified in this version, which could be worrying
users maybe? Here is the text:

       This is a non-official version of scrot.
       Email -r option bugs/feature requests to
       Philippe Proulx <[email protected]>

       This version of scrot is a merge of various features I found online.
       For informations about the repository please refer to
       https://github.com/slabua/scrot.
       Salvatore La Bua <[email protected]>


Index: Makefile
===================================================================
RCS file: /data/cvs/ports/graphics/scrot/Makefile,v
retrieving revision 1.15
diff -u -p -r1.15 Makefile
--- Makefile    22 Jan 2015 21:17:46 -0000      1.15
+++ Makefile    30 Jan 2019 12:30:24 -0000
@@ -2,27 +2,24 @@
 
 COMMENT=               commandline screen capture util
 
-DISTNAME=              scrot-0.8
-REVISION =             3
+DISTNAME=              scrot-20180216
+GH_ACCOUNT=            slabua
+GH_PROJECT=            scrot
+GH_COMMIT=             1428323b1fe21bfc02ff3b55967d209943f44b96
 CATEGORIES=            graphics
 
-HOMEPAGE=              http://www.linuxbrit.co.uk/scrot/
-
 MAINTAINER=            Victor Sahlstedt <[email protected]>
 
 # BSD
 PERMIT_PACKAGE_CDROM=  Yes
 
-WANTLIB=               X11 Xext c freetype m z \
+# use pledge
+WANTLIB=               X11 c m \
                        giblib>=1 Imlib2>=1
 
-MASTER_SITES=          http://www.linuxbrit.co.uk/downloads/
-
 LIB_DEPENDS=            devel/giblib \
                        graphics/imlib2
 
 CONFIGURE_STYLE=       gnu
-
-FAKE_FLAGS+=           docsdir=${PREFIX}/share/doc/scrot/
 
 .include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /data/cvs/ports/graphics/scrot/distinfo,v
retrieving revision 1.4
diff -u -p -r1.4 distinfo
--- distinfo    18 Jan 2015 03:14:14 -0000      1.4
+++ distinfo    30 Jan 2019 12:30:28 -0000
@@ -1,2 +1,2 @@
-SHA256 (scrot-0.8.tar.gz) = YT0c9STCtizjxl8SMupPBcfa8kjV6C/ypoksmAk5lPI=
-SIZE (scrot-0.8.tar.gz) = 74324
+SHA256 (scrot-20180216-1428323b.tar.gz) = 
nDoyfpGd8BlfDLhrMcJP8GIvKnLvGGP6VEA53NU1ui8=
+SIZE (scrot-20180216-1428323b.tar.gz) = 68387
Index: patches/patch-Makefile_in
===================================================================
RCS file: patches/patch-Makefile_in
diff -N patches/patch-Makefile_in
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-Makefile_in   30 Jan 2019 12:38:41 -0000
@@ -0,0 +1,25 @@
+$OpenBSD$
+
+Index: Makefile.in
+--- Makefile.in.orig
++++ Makefile.in
+@@ -75,8 +75,8 @@ AUTOMAKE_OPTIONS = 1.4 foreign
+ # A list of all the files in the current directory which can be regenerated
+ MAINTAINERCLEANFILES = Makefile.in scrot.spec
+ 
+-LDFLAGS = -L/usr/X11R6/lib -L/usr/lib -L/usr/local/lib
+-INCLUDES = -I/usr/X11R6/include $(X_CFLAGS) -I$(prefix)/include 
-I$(includedir) -I.
++LDFLAGS = -L${X11BASE}/lib -L/usr/lib -L/usr/local/lib
++INCLUDES = -I${X11BASE}/include $(X_CFLAGS) -I$(prefix)/include 
-I$(includedir) -I.
+ 
+ 
+ man_MANS = scrot.1
+@@ -349,7 +349,7 @@ installcheck: installcheck-recursive
+ install-exec-am:
+ install-exec: install-exec-recursive
+ 
+-install-data-am: install-man install-docsDATA
++install-data-am: install-man
+ install-data: install-data-recursive
+ 
+ install-am: all-am
Index: patches/patch-src_Makefile_in
===================================================================
RCS file: /data/cvs/ports/graphics/scrot/patches/patch-src_Makefile_in,v
retrieving revision 1.2
diff -u -p -r1.2 patch-src_Makefile_in
--- patches/patch-src_Makefile_in       8 Jul 2011 11:25:47 -0000       1.2
+++ patches/patch-src_Makefile_in       30 Jan 2019 12:36:25 -0000
@@ -1,7 +1,8 @@
 $OpenBSD: patch-src_Makefile_in,v 1.2 2011/07/08 11:25:47 jasper Exp $
---- src/Makefile.in.orig       Mon Jun 23 14:13:34 2003
-+++ src/Makefile.in    Fri Jul  8 13:22:30 2011
-@@ -73,13 +73,13 @@ VERSION = @VERSION@
+Index: src/Makefile.in
+--- src/Makefile.in.orig
++++ src/Makefile.in
+@@ -73,8 +73,8 @@ VERSION = @VERSION@
  
  MAINTAINERCLEANFILES = Makefile.in                            
  
@@ -12,33 +13,3 @@ $OpenBSD: patch-src_Makefile_in,v 1.2 20
  
  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 @@ PROGRAMS =  $(bin_PROGRAMS)
- 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 @@ distdir: $(DISTFILES)
-           || 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:
Index: patches/patch-src_main_c
===================================================================
RCS file: /data/cvs/ports/graphics/scrot/patches/patch-src_main_c,v
retrieving revision 1.2
diff -u -p -r1.2 patch-src_main_c
--- patches/patch-src_main_c    8 Jul 2011 11:25:47 -0000       1.2
+++ patches/patch-src_main_c    30 Jan 2019 12:06:32 -0000
@@ -1,7 +1,28 @@
 $OpenBSD: patch-src_main_c,v 1.2 2011/07/08 11:25:47 jasper Exp $
---- src/main.c.orig    Mon Jun 23 14:05:48 2003
-+++ src/main.c Fri Jul  8 13:22:30 2011
-@@ -426,28 +426,28 @@ im_printf(char *str, struct tm *tm,
+Index: src/main.c
+--- src/main.c.orig
++++ src/main.c
+@@ -70,6 +70,19 @@ main(int argc,
+   if (!image)
+     gib_eprintf("no image grabbed");
+ 
++  if(opt.exec) {
++    if (pledge("cpath exec prot_exec rpath stdio wpath proc", NULL) == -1) {
++      fprintf ( stderr, "scrot: pledge\n" );
++      exit ( 1 );
++    }
++  } else {
++    if (pledge("cpath prot_exec rpath stdio wpath", NULL) == -1) {
++      fprintf ( stderr, "scrot: pledge\n" );
++      exit ( 1 );
++    }
++  }
++
++
+   time(&t); /* Get the time directly after the screenshot */
+   tm = localtime(&t);
+ 
+@@ -917,28 +930,28 @@ im_printf(char *str, struct tm *tm,
        switch (*c) {
          case 'f':
            if (filename_im)
@@ -36,7 +57,7 @@ $OpenBSD: patch-src_main_c,v 1.2 2011/07
            break;
          case 's':
            if (filename_im) {
-@@ -456,22 +456,22 @@ im_printf(char *str, struct tm *tm,
+@@ -947,22 +960,22 @@ im_printf(char *str, struct tm *tm,
  
                size = st.st_size;
                snprintf(buf, sizeof(buf), "%d", size);
@@ -64,7 +85,7 @@ $OpenBSD: patch-src_main_c,v 1.2 2011/07
            break;
          default:
            strncat(ret, c, 1);
-@@ -482,7 +482,7 @@ im_printf(char *str, struct tm *tm,
+@@ -973,7 +986,7 @@ im_printf(char *str, struct tm *tm,
        switch (*c) {
          case 'n':
            if (filename_im)
Index: patches/patch-src_options_c
===================================================================
RCS file: /data/cvs/ports/graphics/scrot/patches/patch-src_options_c,v
retrieving revision 1.2
diff -u -p -r1.2 patch-src_options_c
--- patches/patch-src_options_c 8 Jul 2011 11:25:47 -0000       1.2
+++ patches/patch-src_options_c 30 Jan 2019 12:37:13 -0000
@@ -1,7 +1,17 @@
 $OpenBSD: patch-src_options_c,v 1.2 2011/07/08 11:25:47 jasper Exp $
---- src/options.c.orig Mon Jun 23 14:09:08 2003
-+++ src/options.c      Fri Jul  8 13:22:30 2011
-@@ -141,6 +141,7 @@ name_thumbnail(char *name)
+Index: src/options.c
+--- src/options.c.orig
++++ src/options.c
+@@ -46,7 +46,7 @@ init_parse_options(int argc, char **argv)
+ static void
+ scrot_parse_option_array(int argc, char **argv)
+ {
+-   static char stropts[] = "abcd:e:hmnq:w:g:st:uv+:";
++   static char stropts[] = "abcd:e:hmnq:w:g:rst:uv+:";
+    static struct option lopts[] = {
+       /* actions */
+       {"help", 0, 0, 'h'},                  /* okay */
+@@ -179,6 +179,7 @@ name_thumbnail(char *name)
  
     length = strlen(name) + 7;
     new_title = gib_emalloc(length);
@@ -9,7 +19,7 @@ $OpenBSD: patch-src_options_c,v 1.2 2011
  
     dot_pos = strrchr(name, '.');
     if (dot_pos)
-@@ -148,11 +149,11 @@ name_thumbnail(char *name)
+@@ -186,11 +187,11 @@ name_thumbnail(char *name)
        diff = (dot_pos - name) / sizeof(char);
  
        strncpy(new_title, name, diff);
Index: pkg/PLIST
===================================================================
RCS file: /data/cvs/ports/graphics/scrot/pkg/PLIST,v
retrieving revision 1.3
diff -u -p -r1.3 PLIST
--- pkg/PLIST   8 Jul 2011 12:20:49 -0000       1.3
+++ pkg/PLIST   30 Jan 2019 11:09:06 -0000
@@ -1,8 +1,3 @@
 @comment $OpenBSD: PLIST,v 1.3 2011/07/08 12:20:49 jasper Exp $
 @bin bin/scrot
 @man man/man1/scrot.1
-share/doc/scrot/
-share/doc/scrot/AUTHORS
-share/doc/scrot/ChangeLog
-share/doc/scrot/README
-share/doc/scrot/TODO

Reply via email to