git: 4d3c08abcb26 - main - www/SNIP: New port

From: Muhammad Moinur Rahman <bofh_at_FreeBSD.org>
Date: Sun, 04 May 2025 18:45:12 UTC
The branch main has been updated by bofh:

URL: https://cgit.FreeBSD.org/ports/commit/?id=4d3c08abcb261f096f728e89b287fc955f1894bb

commit 4d3c08abcb261f096f728e89b287fc955f1894bb
Author:     Janky Jay, III <ek@purplehat.org>
AuthorDate: 2025-04-30 16:14:12 +0000
Commit:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2025-05-04 18:44:36 +0000

    www/SNIP: New port
    
    SNIP is a powerful Open-Source PHP Pastebin, with the aim of keeping
    a simple and easy to use user interface. SNIP allows you to easily
    share code and files with anyone you wish. Based on the original
    Stikked with lots of bug fixes and improvements.
    
    Prerequisites:
    * A web server: Apache, LiteSpeed, Nginx, Lighttpd, Cherokee.
    * A database: MySQL / MariaDB, Postgres. OR a writable folder for SQLite.
    * PHP version 7.0 or newer is required.
    * PHP-GD for the creation of QR-codes.
    
    Here are some features:
    * Syntax highlighting including live highlighting with CodeMirror
    * Paste replies
    * Diff view between the original paste and the reply
    * An API
    * Trending pastes
    * Encrypted pastes
    * Burn on reading
    * File upload and preview
    * Anti-Spam features
    * Multilanguage support
    * SNIP client with support for client side encryption/decryption: gostikkit
    * Another CLI tool requiring only curl program: pbin
    
    WWW: https://github.com/MercanoGlobal/SNIP
    
    PR: 281810
---
 www/Makefile                  |  1 +
 www/SNIP/Makefile             | 59 +++++++++++++++++++++++++++++++++++++++++++
 www/SNIP/distinfo             |  3 +++
 www/SNIP/files/pkg-message.in | 20 +++++++++++++++
 www/SNIP/pkg-descr            | 24 ++++++++++++++++++
 5 files changed, 107 insertions(+)

diff --git a/www/Makefile b/www/Makefile
index b8e680c02106..06c31b67e144 100644
--- a/www/Makefile
+++ b/www/Makefile
@@ -22,6 +22,7 @@
     SUBDIR += R-cran-shinyjs
     SUBDIR += R-cran-webshot
     SUBDIR += R-cran-webutils
+    SUBDIR += SNIP
     SUBDIR += UniversalFeedCreator
     SUBDIR += adguardhome
     SUBDIR += adjuster
