File debian.rules of Package bcunit
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1
export DIR_WHERE_FIRST_CMAKELISTS_DOT_TEXT_IS=buildstartshere
# Set debhelper options
DEB_BUILD_OPTIONS=nocheck
# Get some information about the machine we are building on:
export numberOfProcessorsOnMachine=$(shell nproc)
export wantedJobs=$(shell echo "1.25*$(numberOfProcessorsOnMachine)" | bc -l)
export jobsIget=$(shell echo $(wantedJobs) | awk '{print int($$1+0.5)}')
export TOTAL_DISK = $(shell df -h --total | awk 'END{print $$2}')
export FREEMEM = $(shell free --mega)
export TOTAL_MEM = $(shell free --total --mega | xargs | awk '{print $$19"MB"}')
export TOTAL_RAM = $(shell free --total --mega | xargs | awk '{print $$8"MB"}')
export TOTAL_SWAP = $(shell free --total --mega | xargs | awk '{print $$15"MB"}')
%:
echo
echo "----- Entering section % -----"
echo
#dh $@ --buildsystem=cmake --builddirectory=$(DIR_WHERE_FIRST_CMAKELISTS_DOT_TEXT_IS) --parallel --max-parallel=$(jobsIget)
dh $@ --buildsystem=cmake --parallel --max-parallel=$(jobsIget)
#dh $@ --buildsystem=cmake
#dh $@
echo
echo "----- Exiting section % -----"
echo
override_dh_auto_configure:
echo
echo "--- Start override_dh_auto_configure: ---"
echo
#find /usr/src/packages
cmake . \
-DCMAKE_INSTALL_PREFIX=/usr \
-DENABLE_STATIC=OFF \
-DENABLE_DOC=ON
echo
echo "--- End override_dh_auto_configure: ---"
echo
override_dh_update_autotools_config:
echo
echo "--- Start override_dh_update_autotools_config: ---"
echo
echo "Skipping running override_dh_update_autotools_config"
echo
echo "--- End override_dh_update_autotools_config: ---"
echo
override_dh_autoreconf:
echo
echo "--- Start override_dh_autoreconf: ---"
echo
echo "Skipping running dh_autoreconf"
echo
echo "--- End override_dh_autoreconf: ---"
echo
override_dh_auto_build:
echo
echo "--- Start override_dh_auto_build: ---"
echo
echo "--- Machine data we are building on ---"
echo "Total disk: $$TOTAL_DISK"
echo "Output of free -h:"
echo "$$FREEMEM"
echo "Total memory: $$TOTAL_MEM"
echo "Total RAM: $$TOTAL_RAM"
echo "Total SWAP: $$TOTAL_SWAP"
echo "numberOfProcessorsOnMachine=$$numberOfProcessorsOnMachine"
echo "wantedJobs=$$wantedJobs"
echo "jobsIget=$$jobsIget"
echo "--- End machine data we are building on ---"
echo
echo "--- Show files ---"
find /usr/src/packages
echo "--- End show files ---"
echo
cmake --build .
echo
echo "--- End override_dh_auto_build: ---"
echo
override_dh_auto_test:
echo
echo "--- Start override_dh_auto_test: ---"
echo
echo "Skipping running dh_auto_test"
echo
echo "--- End override_dh_auto_test: ---"
echo
override_dh_auto_install:
echo
echo "--- Start override_dh_auto_install: ---"
echo
make -j$(jobsIget) install DESTDIR=/usr/src/packages/BUILD/debian/tmp AM_UPDATE_INFO_DIR=no
echo
echo "--- End override_dh_auto_install: ---"
echo
execute_after_dh_install:
echo
echo "--- Start execute_before_dh_auto_install: ---"
echo
echo "--- Show files ---"
find /usr/src/packages/BUILD/debian/tmp
echo "--- End show files ---"
echo
echo "--- End execute_before_dh_auto_install: ---"
echo