#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/autoreconf.mk
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/gnome.mk
include /usr/share/gnome-pkg-tools/1/rules/uploaders.mk
include /usr/share/gnome-pkg-tools/1/rules/gnome-version.mk
-include /usr/share/gnome-pkg-tools/1/rules/gnome-get-source.mk

LDFLAGS += -Wl,-z,defs -Wl,-O1 -Wl,--as-needed

DEB_CONFIGURE_EXTRA_FLAGS += --disable-scrollkeeper \
	--enable-ipv6 \
	--enable-suid=no \
	--disable-battstat \
	--without-hal

DEB_DH_BUILDDEB_ARGS := -- -Zbzip2

DEB_MAKE_ENVVARS += echo=/bin/echo

MANPAGES += debian/cpufreq-selector.1
DEB_INSTALL_MANPAGES_gnome-applets = $(MANPAGES)

DEB_DH_STRIP_ARGS += --dbg-package=gnome-applets-dbg

# Build manual pages
build/gnome-applets:: $(MANPAGES)

debian/cpufreq-selector.1: debian/cpufreq-selector.sgml
	docbook-to-man $< > $@

binary-install/gnome-applets::
	rm -rf debian/gnome-applets/usr/lib/gnome-applets/gnome-applets/
	chmod a+x debian/gnome-applets/usr/bin/* debian/gnome-applets/usr/lib/gnome-applets/*
	dh_python2 -pgnome-applets

binary-install/gnome-applets-data::
	find debian/gnome-applets-data/usr/share -type f -exec chmod -R a-x {} \;
	dh_python2 -pgnome-applets-data

clean::
	rm -f $(MANPAGES)
