I haven't posted here in a while. I took a break from BSD and came back on fire for it. Last week I re-wrote parts of an old Linux app to work with FreeBSD and Python 3 vs 2. I was very happy how it turned out and wondered if I could make it into a port. I had never tired anything like this before, but made a folder at /usr/ports/security/theZoo on my local machine. Inside it I have this in distinfo:
This is my Makefile:
I haven't added it yet, but sqlite3 will also needed to be installed with pip. The problem is that when I try to build it I get:
You can probably see from this it starts to look for a Makefile, distinfo, etc. in /usr/ports/security/theZoo/work/theZoo-0.60 instead of /usr/ports/security/theZoo as it should. Once you put all those files in /usr/ports/security/theZoo/work/theZoo-0.60 it creates another work folder in there and restarts the whole process again, leading to an infinite loop of folders and unfinished builds. I tried looking in the online handbook and with portlint, but only saw some warnings that appeared to be unrelated:
If anyone wants to see the code before downloading it, the source can be found here, but I feel this is just an issue with the Makefile. I feel like if I could just get past this issue I could finish and do more of these. Does anyone know why this is happening? Or how I could fix it?
Code:
TIMESTAMP = 1697549012
SHA256 (theZoo-0.60.tar.gz) = 6d8022e79d7f750ce112bbbb1734c8e82e7a7d6821792d619c507c508249b47d
SIZE (theZoo-0.60.tar.gz) = 919235180
This is my Makefile:
Code:
PORTNAME= theZoo
PORTVERSION= 0.60
CATEGORIES= security
MASTER_SITES= https://teamsloth.net/
MAINTAINER= notmyemail@gmail.com
COMMENT= Malware Research
WWW= https://thezoo.morirt.com
LICENSE= GPLv3
PVERS != pkg info -x python | perl -p -e 's/python3/python3\./g' | awk -F- '{ print $$1}'
FETCH_DEPENDS+= curl:ftp/curl
WRKSRC = ${WRKDIR}/${DISTNAME}
INSTALL_DIR = /usr/local/bin
LOCALBASE = /usr/local
PREFIX = /usr/local/etc
do-install: all
pip install --no-warn-script-location -r ${WRKSRC}/requirements.txt
install -m 755 ${WRKSRC}/theZoo.py ${INSTALL_DIR}/theZoo
${MKDIR} ${PREFIX}/theZoo/
${CP} -a ${WRKSRC}/imports ${LOCALBASE}/lib/$(PVERS)/site-packages/
${CP} -a ${WRKSRC}/conf ${PREFIX}/theZoo/
${CP} -a ${WRKSRC}/malware ${PREFIX}/theZoo/
${CP} ${WRKSRC}/*.md ${PREFIX}/theZoo
deinstall:
${RM} -f ${INSTALL_DIR}/theZoo
${RM} -rf ${WRKDIR}
${RM} -rf ${LOCALBASE}/lib/${PVERS}/site-packages/imports
clean: install
${RM} -rf work
.include <bsd.port.mk>
I haven't added it yet, but sqlite3 will also needed to be installed with pip. The problem is that when I try to build it I get:
Code:
# make
===> License GPLv3 accepted by the user
===> theZoo-0.60 depends on file: /usr/local/sbin/pkg - found
===> theZoo-0.60 depends on executable: curl - found
===> Fetching all distfiles required by theZoo-0.60 for building
===> Extracting for theZoo-0.60
=> SHA256 Checksum OK for theZoo-0.60.tar.gz.
===> Patching for theZoo-0.60
===> Configuring for theZoo-0.60
===> Building for theZoo-0.60
--- show-dev-warnings ---
/!\ theZoo-0.60: Makefile warnings, please consider fixing /!\
Not validating first entry in CATEGORIES due to being outside of PORTSDIR.
Please ensure this is proper when committing.
--- check-vulnerable ---
--- check-license ---
===> License GPLv3 accepted by the user
--- pkg-depends ---
===> theZoo-0.60 depends on file: /usr/local/sbin/pkg - found
--- fetch-depends ---
===> theZoo-0.60 depends on executable: curl - found
--- do-fetch ---
--- fetch-specials ---
===> Fetching all distfiles required by theZoo-0.60 for building
--- extract-message ---
===> Extracting for theZoo-0.60
--- checksum ---
=> No checksum file (/usr/ports/security/theZoo/work/theZoo-0.60/distinfo).
*** [checksum] Error code 1
make[1]: stopped in /usr/ports/security/theZoo/work/theZoo-0.60
1 error
make[1]: stopped in /usr/ports/security/theZoo/work/theZoo-0.60
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1
Stop.
make: stopped in /usr/ports/security/theZoo
You can probably see from this it starts to look for a Makefile, distinfo, etc. in /usr/ports/security/theZoo/work/theZoo-0.60 instead of /usr/ports/security/theZoo as it should. Once you put all those files in /usr/ports/security/theZoo/work/theZoo-0.60 it creates another work folder in there and restarts the whole process again, leading to an infinite loop of folders and unfinished builds. I tried looking in the online handbook and with portlint, but only saw some warnings that appeared to be unrelated:
Code:
# portlint
WARN: Makefile: [15]: possible direct use of command "awk" found. use ${AWK} instead.
WARN: Makefile: [23]: possible direct use of command "install" found. use ${INSTALL_foobar} instead.
WARN: Makefile: [25]: possible direct use of command "install" found. use ${INSTALL_foobar} instead.
WARN: Makefile: [36]: possible direct use of command "install" found. use ${INSTALL_foobar} instead.
WARN: Makefile: [15]: possible direct use of command "python" found. use ${PYTHON_CMD} instead.
WARN: Makefile: [15]: possible direct use of command "perl" found. use ${PERL} instead.
WARN: Makefile: possible use of absolute pathname "/usr/local/bin".
WARN: Makefile: possible use of absolute pathname "/usr/local".
WARN: Makefile: possible use of absolute pathname "/usr/local/etc".
WARN: Makefile: possible direct use of "INSTALL_DIR = /usr/local" found. if so, use ${PREFIX} or ${LOCALBASE}, as appropriate.
WARN: Makefile: possible direct use of "LOCALBASE = /usr/local" found. if so, use ${PREFIX} or ${LOCALBASE}, as appropriate.
WARN: Makefile: possible direct use of "PREFIX = /usr/local" found. if so, use ${PREFIX} or ${LOCALBASE}, as appropriate.
0 fatal errors and 12 warnings found.
If anyone wants to see the code before downloading it, the source can be found here, but I feel this is just an issue with the Makefile. I feel like if I could just get past this issue I could finish and do more of these. Does anyone know why this is happening? Or how I could fix it?