From nobody Sun Oct 31 16:09:15 2021 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 97DD5183197B; Sun, 31 Oct 2021 16:09:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hj1Lz2XGCz3kS0; Sun, 31 Oct 2021 16:09:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3758920942; Sun, 31 Oct 2021 16:09:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19VG9FBN014180; Sun, 31 Oct 2021 16:09:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19VG9FXJ014179; Sun, 31 Oct 2021 16:09:15 GMT (envelope-from git) Date: Sun, 31 Oct 2021 16:09:15 GMT Message-Id: <202110311609.19VG9FXJ014179@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Yasuhiro Kimura Subject: git: 670f7113501b - main - polish/napi: Add new port List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: yasu X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 670f7113501b81f3ea7ae1aca7c44fa335048b20 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by yasu: URL: https://cgit.FreeBSD.org/ports/commit/?id=670f7113501b81f3ea7ae1aca7c44fa335048b20 commit 670f7113501b81f3ea7ae1aca7c44fa335048b20 Author: Dominik Lisiak AuthorDate: 2021-10-31 15:44:19 +0000 Commit: Yasuhiro Kimura CommitDate: 2021-10-31 16:08:14 +0000 polish/napi: Add new port "napi.sh" is a napiprojekt.pl client written in Bash. The purpose of the project was to create simple tool for systems with very limited resources (NAS QNAP drives, Synology, OpenWRT routers, Popcorn streamers, etc). It was inspired by "pynapi.py" script. "napi.sh" is distributed together with automatic subtitle format converter "subotage.sh" created specially for "napi.sh". "subotage.sh" is written in Bash and uses awk for text processing. PR: 245996 --- polish/Makefile | 1 + polish/napi/Makefile | 56 +++++++++++++++++++++++ polish/napi/distinfo | 3 ++ polish/napi/files/patch-libs_libnapi__fs.sh | 29 ++++++++++++ polish/napi/files/patch-libs_libnapi__subs.sh | 16 +++++++ polish/napi/files/patch-libs_libnapi__wrappers.sh | 24 ++++++++++ polish/napi/pkg-descr | 10 ++++ polish/napi/pkg-plist | 23 ++++++++++ 8 files changed, 162 insertions(+) diff --git a/polish/Makefile b/polish/Makefile index 208f69285a27..76f6cae99dd4 100644 --- a/polish/Makefile +++ b/polish/Makefile @@ -10,6 +10,7 @@ SUBDIR += libreoffice SUBDIR += libtlen SUBDIR += mythes + SUBDIR += napi SUBDIR += qnapi SUBDIR += tleenx2 SUBDIR += trf diff --git a/polish/napi/Makefile b/polish/napi/Makefile new file mode 100644 index 000000000000..e6db02445bed --- /dev/null +++ b/polish/napi/Makefile @@ -0,0 +1,56 @@ +PORTNAME= napi +PORTVERSION= 2.0.1 +CATEGORIES= polish multimedia + +MAINTAINER= dominik.lisiak@bemsoft.pl +COMMENT= Command line subtitles downloader for napiprojekt.pl + +LICENSE= GPLv3 + +RUN_DEPENDS= 7z:archivers/p7zip \ + base64:converters/base64 \ + bash:shells/bash \ + mediainfo:multimedia/mediainfo \ + wget:ftp/wget + +USES= cmake shebangfix + +USE_GITLAB= yes +GL_ACCOUNT= hesperos +GL_PROJECT= ${PORTNAME} +GL_COMMIT= ac404649571e470bf9494f788bd8a74843956851 + +SHEBANG_GLOB= *.sh *.sh.in + +STRIP= +NO_ARCH= yes + +OPTIONS_DEFINE= COVER NFO RMORIG SUBRIP UTF8 + +COVER_DESC= Always try to download cover (-c) +NFO_DESC= Always try to download .nfo file (-n) +RMORIG_DESC= Always remove intermediate files (-d) +SUBRIP_DESC= Convert subtitles to SubRip (.srt) by default (-f subrip) +UTF8_DESC= Convert subtitles to UTF-8 by default (-C UTF-8) + +NAPI_CONF= libs/libnapi_sysconf.sh + +post-patch-COVER-on: + @${REINPLACE_CMD} -e 's|\(napiprojekt\.cover\.download\)=0|\1=1|' ${WRKSRC}/${NAPI_CONF} + +post-patch-NFO-on: + @${REINPLACE_CMD} -e 's|\(napiprojekt\.nfo\.download\)=0|\1=1|' ${WRKSRC}/${NAPI_CONF} + +post-patch-RMORIG-on: + @${REINPLACE_CMD} -e 's|\(napiprojekt\.subtitles\.orig\.delete\)=0|\1=1|' ${WRKSRC}/${NAPI_CONF} + +post-patch-SUBRIP-on: + @${REINPLACE_CMD} -e 's|\(napiprojekt\.subtitles\.format\)=default|\1=subrip|' ${WRKSRC}/${NAPI_CONF} + +post-patch-UTF8-on: + @${REINPLACE_CMD} -e 's|\(napiprojekt\.subtitles\.encoding\)=default|\1=UTF-8|' ${WRKSRC}/${NAPI_CONF} + +post-install: + @${RM} -r ${STAGEDIR}${LOCALBASE}/lib/napi/*.in + +.include diff --git a/polish/napi/distinfo b/polish/napi/distinfo new file mode 100644 index 000000000000..f9e74e94c15e --- /dev/null +++ b/polish/napi/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1624840400 +SHA256 (hesperos-napi-ac404649571e470bf9494f788bd8a74843956851_GL0.tar.gz) = 41919054d04b93f90d5a4a13f2964322111194afe60212bb434f105f6c7675e0 +SIZE (hesperos-napi-ac404649571e470bf9494f788bd8a74843956851_GL0.tar.gz) = 106739 diff --git a/polish/napi/files/patch-libs_libnapi__fs.sh b/polish/napi/files/patch-libs_libnapi__fs.sh new file mode 100644 index 000000000000..755e942821a3 --- /dev/null +++ b/polish/napi/files/patch-libs_libnapi__fs.sh @@ -0,0 +1,29 @@ +--- libs/libnapi_fs.sh.orig 2020-04-24 07:22:41 UTC ++++ libs/libnapi_fs.sh +@@ -54,7 +54,7 @@ _fs_configureStat_GV() { + # verify stat tool + ___g_fsWrappers[$___g_fsStat]="stat -c%s " + +- if wrappers_isSystemDarwin; then ++ if wrappers_isSystemDarwin || wrappers_isSystemFreeBSD; then + # stat may be installed through macports, check if + # there's a need to reconfigure it to BSD flavour + ${___g_fsWrappers[$___g_fsStat]} "$0" >/dev/null 2>&1 || +@@ -72,6 +72,8 @@ _fs_configureBase64_GV() { + # verify base64 + wrappers_isSystemDarwin && + ___g_fsWrappers[$___g_fsBase64]="base64 -D" ++ wrappers_isSystemFreeBSD && ++ ___g_fsWrappers[$___g_fsBase64]="base64 -d" + } + + # +@@ -83,6 +85,8 @@ _fs_configureMd5_GV() { + # verify md5 tool + ___g_fsWrappers[$___g_fsMd5]="md5sum" + wrappers_isSystemDarwin && ++ ___g_fsWrappers[$___g_fsMd5]="md5" ++ wrappers_isSystemFreeBSD && + ___g_fsWrappers[$___g_fsMd5]="md5" + } + diff --git a/polish/napi/files/patch-libs_libnapi__subs.sh b/polish/napi/files/patch-libs_libnapi__subs.sh new file mode 100644 index 000000000000..2b55c8f3f902 --- /dev/null +++ b/polish/napi/files/patch-libs_libnapi__subs.sh @@ -0,0 +1,16 @@ +--- libs/libnapi_subs.sh.orig 2020-04-26 01:52:36 UTC ++++ libs/libnapi_subs.sh +@@ -189,11 +189,11 @@ subs_convertFormat() { + subotage_processFile \ + "${videoFileDir}/${sourceSubsFileName}" \ + "none" \ +- "0" \ ++ "${fps}" \ + "" \ + "${videoFileDir}/${destSubsFileName}" \ + "${format}" \ +- "${fps}" \ ++ "0" \ + "" + convStatus=$? + diff --git a/polish/napi/files/patch-libs_libnapi__wrappers.sh b/polish/napi/files/patch-libs_libnapi__wrappers.sh new file mode 100644 index 000000000000..fd696a768cbe --- /dev/null +++ b/polish/napi/files/patch-libs_libnapi__wrappers.sh @@ -0,0 +1,24 @@ +--- libs/libnapi_wrappers.sh.orig 2020-04-24 07:38:48 UTC ++++ libs/libnapi_wrappers.sh +@@ -129,13 +129,20 @@ wrappers_isSystemDarwin() { + } + + # ++# @brief returns true if system is FreeBSD ++# ++wrappers_isSystemFreeBSD() { ++ [ "$(wrappers_getSystem_SO)" = "freebsd" ] ++} ++ ++# + # @brief determines number of available cpu's in the system + # + # @param system type (linux|darwin) + # + wrappers_getCores_SO() { + local os="${1:-linux}" +- if wrappers_isSystemDarwin; then ++ if wrappers_isSystemDarwin || wrappers_isSystemFreeBSD; then + sysctl hw.ncpu | cut -d ' ' -f 2 + else + grep -i processor /proc/cpuinfo | wc -l diff --git a/polish/napi/pkg-descr b/polish/napi/pkg-descr new file mode 100644 index 000000000000..ff00f50bb29a --- /dev/null +++ b/polish/napi/pkg-descr @@ -0,0 +1,10 @@ +"napi.sh" is a napiprojekt.pl client written in Bash. The purpose of the project +was to create simple tool for systems with very limited resources (NAS QNAP +drives, Synology, OpenWRT routers, Popcorn streamers, etc). It was inspired by +"pynapi.py" script. + +"napi.sh" is distributed together with automatic subtitle format converter +"subotage.sh" created specially for "napi.sh". "subotage.sh" is written in Bash +and uses awk for text processing. + +WWW: https://gitlab.com/hesperos/napi diff --git a/polish/napi/pkg-plist b/polish/napi/pkg-plist new file mode 100644 index 000000000000..7a30d3b29174 --- /dev/null +++ b/polish/napi/pkg-plist @@ -0,0 +1,23 @@ +bin/napi.sh +bin/subotage.sh +lib/napi/actions/libnapi_download.sh +lib/napi/actions/libnapi_scan.sh +lib/napi/actions/libnapi_search.sh +lib/napi/actions/libnapi_subtitles.sh +lib/napi/libnapi_argv.sh +lib/napi/libnapi_assoc.sh +lib/napi/libnapi_constants.sh +lib/napi/libnapi_fs.sh +lib/napi/libnapi_hooks.sh +lib/napi/libnapi_http.sh +lib/napi/libnapi_language.sh +lib/napi/libnapi_logging.sh +lib/napi/libnapi_napiprojekt.sh +lib/napi/libnapi_retvals.sh +lib/napi/libnapi_subotage.sh +lib/napi/libnapi_subs.sh +lib/napi/libnapi_sysconf.sh +lib/napi/libnapi_tools.sh +lib/napi/libnapi_version.sh +lib/napi/libnapi_wrappers.sh +lib/napi/libnapi_xml.sh