diff --git a/www/SNIP/Makefile b/www/SNIP/Makefile
new file mode 100644
index 000000000000..9f7b1550b139
--- /dev/null
+++ b/www/SNIP/Makefile
@@ -0,0 +1,59 @@
+PORTNAME=	SNIP
+DISTVERSIONPREFIX=	v
+DISTVERSION=	1.1.0
+CATEGORIES=	www
+
+MAINTAINER=	ek@purplehat.org
+COMMENT=	SNIP is a powerful, simple, and easy to use Open-Source PHP Pastebin
+WWW=		https://github.com/MercanoGlobal/SNIP
+
+LICENSE=	GPLv3
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+USES=		php:web
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	MercanoGlobal
+
+USE_PHP=	ctype filter gd session
+
+NO_ARCH=	yes
+NO_BUILD=	yes
+
+SUB_FILES=	pkg-message
+PLIST_SUB+=	WWWGRP="${WWWGRP}" \
+		WWWOWN="${WWWOWN}"
+
+OPTIONS_DEFAULT=	MYSQLI
+OPTIONS_SINGLE=		DB
+OPTIONS_SINGLE_DB=	MYSQLI PGSQL SQLITE
+
+MYSQLI_DESC=	Install MySQLi Support for PHP
+
+MYSQLI_USE=	PHP=mysqli
+PGSQL_USES=	pgsql
+PGSQL_USE=	PHP=pgsql
+SQLITE_USES=	sqlite
+SQLITE_USE=	PHP=sqlite3
+
+do-install:
+	${MKDIR} ${STAGEDIR}${ETCDIR}
+	${MKDIR} ${STAGEDIR}${WWWDIR}
+	(cd ${WRKSRC}/htdocs && ${COPYTREE_SHARE} . ${STAGEDIR}${WWWDIR})
+	${FIND} ${STAGEDIR}${WWWDIR} -type f -iname "*.orig" -delete
+	${INSTALL_DATA} ${STAGEDIR}${WWWDIR}/application/config/snip.php.dist ${STAGEDIR}${ETCDIR}/snip.php.sample
+	${LN} -sf ${ETCDIR}/snip.php ${STAGEDIR}${WWWDIR}/application/config/
+
+post-install:
+	@${ECHO_CMD} "@owner ${WWWOWN}" >> ${TMPPLIST}
+	@${ECHO_CMD} "@group ${WWWGRP}" >> ${TMPPLIST}
+	${FIND} -s ${STAGEDIR}${ETCDIR} -not -type d | ${SORT} | \
+		${SED} -e 's#^${STAGEDIR}${ETCDIR}#${ETCDIR_REL}#' | \
+		${SED} -E -e '/sample$$/ s#^#@sample(,,0640) #;' >> ${TMPPLIST}
+	${FIND} -s ${STAGEDIR}${WWWDIR} -not -type d | ${SORT} | \
+		${SED} -e 's#^${STAGEDIR}${PREFIX}/##' | \
+		${SED} -E -e '/snip.php(\.dist)?/ s#^#@(,,0640) #;' >> ${TMPPLIST}
+	${FIND} -s ${STAGEDIR}${WWWDIR} -type d -exec echo "@dir {}" \; | ${SORT} | \
+		${SED} -e 's#^@dir ${STAGEDIR}${PREFIX}/#@dir #' >> ${TMPPLIST}
+
+.include <bsd.port.mk>
diff --git a/www/SNIP/distinfo b/www/SNIP/distinfo
new file mode 100644
index 000000000000..6d5aebe1c581
--- /dev/null
+++ b/www/SNIP/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1745194264
+SHA256 (MercanoGlobal-SNIP-v1.1.0_GH0.tar.gz) = 94c6461b7b7f4b823148bac47e9d7fa0510d593aa8fce5c6a70ccc0ddd2a6893
+SIZE (MercanoGlobal-SNIP-v1.1.0_GH0.tar.gz) = 15305696
diff --git a/www/SNIP/files/pkg-message.in b/www/SNIP/files/pkg-message.in
new file mode 100644
index 000000000000..cd4a6724162c
--- /dev/null
+++ b/www/SNIP/files/pkg-message.in
@@ -0,0 +1,20 @@
+[
+{ type: install
+  message: <<EOM
+The configuration file is in %%ETCDIR%%/snip.php
+
+This package contains a true_paste feature which has been sent
+upstream but has not yet been included.
+
+There are the minimal configuration items:
+
+Set driver to one of:
+
+* 'postgres'
+* 'mysqli'
+* 'sqlite'
+
+Set appropriate values in the 'Database connection' section.
+EOM
+}
+]
diff --git a/www/SNIP/pkg-descr b/www/SNIP/pkg-descr
new file mode 100644
index 000000000000..9dfe9a5699bb
--- /dev/null
+++ b/www/SNIP/pkg-descr
@@ -0,0 +1,24 @@
+SNIP is a powerful Open-Source PHP Pastebin, with the aim of keeping
+a simple and easy to use user interface. SNIP allows you to easily
+share code and files with anyone you wish. Based on the original
+Stikked with lots of bug fixes and improvements.
+
+Prerequisites:
+* A web server: Apache, LiteSpeed, Nginx, Lighttpd, Cherokee.
+* A database: MySQL / MariaDB, Postgres. OR a writable folder for SQLite.
+* PHP version 7.0 or newer is required.
+* PHP-GD for the creation of QR-codes.
+
+Here are some features:
+* Syntax highlighting including live highlighting with CodeMirror
+* Paste replies
+* Diff view between the original paste and the reply
+* An API
+* Trending pastes
+* Encrypted pastes
+* Burn on reading
+* File upload and preview
+* Anti-Spam features
+* Multilanguage support
+* SNIP client with support for client side encryption/decryption: gostikkit
+* Another CLI tool requiring only curl program: pbin