diff --git a/README.md b/README.md index 8f77bd4..a5a0eb0 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,12 @@ MacOS ```brew install gettext && brew install openssl``` To compile on mac you need to edit the Makefile to point to openssl@3 within the homebrew install dir +FreeBSD +``` +pkg install gettext +``` +FreeBSD includes OpenSSL in base, it only requires to install gettext via ports or pkg. A custom BSDmakefile is provided for build and installation. + ## Author Alexia Michelle diff --git a/src/BSDmakefile b/src/BSDmakefile new file mode 100644 index 0000000..d70183b --- /dev/null +++ b/src/BSDmakefile @@ -0,0 +1,47 @@ +# Makefile for sslcheck +# https://github.com/alexiarstein/sslcheck +# If you're building on macOS, be sure to install gettext and openssl. +# Maintained by Alexia Michelle +# Modified by Joel Pelaez Jorge for FreeBSD + +CC = cc +CFLAGS = -Wall -O2 -I/usr/local/include +LDFLAGS = -L/usr/local/lib +LIBS = -lssl -lcrypto -lintl + +OUTPUT = sslcheck +SOURCES = sslcheck.c + +UNAME_S := $(shell uname -s) +PREFIX = /usr/local +DOMAIN = sslcheck +LOCALEDIR = ${PREFIX}/share/locale +BINDIR = ${PREFIX}/bin +POFILES = es fr en it + +all: sslcheck mo + +sslcheck: sslcheck.c + @echo "Compiling for: ${UNAME_S}" + ${CC} ${CFLAGS} -DLOCALE_PATH=\"${LOCALEDIR}\" -o ${OUTPUT} ${SOURCES} ${LDFLAGS} ${LIBS} + +mo: + @echo "Compiling translation files..." + @for lang in ${POFILES}; do \ + echo " $$lang"; \ + msgfmt $$lang.po -o $$lang.mo; \ + done + +install: all + @echo "Installing binary to ${BINDIR}" + @mkdir -p ${DESTDIR}${BINDIR} + install -m 755 sslcheck ${DESTDIR}${BINDIR}/sslcheck + @echo "Installing locales to ${LOCALEDIR}" + @for lang in ${POFILES}; do \ + mkdir -p ${DESTDIR}${LOCALEDIR}/$$lang/LC_MESSAGES; \ + install -m 644 $$lang.mo ${DESTDIR}${LOCALEDIR}/$$lang/LC_MESSAGES/${DOMAIN}.mo; \ + done + +clean: + @rm -f sslcheck *.mo *~ + @echo "Clean complete." diff --git a/src/sslcheck.h b/src/sslcheck.h index 32e161d..094bc61 100644 --- a/src/sslcheck.h +++ b/src/sslcheck.h @@ -3,7 +3,9 @@ // Header file #define _(STRING) gettext(STRING) +#ifndef LOCALE_PATH #define LOCALE_PATH "/usr/share/locale" +#endif #define VERSION "1.2.0" #define AUTHOR "Alexia Michelle "