debian swirl logo

Back to the packages list licq

#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/langcore.mk

DEB_INSTALL_DOCS_ALL = 
DEB_INSTALL_CHANGELOGS_ALL = doc/CHANGELOG
DEB_DH_MAKESHLIBS_ARGS_ALL = -X usr/lib/licq/

# cmake settings
CMAKE = cmake
CMAKE_BUILDDIR = obj-$(if $(1),$(1)-)$(DEB_BUILD_GNU_TYPE)
CMAKE_INSTALL_PREFIX = /usr
CMAKE_NORMAL_ARGS  = -DCMAKE_INSTALL_PREFIX="$(CMAKE_INSTALL_PREFIX)"
CMAKE_NORMAL_ARGS += -DCMAKE_C_COMPILER:FILEPATH="$(CC)"
CMAKE_NORMAL_ARGS += -DCMAKE_CXX_COMPILER:FILEPATH="$(CXX)"
CMAKE_NORMAL_ARGS += -DCMAKE_C_FLAGS="$(CFLAGS) $(CPPFLAGS)"
CMAKE_NORMAL_ARGS += -DCMAKE_CXX_FLAGS="$(CXXFLAGS) $(CPPFLAGS)"
CMAKE_NORMAL_ARGS += -DCMAKE_EXE_LINKER_FLAGS="$(LDFLAGS)"
CMAKE_NORMAL_ARGS += -DCMAKE_MODULE_LINKER_FLAGS="$(LDFLAGS)"
CMAKE_NORMAL_ARGS += -DCMAKE_SKIP_RPATH=ON
CMAKE_NORMAL_ARGS += -DCMAKE_VERBOSE_MAKEFILE=ON
export CTEST_OUTPUT_ON_FAILURE= 1

# plugin packages
PLUGINS := $(filter licq-plugin-%,$(shell dh_listpackages))
PLUGINS := $(patsubst licq-plugin-%,%,$(PLUGINS))
PLUGINS := $(filter-out qt4-common,$(PLUGINS))

# directories of plugin packages in source tree
src/autoreply = auto-reply
src/console   = console
src/forwarder = forwarder
src/icq       = icq
src/jabber    = jabber
src/kde4      = qt4-gui
src/msn       = msn
src/osd       = osd
src/qt4       = qt4-gui
src/rms       = rms


# Build rules

ifeq ($(filter nocheck,$(DEB_BUILD_OPTIONS)),)
configure/licq:: CMAKE_EXTRA_ARGS += -DBUILD_TESTS=ON
else
configure/licq:: CMAKE_EXTRA_ARGS += -DBUILD_TESTS=OFF
endif

configure/licq:: $(CMAKE_BUILDDIR)/CMakeCache.txt
$(CMAKE_BUILDDIR)/CMakeCache.txt:
		mkdir -p $(@D)
		cd $(@D) && $(CMAKE) $(CURDIR) $(CMAKE_NORMAL_ARGS) $(CMAKE_EXTRA_ARGS)

build/licq:: debian/stamp-licq-build
debian/stamp-licq-build:
		$(DEB_MAKE_ENVVARS) $(MAKE) -C $(CMAKE_BUILDDIR)
		touch $@

clean::
		rm -f debian/stamp-licq-build
		rm -rf $(CMAKE_BUILDDIR)


# Plugins
define build-plugin
configure/licq-plugin-$(1):: CMAKE_EXTRA_ARGS += -DCMAKE_MODULE_PATH=$(CURDIR)/cmake
configure/licq-plugin-$(1):: plugins/$$(src/$(1))/$(CMAKE_BUILDDIR)/CMakeCache.txt
plugins/$$(src/$(1))/$(CMAKE_BUILDDIR)/CMakeCache.txt:
		mkdir -p $$(@D)
		cd $$(@D) && $$(CMAKE) $(CURDIR)/plugins/$$(src/$(1)) $$(CMAKE_NORMAL_ARGS) $$(CMAKE_EXTRA_ARGS)

build/licq-plugin-$(1):: debian/stamp-$(1)-build
debian/stamp-$(1)-build:
		$$(DEB_MAKE_ENVVARS) $$(MAKE) -C plugins/$$(src/$(1))/$(CMAKE_BUILDDIR)
		touch $$@

install/licq-plugin-$(1)::
		$$(DEB_MAKE_ENVVARS) $$(MAKE) -C plugins/$$(src/$(1))/$(CMAKE_BUILDDIR) install DESTDIR=$(CURDIR)/debian/licq-plugin-$(1)
ifeq ($(1),qt4)
		rm debian/licq-plugin-qt4/usr/share/licq/qt4-gui/emoticons/FeltTip4/LICENSE
		mkdir -p debian/licq-plugin-qt4-common/usr/share/licq
		mv debian/licq-plugin-qt4/usr/share/licq/qt4-gui debian/licq-plugin-qt4-common/usr/share/licq/
endif
ifneq ($(filter $(1), qt4 kde4),)
		rm -r debian/licq-plugin-$(1)/usr/share/licq
endif

clean::
		rm -f debian/stamp-$(1)-build
		rm -rf plugins/$$(src/$(1))/$(CMAKE_BUILDDIR)
endef

configure/licq-plugin-kde4:: CMAKE_EXTRA_ARGS += -DWITH_KDE=ON

$(foreach X,$(PLUGINS),$(eval $(call build-plugin,$(X))))


# Install rules

install/licq-plugin-qt4-common:: install/licq-plugin-qt4

install/licq install/licq-dev:: install-licq-common
install-licq-common::
		$(DEB_MAKE_ENVVARS) $(MAKE) -C $(CMAKE_BUILDDIR) install DESTDIR=$(CURDIR)/debian/licq
		mkdir -p debian/licq/usr/share/pixmaps
		cp plugins/qt4-gui/src/xpm/licq.xpm debian/licq/usr/share/pixmaps
		mkdir -p debian/licq-dev/usr
		mv debian/licq/usr/include debian/licq-dev/usr/include

Builds:

licq-dev
licq development and header files
licq
multi-protocol instant messaging client (base files)
licq-plugin-autoreply
autoreply plug-in for licq
licq-plugin-forwarder
forwarder plug-in for licq
licq-plugin-icq
icq/aim plug-in for licq
licq-plugin-jabber
jabber plug-in for licq
licq-plugin-kde4
graphical user interface plug-in for licq using kde4
licq-plugin-msn
msn plug-in for licq
licq-plugin-osd
on-screen display plug-in for licq
licq-plugin-qt4-common
common data files for the qt4 and kde4 licq plugins
licq-plugin-qt4
graphical user interface plug-in for licq using qt4
licq-plugin-rms
remote management server plug-in for telnet licq access