mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-06 08:26:50 +01:00
system/ttyrec: Patch for the newer glibc and fix the CFLAGS.
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
This commit is contained in:
parent
f6191a5590
commit
b42166cb70
4 changed files with 52 additions and 36 deletions
19
system/ttyrec/ttyrec-1.0.8-flags.patch
Normal file
19
system/ttyrec/ttyrec-1.0.8-flags.patch
Normal file
|
@ -0,0 +1,19 @@
|
|||
--- a/Makefile 2017-08-26 11:47:02.981266309 +0200
|
||||
+++ b/Makefile 2017-08-26 14:33:47.161600445 +0200
|
||||
@@ -10,13 +10,13 @@
|
||||
all: $(TARGET)
|
||||
|
||||
ttyrec: ttyrec.o io.o
|
||||
- $(CC) $(CFLAGS) -o ttyrec ttyrec.o io.o
|
||||
+ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o ttyrec ttyrec.o io.o
|
||||
|
||||
ttyplay: ttyplay.o io.o
|
||||
- $(CC) $(CFLAGS) -o ttyplay ttyplay.o io.o
|
||||
+ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o ttyplay ttyplay.o io.o
|
||||
|
||||
ttytime: ttytime.o io.o
|
||||
- $(CC) $(CFLAGS) -o ttytime ttytime.o io.o
|
||||
+ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o ttytime ttytime.o io.o
|
||||
|
||||
clean:
|
||||
rm -f *.o $(TARGET) ttyrecord *~
|
30
system/ttyrec/ttyrec-1.0.8-glibc-2.30.patch
Normal file
30
system/ttyrec/ttyrec-1.0.8-glibc-2.30.patch
Normal file
|
@ -0,0 +1,30 @@
|
|||
diff --git a/ttyrec.c b/ttyrec.c
|
||||
index 3392f70..86a59ee 100644
|
||||
--- a/ttyrec.c
|
||||
+++ b/ttyrec.c
|
||||
@@ -57,7 +57,9 @@
|
||||
|
||||
#if defined(SVR4)
|
||||
#include <fcntl.h>
|
||||
+#if !(defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) || defined(__linux__))
|
||||
#include <stropts.h>
|
||||
+#endif
|
||||
#endif /* SVR4 */
|
||||
|
||||
#include <sys/time.h>
|
||||
@@ -449,6 +451,7 @@ getslave()
|
||||
perror("open(fd, O_RDWR)");
|
||||
fail();
|
||||
}
|
||||
+#ifndef __linux__
|
||||
if (isastream(slave)) {
|
||||
if (ioctl(slave, I_PUSH, "ptem") < 0) {
|
||||
perror("ioctl(fd, I_PUSH, ptem)");
|
||||
@@ -466,6 +469,7 @@ getslave()
|
||||
#endif
|
||||
(void) ioctl(0, TIOCGWINSZ, (char *)&win);
|
||||
}
|
||||
+#endif
|
||||
#else /* !SVR4 */
|
||||
#ifndef HAVE_openpty
|
||||
line[strlen("/dev/")] = 't';
|
|
@ -1,33 +0,0 @@
|
|||
diff -rupN original/Makefile new/Makefile
|
||||
--- original/Makefile 2006-06-11 10:52:50.000000000 -0500
|
||||
+++ new/Makefile 2012-04-23 18:34:05.000000000 -0500
|
||||
@@ -1,5 +1,5 @@
|
||||
CC = gcc
|
||||
-CFLAGS = -O2
|
||||
+CFLAGS = -O2 -DHAVE_openpty
|
||||
VERSION = 1.0.8
|
||||
|
||||
TARGET = ttyrec ttyplay ttytime
|
||||
@@ -10,7 +10,7 @@ DIST = ttyrec.c ttyplay.c ttyrec.h io.c
|
||||
all: $(TARGET)
|
||||
|
||||
ttyrec: ttyrec.o io.o
|
||||
- $(CC) $(CFLAGS) -o ttyrec ttyrec.o io.o
|
||||
+ $(CC) $(CFLAGS) -o ttyrec ttyrec.o io.o -lutil
|
||||
|
||||
ttyplay: ttyplay.o io.o
|
||||
$(CC) $(CFLAGS) -o ttyplay ttyplay.o io.o
|
||||
diff -rupN original/ttyrec.c new/ttyrec.c
|
||||
--- original/ttyrec.c 2006-06-11 10:52:50.000000000 -0500
|
||||
+++ new/ttyrec.c 2012-04-23 18:26:41.000000000 -0500
|
||||
@@ -71,7 +71,9 @@
|
||||
#define _(FOO) FOO
|
||||
|
||||
#ifdef HAVE_openpty
|
||||
-#include <libutil.h>
|
||||
+/* #include <libutil.h> */
|
||||
+#include <pty.h> /* for openpty and forkpty */
|
||||
+#include <utmp.h> /* for login_tty */
|
||||
#endif
|
||||
|
||||
#if defined(SVR4) && !defined(CDEL)
|
|
@ -69,10 +69,10 @@ find -L . \
|
|||
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
|
||||
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
|
||||
|
||||
# Fixed: "Out of pty's Terminated"
|
||||
patch -p1 < $CWD/ttyrec-1.0.8.RHEL5.patch
|
||||
patch -p1 < $CWD/ttyrec-1.0.8-flags.patch
|
||||
patch -p1 < $CWD/ttyrec-1.0.8-glibc-2.30.patch
|
||||
|
||||
make
|
||||
make CFLAGS+="$SLKCFLAGS -DSVR4 -DHAVE_inotify -D_XOPEN_SOURCE=500"
|
||||
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue