public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: net-mail/safecat/files/, net-mail/safecat/
@ 2018-01-03 18:39 David Seifert
  0 siblings, 0 replies; 2+ messages in thread
From: David Seifert @ 2018-01-03 18:39 UTC (permalink / raw
  To: gentoo-commits

commit:     181d152380aa77d302585b7f5048df95775c0b4f
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Wed Jan  3 18:37:34 2018 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Wed Jan  3 18:37:34 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=181d1523

net-mail/safecat: Port to EAPI 6

Package-Manager: Portage-2.3.19, Repoman-2.3.6

 .../files/safecat-1.13-head-tail-POSIX.patch       | 45 ++++++++++++++++++++++
 net-mail/safecat/safecat-1.13.ebuild               | 41 +++++++++-----------
 2 files changed, 64 insertions(+), 22 deletions(-)

diff --git a/net-mail/safecat/files/safecat-1.13-head-tail-POSIX.patch b/net-mail/safecat/files/safecat-1.13-head-tail-POSIX.patch
new file mode 100644
index 00000000000..59bd33b0f76
--- /dev/null
+++ b/net-mail/safecat/files/safecat-1.13-head-tail-POSIX.patch
@@ -0,0 +1,45 @@
+--- a/make-compile.sh
++++ b/make-compile.sh
+@@ -1 +1 @@
+-echo exec "$CC" "`head -1 conf-includes`" -c '${1+"$@"}'
++echo exec "$CC" "`head -n 1 conf-includes`" -c '${1+"$@"}'
+--- a/Makefile
++++ b/Makefile
+@@ -17,8 +17,8 @@
+ auto-ccld.sh: \
+ conf-cc conf-ld warn-auto.sh
+ 	( cat warn-auto.sh; \
+-	echo CC=\'`head -1 conf-cc`\'; \
+-	echo LD=\'`head -1 conf-ld`\'; \
++	echo CC=\'`head -n 1 conf-cc`\'; \
++	echo LD=\'`head -n 1 conf-ld`\'; \
+ 	) > auto-ccld.sh
+ 
+ auto-str: \
+@@ -31,7 +31,7 @@
+ 
+ auto_home.c: \
+ auto-str conf-root
+-	./auto-str auto_home `head -1 conf-root` > auto_home.c
++	./auto-str auto_home `head -n 1 conf-root` > auto_home.c
+ 
+ auto_home.o: \
+ compile auto_home.c
+@@ -161,7 +161,7 @@
+ maildir: \
+ warn-auto.sh maildir.sh conf-root
+ 	cat warn-auto.sh maildir.sh \
+-	| sed s}HOME}"`head -1 conf-root`"}g \
++	| sed s}HOME}"`head -n 1 conf-root`"}g \
+ 	> maildir
+ 	chmod 755 maildir
+ 
+@@ -407,7 +407,7 @@
+ version.h: \
+ conf-version
+ 	@echo 'static const char *const version_string="$$Version:' \
+-	`head -1 conf-version` 'built' `date +"%b %d, %Y"` at \
++	`head -n 1 conf-version` 'built' `date +"%b %d, %Y"` at \
+ 	`date +"%H:%M"`'$$";' > version.h
+ 
+ writefile.o: \

diff --git a/net-mail/safecat/safecat-1.13.ebuild b/net-mail/safecat/safecat-1.13.ebuild
index 78dc3a09942..7dbf9cc60c4 100644
--- a/net-mail/safecat/safecat-1.13.ebuild
+++ b/net-mail/safecat/safecat-1.13.ebuild
@@ -1,11 +1,11 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI="3"
+EAPI=6
 
-inherit fixheadtails eutils toolchain-funcs flag-o-matic
+inherit toolchain-funcs
 
-DESCRIPTION="Safecat implements qmail's maildir algorithm, copying standard input safely to a specified directory"
+DESCRIPTION="Safecat implements qmail's maildir algorithm, safely copying standard input"
 HOMEPAGE="http://www.jeenyus.net/linux/software/safecat.html"
 SRC_URI="http://www.jeenyus.net/linux/software/${PN}/${P}.tar.gz"
 
@@ -18,35 +18,32 @@ RESTRICT="test"
 DEPEND="sys-apps/groff"
 RDEPEND=""
 
