1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2010, Jonas Smedegaard <dr@jones.dk>
# Description: Debian packaging script for Radicale
#
# 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 <http://www.gnu.org/licenses/>.
DEB_PYTHON_SYSTEM = pysupport
include /usr/share/cdbs/1/rules/upstream-tarball.mk
include /usr/share/cdbs/1/rules/utils.mk
include /usr/share/cdbs/1/class/python-distutils.mk
include /usr/share/cdbs/1/rules/debhelper.mk
DEB_UPSTREAM_URL = http://radicale.org/src/radicale
DEB_UPSTREAM_PACKAGE = Radicale
DEB_UPSTREAM_TARBALL_MD5 = 3bc9b8a495bcfcd68a02d5253320b51f
# workaround: python-distutils.mk by default adds unusual option -a
DEB_PYTHON_CLEAN_ARGS =
# Avoid unneeded build-dependency on python-dev
CDBS_BUILD_DEPENDS_class_python-distutils = python$(cdbs_python_nondefault_version)
# generate manpage based on --help option of script itself
CDBS_BUILD_DEPENDS += , help2man (>= 1.37.1~)
manpages = debian/radicale.1
DEB_INSTALL_MANPAGES_radicale = $(manpages)
common-binary-indep:: $(manpages)
$(manpages): install/python-radicale
$(manpages): debian/%.1 : %
export PYTHONPATH="$(cdbs_python_destdir)/usr/lib/python$(or $(cdbs_python_nondefault_version),$(cdbs_python_current_version))/site-packages/"; \
help2man \
--name="a simple calendar server" \
--version-string="$(DEB_NOEPOCH_VERSION)" \
--no-info \
--output=$@ \
$(cdbs_python_destdir)/usr/bin/$<
find "$(cdbs_python_destdir)/usr/lib" -name '*.pyc' -exec rm '{}' ';'
clean::
rm -f $(manpages)
# Ensure proper hash-bang in Python script (Python Policy 0.9 §3.1)
binary-fixup/radicale::
egrep -r -l -Z '^#! ?/usr/bin/(env )?python[[:print:]]*$$' debian/$(cdbs_curpkg)/usr/bin/* \
| xargs -r -0 perl -pi -e 's,^#! ?/usr/bin/(env )?python[[:print:]]*$$,#!/usr/bin/python$(cdbs_python_nondefault_version),'
|