How to build Debian packages
Please describe.
The source tree has a debian directory with control.tpl.
Describe the solution you'd like
Description how to build Debian packages from source got from git clone https://github.com/rustdesk/rustdesk-server.git.
Describe alternatives you've considered
debuild, screenshot follows:
stappers@messer:/usr/src/rust/rustdesk/rustdesk-server
$ debuild
debuild: warning: debian/changelog(l4): found start of entry where expected more change data or trailer
LINE: rustdesk-server (1.1.13) UNRELEASED; urgency=medium
debuild: warning: debian/changelog(l4): found end of file where expected more change data or trailer
dpkg-buildpackage -us -uc -ui
dpkg-buildpackage: warning: debian/changelog(l4): found start of entry where expected more change data or trailer
LINE: rustdesk-server (1.1.13) UNRELEASED; urgency=medium
dpkg-buildpackage: warning: debian/changelog(l4): found end of file where expected more change data or trailer
dpkg-buildpackage: error: cannot read debian/control: No such file or directory
debuild: fatal error at line 1182:
dpkg-buildpackage -us -uc -ui failed
stappers@messer:/usr/src/rust/rustdesk/rustdesk-server
$
Notes
At https://www.debian.org/doc/debian-policy/ch-source.html#s-readmesource is this text:
debian/README.source may also include any other information that would be helpful to someone modifying the source package. Even if the package doesn’t fit the above description, maintainers are encouraged to document in a debian/README.source file any source package with a particularly complex or unintuitive source layout or build system (for example, a package that builds the same source multiple times to generate different binary packages).
Qouting rustdesk-server/.github/workflows/build.yaml
- name: Download binaries
uses: actions/download-artifact@v4
with:
name: binaries-linux-${{ matrix.job.name }}
path: debian-build/${{ matrix.job.name }}/bin
- name: Build package for ${{ matrix.job.name }} arch
run: |
chmod -v a+x debian-build/${{ matrix.job.name }}/bin/*
cp -vr debian systemd debian-build/${{ matrix.job.name }}/
cat debian/control.tpl | sed 's/{{ ARCH }}/${{ matrix.job.debian_platform }}/' > debian-build/${{ matrix.job.name }}/debian/control
cd debian-build/${{ matrix.job.name }}/
debuild -i -us -uc -b -a${{ matrix.job.debian_platform }}
Now converting that to something that works locally.
For (re)using the debian/control.tpl has debian/README.source from #592 these lines:
eval $( dpkg-architecture )
sed -e "s/{{ ARCH }}/${DEB_TARGET_ARCH}/" \
debian/control.tpl > target/rustdesk-server/debian/control