-src_prepare() {
+PATCHES=(
 	# applying maildir-patch
-	epatch "${FILESDIR}"/safecat-1.11-gentoo.patch
-
+	"${FILESDIR}"/safecat-1.11-gentoo.patch
 	# Fix parallel make errors
-	epatch "${FILESDIR}"/${P}-makefile.patch
+	"${FILESDIR}"/${P}-makefile.patch
+	# Fix POSIX head/tail syntax
+	"${FILESDIR}"/${P}-head-tail-POSIX.patch
+)
 
-	ht_fix_file Makefile make-compile.sh
+src_prepare() {
+	default
 
-	sed -ni '/man\|doc/!p' hier.c
+	sed -ni '/man\|doc/!p' hier.c || die
 
 	# Fix implicit decleration
-	sed -i -e '/include <signal.h>/ a #include <stdlib.h>' \
-		safecat.c
+	sed '/include <signal.h>/ a #include <stdlib.h>' -i safecat.c || die
 }
 
 src_configure() {
-	# safecat segfaults on gcc-4.0 x86 with -Os, seems to be okay with -O2
-	if [[ $(gcc-major-version).$(gcc-minor-version) == 4.0 ]]; then
-		replace-flags -Os -O2
-	fi
-
-	echo "${D}/usr" > conf-root
-	echo "$(tc-getCC) ${CFLAGS}" > conf-cc
-	echo "$(tc-getCC) ${LDFLAGS}" > conf-ld
+	echo "${D}/usr" > conf-root || die
+	echo "$(tc-getCC) ${CFLAGS}" > conf-cc || die
+	echo "$(tc-getCC) ${LDFLAGS}" > conf-ld || die
 }
 
 src_install() {
-	emake setup check || die
-	dodoc CHANGES README
+	emake setup check
+	einstalldocs
 	doman maildir.1 safecat.1
 }


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-mail/safecat/files/, net-mail/safecat/
@ 2024-06-15 22:03 Robin H. Johnson
  0 siblings, 0 replies; 2+ messages in thread
From: Robin H. Johnson @ 2024-06-15 22:03 UTC (permalink / raw
  To: gentoo-commits

commit:     69ef13ef2d97eecefe30c83a4dfcca76732c0f71
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 15 21:59:21 2024 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sat Jun 15 22:03:05 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=69ef13ef

net-mail/safecat: EAPI 8 bump, some fixes

This does not include a full suite of Clang fixes, due to upstream's C
coding style: significant work to fix all of the prototypes in this code
base, and align with modern types.

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
Closes: https://bugs.gentoo.org/show_bug.cgi?id=725030
Closes: https://bugs.gentoo.org/show_bug.cgi?id=836088

 .../files/safecat-1.13-dup-obj-makefile.patch      | 39 +++++++++
 net-mail/safecat/files/safecat-1.13-include.patch  | 97 ++++++++++++++++++++++
 ...{safecat-1.13.ebuild => safecat-1.13-r1.ebuild} | 20 +++--
 net-mail/safecat/safecat-1.13.ebuild               |  7 +-
 4 files changed, 150 insertions(+), 13 deletions(-)

diff --git a/net-mail/safecat/files/safecat-1.13-dup-obj-makefile.patch b/net-mail/safecat/files/safecat-1.13-dup-obj-makefile.patch
new file mode 100644
index 000000000000..b276bb7ff709
--- /dev/null
+++ b/net-mail/safecat/files/safecat-1.13-dup-obj-makefile.patch
@@ -0,0 +1,39 @@
+https://bugs.gentoo.org/740798
+https://cgit.freebsd.org/ports/plain/sysutils/safecat/files/patch-Makefile    
+
+    sysutils/safecat: avoid duplicating object files in library
+    
+    Previously byte_copy.o and str_len.o were added to str.a, and then
+    specified as objects on the safecat link command line along with str.
+    When linking with lld this produces duplicate symbol errors like:
+    
+    /usr/bin/ld: error: duplicate symbol: byte_copy
+    >>> defined at byte_copy.c
+    >>>            byte_copy.o:(byte_copy) in archive str.a
+    >>> defined at byte_copy.c
+    >>>            byte_copy.o(.text+0x0)
+    
+    As these symbols are provided by str.a just avoid listing the object
+    files as well.
+--- safecat-1.13/Makefile.orig	2004-08-16 20:50:09.000000000 -0400
++++ safecat-1.13/Makefile	2017-11-23 16:49:00.505811000 -0500
+@@ -219,14 +219,14 @@
+ 
+ safecat: \
+ load safecat.o getln.a str.a stralloc.a strerr.a substdio.a alloc.o \
+-alloc_re.o byte_copy.o byte_cr.o envread.o error.o error_str.o fmt_uint64.o \
+-hostname.o sig.o stat_dir.o str_diffn.o str_len.o substdio_copy.o \
++alloc_re.o byte_cr.o envread.o error.o error_str.o fmt_uint64.o \
++hostname.o sig.o stat_dir.o str_diffn.o substdio_copy.o \
+ substdi.o substdio.o taia_fmtfrac.o taia_now.o taia_tai.o tempfile.o \
+ writefile.o
+-	./load safecat getln.a str.a stralloc.a strerr.a substdio.a \
+-	alloc.o alloc_re.o byte_copy.o byte_cr.o envread.o error.o \
++	./load safecat getln.a stralloc.a strerr.a substdio.a str.a \
++	alloc.o alloc_re.o byte_cr.o envread.o error.o \
+ 	error_str.o fmt_uint64.o hostname.o sig.o stat_dir.o str_diffn.o \
+-	str_len.o substdi.o substdio.o substdio_copy.o taia_fmtfrac.o \
++	substdi.o substdio.o substdio_copy.o taia_fmtfrac.o \
+ 	taia_now.o taia_tai.o tempfile.o writefile.o
+ 
+ safecat.0: \

diff --git a/net-mail/safecat/files/safecat-1.13-include.patch b/net-mail/safecat/files/safecat-1.13-include.patch
new file mode 100644
index 000000000000..f59f2a45d230
--- /dev/null
+++ b/net-mail/safecat/files/safecat-1.13-include.patch
@@ -0,0 +1,97 @@
+diff '--color=auto' -Nuar safecat-1.13.orig/install.c safecat-1.13/install.c
+--- safecat-1.13.orig/install.c	2000-02-28 20:10:12.000000000 -0800
++++ safecat-1.13/install.c	2024-06-15 14:40:24.142699634 -0700
+@@ -1,3 +1,10 @@
++#include <sys/types.h>
++#include <sys/stat.h>
++#include <errno.h>
++#include <fcntl.h>
++#include <signal.h>
++#include <stdlib.h>
++#include <unistd.h>
+ #include "substdio.h"
+ #include "strerr.h"
+ #include "error.h"
+diff '--color=auto' -Nuar safecat-1.13.orig/instcheck.c safecat-1.13/instcheck.c
+--- safecat-1.13.orig/instcheck.c	2000-02-28 20:10:12.000000000 -0800
++++ safecat-1.13/instcheck.c	2024-06-15 14:40:27.502696776 -0700
+@@ -1,5 +1,12 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#include <errno.h>
++#include <fcntl.h>
++#include <signal.h>
++#include <stdlib.h>
++#include <unistd.h>
++#include <sys/types.h>
++#include <sys/stat.h>
+ #include "strerr.h"
+ #include "error.h"
+ #include "readwrite.h"
+diff '--color=auto' -Nuar safecat-1.13.orig/safecat.c safecat-1.13/safecat.c
+--- safecat-1.13.orig/safecat.c	2004-08-16 18:14:34.000000000 -0700
++++ safecat-1.13/safecat.c	2024-06-15 14:40:17.246038832 -0700
+@@ -23,6 +23,7 @@
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <signal.h>
++#include <stdlib.h>
+ #include <unistd.h>
+ 
+ /* Support for large files (on Linux systems, if the appropriate
+--- safecat-1.13.orig/alloc.c	2000-02-28 20:10:12.000000000 -0800
++++ safecat-1.13/alloc.c	2024-06-15 14:41:26.985979033 -0700
+@@ -1,7 +1,6 @@
++#include <stdlib.h>
+ #include "alloc.h"
+ #include "error.h"
+-extern char *malloc();
+-extern void free();
+ 
+ #define ALIGNMENT 16 /* XXX: assuming that this alignment is enough */
+ #define SPACE 4096 /* must be multiple of ALIGNMENT */
+@@ -18,7 +17,7 @@
+   char *x;
+   n = ALIGNMENT + n - (n & (ALIGNMENT - 1)); /* XXX: could overflow */
+   if (n <= avail) { avail -= n; return space + avail; }
+-  x = malloc(n);
++  x = (char*)malloc(n);
+   if (!x) errno = error_nomem;
+   return x;
+ }
+--- safecat-1.13.orig/readwrite.h	2024-06-15 14:46:41.472362482 -0700
++++ safecat-1.13/readwrite.h	2024-06-15 14:46:21.755714187 -0700
+@@ -1,7 +1,8 @@
+ #ifndef READWRITE_H
+ #define READWRITE_H
+ 
+-extern int read();
+-extern int write();
++#include <unistd.h>
++//extern int read();
++//extern int write();
+ 
+ #endif
+--- safecat-1.13/stralloc.h	2000-02-28 20:10:12.000000000 -0800
++++ safecat-1.13/stralloc.h	2024-06-15 14:55:46.678492988 -0700
+@@ -7,14 +7,14 @@
+ 
+ extern int stralloc_ready();
+ extern int stralloc_readyplus();
+-extern int stralloc_copy();
+-extern int stralloc_cat();
++extern int stralloc_copy(stralloc *sato, stralloc *safrom);
++extern int stralloc_cat(stralloc *sato, stralloc *safrom);
+ extern int stralloc_copys();
+-extern int stralloc_cats();
+-extern int stralloc_copyb();
+-extern int stralloc_catb();
++extern int stralloc_cats(stralloc *sa, char *s);
++extern int stralloc_copyb(stralloc *sa, char *s, unsigned int n);
++extern int stralloc_catb(stralloc *sa, char *s, unsigned int n);
+ extern int stralloc_append(); /* beware: this takes a pointer to 1 char */
+-extern int stralloc_starts();
++extern int stralloc_starts(stralloc *sa, char *s);
+ 
+ #define stralloc_0(sa) stralloc_append(sa,"")
+ 

diff --git a/net-mail/safecat/safecat-1.13.ebuild b/net-mail/safecat/safecat-1.13-r1.ebuild
similarity index 74%
copy from net-mail/safecat/safecat-1.13.ebuild
copy to net-mail/safecat/safecat-1.13-r1.ebuild
index 7dbf9cc60c48..5ceefb07bb67 100644
--- a/net-mail/safecat/safecat-1.13.ebuild
+++ b/net-mail/safecat/safecat-1.13-r1.ebuild
@@ -1,7 +1,7 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=6
+EAPI=8
 
 inherit toolchain-funcs
 
@@ -11,12 +11,10 @@ SRC_URI="http://www.jeenyus.net/linux/software/${PN}/${P}.tar.gz"
 
 LICENSE="BSD"
 SLOT="0"
-KEYWORDS="amd64 ~hppa ~mips ppc ~sparc x86"
-IUSE=""
+KEYWORDS="~amd64 ~hppa ~mips ~ppc ~sparc ~x86"
 RESTRICT="test"
 
 DEPEND="sys-apps/groff"
-RDEPEND=""
 
 PATCHES=(
 	# applying maildir-patch
@@ -25,24 +23,28 @@ PATCHES=(
 	"${FILESDIR}"/${P}-makefile.patch
 	# Fix POSIX head/tail syntax
 	"${FILESDIR}"/${P}-head-tail-POSIX.patch
+	# Fix dup objects
+	"${FILESDIR}"/${P}-dup-obj-makefile.patch
+	# Headers
+	"${FILESDIR}"/${P}-include.patch
 )
 
 src_prepare() {
 	default
 
 	sed -ni '/man\|doc/!p' hier.c || die
-
-	# Fix implicit decleration
-	sed '/include <signal.h>/ a #include <stdlib.h>' -i safecat.c || die
 }
 
 src_configure() {
-	echo "${D}/usr" > conf-root || die
+	echo "/usr" > conf-root || die
 	echo "$(tc-getCC) ${CFLAGS}" > conf-cc || die
 	echo "$(tc-getCC) ${LDFLAGS}" > conf-ld || die
+	echo "$(tc-getAR)" > conf-ar || die
 }
 
 src_install() {
+	# ${D} is not valid in src_configure
+	echo "${D}/usr" > conf-root || die
 	emake setup check
 	einstalldocs
 	doman maildir.1 safecat.1

diff --git a/net-mail/safecat/safecat-1.13.ebuild b/net-mail/safecat/safecat-1.13.ebuild
index 7dbf9cc60c48..f8fa413f269e 100644
--- a/net-mail/safecat/safecat-1.13.ebuild
+++ b/net-mail/safecat/safecat-1.13.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
@@ -12,11 +12,9 @@ SRC_URI="http://www.jeenyus.net/linux/software/${PN}/${P}.tar.gz"
 LICENSE="BSD"
 SLOT="0"
 KEYWORDS="amd64 ~hppa ~mips ppc ~sparc x86"
-IUSE=""
 RESTRICT="test"
 
 DEPEND="sys-apps/groff"
-RDEPEND=""
 
 PATCHES=(
 	# applying maildir-patch
@@ -37,12 +35,13 @@ src_prepare() {
 }
 
 src_configure() {
-	echo "${D}/usr" > conf-root || die
+	echo "/usr" > conf-root || die
 	echo "$(tc-getCC) ${CFLAGS}" > conf-cc || die
 	echo "$(tc-getCC) ${LDFLAGS}" > conf-ld || die
 }
 
 src_install() {
+	echo "${D}/usr" > conf-root || die
 	emake setup check
 	einstalldocs
 	doman maildir.1 safecat.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-06-15 22:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-15 22:03 [gentoo-commits] repo/gentoo:master commit in: net-mail/safecat/files/, net-mail/safecat/ Robin H. Johnson
  -- strict thread matches above, loose matches on Subject: below --
2018-01-03 18:39 David Seifert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox