summaryrefslogtreecommitdiff
path: root/scripts/prep-librewolf-dpkg.sh
blob: dba3b9506540c8e398cf3d976d6919bf3659c56a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
#!/bin/sh
# File: prep-librewolf-dpkg.sh
# Location: https://gitlab.com/bgstack15/librewolf-linux.git
# Latest supported version: librewolf-126.0-1
# Author: bgstack15
# SPDX-License-Identifier: CC-BY-SA-4.0
# Startdate: 2020-11-29
# Title: Build Dpkg for LibreWolf
# Purpose: Prepare initial assets for running "dpkg-buildpackage -b -us -uc" for LibreWolf by adapting distro Firefox assets
# History:
#    2021-03-10 add initial Ubuntu support
#    2022-01-18 modified to use "source" repo instead of "common" for version 97.0.1
#    2023-05-07 dropped repo "linux" which is disused
#    2023-08-30 point to codeberg source repo
# Usage:
#    Can send these final assets up to Open Build Service
# References:
#    Script numbers from https://gitlab.com/librewolf-community/browser/linux/-/tree/master/binary_tarball/scripts
# Improve:
#    Make this idempotent. Right now it is very much not.
# Dependencies:
#    wget, git, tar, awk, sed, jq

# Aborts the script upon any failure
set -e;
set -x;

#####################################
# Load settings
# basically, dot-source the conf file.
test -z "${librewolf_dpkg_conf}" && export librewolf_dpkg_conf="$( find "$( dirname "${0}" )" -maxdepth 2 -name "$( basename "${0%%.sh}.conf" )" -print 2>/dev/null | head -n1 )"
test ! -r "${librewolf_dpkg_conf}" && { echo "Unable to load config file, which should be named the same as this script but with a .conf ending. Aborted." 1>&2 ; exit 1 ; }
. "${librewolf_dpkg_conf}"

librewolf_source_url=https://codeberg.org/librewolf/source.git
librewolf_settings_url=https://codeberg.org/librewolf/settings.git

if test "${DISTRO}" = "ubuntu" ; then
   _mozconfig='/config/mozconfig.in'
else
   _mozconfig='/browser.mozconfig.in'
fi

# user configurable
git_source_dir=${CI_PROJECT_DIR}/git  # where LibreWolf git contents are cached
debian_dir=${CI_PROJECT_DIR}/${firefox_version}/debian # where the firefox_debian.tar.xz file is extracted
source_dir=${CI_PROJECT_DIR}/${firefox_version}/librewolf_${firefox_version} # where firefox.orig.tar.xz file is extracted with --strip-components=1
work_dir=${CI_PROJECT_DIR}/prepared/
scripts_dir="${CI_PROJECT_DIR}/scripts"

#####################################
# Download initial components
test -z "${SKIP_APT}" && apt update && apt install -y git curl wget xz-utils python3-pip jq

# Download upstream distro assets, which includes
#   1. orig tarball, which in Debian is not always the pristine contents from upstream source
#   2. debian/ directory which defines how to build a dpkg
#   3. source package control file
mkdir -p "${work_dir}" ; cd "${work_dir}"
test -z "${SKIP_DOWNLOAD}" && {
   case "${DISTRO}" in
      ubuntu)
         wget --continue --content-disposition http://archive.ubuntu.com/ubuntu/pool/main/f/firefox/firefox_"${firefox_version}".orig.tar.xz
         wget --continue --content-disposition http://archive.ubuntu.com/ubuntu/pool/main/f/firefox/firefox_"${distro_firefox_version}".debian.tar.xz
         wget --continue --content-disposition http://archive.ubuntu.com/ubuntu/pool/main/f/firefox/firefox_"${distro_firefox_version}".dsc
         ;;
      *) # catch-all, including for Debian
         wget --continue --content-disposition http://deb.debian.org/debian/pool/main/f/firefox/firefox_"${firefox_version}".orig.tar.xz
         wget --continue --content-disposition http://deb.debian.org/debian/pool/main/f/firefox/firefox_"${distro_firefox_version}".debian.tar.xz
         wget --continue --content-disposition http://deb.debian.org/debian/pool/main/f/firefox/firefox_"${distro_firefox_version}".dsc
         ;;
   esac
}

# extract these contents to where they belong
mkdir -p "${source_dir}"
test -z "${SKIP_EXTRACT}" && {
   echo "Extracting files from orig and debian tarballs. This might take a while." 1>&2
   tar -C "${source_dir}" -Jx --strip-components=1 -f firefox_"${firefox_version}".orig.tar.xz
   tar -C "$( dirname "${debian_dir}" )" -Jxf firefox_"${distro_firefox_version}".debian.tar.xz
   # dsc file is a text file and needs no extraction
}

# Download git sources
test -z "${SKIP_GIT}" && {
   git clone "${librewolf_source_url}" ${git_source_dir}/source || : ; ( cd "${git_source_dir}/source" ; git checkout master || git checkout main ; git pull ; git checkout "${source_version}" ; )
   git clone "${librewolf_settings_url}" ${git_source_dir}/settings || : ; ( cd "${git_source_dir}/settings" ; git checkout master || git checkout main ; git pull ; )
}

#####################################
# Script 1 tasks

# update debian/control file
# update fields and add libjack-dev
sed -i -r "${debian_dir}"/control \
   -e '/^[[:alpha:]]+: firefox/s/firefox/librewolf/' \
   -e '/^Package:.*-l10/,$d' \
   -e '/^Maintainer:/{s/Maintainer:/XSBC-Original-Maintainer:/;iMaintainer: B. Stack <bgstack15@gmail.com>' -e '}' \
   -e '/^Uploaders:/d' \
   -e '/libasound2-dev/s/libasound2-dev,/libasound2-dev, libjack-dev,/;' \
   -e '/^Vcs-/d' \
   -e '/Breaks:.*xul-ext-torbutton/d' \
   -e '/Description:/,+8{/Description:/,/^\s*$/d}'
