Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize dependencies #94

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

JoseGoncalves
Copy link
Contributor

@JoseGoncalves JoseGoncalves commented Aug 22, 2024

When installing FreePBX on a production machine, that will not be used to build packages, Debian development packages should not be installed.
This PR removes unnecessary build packages (dpkg-dev, build-essential, pkg-config, automake, libtool, autoconf) and replaces development libraries with run-time packages.
With this change, around 318 MB of storage space are saved, which could be relevant when installing FreePBX in some low resources SBC (like a Raspberry Pi Compute Module).

@kguptasangoma
Copy link
Member

Hi @JoseGoncalves

thank you for your contribution.

may be better to add option like --dev which will install dev binaries and by default will install prod binaries.

thanks

@JoseGoncalves
Copy link
Contributor Author

may be better to add option like --dev which will install dev binaries and by default will install prod binaries.

That's fine with me... going to add that option...

@JoseGoncalves
Copy link
Contributor Author

@kguptasangoma What do you think of, instead of adding a new --dev option, use the existing --testing option for the selection between a dev/prod installation (--testing => install dev binaries and libs)?

@kguptasangoma
Copy link
Member

--testing is more for testing our Debian packages like we first publish our packages into the testing repo to validate and then to production.

ideally testing environment means entire setup should be same except our packages so this should have prod binaries.

dev binary is more like for someone who is creating development system , for example we create our 17 dev system so i think its better to have --dev option.

Please let me know if this makes sense to you ?

@JoseGoncalves
Copy link
Contributor Author

OK, understood... I'll add a --dev option.

@JoseGoncalves
Copy link
Contributor Author

JoseGoncalves commented Aug 22, 2024

P.S. It would be a nice addition to have a --help option to give a description of the available options...

@JoseGoncalves
Copy link
Contributor Author

Hi @kguptasangoma. I've reviewd all FreePBX package dependencies and pushed another commit to this PR in order to install only the minimum required packages for FreePBX 17 in production. With the proposed changes, a production installation (without the --dev option) will use 334 MB less storage space.

@JoseGoncalves
Copy link
Contributor Author

JoseGoncalves commented Aug 28, 2024

I've pushed another commit to add some comments on whose packages/modules are requiring some specific dependencies.

I would like to suggest that, in future FreePBX releases, you would publish native Debian packages instead of building RPM and converting them to DEB using alien. If you build natively, the DEB packages would have built-in information on dependencies and would not require that you manually need to install them.

Example for Debian's ffmpeg package (output provided by dpkg -s):

Package: ffmpeg
Status: install ok installed
Priority: optional
Section: video
Installed-Size: 2380
Maintainer: Debian Multimedia Maintainers <debian-multimedia@lists.debian.org>
Architecture: amd64
Multi-Arch: foreign
Version: 7:5.1.6-0+deb12u1
Depends: libavcodec59 (>= 7:5.0), libavdevice59 (>= 7:5.0), libavfilter8 (>= 7:5.1), libavformat59 (>= 7:5.1), libavutil57 (>= 7:5.1), libc6 (>= 2.35), libpostproc56 (>= 7:5.0), libsdl2-2.0-0 (>= 2.0.12), libswresample4 (>= 7:5.1), libswscale6 (>= 7:5.0)
Suggests: ffmpeg-doc
Description: Tools for transcoding, streaming and playing of multimedia files
 FFmpeg is the leading multimedia framework, able to decode, encode, transcode,
 mux, demux, stream, filter and play pretty much anything that humans and
 machines have created. It supports the most obscure ancient formats up to the
 cutting edge.
 .
 This package contains:
  * ffmpeg: a command line tool to convert multimedia files between formats
  * ffplay: a simple media player based on SDL and the FFmpeg libraries
  * ffprobe: a simple multimedia stream analyzer
  * qt-faststart: a utility to rearrange Quicktime files
Homepage: https://ffmpeg.org/

were Depends has information that the libavdevice59 package is required for proper ffmpeg operation.

In your's custom build ffmpeg package dpkg -s reports:

Package: ffmpeg
Status: install ok installed
Priority: extra
Section: alien
Installed-Size: 11845
Maintainer: root <root@4380a4f19800>
Architecture: amd64
Version: 5.1.4-10.sng12
Description: Digital VCR and streaming server
 FFmpeg is a complete and free Internet live audio and video
 broadcasting solution for Linux/Unix. It also includes a digital
 VCR. It can encode in real time in many formats including MPEG1 audio
 and video, MPEG4, h263, ac3, asf, avi, real, mjpeg, and flash.
 .
 (Converted from a rpm package by alien version 8.95.6.)

were there is no Depends section.

@raphaotten
Copy link

@JoseGoncalves Did you remove the --dev flag again with the latest commit?

@JoseGoncalves
Copy link
Contributor Author

@JoseGoncalves Did you remove the --dev flag again with the latest commit?

@raphaotten Yep. My bad... just fixed that. Thanks for reporting.

@raphaotten
Copy link

Is there a discussion what's blocking this PR? Seems like a useful addition to the installer script to me.

@JoseGoncalves
Copy link
Contributor Author

JoseGoncalves commented Oct 2, 2024

Is there a discussion what's blocking this PR?

As I'm aware, there is nothing blocking this PR from being merged.
My guess it that @kguptasangoma has higher priority issues to address first...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants