mirror of
https://git.proxmox.com/git/fwupd
synced 2025-07-24 17:32:09 +00:00

Since https://fwupd.github.io is now a thing, people can be directed there rather than relying upon locally built documentation by default. Also this will mean one less dependency to install for people who build from source. Lastly this finally means that I can do this set of actions without failure: ``` meson build ninja -C build ninja -C build install (PK prompts for password) rm -rf build ``` Previously gtkdoc stuff was built as root due to the PK prompt and removing it would lead to stuff like this: ``` rm: cannot remove 'build/docs/libfwupd/html/libfwupd-FwupdClient.html': Permission denied ```
111 lines
3.9 KiB
Makefile
Executable File
111 lines
3.9 KiB
Makefile
Executable File
#!/usr/bin/make -f
|
|
# -*- makefile -*-
|
|
|
|
export LC_ALL := C.UTF-8
|
|
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
|
|
export DEB_LDFLAGS_MAINT_STRIP=-Wl,-Bsymbolic-functions
|
|
|
|
#GPGME needs this for proper building on 32 bit archs
|
|
ifeq "$(DEB_HOST_ARCH_BITS)" "32"
|
|
export DEB_CFLAGS_MAINT_APPEND = -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
|
|
endif
|
|
|
|
ifneq ($(CI),)
|
|
export CI=--werror --wrap-mode=default
|
|
endif
|
|
|
|
SB_STYLE := debian
|
|
deb_version := $(shell dpkg-parsechangelog --show-field Version)
|
|
ifeq (yes,$(shell dpkg-vendor --derives-from Ubuntu && echo yes))
|
|
SB_STYLE := ubuntu
|
|
tar_name := fwupd_$(deb_version)_$(DEB_HOST_ARCH).tar.gz
|
|
else
|
|
TMPLDIR := debian/fwupd-$(DEB_HOST_ARCH)-signed-template/usr/share/code-signing/fwupd-$(DEB_HOST_ARCH)-signed-template
|
|
endif
|
|
|
|
%:
|
|
dh $@ --with gir
|
|
|
|
override_dh_auto_clean:
|
|
rm -fr debian/build
|
|
ifeq (ubuntu,$(SB_STYLE))
|
|
rm -rf debian/fwupd-images
|
|
endif
|
|
|
|
override_dh_auto_configure:
|
|
if pkg-config --exists libsmbios_c; then \
|
|
export DELL="-Dplugin_dell=true"; \
|
|
else \
|
|
export DELL="-Dplugin_dell=false"; \
|
|
fi; \
|
|
if pkg-config --exists efivar; then \
|
|
export UEFI="-Dplugin_uefi=true -Dplugin_redfish=true -Dplugin_nvme=true"; \
|
|
else \
|
|
export UEFI="-Dplugin_uefi=false -Dplugin_redfish=false -Dplugin_nvme=false"; \
|
|
fi; \
|
|
if [ ! -z "$$CI" ]; then \
|
|
export FLASHROM="-Dplugin_flashrom=true"; \
|
|
else \
|
|
export FLASHROM="-Dplugin_flashrom=false"; \
|
|
fi; \
|
|
dh_auto_configure -- $$UEFI $$DELL $$FLASHROM $$CI -Dplugin_dummy=true -Dgtkdoc=true --libexecdir=/usr/lib
|
|
|
|
override_dh_install:
|
|
find debian/tmp/usr -type f -name "*a" -print | xargs rm -f
|
|
sed -i 's,wheel,sudo,' ./debian/tmp/usr/share/polkit-1/rules.d/org.freedesktop.fwupd.rules
|
|
dh_install
|
|
#install the EFI binaries if needed
|
|
if [ -d debian/tmp/usr/lib/fwupd/efi/ ]; then \
|
|
dh_install -pfwupd usr/lib/fwupd/efi ;\
|
|
dh_install -pfwupd usr/lib/fwupd/fwupdate; \
|
|
fi
|
|
#if build with meson subproject in CI need to install this too
|
|
if [ ! -z "$$CI" ] && [ -f debian/tmp/usr/lib/xb-tool ]; then \
|
|
dh_install -pfwupd usr/lib/xb-tool ;\
|
|
fi
|
|
if [ ! -z "$$CI" ] && [ -f debian/tmp/usr/sbin/flashrom ]; then \
|
|
dh_install -pfwupd usr/sbin/flashrom ;\
|
|
fi
|
|
dh_missing -a --fail-missing
|
|
|
|
#this is placed in fwupd-tests
|
|
rm -f debian/fwupd/usr/lib/*/fwupd-plugins-3/libfu_plugin_test.so
|
|
rm -f debian/fwupd/etc/fwupd/remotes.d/fwupd-tests.conf
|
|
|
|
ifeq (debian,$(SB_STYLE))
|
|
# Generate the template source for the Debian signing service to use
|
|
mkdir -p $(TMPLDIR)/source-template/debian
|
|
cp -a debian/signing-template/* $(TMPLDIR)/source-template/debian
|
|
cp debian/README.Debian $(TMPLDIR)/source-template/debian
|
|
find $(TMPLDIR)/source-template/debian -type f | xargs sed -i "s,SIGNARCH,$(DEB_HOST_ARCH),"
|
|
find $(TMPLDIR)/source-template/debian -type f | xargs sed -i "s,SIGNVERSION,$(deb_version),"
|
|
for file in $$(find $(TMPLDIR)/source-template/debian -type f -name *SIGNARCH*); do file1=$$(echo $$file | sed "s,SIGNARCH,$(DEB_HOST_ARCH),"); mv -v $$file $$file1; done
|
|
install -m 0755 debian/fwupd.postinst $(TMPLDIR)/source-template/debian/fwupd-$(DEB_HOST_ARCH)-signed.postinst
|
|
install -m 0755 debian/fwupd.postrm $(TMPLDIR)/source-template/debian/fwupd-$(DEB_HOST_ARCH)-signed.postrm
|
|
./debian/gen_signing_changelog $(TMPLDIR)/source-template/debian fwupd $(DEB_HOST_ARCH)
|
|
./debian/gen_signing_json $(TMPLDIR) fwupd ${DEB_HOST_ARCH}
|
|
endif
|
|
|
|
override_dh_strip_nondeterminism:
|
|
dh_strip_nondeterminism -Xfirmware-example.xml.gz
|
|
|
|
override_dh_auto_test:
|
|
if [ -x /usr/bin/valgrind ] ; then \
|
|
dh_auto_test; \
|
|
fi
|
|
|
|
override_dh_builddeb:
|
|
dh_builddeb
|
|
ifeq (ubuntu,$(SB_STYLE))
|
|
if [ -d debian/tmp/usr/lib/fwupd/efi/ ]; then \
|
|
mkdir -p debian/fwupd-images/$(deb_version) ;\
|
|
cp debian/tmp/usr/lib/fwupd/efi/fwupd*.efi debian/fwupd-images/$(deb_version) ;\
|
|
echo $(deb_version) > debian/fwupd-images/$(deb_version)/version ;\
|
|
tar -C debian/fwupd-images -czvf ../$(tar_name) . ;\
|
|
dpkg-distaddfile $(tar_name) raw-uefi - ;\
|
|
fi
|
|
endif
|
|
|
|
override_dh_shlibdeps:
|
|
dh_shlibdeps $$DHSLIBS
|