From e20bde6c7a4078ef5b71c2e277843ba5849968fd Mon Sep 17 00:00:00 2001 From: meliurwen Date: Sat, 21 May 2022 12:21:57 +0200 Subject: [PATCH] First fully working vesion of the packager --- .gitignore | 8 +++++ debian/README | 4 +++ debian/changelog | 11 ++++++ debian/control | 19 ++++++++++ debian/copyright | 11 ++++++ debian/install | 1 + debian/rules | 4 +++ debian/source/format | 1 + main.sh | 83 ++++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 142 insertions(+) create mode 100644 .gitignore create mode 100644 debian/README create mode 100644 debian/changelog create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/install create mode 100755 debian/rules create mode 100644 debian/source/format create mode 100755 main.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e9b6008 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +tree/ +tmp/ + +debian/.debhelper/ +debian/debhelper-build-stamp +debian/chromium-widevine-plugin/ +debian/chromium-widevine-plugin.substvars +debian/files diff --git a/debian/README b/debian/README new file mode 100644 index 0000000..04206f1 --- /dev/null +++ b/debian/README @@ -0,0 +1,4 @@ +The Debian Package chromium-widevine-plugin +---------------------------- + +Uh, proprietary. diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..1004364 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,11 @@ +chromium-widevine-plugin (4.10.2449.0) unstable; urgency=medium + + * New release. + + -- Meliurwen Sat, 21 May 2022 12:15:35 +0200 + +chromium-widevine-plugin (4.10.2391.0) unstable; urgency=medium + + * Initial Release. + + -- Meliurwen Sat, 11 Dec 2021 16:47:01 +0100 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..3931382 --- /dev/null +++ b/debian/control @@ -0,0 +1,19 @@ +Source: chromium-widevine-plugin +Section: web +Priority: optional +Maintainer: Meliurwen +Rules-Requires-Root: no +Build-Depends: + debhelper-compat (= 13), +Standards-Version: 4.6.1 +#Homepage: + +Package: chromium-widevine-plugin +Architecture: amd64 +Depends: + ${shlibs:Depends}, +Description: This package contains Google's Widevine DRM plugin for Chromium. + This package contains Google Chrome's Widevine DRM plugin for Chromium. + . + Widevine Content Decryption Module enables playback of Widevine-licensed + audio and video content. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..f7d015c --- /dev/null +++ b/debian/copyright @@ -0,0 +1,11 @@ +Copyright 2022 Google Inc. + +"Google Inc. and its affiliates ("Google") own all legal right, title and +interest in and to the content decryption module software ("Software") and +related documentation, including any intellectual property rights in the +Software. You may not use, modify, sell, or otherwise distribute the Software +without a separate license agreement with Google. The Software is not open +source software. + +If you are interested in licensing the Software, please contact +widevine@google.com. diff --git a/debian/install b/debian/install new file mode 100644 index 0000000..f49330c --- /dev/null +++ b/debian/install @@ -0,0 +1 @@ +tree/* / diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..2d33f6a --- /dev/null +++ b/debian/rules @@ -0,0 +1,4 @@ +#!/usr/bin/make -f + +%: + dh $@ diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/main.sh b/main.sh new file mode 100755 index 0000000..5b775e7 --- /dev/null +++ b/main.sh @@ -0,0 +1,83 @@ +#!/bin/sh + +# Acknowledgements: +# - Eric Hameleers (AlienBOB) - https://alien.slackbook.org/ + +set -e + +retrieve() { + mkdir -p tmp + + printf "Downloading 'versions.txt'...\n" + # Each zip contains a CDM binary, manifest.json file, and LICENSE.txt file. + # Current version can be read online (last line): + # https://dl.google.com/widevine-cdm/versions.txt + if [ ! -f "tmp/versions.txt" ]; then + curl --fail -o "tmp/versions.txt" \ + "https://dl.google.com/widevine-cdm/versions.txt" + fi + + # Set the latest version if not otherwise stated (last entry in the txt) + pkgver="${pkgver:-$(tail --quiet -n1 "tmp/versions.txt")}" + + printf "Downloading '%s'...\n" "${pkgver}-linux-${pkgarch}.zip" + # The place where Mozilla Firefox downloads these ZIP files is documented here: + # https://github.com/mozilla/gecko-dev/blob/master/toolkit/content/gmp-sources/widevinecdm.json + if [ ! -f "tmp/${pkgver}-linux-${pkgarch}.zip" ]; then + curl --fail -o "tmp/${pkgver}-linux-${pkgarch}.zip" \ + "https://dl.google.com/widevine-cdm/${pkgver}-linux-${pkgarch}.zip" + fi +} + +prepare() { + + # Test archve files + unzip -t "tmp/${pkgver}-linux-${pkgarch}.zip" + + mkdir tmp/archive + + unzip "tmp/${pkgver}-linux-${pkgarch}.zip" -d "tmp/archive/." 2>/dev/null + + # Prepare the final dirtree structure, ready to be packaged + mkdir "${pkgdir}" + + install -D -m755 "tmp/archive/libwidevinecdm.so" \ + "${pkgdir}/usr/lib/chromium/WidevineCdm/_platform_specific/linux_${pkgarch}/libwidevinecdm.so" + # The manifest.json file is now used by Chromium to determine the features + # that are supported by the Widevine CDM: + install -m644 "tmp/archive/manifest.json" \ + "${pkgdir}/usr/lib/chromium/WidevineCdm/" + + # Enable for chromium + ln -sr "${pkgdir}/usr/lib/chromium/WidevineCdm/_platform_specific/linux_${pkgarch}/libwidevinecdm.so" \ + "${pkgdir}/usr/lib/chromium/libwidevinecdm.so" + # Enable for chromium-ungoogled + install -d "${pkgdir}/usr/lib/chromium-ungoogled/" + ln -sr "${pkgdir}/usr/lib/chromium/WidevineCdm" \ + "${pkgdir}/usr/lib/chromium-ungoogled/WidevineCdm" + ln -sr "${pkgdir}/usr/lib/chromium/WidevineCdm/_platform_specific/linux_${pkgarch}/libwidevinecdm.so" \ + "${pkgdir}/usr/lib/chromium-ungoogled/libwidevinecdm.so" + + sed -i '1s/^/Copyright 2022 Google Inc. \n\n/' "tmp/archive/LICENSE.txt" + + # Update the license in case it changes + if ! cmp --silent "debian/copyright" "tmp/archive/LICENSE.txt"; then + cp "tmp/archive/LICENSE.txt" "debian/copyright" + fi + + # Update the changelog + dch \ + --newversion "${pkgver}" \ + --distribution unstable \ + --controlmaint "New release." + +} + +#pkgver=4.10.2449.0 +pkgarch=x64 +pkgdir="tree" + +retrieve +prepare + +dpkg-buildpackage