mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-20 19:41:34 +01:00
misc/grabc: Updated for v1.0.2 (newer than 1.1), new maintainer.
Signed-off-by: B. Watson <urchlay@slackware.uk> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
parent
b8488579f1
commit
ef5683f370
6 changed files with 183 additions and 52 deletions
Binary file not shown.
|
@ -1,4 +1,12 @@
|
|||
grabc is s simple but very useful program to determine the color
|
||||
grabc (X11 pixel color grabber)
|
||||
|
||||
grabc is a simple but very useful program to determine the color
|
||||
string in hex (or in RGB components) by clicking on a pixel on the
|
||||
screen. While web browsing, lots of time you find a nice color and
|
||||
wonder what color is that! Well just use grabc!
|
||||
wonder what color is that? Well, just use grabc!
|
||||
|
||||
Note: the previous version of grabc was 1.1, and the current version
|
||||
is 1.0.2. This is *not* a downgrade or a mistake: the 1.1 release is
|
||||
from 1998; 1.0.2 is from 2018, and has some bug fixes and includes
|
||||
a man page. Apparently "1.1" was a typo for "1.0.1". Please don't
|
||||
contact the maintainer asking to "upgrade" this to 1.1.
|
||||
|
|
|
@ -2,30 +2,25 @@
|
|||
|
||||
# Slackware build script for grabc
|
||||
|
||||
# Copyright 2016 Hunter Sezen California, USA
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use of this script, with or without modification, is
|
||||
# permitted provided that the following conditions are met:
|
||||
#
|
||||
# 1. Redistributions of this script must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# Originally written by Hunter Sezen.
|
||||
# Modified and now maintained by B. Watson <urchlay@slackware.uk>.
|
||||
|
||||
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
|
||||
|
||||
# NOTE: yes, 1.0.2 is *newer than* 1.1, see README.
|
||||
|
||||
# 20240827 bkw:
|
||||
# - new maintainer.
|
||||
# - relicense as WTFPL.
|
||||
# - update for v1.0.2.
|
||||
# - fix typo in README and slack-desc.
|
||||
# - 1.0.2 has a man page; clean it up a bit.
|
||||
# - use github repo as HOMEPAGE since that seems to be what gets updated.
|
||||
|
||||
cd $(dirname $0) ; CWD=$(pwd)
|
||||
|
||||
PRGNAM=grabc
|
||||
VERSION=${VERSION:-1.1}
|
||||
VERSION=${VERSION:-1.0.2}
|
||||
BUILD=${BUILD:-1}
|
||||
TAG=${TAG:-_SBo}
|
||||
PKGTYPE=${PKGTYPE:-tgz}
|
||||
|
@ -38,9 +33,6 @@ if [ -z "$ARCH" ]; then
|
|||
esac
|
||||
fi
|
||||
|
||||
# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
|
||||
# the name of the created package would be, and then exit. This information
|
||||
# could be useful to other scripts.
|
||||
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
|
||||
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
|
||||
exit 0
|
||||
|
@ -69,31 +61,27 @@ set -e
|
|||
rm -rf $PKG
|
||||
mkdir -p $TMP $PKG $OUTPUT
|
||||
cd $TMP
|
||||
rm -rf $PRGNAM$VERSION
|
||||
tar xvf $CWD/$PRGNAM$VERSION.tar.gz
|
||||
cd $PRGNAM$VERSION
|
||||
rm -rf $PRGNAM-$VERSION
|
||||
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
|
||||
cd $PRGNAM-$VERSION
|
||||
chown -R root:root .
|
||||
find -L . \
|
||||
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
|
||||
-o -perm 511 \) -exec chmod 755 {} \; -o \
|
||||
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
|
||||
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
|
||||
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} + -o \
|
||||
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} +
|
||||
|
||||
zcat $CWD/Makefile.diff.gz | patch -p1
|
||||
# 20240827 bkw: make the man page look more like a man page.
|
||||
patch -p1 < $CWD/manpage.diff
|
||||
|
||||
CFLAGS="$SLKCFLAGS" make \
|
||||
X11LIB=/usr/X11R6/lib${LIBDIRSUFFIX}
|
||||
mkdir -p $PKG/usr/bin $PKG/usr/man/man1
|
||||
|
||||
make install \
|
||||
PREFIX=/usr \
|
||||
DOCDIR=/usr/doc/$PRGNAM-$VERSION \
|
||||
DESTDIR=$PKG
|
||||
make DEFS="$SLKCFLAGS"
|
||||
strip $PRGNAM
|
||||
make install DESTDIR=$PKG bindir=/usr/bin mandir=/usr/man/man1
|
||||
gzip -9 $PKG/usr/man/man1/$PRGNAM.1
|
||||
|
||||
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
|
||||
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
||||
|
||||
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
||||
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
||||
PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
|
||||
mkdir -p $PKGDOC
|
||||
cp -a README.md $PKGDOC
|
||||
cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
|
||||
|
||||
mkdir -p $PKG/install
|
||||
cat $CWD/slack-desc > $PKG/install/slack-desc
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
PRGNAM="grabc"
|
||||
VERSION="1.1"
|
||||
HOMEPAGE="http://www.muquit.com/muquit/software/grabc/grabc.html"
|
||||
DOWNLOAD="http://www.muquit.com/muquit/software/grabc/grabc1.1.tar.gz"
|
||||
MD5SUM="d8d308f3183c719309f35c249db4f9ed"
|
||||
VERSION="1.0.2"
|
||||
HOMEPAGE="https://github.com/muquit/grabc/"
|
||||
DOWNLOAD="https://github.com/muquit/grabc/archive/v1.0.2/grabc-1.0.2.tar.gz"
|
||||
MD5SUM="3a3f39a7ee35b140d82a97c3d78e74c4"
|
||||
DOWNLOAD_x86_64=""
|
||||
MD5SUM_x86_64=""
|
||||
REQUIRES=""
|
||||
MAINTAINER="Hunter Sezen"
|
||||
EMAIL="orbea@riseup.net"
|
||||
MAINTAINER="B. Watson"
|
||||
EMAIL="urchlay@slackware.uk"
|
||||
|
|
135
misc/grabc/manpage.diff
Normal file
135
misc/grabc/manpage.diff
Normal file
|
@ -0,0 +1,135 @@
|
|||
diff --git a/Makefile b/Makefile
|
||||
index 5de8e52..adc88e5 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -28,13 +28,13 @@ OBJS = grabc.o
|
||||
rm -f $@
|
||||
$(CC) $(CFLAGS) -c $*.c
|
||||
|
||||
-all: $(PROGNAME)
|
||||
+all: $(PROGNAME) doc
|
||||
|
||||
$(PROGNAME) : $(OBJS)
|
||||
$(CC) $(CFLAGS) -o $(PROGNAME) $(OBJS) $(LIBS)
|
||||
|
||||
doc:
|
||||
- pod2man grabc.pod > grabc.1
|
||||
+ pod2man -cSlackBuilds.org -r1.0.2 grabc.pod > grabc.1
|
||||
|
||||
install: installdirs install-bin install-man
|
||||
|
||||
diff --git a/grabc.pod b/grabc.pod
|
||||
index 85f2c2f..627bc22 100644
|
||||
--- a/grabc.pod
|
||||
+++ b/grabc.pod
|
||||
@@ -4,42 +4,75 @@ grabc - A tool to identify a pixel color of an X Window.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
- grabc v1.0.2
|
||||
- A program to identify a pixel color of an X Window
|
||||
- by muquit@muquit.com https://www.muquit.com/
|
||||
-
|
||||
- Usage: grabc [options]
|
||||
- Where the options are:
|
||||
- -v - show version info
|
||||
- -h - show this usage
|
||||
- -hex - print pixel value as Hex on stdout
|
||||
- -rgb - print pixel value as RGB on stderr
|
||||
- -W - print the Window id at mouse click
|
||||
- -w id - window id in hex, use -l +x+y
|
||||
- -l +x+y - pixel co-ordinate. requires window id
|
||||
- -d - show debug messages
|
||||
- -a - Print all 16 bits of color. Default is high order 8 bits
|
||||
- Example:
|
||||
- * Print pixel color in hex on stdout:
|
||||
- $ grabc
|
||||
- * Show usage:
|
||||
- $ grabc -h
|
||||
- * Print Window Id (Note the upper case W):
|
||||
- $ grabc -W
|
||||
- * Print pixel color of Window iwith id 0x13234 at location 10,20
|
||||
- $ grabc -w 0x13234 -l +10+20
|
||||
+grabc [B<-v>] [B<-h>] [B<-W>] [B<-d>] [B<-a>] [B<-hex>] [B<-rgb>] [B<-w> I<window-id>] [B<-l> +I<x>+I<y>]
|
||||
+
|
||||
+=head1 OPTIONS
|
||||
+
|
||||
+=over 4
|
||||
+
|
||||
+=item B<-v>
|
||||
+
|
||||
+Show version info and exit.
|
||||
+
|
||||
+=item B<-h>
|
||||
+
|
||||
+Show usage and exit.
|
||||
+
|
||||
+=item B<-hex>
|
||||
+
|
||||
+Print pixel value as Hex on B<stdout>.
|
||||
+
|
||||
+=item B<-rgb>
|
||||
+
|
||||
+Print pixel value as RGB on B<stderr>.
|
||||
+
|
||||
+=item B<-W>
|
||||
+
|
||||
+Print the window id at mouse click.
|
||||
+
|
||||
+=item B<-w> I<window-id>
|
||||
+
|
||||
+Window id in hex, use with B<-l> I<+x+y>.
|
||||
+
|
||||
+=item B<-l> I<+x+y>
|
||||
+
|
||||
+Pixel co-ordinate. Requires window id.
|
||||
+
|
||||
+=item B<-d>
|
||||
+
|
||||
+Show debug messages.
|
||||
+
|
||||
+=item B<-a>
|
||||
+
|
||||
+Print all 16 bits of color. Default is high order 8 bits.
|
||||
+
|
||||
+=back
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
-grabc is a simple but very useful program to determine the color string in
|
||||
+B<grabc> is a simple but very useful program to determine the color string in
|
||||
hex (or in RGB components) by clicking on a pixel on the screen. While web
|
||||
-browsing, lots of time you find a nice color and wonder what color is that.
|
||||
-Well just use grabc!
|
||||
+browsing, lots of times you find a nice color and wonder, "What color is that"?
|
||||
+Well, just use B<grabc>!
|
||||
|
||||
When this program is run, the mouse pointer is grabbed and changed to a
|
||||
cross hair and when the mouse is clicked, the color of the clicked pixel
|
||||
is written to stdout in hex prefixed with #.
|
||||
|
||||
+=head1 EXAMPLES
|
||||
+
|
||||
+Print pixel color in hex on stdout:
|
||||
+
|
||||
+ $ grabc
|
||||
+
|
||||
+Print Window Id (Note the upper case W):
|
||||
+
|
||||
+ $ grabc -W
|
||||
+
|
||||
+Print pixel color of window with id 0x13234 at location 10,20
|
||||
+
|
||||
+ $ grabc -w 0x13234 -l +10+20
|
||||
+
|
||||
=head1 LICENSE
|
||||
|
||||
MIT
|
||||
@@ -47,4 +80,7 @@ MIT
|
||||
=head1 AUTHOR
|
||||
|
||||
grabc is written by Muhammad Muquit E<lt>muquit@muquit.comE<gt>.
|
||||
+
|
||||
+=head1 SEE ALSO
|
||||
+
|
||||
Homepage: L<https://www.muquit.com/>.
|
|
@ -8,7 +8,7 @@
|
|||
|-----handy-ruler------------------------------------------------------|
|
||||
grabc: grabc (X11 pixel color grabber)
|
||||
grabc:
|
||||
grabc: grabc is s simple but very useful program to determine the color
|
||||
grabc: grabc is a simple but very useful program to determine the color
|
||||
grabc: string in hex (or in RGB components) by clicking on a pixel on the
|
||||
grabc: screen.
|
||||
grabc:
|
||||
|
|
Loading…
Reference in a new issue