Thursday, October 27, 2022

[SOLVED] Debian package (.deb) that only installs from source

Issue

I have a C++ application that I want to deploy to Ubuntu/Debian users. But I have one constraint: this application should not be pre-compiled binary, but must compile in user environment. How can I organize the source .deb package that will be builds on user machine ?

Steps:

  1. Run tar -czf project_1.0.orig.tar.gz project-1.0 to get .orig tarball
  2. Run dh_make to get debian folder
  3. Update debian/control and debian/rules files
  4. Run dpkg-source -b to get .dsc and .debian.tar.xz
  5. What should I do to get .deb file ???
|-- project-1.0
|   |-- debian
|   |   |-- changelog
|   |   |-- control
|   |   |-- copyright
|   |   |-- rules
|   |   `-- source
|   `-- src
|       |-- CMakeLists.txt
|       `-- main.cpp
|-- project_1.0-1.debian.tar.xz
|-- project_1.0-1.dsc
`-- project_1.0.orig.tar.gz

debian/control

Source: project
Section: misc
Priority: optional
Maintainer: My Name <[email protected]>
Build-Depends:  cmake, debhelper-compat (= 12), qtbase5-dev, qtdeclarative5-dev
Standards-Version: 4.5.0

Package: project
Architecture: any
Multi-Arch: foreign
Depends: ${misc:Depends}, ${shlibs:Depends}, qml-module-qtquick2
Description: Super usefull tool

debian/rules

#!/usr/bin/make -f

%:
    dh $@

override_dh_auto_configure:
    dh_auto_configure -- -DIS_DEV=OFF

Thank a lot in advance !


Solution

There is no sane way to create a Debian package with these requirements. Just make sure installing from source works out of the box on your target platform(s).

You might want to ensure that any dependencies are installed, perhaps as part of your Makefile. This serves the same purpose as having a sequence of Build-Depends: in your debian/control file.



Answered By - tripleee
Answer Checked By - Marie Seifert (WPSolving Admin)