diff --git a/sysutils/incron/Makefile b/sysutils/incron/Makefile index 3e804faea4e8b..4aec6aca618bd 100644 --- a/sysutils/incron/Makefile +++ b/sysutils/incron/Makefile @@ -15,27 +15,29 @@ LICENSE_FILE_MIT= ${WRKSRC}/LICENSE-X11 LIB_DEPENDS= libinotify.so:devel/libinotify -USES= compiler +USES= compiler localbase:ldflags USE_GITHUB= yes GH_ACCOUNT= ar- GH_TAGNAME= 81421d3a8bde0989d7e167d8a814d5232896c930 -CPPFLAGS+= -I${LOCALBASE}/include -D__NR_inotify_init -LDFLAGS+= -L${LOCALBASE}/lib -linotify +USE_RC_SUBR= ${PORTNAME} + MAKE_ARGS= PREFIX="${PREFIX}" USER=${UID} \ DOCDIR="${PREFIX}/etc" \ MANPATH=${MANPREFIX}/man -USE_RC_SUBR= ${PORTNAME} + +CPPFLAGS+= -D__NR_inotify_init +LDFLAGS+= -linotify .include +.if ${OPSYS} == FreeBSD && ( ${OSVERSION} >= 1400079 || ( ${OSVERSION} >= 1302505 && ${OSVERSION} < 1400000 )) +EXTRA_PATCHES= ${FILESDIR}/extra-patch-FreeBSD_14 +.endif + post-patch: ${REINPLACE_CMD} -e 's,/etc/incron,${PREFIX}/etc/incron,' \ ${WRKSRC}/*conf* ${WRKSRC}/Makefile ${WRKSRC}/*.[158h] \ ${WRKSRC}/*.cpp ${REINPLACE_CMD} -e '/INITDIR/d' ${WRKSRC}/Makefile -.if ${CHOSEN_COMPILER_TYPE} == gcc && ${COMPILER_VERSION} <= 42 - ${REINPLACE_CMD} -e '/pragma/d' ${WRKSRC}/inotify-cxx.cpp \ - ${WRKSRC}/usertable.cpp -.endif .include diff --git a/sysutils/incron/files/extra-patch-FreeBSD_14 b/sysutils/incron/files/extra-patch-FreeBSD_14 new file mode 100644 index 0000000000000..9d2606f8e8a7d --- /dev/null +++ b/sysutils/incron/files/extra-patch-FreeBSD_14 @@ -0,0 +1,20 @@ +--- usertable.cpp.orig 2023-06-10 14:06:49 UTC ++++ usertable.cpp +@@ -571,17 +571,6 @@ bool UserTable::MayAccess(const std::string& rPath, bo + return false; // no access right found + } + +-#ifndef __linux__ +-static int +-clearenv(void) +-{ +- extern char **environ; +- +- environ[0] = NULL; +- return 0; +-} +-#endif +- + void UserTable::RunAsUser(std::string cmd) const + { + struct passwd* pwd = getpwnam(m_user.c_str());