cat <<'EOF' >> "${debian_dir}"/control
Description: LibreWolf variant of Mozilla Firefox web browser
 LibreWolf is a build of Firefox that seeks to protect user privacy,
 security, and freedom.
EOF

#####################################
# Script 2 tasks

# none. Dependencies are handled by the build environment by interpreting the dsc file.

#####################################
# Script 3 tasks

# overlay the orig tarball contents with LibreWolf contents
# LibreWolf branding
cp -pr "${git_source_dir}"/source/themes/browser/base \
   "${git_source_dir}"/source/themes/browser/branding \
   "${source_dir}"/browser/
# update mozconfig with needed info
sed -i -e '/with-app-name=/d' "${debian_dir}${_mozconfig}"
cat <<EOF >> "${debian_dir}${_mozconfig}"

# Start of LibreWolf effects
ac_add_options --disable-tests
ac_add_options --disable-debug
ac_add_options --disable-default-browser-agent

ac_add_options --prefix=/usr
ac_add_options --enable-hardening
ac_add_options --enable-rust-simd

# Branding
ac_add_options --with-app-name=librewolf
ac_add_options --with-app-basename=LibreWolf
ac_add_options --with-branding=browser/branding/librewolf
ac_add_options --with-distribution-id=io.gitlab.librewolf-community

export MOZ_REQUIRE_SIGNING=

# Features
ac_add_options --enable-jack
ac_add_options --disable-crashreporter

# Disables crash reporting, telemetry and other data gathering tools
mk_add_options MOZ_CRASHREPORTER=0
mk_add_options MOZ_DATA_REPORTING=0
mk_add_options MOZ_SERVICES_HEALTHREPORT=0
mk_add_options MOZ_TELEMETRY_REPORTING=0
#ac_add_options --with-wasi-sysroot=\$HOME/.mozbuild/wrlb/wasi-sysroot

EOF
test "$( uname -p )" = "x86_64" && { echo "ac_add_options --disable-elf-hack" >> "${debian_dir}${_mozconfig}" ; }
cat <<EOF >> "${debian_dir}${_mozconfig}"
# LibreWolf binary release uses clang-11 but Debian builds Firefox with gcc so this is irrelevant.
#export CC='clang-11'
#export CXX='clang++-11'
#export AR=llvm-ar-11
#export NM=llvm-nm-11
#export RANLIB=llvm-ranlib-11

ac_add_options --enable-optimize
EOF

# add patches to debian/patches
mkdir -p "${debian_dir}"/patches/librewolf

if test "${DISTRO}" = "ubuntu" ; then
   cp -pr "${git_source_dir}"/common/patches/megabar.patch \
      "${git_source_dir}"/common/patches/remove_addons.patch \
      "${git_source_dir}"/common/patches/mozilla-vpn-ad2.patch \
      "${git_source_dir}"/common/patches/sed-patches/disable-pocket.patch \
      "${git_source_dir}"/common/patches/context-menu.patch \
      "${git_source_dir}"/common/patches/browser-confvars.patch \
      "${git_source_dir}"/common/patches/urlbarprovider-interventions.patch \
      "${git_source_dir}"/common/patches/sed-patches/remove-internal-plugin-certs.patch \
      "${git_source_dir}"/common/patches/sed-patches/allow-searchengines-non-esr.patch \
      "${git_source_dir}"/common/patches/sed-patches/stop-undesired-requests.patch \
      "${git_source_dir}"/common/patches/about-dialog.patch \
      "${debian_dir}"/patches/librewolf/
   cat <<EOF >> "${debian_dir}"/patches/series
librewolf/remove_addons.patch -p1
librewolf/megabar.patch -p1
librewolf/mozilla-vpn-ad2.patch -p1
librewolf/disable-pocket.patch -p1
librewolf/context-menu.patch -p1
librewolf/browser-confvars.patch -p1
librewolf/urlbarprovider-interventions.patch -p1
librewolf/remove-internal-plugin-certs.patch -p1
librewolf/allow-searchengines-non-esr.patch -p1
librewolf/stop-undesired-requests.patch -p1
librewolf/about-dialog.patch -p1
EOF
else
   # the vpn-ad was disabled at v99.0 because it was broken
   cp -pr $( sed -r "${git_source_dir}"/source/assets/patches.txt -e "s@^@/${git_source_dir}/source/@" -e '/vpn-ad/d' ) \
      "${debian_dir}"/patches/librewolf/
   awk -F'/' '{print "librewolf/"$NF}' "${git_source_dir}"/source/assets/patches.txt | \
      sed -r -e 's@$@ -p1@' -e '/vpn-ad/d' >> "${debian_dir}/patches/series"
   #echo "librewolf/webrender_ffi.patch -p1" >> "${debian_dir}/patches/series"
   # added 126.0 ; just defuzzing this patch
   test -n "1" && patch -p1 "${debian_dir}/patches/librewolf/encoding_rs.patch" < "${scripts_dir}/126.0_defuzz-encoding_rs.patch"
   # added 120.0.1; just defuzzing this patch
   test -n "1" && patch -p1 "${debian_dir}/patches/librewolf/rust-gentoo-musl.patch" <<'EOF'
