pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/www/firefox-l10n www/firefox-l10n: add LICENSE and doc...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/90faa3258637
branches:  trunk
changeset: 405542:90faa3258637
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sat Nov 30 22:14:39 2019 +0000

description:
www/firefox-l10n: add LICENSE and document how to check it

diffstat:

 www/firefox-l10n/Makefile         |  16 +++++++++++-----
 www/firefox-l10n/list-licenses.mk |  37 +++++++++++++++++++++++++++++++++++++
 2 files changed, 48 insertions(+), 5 deletions(-)

diffs (82 lines):

diff -r dc993091ff05 -r 90faa3258637 www/firefox-l10n/Makefile
--- a/www/firefox-l10n/Makefile Sat Nov 30 22:10:52 2019 +0000
+++ b/www/firefox-l10n/Makefile Sat Nov 30 22:14:39 2019 +0000
@@ -1,8 +1,9 @@
-# $NetBSD: Makefile,v 1.162 2019/11/30 21:03:23 rillig Exp $
+# $NetBSD: Makefile,v 1.163 2019/11/30 22:14:39 rillig Exp $
 #
 
 FIREFOX_VER=   70.0.1
 PKGNAME=       firefox-l10n-${FIREFOX_VER:S/esr//}
+PKGREVISION=   1
 DISTNAME=      # empty
 CATEGORIES=    www
 #MASTER_SITES= ${MASTER_SITE_MOZILLA_ALL:=firefox/releases/${FIREFOX_VER}/linux-i686/xpi/}
@@ -10,7 +11,8 @@
 
 MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
 HOMEPAGE=      https://www.mozilla.com/en-US/firefox/
-COMMENT=       Language packs for www/firefox (version ${PKGVERSION_NOREV:C/\..*//})
+COMMENT=       Language packs for www/firefox
+LICENSE=       mpl-2.0 AND mpl-1.1 AND gnu-lgpl-v3 # as of 70.0.1
 
 DIST_SUBDIR=   ${PKGNAME_NOREV}
 DISTFILES=     ${FIREFOX_LOCALES:=.xpi}
@@ -31,9 +33,13 @@
 EXTENSIONS_DIR=                ${PREFIX}/lib/firefox/browser/extensions
 
 do-install:
-.for f in ${FIREFOX_LOCALES}
-       ${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/${f}.xpi \
-       ${DESTDIR}${EXTENSIONS_DIR}/langpack-${f}@firefox.mozilla.org.xpi
+.for locale in ${FIREFOX_LOCALES}
+       ${INSTALL_DATA} ${WRKSRC}/${locale}.xpi \
+       ${DESTDIR}${EXTENSIONS_DIR}/langpack-${locale}@firefox.mozilla.org.xpi
 .endfor
 
+.if make(list-licenses)
+.include "list-licenses.mk"
+.endif
+
 .include "../../mk/bsd.pkg.mk"
diff -r dc993091ff05 -r 90faa3258637 www/firefox-l10n/list-licenses.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/firefox-l10n/list-licenses.mk Sat Nov 30 22:14:39 2019 +0000
@@ -0,0 +1,37 @@
+# $NetBSD: list-licenses.mk,v 1.1 2019/11/30 22:14:39 rillig Exp $
+#
+# list-licenses:
+#      Downloads the addon page of each language pack to determine the
+#      license.
+#
+#      As of Firefox 70, the license information is not included in the
+#      .xpi files themselves, therefore this seemed to be the best
+#      alternative.
+
+TOOL_DEPENDS+= curl-[0-9]*:../../www/curl
+USE_TOOLS+=    perl
+
+# To declare WRKDIR; WRKSRC is still undefined.
+.include "../../mk/bsd.prefs.mk"
+
+list-licenses: .PHONY
+
+.for locale in ${FIREFOX_LOCALES}
+${WRKDIR}/${locale}.html:
+       ${RUN} \
+       url="https://addons.mozilla.org/en-US/firefox/addon/langpack-${locale}@firefox.mozilla.org";; \
+       ${PREFIX}/bin/curl -ksSL "$$url" > ${.TARGET}.tmp; \
+       ${MV} ${.TARGET}.tmp ${.TARGET}
+
+${WRKDIR}/${locale}.license: ${WRKDIR}/${locale}.html
+       # Cannot use sed here since nbsed cannot handle long lines.
+       # It gets caught in a seemingly endless loop.
+       ${RUN} ${PREFIX}/bin/perl -ne 'print "$$1\n" if /class="AddonMoreInfo-license-link" href="([^"]*)"/' \
+               < ${WRKDIR}/${locale}.html > ${.TARGET}.tmp \
+       && ${MV} ${.TARGET}.tmp ${.TARGET}
+
+list-licenses: show-license-${locale}
+
+show-license-${locale}: .PHONY ${WRKDIR}/${locale}.license
+       ${RUN} printf '%s\t%s\n' ${locale:Q} "`${CAT} ${WRKDIR}/${locale}.license`"
+.endfor



Home | Main Index | Thread Index | Old Index