!1 Package init
From: @wk333 Reviewed-by: @caodongxia Signed-off-by: @caodongxia
This commit is contained in:
commit
754f5c6473
BIN
xclip-11cba61.tar.gz
Normal file
BIN
xclip-11cba61.tar.gz
Normal file
Binary file not shown.
39
xclip-fix-segfault-bz1947285.patch
Normal file
39
xclip-fix-segfault-bz1947285.patch
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
diff -up xclip-11cba613840b0d0e76dc2ea6d4ec7cc5f23daf88/xclip.c.1947285 xclip-11cba613840b0d0e76dc2ea6d4ec7cc5f23daf88/xclip.c
|
||||||
|
--- xclip-11cba613840b0d0e76dc2ea6d4ec7cc5f23daf88/xclip.c.1947285 2020-11-08 09:01:39.000000000 -0500
|
||||||
|
+++ xclip-11cba613840b0d0e76dc2ea6d4ec7cc5f23daf88/xclip.c 2022-02-22 18:04:44.598444273 -0500
|
||||||
|
@@ -353,7 +353,7 @@ doOptTarget(void)
|
||||||
|
static int
|
||||||
|
doIn(Window win, const char *progname)
|
||||||
|
{
|
||||||
|
- unsigned char *sel_buf; /* buffer for selection data */
|
||||||
|
+ unsigned char *sel_buf = NULL; /* buffer for selection data */
|
||||||
|
unsigned long sel_len = 0; /* length of sel_buf */
|
||||||
|
unsigned long sel_all = 0; /* allocated size of sel_buf */
|
||||||
|
XEvent evt; /* X Event Structures */
|
||||||
|
@@ -714,9 +714,9 @@ static int
|
||||||
|
doOut(Window win)
|
||||||
|
{
|
||||||
|
Atom sel_type = None;
|
||||||
|
- unsigned char *sel_buf; /* buffer for selection data */
|
||||||
|
- unsigned long sel_len = 0; /* length of sel_buf */
|
||||||
|
- XEvent evt; /* X Event Structures */
|
||||||
|
+ unsigned char *sel_buf = NULL; /* buffer for selection data */
|
||||||
|
+ unsigned long sel_len = 0; /* length of sel_buf */
|
||||||
|
+ XEvent evt; /* X Event Structures */
|
||||||
|
unsigned int context = XCLIB_XCOUT_NONE;
|
||||||
|
|
||||||
|
if (sseln == XA_STRING)
|
||||||
|
@@ -743,9 +743,11 @@ doOut(Window win)
|
||||||
|
/* If user requested -sensitive, then prevent further pastes (even though we failed to paste) */
|
||||||
|
XSetSelectionOwner(dpy, sseln, None, CurrentTime);
|
||||||
|
/* Clear memory buffer */
|
||||||
|
- xcmemzero(sel_buf,sel_len);
|
||||||
|
+ if (sel_buf != NULL)
|
||||||
|
+ xcmemzero(sel_buf,sel_len);
|
||||||
|
}
|
||||||
|
- free(sel_buf);
|
||||||
|
+ if (sel_buf != NULL)
|
||||||
|
+ free(sel_buf);
|
||||||
|
errconvsel(dpy, target, sseln);
|
||||||
|
// errconvsel does not return but exits with EXIT_FAILURE
|
||||||
|
}
|
||||||
48
xclip.spec
Normal file
48
xclip.spec
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
%global commit 11cba613840b0d0e76dc2ea6d4ec7cc5f23daf88
|
||||||
|
%global shortcommit %(c=%{commit}; echo ${c:0:7})
|
||||||
|
|
||||||
|
Name: xclip
|
||||||
|
Version: 0.13
|
||||||
|
Release: 1.git%{shortcommit}
|
||||||
|
License: GPLv2+
|
||||||
|
Summary: Command line clipboard grabber
|
||||||
|
URL: https://github.com/astrand/xclip
|
||||||
|
Source0: https://github.com/astrand/xclip/archive/%{commit}/%{name}-%{shortcommit}.tar.gz
|
||||||
|
Patch0: xclip-fix-segfault-bz1947285.patch
|
||||||
|
BuildRequires: make
|
||||||
|
BuildRequires: libXmu-devel, libICE-devel, libX11-devel, libXext-devel
|
||||||
|
BuildRequires: autoconf, automake, libtool
|
||||||
|
|
||||||
|
%description
|
||||||
|
xclip is a command line utility that is designed to run on any system with an
|
||||||
|
X11 implementation. It provides an interface to X selections ("the clipboard")
|
||||||
|
from the command line. It can read data from standard in or a file and place it
|
||||||
|
in an X selection for pasting into other X applications. xclip can also print
|
||||||
|
an X selection to standard out, which can then be redirected to a file or
|
||||||
|
another program.
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%setup -q -n %{name}-%{commit}
|
||||||
|
%patch0 -p1 -b .1947285
|
||||||
|
autoreconf -ifv
|
||||||
|
|
||||||
|
%build
|
||||||
|
%configure
|
||||||
|
make CDEBUGFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags}
|
||||||
|
|
||||||
|
%install
|
||||||
|
make DESTDIR=$RPM_BUILD_ROOT install
|
||||||
|
make DESTDIR=$RPM_BUILD_ROOT install.man
|
||||||
|
|
||||||
|
%files
|
||||||
|
%license COPYING
|
||||||
|
%doc README
|
||||||
|
%{_bindir}/xclip
|
||||||
|
%{_bindir}/xclip-copyfile
|
||||||
|
%{_bindir}/xclip-cutfile
|
||||||
|
%{_bindir}/xclip-pastefile
|
||||||
|
%{_mandir}/man1/xclip*.1*
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Mon Jul 25 2022 wangkai <wangkai385@h-partners.com> - 0.13-1.git11cba61
|
||||||
|
- Package init
|
||||||
4
xclip.yaml
Normal file
4
xclip.yaml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
version_control: github
|
||||||
|
src_repo: astrand/xclip
|
||||||
|
tag_prefix: "^xclip-"
|
||||||
|
separator: "."
|
||||||
Loading…
x
Reference in New Issue
Block a user