# This is the recipe.sh script. It is executed by BPM in a temporary directory when compiling a source package # BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE # BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT # The package function is executed in the source directory # This function is used to move the compiled files into the output directory package_tlp() { cd "$BPM_SOURCE" export TLP_NO_INIT=1 export TLP_SBIN=/usr/sbin export TLP_WITH_ELOGIND=1 export TLP_WITH_SYSTEMD=0 make DESTDIR="$BPM_OUTPUT" install-tlp install-man-tlp # Install esvm service install -Dm644 "$BPM_WORKDIR"/tlp.esv "$BPM_OUTPUT"/etc/esvm/services/tlp.esv # Install package license install -Dm644 "$BPM_SOURCE"/LICENSE "$BPM_OUTPUT"/usr/share/licenses/tlp/LICENSE } package_tlp-pd() { cd "$BPM_SOURCE" make DESTDIR="$BPM_OUTPUT" install-pd install-man-pd # Fix path to 'tlp' binary in 'tlp-pd' sed -i 's|"tlp", f"{profile}"|"/usr/sbin/tlp", f"{profile}"|g' "$BPM_OUTPUT"/usr/sbin/tlp-pd # Set Exec field in dbus services to tlp-pd sed -i 's|^Exec=.*|Exec=/usr/sbin/tlp-pd|' \ "$BPM_OUTPUT"/usr/share/dbus-1/system-services/org.freedesktop.UPower.PowerProfiles.service \ "$BPM_OUTPUT"/usr/share/dbus-1/system-services/net.hadess.PowerProfiles.service # Install esvm service install -Dm644 "$BPM_WORKDIR"/tlp-pd.esv "$BPM_OUTPUT"/etc/esvm/services/tlp-pd.esv # Install package license install -d "$BPM_OUTPUT"/usr/share/licenses ln -sf "$BPM_OUTPUT"/usr/share/licenses/tlp "$BPM_OUTPUT"/usr/share/licenses/tlp-pd }