pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/www/firefox-l10n
Module Name: pkgsrc
Committed By: rillig
Date: Sat Nov 30 22:14:39 UTC 2019
Modified Files:
pkgsrc/www/firefox-l10n: Makefile
Added Files:
pkgsrc/www/firefox-l10n: list-licenses.mk
Log Message:
www/firefox-l10n: add LICENSE and document how to check it
To generate a diff of this commit:
cvs rdiff -u -r1.162 -r1.163 pkgsrc/www/firefox-l10n/Makefile
cvs rdiff -u -r0 -r1.1 pkgsrc/www/firefox-l10n/list-licenses.mk
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/www/firefox-l10n/Makefile
diff -u pkgsrc/www/firefox-l10n/Makefile:1.162 pkgsrc/www/firefox-l10n/Makefile:1.163
--- pkgsrc/www/firefox-l10n/Makefile:1.162 Sat Nov 30 21:03:23 2019
+++ pkgsrc/www/firefox-l10n/Makefile Sat Nov 30 22:14:39 2019
@@ -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 @@ MASTER_SITES= ${MASTER_SITE_MOZILLA:=fir
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 @@ FIREFOX_LOCALES= \
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"
Added files:
Index: pkgsrc/www/firefox-l10n/list-licenses.mk
diff -u /dev/null pkgsrc/www/firefox-l10n/list-licenses.mk:1.1
--- /dev/null Sat Nov 30 22:14:39 2019
+++ pkgsrc/www/firefox-l10n/list-licenses.mk Sat Nov 30 22:14:39 2019
@@ -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