Packaging beep for Linux distributions

This file contains a number of ideas and suggestions and references to other documentation which might come in helpful in case you are packaging beep for a Linux distribution.

In addition, to a packager of beep, INSTALL.md might also be interesting.

Building and installing

The building and installing during a package build can be achieved with

make
make install DESTDIR=/path/to/package-root CC=false

While not strictly necessary, the CC=false makes sure that no compilation happens during the make install phase.

You can also add to the default compiler flags by setting or adding to CFLAGS, CPPFLAGS, LDFLAGS, and LIBS, by running make like e.g.

make CFLAGS="-O -g -flto=auto -ffat-lto-objects" CPPFLAGS="-I/opt/include" LDFLAGS="-f" LIBS="-L/opt/lib"

The buildsystem will use whatever compiler CC is set to. clang and gcc are known to work, other toolchains might.

make CC=clang

If you need to set any of the *dir variables like prefix or docdir on the make command line, you need to set them for both the build step (make) and for the install step (make install). You might either give the very same command line for every invocation of make, or you can write those definitions into a make include file called local.mk once. For example, you might want to achieve the effect of

make prefix='/usr' docdir='$(docdir)/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)'
make prefix='/usr' docdir='$(docdir)/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)' DESTDIR=/path/to/package-root install

by creating a local.mk which might look as follows in e.g. an RPM spec file:

cat>local.mk<<EOF
prefix = %{_prefix}
docdir = %{_pkgdocdir}
EOF
make
make install DESTDIR='%{buildroot}'

or in a Debian debian/rules.mk file (something along these lines, untested):

override_dh_auto_configure:
    echo 'CC = $(CC)' > local.mk
    echo 'prefix = /usr' >> local.mk
    echo 'CFLAGS = $(shell dpkg-buildflags --get CFLAGS)' >> local.mk

Files to install for beep

User facing files

Documentation files

The files INSTALL.md, DEVELOPMENT.md, PACKAGING.md are not useful for binary packages. They only make sense for source trees.

System setup including permissions

All files installed into /etc are config files which the system administrator may change and expect to not be overwritten with package updates.

The sysadmin may add their own udev rules to /etc/udev/rules.d/ which should not be touched by the beep package.

Architectures

PC platforms

beep was written for the x86 platform, and works on both 32bit and 64bit x86 platforms.

Non-PC platforms implementing the EV_SND/SND_TONE interface

From a cursory glance through the Linux kernel source code, there appear to be a number of devices implementing the same EV_SND/SND_TONE evdev interface pcspkr.ko implements, like e.g. m68kspkr or sparcspkr.

It would be interesting to know on which non-PC platforms beep actually makes sense. The S/390 e.g. probably does not belong to the systems where beeper hardware is to be expected.

Platforms without pcspkr.ko or other EV_SND/SND_TONE devices

For platforms without a PC speaker, packaging beep only makes sense if there is both hardware support for beeping, and software support for that hardware.

At this time, beep provides no software support for any of those platforms.

Packages

The following is a list of links to some distributions' packages of beep:

More information on miscellaneous distributions' beep packages can be found at the repology.org beep page.

Packaging status