| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
export PYBUILD_INSTALL_ARGS=--install-lib=/usr/share |
| 4 |
|
| 5 |
%: |
| 6 |
dh $@ --buildsystem=pybuild |
| 7 |
|
| 8 |
execute_before_dh_auto_clean: |
| 9 |
find po -name "*.mo" -delete |
| 10 |
|
| 11 |
execute_after_dh_auto_install: |
| 12 |
make -C po install DESTDIR=$(CURDIR)/debian/bleachbit |
| 13 |
# Remove setuptools metadata, useless for a private installation |
| 14 |
rm -rf $(CURDIR)/debian/bleachbit/usr/share/bleachbit-*.egg-info |
| 15 |
# Remove Windows-specific modules |
| 16 |
rm -f $(CURDIR)/debian/bleachbit/usr/share/bleachbit/Winapp.py |
| 17 |
rm -f $(CURDIR)/debian/bleachbit/usr/share/bleachbit/Windows.py |
| 18 |
rm -f $(CURDIR)/debian/bleachbit/usr/share/bleachbit/WindowsWipe.py |
| 19 |
# Remove the macOS-specific module |
| 20 |
rm -f $(CURDIR)/debian/bleachbit/usr/share/bleachbit/Mac.py |
| 21 |
|
| 22 |
override_dh_install: |
| 23 |
# Install the launcher directly, so /usr/bin/bleachbit is a real file |
| 24 |
install -D -m 755 bleachbit.py $(CURDIR)/debian/bleachbit/usr/bin/bleachbit |
| 25 |
# Do not install Windows- and macOS-specific cleaners |
| 26 |
dh_install $(addprefix -X,$(notdir $(shell grep -l -e os=.windows. -e os=.macos. $(shell grep -L -e os=.linux. -e os=.unix. cleaners/*.xml) | xargs ls))) |
| 27 |
# Automatically generate .desktop file to invoke BleachBit as superuser |
| 28 |
sed -e "s/Name=BleachBit/Name=BleachBit \(as root\)/; \ |
| 29 |
s/TryExec=bleachbit/TryExec=pkexec/; \ |
| 30 |
s/Exec=bleachbit/Exec=pkexec bleachbit/" \ |
| 31 |
org.bleachbit.BleachBit.desktop > debian/bleachbit/usr/share/applications/bleachbit-root.desktop |