abrowser source?
- Anmelden oder Registrieren um Kommentare zu schreiben
I grab the .deb's for abrowser from here and install them on my libre-tized MX distro: http://archive.trisquel.info/trisquel/pool/main/f/firefox/
What I would like to do though is package a fully MX compatible .deb of abrowser from source. That way I could share it with MX users and try to turn them on to libre software. Anyone know where I could find a source tarball?
Install build-essential and devscripts if you don't have them already (If you've already built Debian packages on this machine you probably do):
$ sudo apt install build-essential devscripts
Make and change to a build directory, for example:
$ mkdir /tmp/abrowser
$ cd /tmp/abrowser
Get the source package:
$ wget http://archive.trisquel.info/trisquel/pool/main/f/firefox/firefox_79.0+build1-0ubuntu0.18.04.1+9.0trisquel74.dsc
$ wget http://archive.trisquel.info/trisquel/pool/main/f/firefox/firefox_79.0+build1-0ubuntu0.18.04.1+9.0trisquel74.tar.gz
(Note that there are different kinds of Debian packages. The kind that Abrowser is only consists of just those two files, but if you adapt this process for another package you may find that there are sometimes instead three files, a .dsc, a .orig.tar.gz, and a .debian.tar.gz)
Extract it:
$ dpkg-source -x firefox_79.0+build1-0ubuntu0.18.04.1+9.0trisquel74.dsc
Install build dependencies. You might be able to do this by running
$ apt build-dep firefox
to install all the build dependencies of MX's version of Firefox. These may not be completely identical to the dependencies for Abrowser, but it should cover most of them, and you can install the rest manually if building fails due to some missing build dependencies.
Alternatively, you can use mk-build-deps to install the dependencies listed in the actual Abrowser source package.
$ sudo mk-build-deps --install --remove firefox-79.0+build1/debian/control
This will create a .deb metapackage in the current working directory which depends on everything needed to build Abrowser, installs that package and all of the dependencies, and removes the package, leaving the dependencies installed but marked as automatically installed (so that you can get rid of them after the build with `sudo apt autoremove`).
You might then want to clean up that .deb file so that you don't confuse it with the binaries your about to build:
$ sudo rm firefox-build-deps_79.0+build1-0ubuntu0.18.04.1+9.0trisquel74_amd64.deb
(You need sudo because running mk-build-deps as root means that files created by it are owned by root)
but you might find that not all of the build dependencies are available in the MX and Debian repos. Abrowser is based on Ubuntu's version of Firefox, which is packaged a little differently from Debian's version. It may build-depend on some packages that are available in Ubuntu only, or—get this—not even in Ubuntu. Yep, Ubuntu sometimes puts out a Firefox package that cannot be built with the packages in Ubuntu's repositories, because it build-depends on packages in a PPA. I'm not even kidding. When this happens, quidam adds the missing packages to Trisquel's repository so that Abrowser can be built on Trisquel. If you find that you are missing dependencies not included in MX and Debian, you can compile them for MX by compiling them from Trisquel source packages like you're doing for Abrowser.
Once you have all the build dependencies, you can build the package with
$ cd firefox-79.0+build1/
$ dpkg-buildpackage -uc -us
Then, after some number of hours depending on how powerful a machine you're building on, you will either see debs in the parent directory, or you will see that the build has failed, in which case look at the output for an error message at the point where it failed.
Oh, for security you might also want to add Trisquel's signing key. The .dsc file is GPG signed, and dpkg-source is capable of checking the signature and warning you if it doesn't match, but only if it has a copy of Trisquel's public key, which you can add to apt's keyring with
$ sudo apt-key add /path/to/key
The key is available on the keyservers, or you can copy it over from a Trisquel system if you have one handy.
Thank you very much for the step-by-step! That's going to be very helpful. MX is using pbuilder to do the packaging, which makes creating the .deb files a bit simpler, and I've compiled Firefox for myself many times in the recent past, so I'm familiar with some of the steps and how much time it takes to compile. Hopefully I can get or build the dependencies and make a go of it. If not, I can just keep using the Trisquel .deb's for myself, but I don't think I'd be able to get it accepted as an MX package unless it can build in an MX build environment.
Cool. Using sbuild or pbuilder is a better way to do it. I only went with dpkg in my explaination because it takes less setup.
I'm more familiar with sbuild than pbuilder, but like sbuild pbuilder presumably has a way to include extra deb packages in the chroot. If MX doesn't have all of the necessary build dependencies then you'll need to learn how to do this if you don't already know, since just installing the debs yourself would make them available in pbuilder's chroot.
Yes, pbuilder has a very simple way of dealing with extra build dependencies - you just throw them into a folder you create called ~/local_repo
- Anmelden oder Registrieren um Kommentare zu schreiben