#!/usr/bin/make -f # -*- makefile -*- # Sample debian/rules that uses debhelper. # # This file was originally written by Joey Hess and Craig Small. # As a special exception, when this file is copied by dh-make into a # dh-make output file, you may use that output file without restriction. # This special exception was added by Craig Small in version 0.37 of dh-make. # # Modified to make a template file for a multi-binary package with separated # build-arch and build-indep targets by Bill Allombert 2001 # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # This has to be exported to make some magic below work. export DH_OPTIONS include /usr/share/dpkg/default.mk export DEB_LDFLAGS_MAINT_APPEND=-Wl,--as-needed export DEB_BUILD_MAINT_OPTIONS=hardening=+all ifeq ($(DEB_HOST_ARCH_OS), linux) CONFIGURE_ARGS+=--enable-epoll else ifeq ($(DEB_HOST_ARCH_OS), kfreebsd) CONFIGURE_ARGS+=--enable-kqueue else ifeq ($(DEB_HOST_ARCH_OS), solaris) CONFIGURE_ARGS+=--enable-ports else CONFIGURE_ARGS+=--enable-poll endif ifdef DEB_DEBUG CONFIGURE_ARGS+=--enable-warnings --enable-iodebug endif ifneq ($(filter pkg.charybdis.openssl,$(DEB_BUILD_PROFILES)),) CONFIGURE_ARGS+=--enable-openssl else ifneq ($(filter pkg.charybdis.gnutls,$(DEB_BUILD_PROFILES)),) CONFIGURE_ARGS+=--disable-openssl --enable-gnutls else CONFIGURE_ARGS+=--disable-openssl --enable-mbedtls endif ifdef DEB_NICKLEN CONFIGURE_ARGS+=--with-nicklen=$(DEB_NICKLEN) endif EXTERNAL_BUILD_TIMESTAMP?=$(shell LC_ALL=C date --utc -d @$(SOURCE_DATE_EPOCH)) export EXTERNAL_BUILD_TIMESTAMP override_dh_auto_configure: # XXX: too much stuff here, see https://github.com/atheme/charybdis/issues/14 dh_auto_configure -- --prefix=/usr --with-confdir=/etc/charybdis \ ${CONFIGURE_ARGS} \ --with-program-prefix=charybdis- \ --enable-fhs-paths \ --libdir=/usr/lib/charybdis/ \ --localstatedir=/var/lib/ \ --with-helpdir=/usr/share/doc/charybdis/help/ \ --with-logdir=/var/log/charybdis/ \ --with-rundir=/var/run/ \ --with-moduledir=/usr/lib/charybdis/modules \ --with-shared-sqlite \ --enable-ipv6 override_dh_auto_install: dh_auto_install --destdir=debian/charybdis # spurious logs directory creation upstream, remove when fails # fixed upstream: https://github.com/charybdis-ircd/charybdis/commit/550e03fadc91160991e1bbc0f7a7d193f48640ce#diff-c949f93d03f44a4217d7a138f9e2e54a rmdir $(CURDIR)/debian/charybdis/usr/logs # remove when it fails, it means upstream stopped shipping .la files, yay rm $(CURDIR)/debian/charybdis/usr/lib/charybdis/librb.la rm $(CURDIR)/debian/charybdis/usr/lib/charybdis/libircd.la # see https://github.com/atheme/charybdis/issues/23 # maybe this should be in /usr/share/doc, but then users won't know when to update their configs... mv $(CURDIR)/debian/charybdis/etc/charybdis/ircd.conf.example $(CURDIR)/debian/charybdis/etc/charybdis/ircd.conf # restart only after upgrades to reduce downtime override_dh_installinit: dh_installinit -R %: dh $@