diff --git a/devel/chrpath/Makefile b/devel/chrpath/Makefile index e54228ad9188..ff43f038f026 100644 --- a/devel/chrpath/Makefile +++ b/devel/chrpath/Makefile @@ -1,31 +1,34 @@ PORTNAME= chrpath -PORTVERSION= 0.16 -PORTREVISION= 1 +PORTVERSION= 0.18 CATEGORIES= devel sysutils MASTER_SITES= DEBIAN_POOL DISTNAME= ${PORTNAME}_${PORTVERSION}.orig -MAINTAINER= ports@FreeBSD.org +MAINTAINER= rodrigo@FreeBSD.org COMMENT= Tool to modify DT_RPATH in existing ELF binaries - -WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION} +WWW= https://codeberg.org/pere/chrpath/ LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/COPYING -USES= gmake +USES= autoreconf gmake GNU_CONFIGURE= yes -GNU_CONFIGURE_MANPREFIX=${PREFIX}/share -PLIST_FILES= bin/chrpath share/man/man1/chrpath.1.gz +DOCSDIR= ${PREFIX}/share/doc/${PORTNAME} + +WRKSRC= ${WRKDIR}/${PORTNAME} + PORTDOCS= AUTHORS ChangeLog NEWS README OPTIONS_DEFINE= DOCS post-install-DOCS-on: @${MKDIR} ${STAGEDIR}${DOCSDIR} .for i in ${PORTDOCS} ${INSTALL_DATA} ${WRKSRC}/${i} ${STAGEDIR}${DOCSDIR} .endfor +do-test: + cd ${BUILD_WRKSRC} && ${DO_MAKE_BUILD} check + .include diff --git a/devel/chrpath/distinfo b/devel/chrpath/distinfo index 87503d69e8e0..4882221e551b 100644 --- a/devel/chrpath/distinfo +++ b/devel/chrpath/distinfo @@ -1,2 +1,3 @@ -SHA256 (chrpath_0.16.orig.tar.gz) = bb0d4c54bac2990e1bdf8132f2c9477ae752859d523e141e72b3b11a12c26e7b -SIZE (chrpath_0.16.orig.tar.gz) = 134506 +TIMESTAMP = 1740158279 +SHA256 (chrpath_0.18.orig.tar.gz) = f09c49f0618660ca11fc6d9580ddde904c7224d4c6d0f6f2d1f9bcdc9102c9aa +SIZE (chrpath_0.18.orig.tar.gz) = 52095 diff --git a/devel/chrpath/files/patch-Makefile.am b/devel/chrpath/files/patch-Makefile.am new file mode 100644 index 000000000000..926ce6529681 --- /dev/null +++ b/devel/chrpath/files/patch-Makefile.am @@ -0,0 +1,10 @@ +--- Makefile.am.orig 2025-02-23 10:11:45 UTC ++++ Makefile.am +@@ -1,6 +1,6 @@ + SUBDIRS = testsuite deb + +-docdir = $(prefix)/doc/$(PACKAGE)-$(VERSION) ++docdir = $(prefix)/share/doc/$(PACKAGE) + + doc_DATA = AUTHORS COPYING ChangeLog INSTALL NEWS README + diff --git a/devel/chrpath/files/patch-Makefile.in b/devel/chrpath/files/patch-Makefile.in deleted file mode 100644 index 30f3dd2fc3ba..000000000000 --- a/devel/chrpath/files/patch-Makefile.in +++ /dev/null @@ -1,31 +0,0 @@ ---- Makefile.in.orig 2014-01-12 09:03:45.000000000 +0100 -+++ Makefile.in 2016-02-03 19:32:36.764942000 +0100 -@@ -243,7 +243,7 @@ - builddir = @builddir@ - datadir = @datadir@ - datarootdir = @datarootdir@ --docdir = $(prefix)/doc/$(PACKAGE)-$(VERSION) -+docdir = $(prefix)/share/doc/$(PACKAGE) - dvidir = @dvidir@ - exec_prefix = @exec_prefix@ - host = @host@ -@@ -457,19 +457,6 @@ - dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) - install-docDATA: $(doc_DATA) - @$(NORMAL_INSTALL) -- @list='$(doc_DATA)'; test -n "$(docdir)" || list=; \ -- if test -n "$$list"; then \ -- echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \ -- $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \ -- fi; \ -- for p in $$list; do \ -- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ -- echo "$$d$$p"; \ -- done | $(am__base_list) | \ -- while read files; do \ -- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \ -- $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \ -- done - - uninstall-docDATA: - @$(NORMAL_UNINSTALL) diff --git a/devel/chrpath/files/patch-chrpath.c b/devel/chrpath/files/patch-chrpath.c new file mode 100644 index 000000000000..ca4b9690f331 --- /dev/null +++ b/devel/chrpath/files/patch-chrpath.c @@ -0,0 +1,28 @@ +--- chrpath.c.orig 2025-02-22 12:22:26 UTC ++++ chrpath.c +@@ -60,9 +60,9 @@ + * Reads the section names table from an ELF file into memory + */ + char* +-read_section_names(int fd, Elf_Ehdr ehdr) ++read_section_names(int fd, absElf_Ehdr ehdr) + { +- Elf_Shdr shdr; ++ absElf_Shdr shdr; + + const size_t sz_shdr = is_e32() ? sizeof(Elf32_Shdr) : sizeof(Elf64_Shdr); + const size_t sh_off = EHDRWU(e_shoff); +@@ -122,10 +122,10 @@ + chrpath(const char *filename, const char *newpath, int convert) + { + int fd; +- Elf_Ehdr ehdr; ++ absElf_Ehdr ehdr; + int i; +- Elf_Phdr phdr; +- Elf_Shdr shdr; ++ absElf_Phdr phdr; ++ absElf_Shdr shdr; + void *dyns; + int rpathoff; + char * strtab; diff --git a/devel/chrpath/files/patch-elf.c b/devel/chrpath/files/patch-elf.c new file mode 100644 index 000000000000..35aaa1383e36 --- /dev/null +++ b/devel/chrpath/files/patch-elf.c @@ -0,0 +1,20 @@ +--- elf.c.orig 2025-02-22 12:27:36 UTC ++++ elf.c +@@ -48,7 +48,7 @@ + } + + int +-elf_open(const char *filename, int flags, Elf_Ehdr *ehdr) ++elf_open(const char *filename, int flags, absElf_Ehdr *ehdr) + { + int fd; + size_t sz_ehdr; +@@ -105,7 +105,7 @@ + } + + int +-elf_find_dynamic_section(int fd, Elf_Ehdr *ehdr, Elf_Phdr *phdr) ++elf_find_dynamic_section(int fd, absElf_Ehdr *ehdr, absElf_Phdr *phdr) + { + int i; + if (lseek(fd, EHDR_PWU(e_phoff), SEEK_SET) == -1) diff --git a/devel/chrpath/files/patch-killrpath.c b/devel/chrpath/files/patch-killrpath.c new file mode 100644 index 000000000000..2b7e4c214c66 --- /dev/null +++ b/devel/chrpath/files/patch-killrpath.c @@ -0,0 +1,14 @@ +--- killrpath.c.orig 2025-02-22 12:25:43 UTC ++++ killrpath.c +@@ -37,9 +37,9 @@ + killrpath(const char *filename) + { + int fd; +- Elf_Ehdr ehdr; ++ absElf_Ehdr ehdr; + int i; +- Elf_Phdr phdr; ++ absElf_Phdr phdr; + void *dyns; + int dynpos; + diff --git a/devel/chrpath/files/patch-protos.h b/devel/chrpath/files/patch-protos.h index fd827fe6a78f..a37fc77f3540 100644 --- a/devel/chrpath/files/patch-protos.h +++ b/devel/chrpath/files/patch-protos.h @@ -1,30 +1,39 @@ ---- protos.h.orig 2013-11-24 08:30:01.000000000 +0100 -+++ protos.h 2016-02-03 19:47:21.946096000 +0100 -@@ -1,7 +1,14 @@ - #ifndef PROTOS_H - #define PROTOS_H - -+#if defined __FreeBSD__ || defined __DragonFly__ -+#include -+#define bswap_16 bswap16 -+#define bswap_32 bswap32 -+#define bswap_64 bswap64 -+#else - #include -+#endif - #include - #include "config.h" +--- protos.h.orig 2024-10-31 16:19:27 UTC ++++ protos.h +@@ -33,17 +33,17 @@ + unsigned char e_ident[EI_NIDENT]; + Elf32_Ehdr e32; + Elf64_Ehdr e64; +-} Elf_Ehdr; ++} absElf_Ehdr; -@@ -14,6 +21,12 @@ - #error "Unknown word size (SIZEOF_VOID_P)!" - #endif + typedef union { + Elf32_Shdr e32; + Elf64_Shdr e64; +-} Elf_Shdr; ++} absElf_Shdr; -+#if defined __FreeBSD__ || defined __DragonFly__ -+#define Elf_Ehdr Elf__Ehdr -+#define Elf_Shdr Elf__Shdr -+#define Elf_Phdr Elf__Phdr -+#endif -+ typedef union { - unsigned char e_ident[EI_NIDENT]; - Elf32_Ehdr e32; + Elf32_Phdr e32; + Elf64_Phdr e64; +-} Elf_Phdr; ++} absElf_Phdr; + + int is_e32(void); + int swap_bytes(void); +@@ -70,12 +70,12 @@ + int killrpath(const char *filename); + int chrpath(const char *filename, const char *newpath, int convert); + +-char* read_section_names(int fd, Elf_Ehdr ehdr); ++char* read_section_names(int fd, absElf_Ehdr ehdr); + char* get_section_name(int name_off, char* section_names); + +-int elf_open(const char *filename, int flags, Elf_Ehdr *ehdr); ++int elf_open(const char *filename, int flags, absElf_Ehdr *ehdr); + void elf_close(int fd); +-int elf_find_dynamic_section(int fd, Elf_Ehdr *ehdr, Elf_Phdr *phdr); ++int elf_find_dynamic_section(int fd, absElf_Ehdr *ehdr, absElf_Phdr *phdr); + const char *elf_tagname(int tag); + int elf_dynpath_tag(int tag); + diff --git a/devel/chrpath/files/patch-testsuite__Makefile.am b/devel/chrpath/files/patch-testsuite__Makefile.am new file mode 100644 index 000000000000..f01de0d16035 --- /dev/null +++ b/devel/chrpath/files/patch-testsuite__Makefile.am @@ -0,0 +1,11 @@ +--- ./testsuite/Makefile.am.orig 2025-02-21 17:33:44 UTC ++++ ./testsuite/Makefile.am +@@ -12,7 +12,7 @@ + EXTRA_DIST = runtest.sh + + prog: prog.c +- $(CC) $(RPATH) -o $@ $< ++ $(CC) -Wl,$(RPATH) -o $@ $< + + check: $(CHRPATH) + $(srcdir)/runtest.sh diff --git a/devel/chrpath/files/patch-testsuite__Makefile.in b/devel/chrpath/files/patch-testsuite__Makefile.in deleted file mode 100644 index 302f5bf4feb3..000000000000 --- a/devel/chrpath/files/patch-testsuite__Makefile.in +++ /dev/null @@ -1,11 +0,0 @@ ---- testsuite/Makefile.in.orig 2014-01-12 09:03:45.000000000 +0100 -+++ testsuite/Makefile.in 2016-02-03 19:34:07.381487000 +0100 -@@ -457,7 +457,7 @@ - - - prog: prog.c -- $(CC) $(RPATH) -o $@ $< -+ $(CC) -Wl,$(RPATH) -o $@ $< - - check: $(CHRPATH) - $(srcdir)/runtest.sh diff --git a/devel/chrpath/files/patch-testsuite__runtest.sh b/devel/chrpath/files/patch-testsuite__runtest.sh new file mode 100644 index 000000000000..e8fa0efbe8bd --- /dev/null +++ b/devel/chrpath/files/patch-testsuite__runtest.sh @@ -0,0 +1,11 @@ +--- testsuite/runtest.sh.orig 2025-02-22 12:45:08 UTC ++++ testsuite/runtest.sh +@@ -7,7 +7,7 @@ + retval=0 + + rm prog +-make prog ++gmake prog + + if $CHRPATH -h ; then + echo "success: chrpath -h worked." diff --git a/devel/chrpath/pkg-plist b/devel/chrpath/pkg-plist new file mode 100644 index 000000000000..7720a33cd5bf --- /dev/null +++ b/devel/chrpath/pkg-plist @@ -0,0 +1,4 @@ +bin/chrpath +share/man/man1/chrpath.1.gz +%%PORTDOCS%%%%DOCSDIR%%/COPYING +%%PORTDOCS%%%%DOCSDIR%%/INSTALL