16 Commits

Author SHA1 Message Date
Sunil Mohan Adapa
1ad48ecad8
d/rules: Drop a workaround for dh_installsytemd needed for /usr/lib
Since debhelper 13.11.6, we don't need this hack as dh_installsystemd recognizes
the files in /usr/lib/systemd/ directory in addition to /lib/systemd/.

Tests:

- After build package with gbp. Notice that postinst script has code inserted by
dh_installsystemd for starting/restarting the service.

- Install the deb package starts service. Reinstalling the package restarts the
service.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2025-09-29 16:58:45 +03:00
Sunil Mohan Adapa
71a50e6d19
privileged: Add systemd units for socket activating the daemon
Tests:

- Daemon starts up with uid/gid set to root.

- Daemon does not run by default if a request is not received. Socket file is
  created with 666 permissions and root:root ownership. Socket file parent directory
  is created with 755 permissions and root:root ownership.

- Daemon starts if a request is sent to the socket using nc.

- If there an exception in daemon starting, then restart is done every second to
  5 seconds, forever.

- Build a Debian package.

  - Install it on fresh trixie Debian VM. Ensure that setup works and privileged
    daemon is auto-enabled.

  - Start a fresh trixie Debian VM and install freedombox from Debian repos.
    Upgrade to the built package. Privileged daemon works and is auto-enabled.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
2025-08-16 22:41:20 +05:30
James Valleroy
32fd5048c1
debian: Print warning if version mismatch
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2025-07-27 09:01:58 -07:00
Sunil Mohan Adapa
2788d6810d
Makefile: Move various tests into build system
- This allows those tests to be invoked on console and not just in CI pipelines.

Tests:

- Running make check works.

- CI pipeline succeeds.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
[jvalleroy: Remove phony test target]
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2024-02-12 19:17:16 -05:00
Sunil Mohan Adapa
812ed5d60d
*: Introduce make file based build, eliminate setup.py
- setuptools aims to a build library instead of being invoked by setup.py.
Launching setup tools using ./setup.py is deprecated. Launching it using
generic build tools that use pyproject.toml is recommended.

- With the new approach customizing the build is not possible to the earlier
extent. So, introduce is a simple and sufficient build system using 'make'.

Tests:

- Check the pyproject.toml using validate-pyproject tool.

- Run diffoscope on old and new packages and verify that no unexpected changes
were introduced by the build system change.

- None of the files part of .deb package have different file permissions
compared to before.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2024-02-12 19:17:09 -05:00
James Valleroy
122bda7f7e
debian: Fail build if no module dependencies found
debian/rules uses --list-dependencies to collect the dependencies of
all essential modules. Ensure that the list is not empty.

Helps #2149.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-11-22 05:39:56 -08:00
Sunil Mohan Adapa
2b525a1930
d/rules: Don't install and enable other systemd service files
Close: #1982.

This eliminates the issue with calibre and wordpress services getting run even
before the app is installed. These services are enabled when the app is
installed. On disadvantage is that services are no longer restarted when a newer
service file is installed.

Users for whom caibre and wordpress have already been enabled. Nothing changes
on upgrade and service will still be enabled. However, the services won't be
attempted to be started without the app's being installed. This is good enough
without having to write custom logic to disable these services.

Tests:

- Install freedombox package on a fresh setup. wordpress and calibre service
files are not enabled.

- When wordpress and calibre apps are installed, these services are enabled and
run as expected.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-10-09 22:09:03 -04:00
Sunil Mohan Adapa
f2bcecdf74
d/rules: Don't use setup.py to invoke tests, invoke directly instead
Invoking pytest from setup.py seems to be deprecated. It offers no real
advantages other than being predictable way of invoking tests for someone who
don't know that we use pytest for testing. Let's rely on our documentation
instead. Further this clears up the need to have setup.cfg.

Tests:

- Build debian package in using pbuilder. Tests are run and succeed during the
build.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-10-07 15:14:09 -04:00
Sunil Mohan Adapa
bf7a9b8c7a
d/rules: vagrant: INSTALL.md: Fix installing dependencies
- Using ./run --develop ensures that the last list of dependencies are picked up
from current source directory instead of list of dependencies from system
configuration.

- Using sudo -u plinth ensures that even if any temporary files are created,
they belong to the plinth user instead of root user.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-28 21:02:05 -04:00
James Valleroy
2d1ced84cd
upgrades: Use a custom service for manual update
- Do not enable/start service during package install/upgrade
- Configure needrestart to skip restarting service

Closes: #1638.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
[sunil: Provide proper regex string in needrestart configuration with qr()]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-06-15 13:33:31 -07:00
Sunil Mohan Adapa
172f5f3160
debian: Separate binary packages for each language manual
- When there are multiple binary packages, a common practice is to install into
  debian/tmp using the Makefile and then use dh_install and .install files. This
  splits the contents installed into debian/tmp to various package directories
  debian/{package}.

- Install documentation in to /usr/share/freedombox instead of
  /usr/share/doc/freedombox. Then create a link to /usr/share/doc/freedombox/.
  This approach is recommended Debian Policy Manual in section 12.3[1] because
  it should safe for administrator to delete files in /usr/share/doc safely
  without breaking the application functionality. The doc-base must refer to the
  documentation in /usr/share/doc as per doc-base documentation.

Links

1) https://www.debian.org/doc/debian-policy/ch-docs.html#additional-documentation

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-03-25 17:52:22 -04:00
Sunil Mohan Adapa
5f8965df25
debian: Rename plinth package to freedombox
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-12-31 15:59:08 -05:00
James Valleroy
5e13ba0424
debian: Use 'setup.py test' to run tests
Since pytest is a build-depend, pybuild uses it by default.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2018-10-08 23:03:24 -04:00
James Valleroy
094b586834
debian: Bump debhelper compat version to 11
Rely on dh_installsystemd instead of systemd-sequence.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2018-04-09 19:04:35 +05:30
Federico Ceratto
34ae273692
debian: Remove unneded rules target
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2017-11-03 18:31:01 +05:30
Federico Ceratto
17ee712502
debian: Switch to native package
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2017-11-03 18:30:35 +05:30