--- a/librewolf/rust-gentoo-musl.patch	2023-12-05 09:05:23.029244795 -0500
+++ b/librewolf/rust-gentoo-musl.patch	2023-12-05 08:02:36.499359413 -0500
@@ -1,5 +1,3 @@
-diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure
-index 7a2fd1ae70..7abdcaa2c1 100644
 --- a/build/moz.configure/rust.configure
 +++ b/build/moz.configure/rust.configure
 @@ -404,11 +404,21 @@ def detect_rustc_target(
@@ -24,4 +22,4 @@
 +
          return None
  
-     rustc_target = find_candidate(candidates)
\ No newline at end of file
+     rustc_target = find_candidate(candidates)
EOF
   # added 115.0.2; just defuzzing this patch
   test -n "" && patch -p1 "${debian_dir}/patches/librewolf/firefox-view.patch" <<'EOF'
--- a/patches/librewolf/firefox-view.patch	2023-07-13 15:01:06.444375138 -0400
+++ b/patches/librewolf/firefox-view.patch	2023-07-13 15:36:54.116273640 -0400
@@ -15,8 +15,10 @@
 # The tab pickup feature is hidden if Firefox Sync is disabled. It can also
 # be forced to always be disabled by setting `librewolf.firefoxView.hideTabPickup`
 # to `true`.
---- a/browser/base/content/navigator-toolbox.inc.xhtml
-+++ b/browser/base/content/navigator-toolbox.inc.xhtml
+Index: librewolf_115.0.2/browser/base/content/navigator-toolbox.inc.xhtml
+===================================================================
+--- librewolf_115.0.2.orig/browser/base/content/navigator-toolbox.inc.xhtml
++++ librewolf_115.0.2/browser/base/content/navigator-toolbox.inc.xhtml
 @@ -41,16 +41,6 @@
        <hbox flex="1" align="end" class="toolbar-items">
          <toolbartabstop/>
@@ -33,8 +35,8 @@
 -
            <tabs id="tabbrowser-tabs"
                  is="tabbrowser-tabs"
-                 flex="1"
-@@ -707,6 +697,16 @@
+                 aria-multiselectable="true"
+@@ -723,6 +713,16 @@
                     closemenu="none"
                     cui-areatype="toolbar"
                     data-l10n-id="navbar-library"/>
@@ -51,9 +53,11 @@
    </html:template>
  </toolbox>
  </box>
---- a/browser/components/customizableui/CustomizableUI.sys.mjs
-+++ b/browser/components/customizableui/CustomizableUI.sys.mjs
-@@ -289,7 +289,6 @@ var CustomizableUIInternal = {
+Index: librewolf_115.0.2/browser/components/customizableui/CustomizableUI.sys.mjs
+===================================================================
+--- librewolf_115.0.2.orig/browser/components/customizableui/CustomizableUI.sys.mjs
++++ librewolf_115.0.2/browser/components/customizableui/CustomizableUI.sys.mjs
+@@ -282,7 +282,6 @@ var CustomizableUIInternal = {
        {
          type: CustomizableUI.TYPE_TOOLBAR,
          defaultPlacements: [
@@ -61,7 +65,7 @@
            "tabbrowser-tabs",
            "new-tab-button",
            "alltabs-button",
-@@ -620,18 +619,6 @@ var CustomizableUIInternal = {
+@@ -611,18 +610,6 @@ var CustomizableUIInternal = {
        }
      }
  
@@ -80,8 +84,10 @@
      // Unified Extensions addon button migration, which puts any browser action
      // buttons in the overflow menu into the addons panel instead.
      if (currentVersion < 19) {
---- a/browser/components/firefoxview/firefoxview.html
-+++ b/browser/components/firefoxview/firefoxview.html
+Index: librewolf_115.0.2/browser/components/firefoxview/firefoxview.html
+===================================================================
+--- librewolf_115.0.2.orig/browser/components/firefoxview/firefoxview.html
++++ librewolf_115.0.2/browser/components/firefoxview/firefoxview.html
 @@ -62,6 +62,7 @@
          is="tab-pickup-container"
          id="tab-pickup-container"
@@ -90,9 +96,11 @@
        >
          <summary class="page-section-header">
            <span
---- a/browser/components/firefoxview/firefoxview.mjs
-+++ b/browser/components/firefoxview/firefoxview.mjs
-@@ -41,7 +41,26 @@ const launchFeatureTour = () => {
+Index: librewolf_115.0.2/browser/components/firefoxview/firefoxview.mjs
+===================================================================
+--- librewolf_115.0.2.orig/browser/components/firefoxview/firefoxview.mjs
++++ librewolf_115.0.2/browser/components/firefoxview/firefoxview.mjs
+@@ -16,7 +16,26 @@ const launchFeatureTour = () => {
    callout.showFeatureCallout();
  };
  
@@ -119,13 +127,14 @@
    Services.telemetry.setEventRecordingEnabled("firefoxview", true);
    Services.telemetry.recordEvent("firefoxview", "entered", "firefoxview", null);
    document.getElementById("recently-closed-tabs-container").onLoad();
---- a/browser/components/newtab/lib/OnboardingMessageProvider.jsm
-+++ b/browser/components/newtab/lib/OnboardingMessageProvider.jsm
-@@ -92,57 +92,6 @@ const BASE_MESSAGES = () => [
-     },
+Index: librewolf_115.0.2/browser/components/newtab/lib/OnboardingMessageProvider.jsm
+===================================================================
+--- librewolf_115.0.2.orig/browser/components/newtab/lib/OnboardingMessageProvider.jsm
++++ librewolf_115.0.2/browser/components/newtab/lib/OnboardingMessageProvider.jsm
+@@ -78,57 +78,6 @@ const BASE_MESSAGES = () => [
      trigger: { id: "protectionsPanelOpen" },
    },
--  {
+   {
 -    id: "CFR_FIREFOX_VIEW",
 -    groups: ["cfr"],
 -    template: "cfr_doorhanger",
@@ -176,6 +185,7 @@
 -    // Avoid breaking existing tests that close tabs for now.
 -    targeting: `!inMr2022Holdback && fxViewButtonAreaType != null && (currentDate|date - profileAgeCreated) / 86400000 >= 2 && tabsClosedCount >= 3 && 'browser.firefox-view.view-count'|preferenceValue == 0 && !'browser.newtabpage.activity-stream.asrouter.providers.cfr'|preferenceIsUserSet`,
 -  },
-   {
+-  {
      id: "FX_MR_106_UPGRADE",
      template: "spotlight",
+     targeting: "true",
EOF
   # added 115.0.2, updated 117.0; just defuzzing this patch
   test -n "" && patch -p1 "${debian_dir}/patches/librewolf/stop-undesired-requests.patch" <<EOF
--- a/patches/librewolf/stop-undesired-requests.patch	2023-07-13 15:01:06.444375138 -0400
+++ b/patches/librewolf/stop-undesired-requests.patch	2023-07-13 15:35:17.271195985 -0400
@@ -1,8 +1,6 @@
-diff --git a/browser/components/newtab/data/content/activity-stream.bundle.js b/browser/components/newtab/data/content/activity-stream.bundle.js
-index cb7c26e..b1a56e9 100644
 --- a/browser/components/newtab/data/content/activity-stream.bundle.js
 +++ b/browser/components/newtab/data/content/activity-stream.bundle.js
-@@ -1576,7 +1576,7 @@ class ASRouterAdminInner extends (external_React_default()).PureComponent {
+@@ -1787,7 +1787,7 @@ class ASRouterAdminInner extends (extern
          label = /*#__PURE__*/external_React_default().createElement("span", null, "remote settings (", /*#__PURE__*/external_React_default().createElement("a", {
            className: "providerUrl",
            target: "_blank",
@@ -11,11 +9,9 @@
            rel: "noopener noreferrer"
          }, "nimbus-desktop-experiments"), ")");
        }
-diff --git a/services/settings/Utils.jsm b/services/settings/Utils.jsm
-index 23d6bf1..4affc89 100644
 --- a/services/settings/Utils.sys.mjs
 +++ b/services/settings/Utils.sys.mjs
-@@ -51,6 +51,9 @@ ChromeUtils.defineLazyGetter(lazy, "isRunningTests", () => {
+@@ -51,6 +51,9 @@ ChromeUtils.defineLazyGetter(lazy, "isRu
  // Overriding the server URL is normally disabled on Beta and Release channels,
  // except under some conditions.
  ChromeUtils.defineLazyGetter(lazy, "allowServerURLOverride", () => {
@@ -25,11 +21,9 @@
    if (!AppConstants.RELEASE_OR_BETA) {
      // Always allow to override the server URL on Nightly/DevEdition.
      return true;
-diff --git a/toolkit/components/search/SearchUtils.sys.mjs b/toolkit/components/search/SearchUtils.sys.mjs
-index a3100fa..c7bf03b 100644
 --- a/toolkit/components/search/SearchUtils.sys.mjs
 +++ b/toolkit/components/search/SearchUtils.sys.mjs
-@@ -157,9 +157,9 @@ var SearchUtils = {
+@@ -152,9 +152,9 @@ export var SearchUtils = {
  
    ENGINES_URLS: {
      "prod-main":
@@ -39,5 +33,5 @@
 -      "https://firefox.settings.services.mozilla.com/v1/buckets/main-preview/collections/search-config/records",
 +      "https://%.invalid",
      "stage-main":
-       "https://settings.stage.mozaws.net/v1/buckets/main/collections/search-config/records",
+       "https://firefox.settings.services.allizom.org/v1/buckets/main/collections/search-config/records",
      "stage-preview":
EOF
   # added 114.0, updated 123.0.1
   test -n "1" && cat <<'EOF' > "${debian_dir}/patches/librewolf/hide-passwordmgr.patch"
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -1807,6 +1807,13 @@ var gBrowserInit = {
       )?.removeAttribute("key");
     }
 
+    if (Services.prefs.getBoolPref("librewolf.hidePasswdmgr", false)) {
+      PanelMultiView.getViewNode(
+        document,
+        "appMenu-passwords-button"
+      )?.remove();
+    }
+
     this._loadHandled = true;
   },
 
--- a/browser/components/preferences/privacy.js
+++ b/browser/components/preferences/privacy.js
@@ -1203,6 +1203,10 @@ var gPrivacyPane = {
 
     this.initWebAuthn();
 
+    if (Services.prefs.getBoolPref("librewolf.hidePasswdmgr", false)) {
+      document.getElementById("passwordsGroup")?.remove();
+    }
+
     // Notify observers that the UI is now ready
     Services.obs.notifyObservers(window, "privacy-pane-loaded");
   },
EOF

   # added 112.0.1, updated 117.0. Just for de-fuzzing librewolf patches
   test -n "" && patch -p1 "${debian_dir}/patches/librewolf/firefox-view.patch" <<'EOF'
diff --git a/patches/ui-patches/firefox-view.patch b/patches/ui-patches/firefox-view.patch
index b32a6bf..07fd0ed 100644
--- a/patches/ui-patches/firefox-view.patch
+++ b/patches/ui-patches/firefox-view.patch
@@ -15,10 +15,8 @@
 # The tab pickup feature is hidden if Firefox Sync is disabled. It can also
 # be forced to always be disabled by setting `librewolf.firefoxView.hideTabPickup`
 # to `true`.
-Index: librewolf_115.0.2/browser/base/content/navigator-toolbox.inc.xhtml
-===================================================================
---- librewolf_115.0.2.orig/browser/base/content/navigator-toolbox.inc.xhtml
-+++ librewolf_115.0.2/browser/base/content/navigator-toolbox.inc.xhtml
+--- a/browser/base/content/navigator-toolbox.inc.xhtml
++++ b/browser/base/content/navigator-toolbox.inc.xhtml
 @@ -41,16 +41,6 @@
        <hbox flex="1" align="end" class="toolbar-items">
          <toolbartabstop/>
@@ -36,7 +34,7 @@
            <tabs id="tabbrowser-tabs"
                  is="tabbrowser-tabs"
                  aria-multiselectable="true"
-@@ -723,6 +713,16 @@
+@@ -714,6 +704,16 @@
                     closemenu="none"
                     cui-areatype="toolbar"
                     data-l10n-id="navbar-library"/>
@@ -53,11 +51,9 @@
    </html:template>
  </toolbox>
  </box>
-Index: librewolf_115.0.2/browser/components/customizableui/CustomizableUI.sys.mjs
-===================================================================
---- librewolf_115.0.2.orig/browser/components/customizableui/CustomizableUI.sys.mjs
-+++ librewolf_115.0.2/browser/components/customizableui/CustomizableUI.sys.mjs
-@@ -282,7 +282,6 @@ var CustomizableUIInternal = {
+--- a/browser/components/customizableui/CustomizableUI.sys.mjs
++++ b/browser/components/customizableui/CustomizableUI.sys.mjs
+@@ -279,7 +279,6 @@ var CustomizableUIInternal = {
        {
          type: CustomizableUI.TYPE_TOOLBAR,
          defaultPlacements: [
@@ -65,7 +61,7 @@
            "tabbrowser-tabs",
            "new-tab-button",
            "alltabs-button",
-@@ -611,18 +610,6 @@ var CustomizableUIInternal = {
+@@ -608,18 +607,6 @@ var CustomizableUIInternal = {
        }
      }
  
@@ -84,10 +80,8 @@
      // Unified Extensions addon button migration, which puts any browser action
      // buttons in the overflow menu into the addons panel instead.
      if (currentVersion < 19) {
-Index: librewolf_115.0.2/browser/components/firefoxview/firefoxview.html
-===================================================================
---- librewolf_115.0.2.orig/browser/components/firefoxview/firefoxview.html
-+++ librewolf_115.0.2/browser/components/firefoxview/firefoxview.html
+--- a/browser/components/firefoxview/firefoxview.html
++++ b/browser/components/firefoxview/firefoxview.html
 @@ -62,6 +62,7 @@
          is="tab-pickup-container"
          id="tab-pickup-container"
@@ -96,13 +90,11 @@
        >
          <summary class="page-section-header">
            <span
-Index: librewolf_115.0.2/browser/components/firefoxview/firefoxview.mjs
-===================================================================
---- librewolf_115.0.2.orig/browser/components/firefoxview/firefoxview.mjs
-+++ librewolf_115.0.2/browser/components/firefoxview/firefoxview.mjs
-@@ -16,7 +16,26 @@ const launchFeatureTour = () => {
-   callout.showFeatureCallout();
- };
+--- a/browser/components/firefoxview/firefoxview.mjs
++++ b/browser/components/firefoxview/firefoxview.mjs
+@@ -2,7 +2,26 @@
+  * License, v. 2.0. If a copy of the MPL was not distributed with this
+  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  
 +function onPrefChange() {
 +  document.getElementById("tab-pickup-container").hidden =
@@ -127,10 +119,8 @@
    Services.telemetry.setEventRecordingEnabled("firefoxview", true);
    Services.telemetry.recordEvent("firefoxview", "entered", "firefoxview", null);
    document.getElementById("recently-closed-tabs-container").onLoad();
-Index: librewolf_115.0.2/browser/components/newtab/lib/OnboardingMessageProvider.jsm
-===================================================================
---- librewolf_115.0.2.orig/browser/components/newtab/lib/OnboardingMessageProvider.jsm
-+++ librewolf_115.0.2/browser/components/newtab/lib/OnboardingMessageProvider.jsm
+--- a/browser/components/newtab/lib/OnboardingMessageProvider.jsm
++++ b/browser/components/newtab/lib/OnboardingMessageProvider.jsm
 @@ -78,57 +78,6 @@ const BASE_MESSAGES = () => [
      trigger: { id: "protectionsPanelOpen" },
    },
EOF
   # added 111.0, updated 125.0.1
   test -n "1" && cat <<'EOF' > "${debian_dir}/patches/librewolf/disable-pocket.patch"
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -5314,7 +5314,6 @@ var XULBrowserWindow = {
 
     SafeBrowsingNotificationBox.onLocationChange(aLocationURI);
 
-    SaveToPocket.onLocationChange(window);
 
     let originalURI;
     if (aRequest instanceof Ci.nsIChannel) {
--- a/browser/components/BrowserGlue.sys.mjs
+++ b/browser/components/BrowserGlue.sys.mjs
@@ -1440,7 +1440,6 @@ BrowserGlue.prototype = {
       lazy.Normandy.init();
     }
 
-    lazy.SaveToPocket.init();
 
     lazy.ResetPBMPanel.init();
 
--- a/browser/components/moz.build
+++ b/browser/components/moz.build
@@ -48,7 +48,6 @@ DIRS += [
     "originattributes",
     "pagedata",
     "places",
-    "pocket",
     "preferences",
     "privatebrowsing",
     "profiles",
EOF
   # added 109.0 to patch for debian 109.0 until defuzz-109.0 gets merged
   test -n "1" && patch -p1 "${debian_dir}/patches/librewolf/disable-data-reporting-at-compile-time.patch" <<'EOF'
diff --git a/patches/disable-data-reporting-at-compile-time.patch b/patches/disable-data-reporting-at-compile-time.patch
index 3702402..f4a4315 100644
--- a/patches/disable-data-reporting-at-compile-time.patch
+++ b/patches/disable-data-reporting-at-compile-time.patch
@@ -1,5 +1,3 @@
-diff --git a/browser/moz.configure b/browser/moz.configure
-index 8653bcb..935af40 100644
 --- a/browser/moz.configure
 +++ b/browser/moz.configure
 @@ -5,11 +5,11 @@
@@ -14,5 +12,5 @@ index 8653bcb..935af40 100644
 -imply_option("MOZ_NORMANDY", True)
 +imply_option("MOZ_NORMANDY", False)
  
- with only_when(target_is_linux & compile_environment):
+ with only_when(target_has_linux_kernel & compile_environment):
      option(env="MOZ_NO_PIE_COMPAT", help="Enable non-PIE wrapper")
EOF
   # added 109.0 to patch for debian 109.0 until defuzz-109.0 gets merged
   test -n "" && patch -p1 "${debian_dir}/patches/librewolf/librewolf-pref-pane.patch" <<'EOF'
diff --git a/patches/librewolf-pref-pane.patch b/patches/librewolf-pref-pane.patch
index b1ed478..4fcf94b 100644
--- a/patches/librewolf-pref-pane.patch
+++ b/patches/librewolf-pref-pane.patch
@@ -23,8 +23,6 @@ fix xorigin pref init and handling
  create mode 100644 browser/themes/shared/preferences/category-librewolf.svg
  create mode 100644 browser/themes/shared/preferences/librewolf.css
 
-diff --git a/browser/components/preferences/jar.mn b/browser/components/preferences/jar.mn
-index 2131a15ceef7..0b97dc14b42e 100644
 --- a/browser/components/preferences/jar.mn
 +++ b/browser/components/preferences/jar.mn
 @@ -11,6 +11,7 @@ browser.jar:
@@ -35,9 +33,6 @@ index 2131a15ceef7..0b97dc14b42e 100644
     content/browser/preferences/containers.js
     content/browser/preferences/sync.js
     content/browser/preferences/experimental.js
-diff --git a/browser/components/preferences/librewolf.inc.xhtml b/browser/components/preferences/librewolf.inc.xhtml
-new file mode 100644
-index 000000000000..c2dfea6d0858
 --- /dev/null
 +++ b/browser/components/preferences/librewolf.inc.xhtml
 @@ -0,0 +1,254 @@
@@ -295,9 +290,6 @@ index 000000000000..c2dfea6d0858
 +</groupbox>
 +
 +</html:template>
-diff --git a/browser/components/preferences/librewolf.js b/browser/components/preferences/librewolf.js
-new file mode 100644
-index 000000000000..c8cbb075d59b
 --- /dev/null
 +++ b/browser/components/preferences/librewolf.js
 @@ -0,0 +1,287 @@
@@ -588,8 +580,6 @@ index 000000000000..c8cbb075d59b
 +    }
 +  });
 +});
-diff --git a/browser/components/preferences/preferences.js b/browser/components/preferences/preferences.js
-index 19dda7cf39eb..f5e67b637b49 100644
 --- a/browser/components/preferences/preferences.js
 +++ b/browser/components/preferences/preferences.js
 @@ -8,6 +8,7 @@
@@ -600,7 +590,7 @@ index 19dda7cf39eb..f5e67b637b49 100644
  /* import-globals-from sync.js */
  /* import-globals-from experimental.js */
  /* import-globals-from moreFromMozilla.js */
-@@ -196,6 +197,7 @@ function init_all() {
+@@ -197,6 +198,7 @@ function init_all() {
    register_module("paneHome", gHomePane);
    register_module("paneSearch", gSearchPane);
    register_module("panePrivacy", gPrivacyPane);
@@ -608,8 +598,6 @@ index 19dda7cf39eb..f5e67b637b49 100644
    register_module("paneContainers", gContainersPane);
    if (Services.prefs.getBoolPref("browser.preferences.experimental")) {
      // Set hidden based on previous load's hidden value.
-diff --git a/browser/components/preferences/preferences.xhtml b/browser/components/preferences/preferences.xhtml
-index 6ee14eec9b2e..a0d768dce307 100644
 --- a/browser/components/preferences/preferences.xhtml
 +++ b/browser/components/preferences/preferences.xhtml
 @@ -13,6 +13,7 @@
@@ -620,7 +608,7 @@ index 6ee14eec9b2e..a0d768dce307 100644
  
  <!DOCTYPE html>
  
-@@ -129,6 +130,17 @@
+@@ -130,6 +131,17 @@
            <label class="category-name" flex="1" data-l10n-id="pane-privacy-title"></label>
          </richlistitem>
  
@@ -638,7 +626,7 @@ index 6ee14eec9b2e..a0d768dce307 100644
          <richlistitem id="category-sync"
                        class="category"
                        hidden="true"
-@@ -207,6 +219,7 @@
+@@ -208,6 +220,7 @@
  #include home.inc.xhtml
  #include search.inc.xhtml
  #include privacy.inc.xhtml
@@ -646,11 +634,9 @@ index 6ee14eec9b2e..a0d768dce307 100644
  #include containers.inc.xhtml
  #include sync.inc.xhtml
  #include experimental.inc.xhtml
-diff --git a/browser/locales/en-US/browser/preferences/preferences.ftl b/browser/locales/en-US/browser/preferences/preferences.ftl
-index a1e414697e71..8eeb594ca17d 100644
 --- a/browser/locales/en-US/browser/preferences/preferences.ftl
 +++ b/browser/locales/en-US/browser/preferences/preferences.ftl
-@@ -1420,3 +1420,98 @@ httpsonly-radio-disabled =
+@@ -1432,3 +1432,98 @@ httpsonly-radio-disabled =
  desktop-folder-name = Desktop
  downloads-folder-name = Downloads
  choose-download-folder-title = Choose Download Folder:
@@ -749,8 +735,6 @@ index a1e414697e71..8eeb594ca17d 100644
 +librewolf-footer = Useful links
 +librewolf-config-link = All advanced settings (about:config)
 +librewolf-open-profile = Open user profile directory
-diff --git a/browser/themes/shared/jar.inc.mn b/browser/themes/shared/jar.inc.mn
-index 146764d56081..52326c00bdfe 100644
 --- a/browser/themes/shared/jar.inc.mn
 +++ b/browser/themes/shared/jar.inc.mn
 @@ -108,6 +108,7 @@
@@ -767,11 +751,8 @@ index 146764d56081..52326c00bdfe 100644
    skin/classic/browser/preferences/siteDataSettings.css        (../shared/preferences/siteDataSettings.css)
 +  skin/classic/browser/preferences/librewolf.css               (../shared/preferences/librewolf.css)
    skin/classic/browser/spotlight.css                           (../shared/spotlight.css)
-   skin/classic/browser/upgradeDialog/abstract.png              (../shared/upgradeDialog/abstract.png)
-   skin/classic/browser/upgradeDialog/cheers.png                (../shared/upgradeDialog/cheers.png)
-diff --git a/browser/themes/shared/preferences/category-librewolf.svg b/browser/themes/shared/preferences/category-librewolf.svg
-new file mode 100644
-index 000000000000..8ebf2ebe19a9
+   skin/classic/browser/fxa/fxa-spinner.svg                     (../shared/fxa/fxa-spinner.svg)
+   skin/classic/browser/fxa/sync-illustration.svg               (../shared/fxa/sync-illustration.svg)
 --- /dev/null
 +++ b/browser/themes/shared/preferences/category-librewolf.svg
 @@ -0,0 +1,96 @@
@@ -871,9 +852,6 @@ index 000000000000..8ebf2ebe19a9
 +  </g>
 +</svg>
 +
-diff --git a/browser/themes/shared/preferences/librewolf.css b/browser/themes/shared/preferences/librewolf.css
-new file mode 100644
-index 000000000000..12f926ab7018
 --- /dev/null
 +++ b/browser/themes/shared/preferences/librewolf.css
 @@ -0,0 +1,23 @@
@@ -900,11 +878,9 @@ index 000000000000..12f926ab7018
 +	-moz-context-properties: fill, fill-opacity;
 +	fill: currentColor;
 +}
-diff --git a/browser/themes/shared/preferences/preferences.css b/browser/themes/shared/preferences/preferences.css
-index 1968b68a1245..d0da141868e2 100644
 --- a/browser/themes/shared/preferences/preferences.css
 +++ b/browser/themes/shared/preferences/preferences.css
-@@ -206,6 +206,10 @@ checkbox {
+@@ -211,6 +211,10 @@ checkbox {
    list-style-image: url("chrome://browser/skin/preferences/category-privacy-security.svg");
  }
  
@@ -915,6 +891,3 @@ index 1968b68a1245..d0da141868e2 100644
  #category-sync > .category-icon {
    list-style-image: url("chrome://browser/skin/preferences/category-sync.svg");
  }
--- 
-2.37.3
-
EOF
   # added 101.0.1
   # ref: https://raw.githubusercontent.com/canonical/firefox-snap/5622734942524846fb0eb7108918c8cd8557fde3/patches/fix-ftbfs-newer-cbindgen.patch
   # ref: https://bugzilla.mozilla.org/show_bug.cgi?id=1773630
   # ref: https://gitlab.com/librewolf-community/browser/gentoo/-/issues/42#note_985094574
   # ref: https://forums.gentoo.org/viewtopic-p-8718512.html?sid=b090546e8d9bcd60ff775c32d04e1743
   # ref: https://www.google.com/search?hl=en&q=build%2Dbrowser%2Fdist%2Finclude%2Fmozilla%2Fwebrender%2Fwebrender_ffi.h%3A103
   # For 100.0 to fix this patch.
   test -n "1" && cat <<EOF >"${debian_dir}/patches/librewolf/remove-branding-urlbar.patch"
--- a/browser/locales/en-US/browser/browser.ftl.orig	2022-03-22 12:57:21.330016999 -0400
+++ b/browser/locales/en-US/browser/browser.ftl	2022-03-22 13:01:42.740728393 -0400
@@ -543,7 +543,7 @@
 # A label shown above the "Firefox Suggest" (bookmarks/history) group in the
 # urlbar results.
 urlbar-group-firefox-suggest =
-  .label = { -firefox-suggest-brand-name }
+  .label = Suggestions
 
 # A label shown above the search suggestions group in the urlbar results. It
 # should use sentence case.
EOF
   # remove xmas because it does the same tasks as what we accomplish in this script,
   sed -i -r -e '/(xmas)\.patch/s/^/#/;' "${debian_dir}"/patches/series

   # Fixes for Debian Firefox? 97.0, not necessary by 111.0
   #pip3 install --user psutil==5.8.0
   # there's probably a better way to do this with pip, but I don't know it.
   # Basically, we are updating importlib_metadata and attrs to min needed because
   # somehow they're wrong in the orig.tar.xz.
   pip3 install --target "${source_dir}"/third_party/python attrs importlib_metadata
   cd "${source_dir}"/third_party/python
   for word in attrs importlib_metadata zipp ;
   do
      # yes, move importlib_metadata-4.10.1.dist-info/ to inside importlib_metadata/
      # we could not just loop the pip3 command because zipp is dragged in by importlib_metadata.
      mv -f "${word}"-* "${word}"/ || :
   done
   cd "${OLDPWD}"
fi

# observe that build-with-libstdc++-7 is disabled for this dpkg. Debian builds Firefox with gcc, not clang.

#####################################
# Script 4 tasks

if test "${DISTRO}" = "debian" ; then

sed -i -r -e '2{
   iexport DEB_BUILD_HARDENING=1
   ;iexport DEB_BUILD_HARDENING_STACKPROTECTOR=1
   ;iexport DEB_BUILD_HARDENING_FORTIFY=1
   ;iexport DEB_BUILD_HARDENING_FORMAT=1
   ;iexport DEB_BUILD_HARDENING_PIE=1
   ;iexport CPP
}
/^EXPORTS/{
   iCPPFLAGS += -D_FORTIFY_SOURCE=2
   ;iCFLAGS += -march=x86-64 -mtune=generic -O2 -pipe -fno-plt
   ;iCXXFLAGS += -march=x86-64 -mtune=generic -O2 -pipe -fno-plt
   ;iLDFLAGS += -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now
}
2{
   iexport MOZ_NOSPAM=1
}
' "${debian_dir}"/rules
   # removed from the "2{" block at end, for version 104.0
   #iexport MACH_USE_SYSTEM_PYTHON=1

fi

#####################################
# Additional steps for dpkg implementation

# fix the binary name that gets installed in /usr/bin, and disable crash reporter by changing what variable name it looks for that will enable it

if test "${DISTRO}" = "debian" ; then

   sed -i -e '/%if browser/,+2s/firefox/librewolf/' \
      -e '/%if CRASH_REPORTER/s/CRASH_REPORTER/CRASH_REPORTER_ENABLED/' \
      "${debian_dir}"/browser.install.in

elif test "${DISTRO}" = "ubuntu" ; then

   # let's hope this is enough
   export MOZ_ENABLE_BREAKPAD=0
   export MOZ_APP_NAME=librewolf

fi

# instruct dpkg to include the librewolf settings
rm -rf "${debian_dir}"/librewolf_settings
cp -pr "${git_source_dir}"/settings "${debian_dir}"/librewolf_settings
rm -rf "${debian_dir}"/librewolf_settings/.git*

cp -p "${git_source_dir}"/source/assets/search-config.json "${debian_dir}"/
sed -i -r "${debian_dir}"/rules \
   -e '/override_dh_auto_configure/a\	cp -pf debian/search-config.json services/settings/dumps/main/'

# Fetch latest uBlock Origin webextensions
# get latest non-beta, non-Lite tag version
ubo_version="$( curl --silent https://api.github.com/repos/gorhill/uBlock/releases | jq '.[] | select(.tag_name|contains("b")|not)|select(.tag_name|contains("Lite")|not)|.tag_name' | head -n1 | tr -d '"' )"
latest_ubo_url="$( curl --silent "https://api.github.com/repos/gorhill/uBlock/releases/tags/${ubo_version}" | jq '.assets[].browser_download_url | match(".*firefox.*xpi").string' | tr -d '"' )"
curl --silent --location --output "${debian_dir}/uBlock0@raymondhill.net.xpi" "${latest_ubo_url}"

if test "${DISTRO}" = "debian" ; then

   cat <<EOF >> "${debian_dir}"/browser.install.in
debian/librewolf_settings/@browser@.cfg usr/share/@browser@
debian/librewolf_settings/defaults/pref/local-settings.js usr/share/@browser@/defaults/pref
debian/librewolf_settings/distribution/policies.json usr/share/@browser@/distribution
debian/uBlock0@raymondhill.net.xpi usr/lib/@browser@/browser/extensions
EOF
   cat <<EOF >> "${debian_dir}/source/include-binaries"
debian/uBlock0@raymondhill.net.xpi
EOF
   cat <<EOF >> "${debian_dir}"/browser.links.in
/usr/share/distribution/policies.json usr/lib/@browser@/distribution/policies.json
/usr/share/@browser@/defaults/pref/local-settings.js usr/lib/@browser@/defaults/pref/local-settings.js
/usr/share/@browser@/@browser@.cfg /usr/lib/@browser@/@browser@.cfg
EOF

# somewhat of a  brute force approach - should help having everything everywhere, though
sed -e 's#/usr/share/@browser@/distribution /usr/lib/@browser@/distribution##' -i "${debian_dir}"/browser.links.in

else

   cat <<EOF >> "${debian_dir}"/firefox.install.in

debian/librewolf_settings/librewolf.cfg @MOZ_LIBDIR@/
debian/librewolf_settings/defaults/pref/local-settings.js @MOZ_LIBDIR@/defaults/pref
debian/librewolf_settings/distribution/policies.json @MOZ_LIBDIR@/distribution
EOF

fi

# add changelog contents for LibreWolf
new_changelog="$( mktemp )"
{
   cat <<EOF
librewolf (${distro_firefox_version}) unstable; urgency=low

  * Fork to librewolf release

 -- B. Stack <bgstack15@gmail.com>  $( date "+%a, %d %b %+4Y %T %z" )

EOF
   cat "${debian_dir}"/changelog
} > "${new_changelog}"
cat "${new_changelog}" > "${debian_dir}"/changelog

rm -f "${new_changelog:-NOTHINGTODEL}"

# remove dpkg-divert items which librewolf will not use
# thankfully dpkg-divert is the only tasks in these files as of 85.0
rm -f "${debian_dir}"/browser.postrm.in "${debian_dir}"/browser.preinst.in

#####################################
# Build new assets
# dpkg-buildpackage needs the orig tarball, debian tarball, and dsc file.

test -z "${SKIP_TARBALLS}" && {
   echo "Building new tarballs. This might take a while." 1>&2
   # orig tarball
   cd "${work_dir}"
   tar -Jc -f librewolf_"${firefox_version}".orig.tar.xz -C "$( dirname "${source_dir}" )" librewolf_"${firefox_version}"
   # debian tarball
   tar -Jc -f librewolf_"${distro_firefox_version}".debian.tar.xz -C "$( dirname  "${debian_dir}" )" debian
}

# dsc file, which needs to be modified
cd "${work_dir}"
sed -r \
   -e '/^(Files|Checksums-.{0,8}):/,$d' \
   -e '1,/^Format:/{/^Format:/!{d}}' \
   -e 's/^([[:alpha:]]+:).* firefox(-l10n[^\s]*)*/\1 librewolf/' \
   -e '/firefox-l10n/d' \
   -e '/^Maintainer:/{s/Maintainer:/XSBC-Original-Maintainer:/;iMaintainer: B. Stack <bgstack15@gmail.com>' -e '}' \
   -e '/^Uploaders:/d' \
   -e '/libasound2-dev/s/libasound2-dev,/libasound2-dev, libjack-dev,/;' \
   -e '/^Vcs-/d' \
   -e '/^ firefox/s/firefox/librewolf/g' \
   firefox_"${distro_firefox_version}".dsc > librewolf_"${distro_firefox_version}".dsc
{
   echo "Files:"
   for word in librewolf*${firefox_version}*z ;
   do
      printf "%s %s\n" "$( stat -c '%s' "${word}" )" "$( md5sum "${word}" )"
   done | awk '{print " "$2,$1,$3}'
} >> librewolf_"${distro_firefox_version}".dsc

# And now you have in the ${work_dir} location three files.
# librewolf_80.3.orig.tar.xz librewolf_80.3-1.debian.tar.xz librewolf_80.3-1.dsc
bgstack15