debian swirl logo

Back to the packages list gesftpserver

#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2012 Jonas Smedegaard 
# Description: Main Debian packaging script for Green End SFTP Server
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see .

DEB_AUTO_UPDATE_AUTOCONF = 2.67
DEB_AUTO_UPDATE_AUTOHEADER = 2.67
DEB_AUTO_UPDATE_ACLOCAL = 1.11
DEB_AUTO_UPDATE_AUTOMAKE = 1.11
-include /usr/share/cdbs/1/rules/upstream-tarball.mk
include /usr/share/cdbs/1/rules/utils.mk
include /usr/share/cdbs/1/class/autotools.mk
include /usr/share/cdbs/1/rules/debhelper.mk

# suppress optional build-dependencies
CDBS_BUILD_DEPENDS_rules_upstream-tarball = 
CDBS_BUILD_DEPENDS_rules_utils_copyright-check = 

DEB_UPSTREAM_PACKAGE = sftpserver
DEB_UPSTREAM_URL = http://www.greenend.org.uk/rjk/sftpserver
DEB_UPSTREAM_TARBALL_MD5 = 367e2e465e13a748ee8dfee974ca68fc

# Needed by upstream build process
CDBS_BUILD_DEPENDS += , libreadline-dev

# Needed by upstream regresssion testing
CDBS_BUILD_DEPENDS += , python, python-paramiko

# Preserve upstream shipped cruft
DEB_CLEAN_EXCLUDE = tests/version2~

# ignore files unused during build
DEB_COPYRIGHT_CHECK_IGNORE_REGEX = ^Makefile.in|aclocal.m4|configure|config.h.in|config\.aux/.*|debian/(changelog|copyright(|_hints|_newhints))$

# We use autotools too modern for default CDBS
DEB_CONFIGURE_LIBEXECDIR = /usr/lib

DEB_MAKE_CHECK_TARGET = check

# Some regression tests fail if ls output is localized
$(cdbs_make_check_stamps) : export LC_MESSAGES=C

# put aside autogenerated files during build
# TODO: use DEB_UPSTREAM_CRUFT_MOVE when cdbs 0.4.106 is in stable
upstreamtmpstuff = Makefile.in aclocal.m4 configure config.h.in
upstreamtmpstuff += $(patsubst %,config.aux/%,config.guess config.sub depcomp install-sh missing)
pre-build:: debian/upstream-stuff
debian/upstream-stuff: debian/stamp-copyright-check
		mkdir -p debian/upstream-stuff
		@for orig in $(upstreamtmpstuff); do \
		backup= "debian/upstream-stuff/$$orig"; \
			[ ! -e "$$orig" ] || [ -e "$$backup" ] || { \
				mkdir -p "$$(dirname "$$backup")"; \
				echo mv "$$orig" "$$backup"; \
				mv "$$orig" "$$backup"; \
			}; \
		done
clean::
		@for orig in $(upstreamtmpstuff); do \
		backup= "debian/upstream-stuff/$$orig"; \
			if [ -e "$$backup" ]; then \
				if [ -e "$$orig" ]; then \
					echo "rm -rf" "$$orig"; \
					rm -rf "$$orig"; \
				fi; \
				echo mv "$$backup" "$$orig"; \
				mv "$$backup" "$$orig"; \
			fi; \
		done
		rm -rf debian/upstream-stuff

# (re)generate most possible autotools files
DEB_ACLOCAL_ARGS = -Im4 --install --force
DEB_AUTOMAKE_ARGS = --add-missing --copy --foreign --force
DEB_MAKE_CLEAN_TARGET = distclean
makebuilddir::
		mkdir -p m4
clean::
		rm -rf m4

Builds:

gesftpserver
sftp server submodule for openssh