#!/usr/bin/make -f PACKAGE=proftpd-basic PACKAGE_DEV=proftpd-dev NAME=proftpd VERSION=$(shell grep PROFTPD_VERSION_TEXT $(CURDIR)/include/version.h|cut -d\" -f2) # # HAVE_OPENSSL is required by mod_sql.c. # See #233031 for details. # PROFTPD_FLAGS := -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_OPENSSL -DUSE_LDAP_TLS CFLAGS := $(PROFTPD_FLAGS) CC := gcc # Some special build options ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) DEVELOPT=--enable-devel=yes endif ifneq (,$(findstring verbose,$(DEB_BUILD_OPTIONS))) DH_VERBOSE=1 export DH_VERBOSE endif ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) INSTALL_STRIP=-s endif # # dpkg-arch rules # ifeq (,$(DEB_BUILD_GNU_TYPE)) include debian/scripts/dpkg-arch.mk endif # XAttr does not exist on KFreeBSD # XATTR_NOT_EXISTS := kfreebsd-amd64 kfreebsd-i386 ifneq (,$(filter $(DEB_HOST_ARCH), $(XATTR_NOT_EXISTS))) BUILDNOTXATTR=--disable-xattr endif include /usr/share/dpkg/buildflags.mk DSOMODS1 = mod_unique_id:mod_site_misc:mod_load:mod_ban:mod_quotatab:mod_sql:mod_sql_mysql:mod_sql_postgres:mod_sql_sqlite:mod_sql_odbc:mod_dynmasq DSOMODS2 = mod_quotatab_sql:mod_ldap:mod_quotatab_ldap:mod_ratio:mod_tls:mod_rewrite:mod_radius:mod_wrap:mod_wrap2:mod_wrap2_file DSOMODS3 = mod_wrap2_sql:mod_quotatab_file:mod_quotatab_radius:mod_facl:mod_ctrls_admin:mod_copy:mod_deflate:mod_ifversion DSOMODS4 = mod_geoip:mod_exec:mod_sftp:mod_sftp_pam:mod_sftp_sql:mod_shaper:mod_sql_passwd:mod_ifsession:mod_auth_otp:mod_tls_redis DSOMODS5 = mod_wrap2_redis:mod_redis:mod_memcache:mod_tls_memcache:mod_readme:mod_snmp CONF_ARGS := --prefix=/usr \ --with-includes=$(shell pg_config --includedir)$(shell mysql_config --include|sed -e 's/-I/:/g'|sed -e 's/ //') \ --mandir=/usr/share/man --sysconfdir=/etc/$(NAME) --localstatedir=/run --libexecdir=/usr/lib/$(NAME) \ --enable-sendfile --enable-facl --enable-dso --enable-autoshadow --enable-ctrls \ --enable-ipv6 --enable-nls --enable-memcache --with-lastlog=/var/log/lastlog --enable-pcre $(DEVELOPT) \ --disable-strip --enable-redis $(BUILDNOTXATTR) ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) CONF_ARGS += --build $(DEB_HOST_GNU_TYPE) else CONF_ARGS += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) endif debian/control: debian/control.in sed -e 's/@VERSION@/$(VERSION)/' $< >$@ debian/proftpd-substvars: debian/proftpd-substvars.in sed -e 's/@VERSION@/$(VERSION)/' $< >$@ build-arch: build build-indep: build build: debian/proftpd-substvars configure-stamp build-stamp build-stamp: dh_testdir dh_auto_build touch $@ install: build dh_testdir dh_prep dh_auto_install configure: configure-stamp configure-stamp: dh_testdir # Use current autotools helpers dh_update_autotools_config dh_auto_configure -- $(CONF_ARGS) --with-shared=$(DSOMODS1):$(DSOMODS2):$(DSOMODS3):$(DSOMODS4):$(DSOMODS5) touch $@ clean: debian/control debian/proftpd-substvars myclean myclean: dh_testdir dh_auto_clean dh_clean # A few surplus files are removed using debian/clean rm -f $$(find . -type l) $$(find . -name "*~" -o -name "*.orig") rm -rf debian/*.gz core binary-indep: checkroot build dh_installdirs -i dh_install -i dh_installdocs -i dh_installchangelogs -i ChangeLog dh_installexamples -i dh_lintian -i dh_compress -i dh_fixperms -i dh_installdeb -i dh_gencontrol -i dh_md5sums -i dh_fixperms -i dh_builddeb -i binary-arch: checkroot build install dh_installdirs -a dh_install -a dh_installdocs -a dh_installchangelogs -a ChangeLog dh_installman -a dh_installlogrotate -a dh_installpam -a --name=$(NAME) dh_lintian -a # removes ftpasswd.1 installed by upstream see #699800 rm -f debian/$(PACKAGE)/usr/share/man/man1/ftpasswd.1* # removes proftpd.conf installed by upstream rm -f debian/$(PACKAGE)/etc/$(NAME)/$(NAME).conf # Not sure how to put this into a .files entry. install contrib/xferstats.holger-preiss debian/$(PACKAGE)/usr/sbin/ftpstats # TODO: cleanup {pre|post}{install|rm} scripts; remove # --no-scripts statement. dh_installinit -a --name=proftpd --no-scripts dh_installdebconf -a dh_compress -a dh_fixperms -a dh_makeshlibs -a dh_shlibdeps -a dh_installdeb -a dh_perl -a dh_strip -a dh_gencontrol -a dh_md5sums -a dh_fixperms -a dh_builddeb -a binary: binary-arch binary-indep checkroot: dh_testdir dh_testroot .PHONY: binary binary-arch binary-indep clean checkroot myclean install configure debian/proftpd-substvars debian/control .PHONY: build build-arch build-indep