| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
export QT_SELECT=qt5 |
| 4 |
export DEB_BUILD_MAINT_OPTIONS=hardening=+all |
| 5 |
DPKG_EXPORT_BUILDFLAGS = 1 |
| 6 |
|
| 7 |
# The build system doesn't use CPPFLAGS, pass them to CFLAGS/CXXFLAGS to |
| 8 |
# enable the missing (hardening) flags |
| 9 |
DEB_CFLAGS_MAINT_APPEND = -MMD -Wall $(shell dpkg-buildflags --get CPPFLAGS) |
| 10 |
DEB_CXXFLAGS_MAINT_APPEND = $(shell dpkg-buildflags --get CPPFLAGS) |
| 11 |
|
| 12 |
include /usr/share/dpkg/default.mk |
| 13 |
|
| 14 |
ifeq ($(DEB_HOST_ARCH_OS),kfreebsd) |
| 15 |
DEB_BUILD_PROFILES := pkg.wpa.nogui $(DEB_BUILD_PROFILES) |
| 16 |
export LIBS = -ldl |
| 17 |
endif |
| 18 |
|
| 19 |
BINDIR = /usr/sbin |
| 20 |
V = 1 |
| 21 |
|
| 22 |
PKG_CONFIG ?= $(DEB_HOST_GNU_TYPE)-pkg-config |
| 23 |
|
| 24 |
export BINDIR V PKG_CONFIG |
| 25 |
|
| 26 |
HOSTAPD_DOT_CONFIG := debian/config/hostapd/$(DEB_HOST_ARCH_OS) |
| 27 |
WPASUPPLICANT_DOT_CONFIG := debian/config/wpasupplicant/$(DEB_HOST_ARCH_OS) |
| 28 |
WPASUPPLICANT_UDEB_DOT_CONFIG := debian/config/wpasupplicant/$(DEB_HOST_ARCH_OS)-udeb |
| 29 |
|
| 30 |
### start dh overrides |
| 31 |
override_dh_auto_configure: |
| 32 |
ifeq (,$(filter pkg.wpa.nogui,$(DEB_BUILD_PROFILES))) |
| 33 |
dh_auto_configure --sourcedirectory=wpa_supplicant/wpa_gui-qt4 \ |
| 34 |
--buildsystem=qmake |
| 35 |
endif |
| 36 |
|
| 37 |
override_dh_auto_build: |
| 38 |
ifeq (,$(filter nodoc,$(DEB_BUILD_PROFILES))) |
| 39 |
# build documentation |
| 40 |
dh_auto_build --sourcedirectory=wpa_supplicant/doc/docbook \ |
| 41 |
--buildsystem=makefile \ |
| 42 |
-- man |
| 43 |
endif |
| 44 |
ifeq (,$(filter noudeb,$(DEB_BUILD_PROFILES))) |
| 45 |
# build wpasupplicant-udeb |
| 46 |
cp -v --remove-destination $(WPASUPPLICANT_UDEB_DOT_CONFIG) wpa_supplicant/.config |
| 47 |
dh_auto_build --sourcedirectory=wpa_supplicant \ |
| 48 |
--buildsystem=makefile |
| 49 |
mv -v wpa_supplicant/wpa_supplicant wpa_supplicant/wpa_supplicant-udeb |
| 50 |
dh_auto_clean --sourcedirectory=wpa_supplicant \ |
| 51 |
--buildsystem=makefile |
| 52 |
endif |
| 53 |
# build wpasupplicant, libwpa_client and eapol_test |
| 54 |
cp -v --remove-destination $(WPASUPPLICANT_DOT_CONFIG) wpa_supplicant/.config |
| 55 |
dh_auto_build --sourcedirectory=wpa_supplicant \ |
| 56 |
--buildsystem=makefile -- all libwpa_client.a eapol_test |
| 57 |
ifeq (,$(filter pkg.wpa.nogui,$(DEB_BUILD_PROFILES))) |
| 58 |
# build wpa_gui-qt4 |
| 59 |
dh_auto_build --sourcedirectory=wpa_supplicant/wpa_gui-qt4 \ |
| 60 |
--buildsystem=qmake |
| 61 |
endif |
| 62 |
dh_auto_clean --sourcedirectory=src --buildsystem=makefile |
| 63 |
# build hostapd |
| 64 |
cp -v --remove-destination $(HOSTAPD_DOT_CONFIG) hostapd/.config |
| 65 |
dh_auto_build --sourcedirectory=hostapd \ |
| 66 |
--buildsystem=makefile |
| 67 |
dh_auto_clean --sourcedirectory=src --buildsystem=makefile |
| 68 |
|
| 69 |
override_dh_auto_clean: |
| 70 |
ifeq (,$(filter nodoc,$(DEB_BUILD_PROFILES))) |
| 71 |
dh_auto_clean --sourcedirectory=wpa_supplicant/doc/docbook \ |
| 72 |
--buildsystem=makefile |
| 73 |
endif |
| 74 |
dh_auto_clean --sourcedirectory=wpa_supplicant \ |
| 75 |
--buildsystem=makefile |
| 76 |
ifeq (,$(filter pkg.wpa.nogui,$(DEB_BUILD_PROFILES))) |
| 77 |
dh_auto_clean --sourcedirectory=wpa_supplicant/wpa_gui-qt4 \ |
| 78 |
--buildsystem=qmake |
| 79 |
-find wpa_supplicant/wpa_gui-qt4 -type d -name \.moc -exec rm -rf {} \; |
| 80 |
-find wpa_supplicant/wpa_gui-qt4 -type d -name \.ui -exec rm -rf {} \; |
| 81 |
-find wpa_supplicant/wpa_gui-qt4 -type d -name \.obj -exec rm -rf {} \; |
| 82 |
endif |
| 83 |
dh_auto_clean --sourcedirectory=hostapd \ |
| 84 |
--buildsystem=makefile |
| 85 |
|
| 86 |
override_dh_auto_install: |
| 87 |
$(info Skip dh_auto_install ...) |
| 88 |
|
| 89 |
execute_before_dh_clean: |
| 90 |
# make sure to remove the staging directory for the udeb |
| 91 |
rm -rf debian/wpasupplicant-udeb |
| 92 |
|
| 93 |
execute_after_dh_install: |
| 94 |
# install D-Bus service activation files & configuration |
| 95 |
install --mode=644 -D wpa_supplicant/dbus/dbus-wpa_supplicant.conf \ |
| 96 |
debian/wpasupplicant/usr/share/dbus-1/system.d/wpa_supplicant.conf |
| 97 |
ifeq (,$(filter noudeb,$(DEB_BUILD_PROFILES))) |
| 98 |
# Install udeb |
| 99 |
install --mode=755 -D wpa_supplicant/wpa_supplicant-udeb \ |
| 100 |
debian/wpasupplicant-udeb/usr/sbin/wpa_supplicant |
| 101 |
endif |
| 102 |
|
| 103 |
override_dh_installchangelogs: |
| 104 |
dh_installchangelogs --package=hostapd hostapd/ChangeLog |
| 105 |
dh_installchangelogs --package=wpasupplicant wpa_supplicant/ChangeLog |
| 106 |
ifeq (,$(filter pkg.wpa.nogui,$(DEB_BUILD_PROFILES))) |
| 107 |
dh_installchangelogs --package=wpagui wpa_supplicant/ChangeLog |
| 108 |
endif |
| 109 |
dh_installchangelogs --remaining-packages |
| 110 |
### end dh overrides |
| 111 |
|
| 112 |
execute_after_dh_installexamples: |
| 113 |
sed -e 's="includes.h"=<stddef.h>=' -e 's="common/wpa_ctrl.h"=<wpa_ctrl.h>=' -i debian/*/usr/share/doc/*/examples/*.c |
| 114 |
|
| 115 |
%: |
| 116 |
dh $@ |