From 51ae82e41e7c344109c574a0cf3b3cdc2a2e4156 Mon Sep 17 00:00:00 2001 From: Jonathan Reed Date: Wed, 22 May 2013 08:27:04 -0400 Subject: [PATCH] Imported Debian version 5.1.2 --- Debian/Debhelper/Sequence/config_package.pm | 10 + Debian/Debhelper/config_package.pm | 48 ++ check-files.mk | 87 ++++ config-package.mk | 112 +++++ debconf-divert.mk | 72 +++ debconf-hack.sh | 37 ++ debian/changelog | 289 +++++++++++ debian/compat | 1 + debian/config-package-dev.docs | 1 + debian/config-package-dev.examples | 1 + debian/config-package-dev.install | 11 + debian/config-package-dev.manpages | 1 + debian/control | 29 ++ debian/copyright | 22 + debian/rules | 12 + debian/source/format | 1 + decode | 12 + dh_configpackage | 457 ++++++++++++++++++ displace.mk | 144 ++++++ displace.sh.in | 159 ++++++ doc/DOCUMENTATION | 11 + encode | 18 + examples/EXAMPLES | 47 ++ .../debian/changelog | 5 + .../debathena-bin-example-1.0/debian/compat | 1 + .../debathena-bin-example-1.0/debian/control | 17 + .../debian/control.in | 14 + .../debian/copyright | 24 + .../debian/debathena-bin-example.install | 2 + .../debian/elinks.debathena | 6 + .../debian/less.debathena | 4 + .../debathena-bin-example-1.0/debian/rules | 20 + .../debian/changelog | 11 + .../debathena-bin-example-1.1/debian/compat | 1 + .../debathena-bin-example-1.1/debian/control | 17 + .../debian/control.in | 14 + .../debian/copyright | 24 + .../debian/debathena-bin-example.install | 1 + .../debian/less.debathena | 4 + .../debathena-bin-example-1.1/debian/rules | 23 + .../debian/changelog | 5 + .../debian/compat | 1 + .../debian/control | 17 + .../debian/control.in | 14 + .../debian/copyright | 24 + .../debian/debathena-conffile-example.install | 1 + .../debian/rules | 11 + .../files/etc/issue.net.debathena | 1 + .../debian/changelog | 12 + .../debian/compat | 1 + .../debian/control | 17 + .../debian/control.in | 14 + .../debian/copyright | 24 + .../debian/debathena-conffile-example.install | 1 + .../debian/rules | 16 + .../debian/transform_legal.debathena | 6 + .../files/etc/issue.net.debathena | 1 + .../debian/changelog | 5 + .../debathena-cron-example-1.0/debian/compat | 1 + .../debathena-cron-example-1.0/debian/control | 17 + .../debian/control.in | 14 + .../debian/copyright | 24 + .../debian/debathena-cron-example.cron.d | 9 + .../debathena-cron-example-1.0/debian/rules | 17 + .../debian/changelog | 5 + .../debian/compat | 1 + .../debian/control | 17 + .../debian/control.in | 14 + .../debian/copyright | 24 + .../debian/rules | 8 + .../debian/transform_lynx.cfg.debathena | 9 + .../debian/changelog | 5 + .../debathena-bin-example-1.0/debian/compat | 1 + .../debathena-bin-example-1.0/debian/control | 14 + .../debian/copyright | 25 + .../debian/debathena-bin-example.displace | 4 + .../debian/debathena-bin-example.install | 2 + .../debian/debathena-bin-example.links | 2 + .../debian/elinks.debathena | 6 + .../debian/less.debathena | 4 + .../debathena-bin-example-1.0/debian/rules | 4 + .../debian/source/format | 1 + .../debian/changelog | 11 + .../debathena-bin-example-1.1/debian/compat | 1 + .../debathena-bin-example-1.1/debian/control | 14 + .../debian/copyright | 25 + .../debian/debathena-bin-example.displace | 2 + .../debian/debathena-bin-example.install | 1 + .../debian/debathena-bin-example.links | 1 + .../debian/debathena-bin-example.undisplace | 2 + .../debian/less.debathena | 4 + .../debathena-bin-example-1.1/debian/rules | 4 + .../debian/source/format | 1 + .../debian/changelog | 5 + .../debian/compat | 1 + .../debian/control | 14 + .../debian/copyright | 25 + .../debathena-conffile-example.displace | 1 + .../debian/debathena-conffile-example.install | 1 + .../debian/rules | 4 + .../debian/source/format | 1 + .../files/etc/issue.net.debathena | 1 + .../debian/changelog | 12 + .../debian/compat | 1 + .../debian/control | 14 + .../debian/copyright | 25 + .../debathena-conffile-example.displace | 1 + .../debian/debathena-conffile-example.install | 1 + .../debian/rules | 10 + .../debian/source/format | 1 + .../debian/transform_legal.debathena | 6 + .../files/etc/issue.net.debathena | 1 + .../debian/changelog | 5 + .../debathena-cron-example-1.0/debian/compat | 1 + .../debathena-cron-example-1.0/debian/control | 14 + .../debian/copyright | 25 + .../debian/debathena-cron-example.cron.d | 9 + .../debian/debathena-cron-example.hide | 1 + .../debathena-cron-example-1.0/debian/rules | 4 + .../debian/source/format | 1 + .../debian/changelog | 5 + .../debian/compat | 1 + .../debian/control | 14 + .../debian/copyright | 25 + .../debathena-transform-example.transform | 1 + .../debian/rules | 4 + .../debian/source/format | 1 + transform-files.mk | 57 +++ 128 files changed, 2528 insertions(+) create mode 100644 Debian/Debhelper/Sequence/config_package.pm create mode 100644 Debian/Debhelper/config_package.pm create mode 100644 check-files.mk create mode 100644 config-package.mk create mode 100644 debconf-divert.mk create mode 100644 debconf-hack.sh create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/config-package-dev.docs create mode 100644 debian/config-package-dev.examples create mode 100644 debian/config-package-dev.install create mode 100644 debian/config-package-dev.manpages create mode 100644 debian/control create mode 100644 debian/copyright create mode 100755 debian/rules create mode 100644 debian/source/format create mode 100755 decode create mode 100755 dh_configpackage create mode 100644 displace.mk create mode 100644 displace.sh.in create mode 100644 doc/DOCUMENTATION create mode 100755 encode create mode 100644 examples/EXAMPLES create mode 100644 examples/cdbs/debathena-bin-example-1.0/debian/changelog create mode 100644 examples/cdbs/debathena-bin-example-1.0/debian/compat create mode 100644 examples/cdbs/debathena-bin-example-1.0/debian/control create mode 100644 examples/cdbs/debathena-bin-example-1.0/debian/control.in create mode 100644 examples/cdbs/debathena-bin-example-1.0/debian/copyright create mode 100644 examples/cdbs/debathena-bin-example-1.0/debian/debathena-bin-example.install create mode 100644 examples/cdbs/debathena-bin-example-1.0/debian/elinks.debathena create mode 100644 examples/cdbs/debathena-bin-example-1.0/debian/less.debathena create mode 100755 examples/cdbs/debathena-bin-example-1.0/debian/rules create mode 100644 examples/cdbs/debathena-bin-example-1.1/debian/changelog create mode 100644 examples/cdbs/debathena-bin-example-1.1/debian/compat create mode 100644 examples/cdbs/debathena-bin-example-1.1/debian/control create mode 100644 examples/cdbs/debathena-bin-example-1.1/debian/control.in create mode 100644 examples/cdbs/debathena-bin-example-1.1/debian/copyright create mode 100644 examples/cdbs/debathena-bin-example-1.1/debian/debathena-bin-example.install create mode 100644 examples/cdbs/debathena-bin-example-1.1/debian/less.debathena create mode 100755 examples/cdbs/debathena-bin-example-1.1/debian/rules create mode 100644 examples/cdbs/debathena-conffile-example-1.0/debian/changelog create mode 100644 examples/cdbs/debathena-conffile-example-1.0/debian/compat create mode 100644 examples/cdbs/debathena-conffile-example-1.0/debian/control create mode 100644 examples/cdbs/debathena-conffile-example-1.0/debian/control.in create mode 100644 examples/cdbs/debathena-conffile-example-1.0/debian/copyright create mode 100644 examples/cdbs/debathena-conffile-example-1.0/debian/debathena-conffile-example.install create mode 100755 examples/cdbs/debathena-conffile-example-1.0/debian/rules create mode 100644 examples/cdbs/debathena-conffile-example-1.0/files/etc/issue.net.debathena create mode 100644 examples/cdbs/debathena-conffile-example-1.1/debian/changelog create mode 100644 examples/cdbs/debathena-conffile-example-1.1/debian/compat create mode 100644 examples/cdbs/debathena-conffile-example-1.1/debian/control create mode 100644 examples/cdbs/debathena-conffile-example-1.1/debian/control.in create mode 100644 examples/cdbs/debathena-conffile-example-1.1/debian/copyright create mode 100644 examples/cdbs/debathena-conffile-example-1.1/debian/debathena-conffile-example.install create mode 100755 examples/cdbs/debathena-conffile-example-1.1/debian/rules create mode 100755 examples/cdbs/debathena-conffile-example-1.1/debian/transform_legal.debathena create mode 100644 examples/cdbs/debathena-conffile-example-1.1/files/etc/issue.net.debathena create mode 100644 examples/cdbs/debathena-cron-example-1.0/debian/changelog create mode 100644 examples/cdbs/debathena-cron-example-1.0/debian/compat create mode 100644 examples/cdbs/debathena-cron-example-1.0/debian/control create mode 100644 examples/cdbs/debathena-cron-example-1.0/debian/control.in create mode 100644 examples/cdbs/debathena-cron-example-1.0/debian/copyright create mode 100644 examples/cdbs/debathena-cron-example-1.0/debian/debathena-cron-example.cron.d create mode 100755 examples/cdbs/debathena-cron-example-1.0/debian/rules create mode 100644 examples/cdbs/debathena-transform-example-1.0/debian/changelog create mode 100644 examples/cdbs/debathena-transform-example-1.0/debian/compat create mode 100644 examples/cdbs/debathena-transform-example-1.0/debian/control create mode 100644 examples/cdbs/debathena-transform-example-1.0/debian/control.in create mode 100644 examples/cdbs/debathena-transform-example-1.0/debian/copyright create mode 100755 examples/cdbs/debathena-transform-example-1.0/debian/rules create mode 100755 examples/cdbs/debathena-transform-example-1.0/debian/transform_lynx.cfg.debathena create mode 100644 examples/debhelper/debathena-bin-example-1.0/debian/changelog create mode 100644 examples/debhelper/debathena-bin-example-1.0/debian/compat create mode 100644 examples/debhelper/debathena-bin-example-1.0/debian/control create mode 100644 examples/debhelper/debathena-bin-example-1.0/debian/copyright create mode 100644 examples/debhelper/debathena-bin-example-1.0/debian/debathena-bin-example.displace create mode 100644 examples/debhelper/debathena-bin-example-1.0/debian/debathena-bin-example.install create mode 100644 examples/debhelper/debathena-bin-example-1.0/debian/debathena-bin-example.links create mode 100644 examples/debhelper/debathena-bin-example-1.0/debian/elinks.debathena create mode 100644 examples/debhelper/debathena-bin-example-1.0/debian/less.debathena create mode 100755 examples/debhelper/debathena-bin-example-1.0/debian/rules create mode 100644 examples/debhelper/debathena-bin-example-1.0/debian/source/format create mode 100644 examples/debhelper/debathena-bin-example-1.1/debian/changelog create mode 100644 examples/debhelper/debathena-bin-example-1.1/debian/compat create mode 100644 examples/debhelper/debathena-bin-example-1.1/debian/control create mode 100644 examples/debhelper/debathena-bin-example-1.1/debian/copyright create mode 100644 examples/debhelper/debathena-bin-example-1.1/debian/debathena-bin-example.displace create mode 100644 examples/debhelper/debathena-bin-example-1.1/debian/debathena-bin-example.install create mode 100644 examples/debhelper/debathena-bin-example-1.1/debian/debathena-bin-example.links create mode 100644 examples/debhelper/debathena-bin-example-1.1/debian/debathena-bin-example.undisplace create mode 100644 examples/debhelper/debathena-bin-example-1.1/debian/less.debathena create mode 100755 examples/debhelper/debathena-bin-example-1.1/debian/rules create mode 100644 examples/debhelper/debathena-bin-example-1.1/debian/source/format create mode 100644 examples/debhelper/debathena-conffile-example-1.0/debian/changelog create mode 100644 examples/debhelper/debathena-conffile-example-1.0/debian/compat create mode 100644 examples/debhelper/debathena-conffile-example-1.0/debian/control create mode 100644 examples/debhelper/debathena-conffile-example-1.0/debian/copyright create mode 100644 examples/debhelper/debathena-conffile-example-1.0/debian/debathena-conffile-example.displace create mode 100644 examples/debhelper/debathena-conffile-example-1.0/debian/debathena-conffile-example.install create mode 100755 examples/debhelper/debathena-conffile-example-1.0/debian/rules create mode 100644 examples/debhelper/debathena-conffile-example-1.0/debian/source/format create mode 100644 examples/debhelper/debathena-conffile-example-1.0/files/etc/issue.net.debathena create mode 100644 examples/debhelper/debathena-conffile-example-1.1/debian/changelog create mode 100644 examples/debhelper/debathena-conffile-example-1.1/debian/compat create mode 100644 examples/debhelper/debathena-conffile-example-1.1/debian/control create mode 100644 examples/debhelper/debathena-conffile-example-1.1/debian/copyright create mode 100644 examples/debhelper/debathena-conffile-example-1.1/debian/debathena-conffile-example.displace create mode 100644 examples/debhelper/debathena-conffile-example-1.1/debian/debathena-conffile-example.install create mode 100755 examples/debhelper/debathena-conffile-example-1.1/debian/rules create mode 100644 examples/debhelper/debathena-conffile-example-1.1/debian/source/format create mode 100755 examples/debhelper/debathena-conffile-example-1.1/debian/transform_legal.debathena create mode 100644 examples/debhelper/debathena-conffile-example-1.1/files/etc/issue.net.debathena create mode 100644 examples/debhelper/debathena-cron-example-1.0/debian/changelog create mode 100644 examples/debhelper/debathena-cron-example-1.0/debian/compat create mode 100644 examples/debhelper/debathena-cron-example-1.0/debian/control create mode 100644 examples/debhelper/debathena-cron-example-1.0/debian/copyright create mode 100644 examples/debhelper/debathena-cron-example-1.0/debian/debathena-cron-example.cron.d create mode 100644 examples/debhelper/debathena-cron-example-1.0/debian/debathena-cron-example.hide create mode 100755 examples/debhelper/debathena-cron-example-1.0/debian/rules create mode 100644 examples/debhelper/debathena-cron-example-1.0/debian/source/format create mode 100644 examples/debhelper/debathena-transform-example-1.0/debian/changelog create mode 100644 examples/debhelper/debathena-transform-example-1.0/debian/compat create mode 100644 examples/debhelper/debathena-transform-example-1.0/debian/control create mode 100644 examples/debhelper/debathena-transform-example-1.0/debian/copyright create mode 100644 examples/debhelper/debathena-transform-example-1.0/debian/debathena-transform-example.transform create mode 100755 examples/debhelper/debathena-transform-example-1.0/debian/rules create mode 100644 examples/debhelper/debathena-transform-example-1.0/debian/source/format create mode 100644 transform-files.mk diff --git a/Debian/Debhelper/Sequence/config_package.pm b/Debian/Debhelper/Sequence/config_package.pm new file mode 100644 index 0000000..5e9057e --- /dev/null +++ b/Debian/Debhelper/Sequence/config_package.pm @@ -0,0 +1,10 @@ +#!/usr/bin/perl +# debhelper sequence file for config-package-dev + +use warnings; +use strict; +use Debian::Debhelper::Dh_Lib; + +insert_before("dh_link", "dh_configpackage"); + +1 diff --git a/Debian/Debhelper/config_package.pm b/Debian/Debhelper/config_package.pm new file mode 100644 index 0000000..d78bc9c --- /dev/null +++ b/Debian/Debhelper/config_package.pm @@ -0,0 +1,48 @@ +#!/usr/bin/perl + +package Debian::Debhelper::config_package; + +use warnings; +use strict; + +use Exporter; +use vars qw(@ISA @EXPORT); +@ISA=qw(Exporter); +@EXPORT=qw(&encode &decode); + +sub encode { + my $result = ""; + my $input = shift; + $input =~ s,^/,,; + foreach (split('', $input)) { + if (m/[a-z0-9.-]/) { + $result .= "$_"; + } elsif (m/[A-Z]/) { + $result .= "+".lc($_)."+"; + } elsif ($_ eq '/') { + $result .= "++"; + } elsif ($_ eq '_') { + $result .= "+-+"; + } else{ + $result .= "+x".hex(ord($_))."+"; + } + } + return $result; +} + +sub unparse { + $_ = $_[0]; + return "/" unless $_; + return "_" if $_ eq "-"; + return uc($_) if /^[a-z]$/; + s/^x//; + return chr hex $_; +} + +sub decode { + my $input = shift; + $input =~ s/\+([^+]*)\+/unparse($1)/eg; + return $input; +} + +1 diff --git a/check-files.mk b/check-files.mk new file mode 100644 index 0000000..8ee47fb --- /dev/null +++ b/check-files.mk @@ -0,0 +1,87 @@ +# -*- mode: makefile; coding: utf-8 -*- +# Copyright © 2007-2008 Anders Kaseorg and +# Tim Abbott +# +# 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, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. + +# Don't include check-files.mk in your rules files directly; instead +# use config-package.mk. + +# check-files.mk is used to verify that files on local disk have not +# been modified from the upstream packaged version. Its only API +# function is adding the following function as a dependency: +# +# $(call debian_check_files,filename) +# +# Returns the path to a copy of filename that is verified to be +# unmodified from the version shipped by the distribution (by checking +# md5sums). The function causes the package to fail to build if the +# relevant configuration file has been modified on the build machine. + +ifndef _cdbs_rules_check_files +_cdbs_rules_check_files = 1 + +include /usr/share/cdbs/1/rules/displace.mk + +DEB_CHECK_FILES_TMPDIR = debian/check_file_copies + +debian_check_files_source = $(if $(DEB_CHECK_FILES_SOURCE_$(1)),$(DEB_CHECK_FILES_SOURCE_$(1)),$(call displace_files_replace_name,$(1))) + +debian_check_files = $(patsubst %,$(DEB_CHECK_FILES_TMPDIR)%,$(1)) +undebian_check_files = $(patsubst $(DEB_CHECK_FILES_TMPDIR)%,%,$(1)) + +debian_check_files_tmp = $(patsubst %,%.tmp,$(call debian_check_files,$(1))) +undebian_check_files_tmp = $(call undebian_check_files,$(patsubst %.tmp,%,$(1))) + +# We need a level of indirection here in order to make sure that +# normal makefile targets, like "clean", are not affected by the +# debian_check_files rules. +$(call debian_check_files,%): $(call debian_check_files_tmp,%) + mv $< $@ + +# We check md5sums from both /var/lib/dpkg/info/$(package).md5sums +# (the md5sums database for non-conffiles) and the conffiles database +# used for prompting about conffiles being changed (via dpkg-query). +# +# There is some wrangling here because the formats of these sources differ. +$(call debian_check_files_tmp,%): target = $(call undebian_check_files_tmp,$@) +$(call debian_check_files_tmp,%): name = $(call debian_check_files_source,$(target)) +$(call debian_check_files_tmp,%): truename = $(shell dpkg-divert --truename $(name)) +$(call debian_check_files_tmp,%): package = $(shell LC_ALL=C dpkg -S $(name) | sed -n '/^diversion by /! s/: .*$$// p') +$(call debian_check_files_tmp,%): $(truename) + [ -n "$(package)" ] + mkdir -p $(@D) + cp "$(truename)" $@ + set -e; \ + md5sums="$$(dpkg-query --control-path $(package) md5sums 2>/dev/null)" || \ + md5sums=/var/lib/dpkg/info/$(package).md5sums; \ + md5=$$(dpkg-query --showformat='$${Conffiles}\n' --show $(package) | \ + sed -n 's,^ $(name) \([0-9a-f]*\)$$,\1 $@, p'); \ + if [ -n "$$md5" ]; then \ + echo "$$md5" | md5sum -c; \ + elif [ -e "$$md5sums" ]; then \ + md5=$$(sed -n 's,^\([0-9a-f]*\) $(patsubst /%,%,$(name))$$,\1 $@, p' \ + "$$md5sums"); \ + [ -n "$$md5" ] && echo "$$md5" | md5sum -c; \ + else \ + echo "config-package-dev: warning: $(package) does not include md5sums!"; \ + echo "config-package-dev: warning: md5sum for $(name) not verified."; \ + fi + +clean:: + rm -rf $(DEB_CHECK_FILES_TMPDIR) + +endif diff --git a/config-package.mk b/config-package.mk new file mode 100644 index 0000000..0c41b52 --- /dev/null +++ b/config-package.mk @@ -0,0 +1,112 @@ +# -*- mode: makefile; coding: utf-8 -*- +# Copyright © 2007-2008 Anders Kaseorg and +# Tim Abbott +# +# 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, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. + +# /usr/share/cdbs/1/rules/config-package.mk is the externally-facing +# makefile fragment for config-package-dev. It should be included +# after the following variables are set in debian/rules. +# +# +# Most variables are lists, so one can +# +# DEB_DISPLACE_FILES_package += /path1/file1.divert \ +# /path2/file2.divert \ +# /path3/file3.divert +# +# We use += in the examples +# +# The config-package-dev system supports the following variables: +# +# DEB_DISPLACE_EXTENSION +# +# Extension used for all config-package-dev diversions (defaults to +# .divert, which we will use in examples). This field is difficult to +# change on package upgrades; we recommend picking a value to use for +# all packages at your site. +# +# DEB_DISPLACE_FILES_package += /path/file.divert +# +# List of absolute paths to files to be replaced at package install +# time by being diverted from /path/file to /path/file.divert-orig +# (DEB_DISPLACE_EXTENSION should be part of the path, but need not +# appear at the end); a symlink /path/file -> /path/file.divert will +# be installed in its place. The user is responsible for installing +# /path/file.divert. This is best for diverting binaries and most +# configuration files. +# +# DEB_TRANSFORM_FILES_package += /path/file.divert +# +# This works like DEB_DISPLACE_FILES, but additionally the file to be +# installed to /path/file.divert will be generated at package build +# time as the standard output from +# +# $(DEB_TRANSFORM_SCRIPT_path/file.divert) < $(DEB_CHECK_FILES_SOURCE_/path/file.divert) +# +# These variables have the following defaults: +# +# DEB_TRANSFORM_SCRIPT_path/file.divert = debian/transform_file.divert +# DEB_CHECK_FILES_SOURCE_/path/file.divert = /path/file +# +# If DEB_CHECK_FILES_SOURCE_/path/file.divert does not match the +# md5sums shipped with the package containing it, the package build +# will abort. DEB_TRANSFORM_FILES is targeted at making changes to a +# (potentially long) configuration file that will work on several +# Debian versions. We recommend using DEB_TRANSFORM_FILES in +# conjunction with pbuilder, sbuild, or another tool for building +# Debian packages in a clean environment. (That said, if /path/file is +# diverted on the running system, DEB_CHECK_FILES_SOURCE does +# reverse-resolve the diversion and default to the original version of +# the file, to allow you to rebuild a package using DEB_TRANSFORM_FILES +# that is currently installed, in most cases.) +# +# DEB_HIDE_FILES_package += /path/file +# +# List of absolute paths to files to be diverted to a unique path in +# /usr/share/package/. No symlink or replacement file will be +# installed. This system is useful for disabling files in /etc/cron.d +# or similar .d directories where the normal divert-and-symlink +# approach would result in (e.g.) the old cron job still being run, +# and any new cron job being run twice. Note that for technical +# reasons related to how dpkg unpacks files, you cannot also install a +# replacement file to /etc/cron.d/file; you must install it to some +# other path (which should be fine in a .d directory). If you want to +# install a replacement file with the same name, you probably want +# DEB_DISPLACE_FILES. +# +# DEB_UNDISPLACE_FILES_package += /path/file.divert +# +# List of absolute paths to files whose diversions caused by +# DEB_DISPLACE_FILES are to be removed upon installing this package, if +# the diversions have been made on the target system. This is +# primarily useful for removing a now-unnecessary displacement provided by +# a previous version of this package on an upgrade. +# +# DEB_UNHIDE_FILES_package += /path/file +# +# This works like DEB_UNDISPLACE_FILES_package, except that it undoes +# the work of a previous DEB_HIDE_FILES. In particular, it only removes +# the diversion, whereas DEB_UNDISPLACE_FILES first removes the symlink +# generated by DEB_DISPLACE_FILES. + +ifndef _cdbs_rules_config_package +_cdbs_rules_config_package = 1 + +# transform-files.mk includes the other config-package-dev fragments. +include /usr/share/cdbs/1/rules/transform-files.mk + +endif diff --git a/debconf-divert.mk b/debconf-divert.mk new file mode 100644 index 0000000..26f97bf --- /dev/null +++ b/debconf-divert.mk @@ -0,0 +1,72 @@ +# -*- mode: makefile; coding: utf-8 -*- +# Copyright © 2007-2008 Anders Kaseorg and +# Tim Abbott +# +# 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, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. + +ifndef _cdbs_rules_debconf_divert +_cdbs_rules_debconf_divert = 1 + +CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), config-package-dev (>= 3.2~) + +DEB_DEBCONF_HACK_SCRIPT = /usr/share/config-package-dev/debconf-hack.sh + +DEB_DEBCONF_HACK_PACKAGES += $(foreach package,$(DEB_ALL_PACKAGES), \ + $(if $(wildcard debian/$(package).debconf-hack),$(package))) + +dh_compat_6 := $(shell if [ '$(DH_COMPAT)' -ge 6 ]; then echo y; fi) + +$(patsubst %,debian-debconf-hack/%,$(DEB_DEBCONF_HACK_PACKAGES)) :: debian-debconf-hack/%: + set -e; \ + { \ + cat $(DEB_DEBCONF_HACK_SCRIPT); \ + echo 'if [ ! -f /var/cache/$(cdbs_curpkg).debconf-save ]; then'; \ + echo ' debconf_get $(shell cut -d' ' -f2 debian/$(cdbs_curpkg).debconf-hack) >/var/cache/$(cdbs_curpkg).debconf-save'; \ + echo ' debconf_set <> $(CURDIR)/debian/$(cdbs_curpkg).preinst.debhelper + set -e; \ + { \ + cat $(DEB_DEBCONF_HACK_SCRIPT); \ + echo 'if [ -f /var/cache/$(cdbs_curpkg).debconf-save ]; then'; \ + echo ' debconf_set > $(CURDIR)/debian/$(cdbs_curpkg).postinst.debhelper + set -e; \ + { \ + $(if $(dh_compat_6),, \ + if [ -e $(CURDIR)/debian/$(cdbs_curpkg).postrm.debhelper ]; then \ + cat $(CURDIR)/debian/$(cdbs_curpkg).postrm.debhelper; \ + fi;) \ + cat $(DEB_DEBCONF_HACK_SCRIPT); \ + echo 'if [ -f /var/cache/$(cdbs_curpkg).debconf-save ]; then'; \ + echo ' debconf_set > $(CURDIR)/debian/$(cdbs_curpkg).postrm.debhelper.new + mv $(CURDIR)/debian/$(cdbs_curpkg).postrm.debhelper.new \ + $(CURDIR)/debian/$(cdbs_curpkg).postrm.debhelper + +$(patsubst %,binary-fixup/%,$(DEB_DEBCONF_HACK_PACKAGES)) :: binary-fixup/%: debian-debconf-hack/% + +endif diff --git a/debconf-hack.sh b/debconf-hack.sh new file mode 100644 index 0000000..f77fb8a --- /dev/null +++ b/debconf-hack.sh @@ -0,0 +1,37 @@ +debconf_get () { + perl -MDebconf::Db -MDebconf::Question -e ' + Debconf::Db->load(readonly => "true"); + for $label (@ARGV) { + if ($q = Debconf::Question->get($label)) { + print $q->owners."\t".$q->name."\t".$q->type."\t".$q->value."\t".$q->flag("seen")."\n"; + } else { + print "\t$label\t\t\tfalse\n"; + } + }' -- "$@" +} + +debconf_set () { + perl -MDebconf::Db -MDebconf::Template -MDebconf::Question -e ' + Debconf::Db->load; + while (<>) { + chomp; + ($owners, $label, $type, $value, $seen) = split("\t"); + @o{split(", ", $owners)} = (); + unless ($t = Debconf::Template->get($label)) { + next unless ($owners); + $t = Debconf::Template->new($label, $owners[0], $type); + $t->description("Dummy template"); + $t->extended_description("This is a fake template used to pre-seed the debconf database. If you are seeing this, something is probably wrong."); + } + @to{split(", ", $t->owners)} = (); + map { $t->addowner($_) unless exists $to{$_}; } keys %o; + map { $t->removeowner($_) unless exists $o{$_}; } keys %to; + next unless ($q = Debconf::Question->get($label)); + $q->value($value); + $q->flag("seen", $seen); + @qo{split(", ", $q->owners)} = (); + map { $q->addowner($_) unless exists $qo{$_}; } keys %o; + map { $q->removeowner($_) unless exists $o{$_}; } keys %qo; + } + Debconf::Db->save;' +} diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..16cde6b --- /dev/null +++ b/debian/changelog @@ -0,0 +1,289 @@ +config-package-dev (5.1.2) unstable; urgency=low + + * Team upload. + * Don't hardcode dpkg-divert's path in check-files.mk (Debathena: #1358) + + -- Jonathan Reed Wed, 22 May 2013 08:27:04 -0400 + +config-package-dev (5.1.1) unstable; urgency=low + + * Team upload. + * No-change rebuild to remove stray symlinks and build detritus from the + upload (Closes: #705214) + + -- Jonathan Reed Fri, 12 Apr 2013 17:59:30 -0400 + +config-package-dev (5.1) unstable; urgency=low + + [ Team Upload ] + * Support the abort-remove invocation of postinst + * Add the transformed file, not its source, to the list of files to displace + + -- Alexander Chernyakhovsky Mon, 08 Apr 2013 15:12:32 -0400 + +config-package-dev (5.0) unstable; urgency=low + + * Add Debhelper support (Debathena: #867) (Closes: #693672). This + release includes a new command, dh_configpackage, and a sequencer + extension, dh --with config-package. + * Use the terms "displace" and "hide" for actions of the + config-package-dev system, instead of the terms "divert" and + "remove", which already have existing (related) meanings in the + context of Debian packages. + * Move examples/* to examples/cdbs/*, and create examples/debhelper/*, + with the same packages using Debhelper 7-style packaging. + + * Change config-package-dev's own packaging to Debhelper 7. + * Bump Standards-Version to 3.9.4 (no changes required). + * Update Vcs-Git and Vcs-Browser locations to new upstream. + * Drop CDBS runtime dependency. CDBS users should be explicitly + Build-Depending on CDBS, probably through use of the @cdbs@ macro in + debian/control.in. + + -- Geoffrey Thomas Wed, 06 Mar 2013 17:14:42 -0800 + +config-package-dev (4.14) unstable; urgency=low + + [ Anders Kaseorg ] + * Reverse prerm and postrm maintainer script fragments when DH_COMPAT ≥ + 6, not 5, to actually match debhelper’s behavior. + + [ Geoffrey Thomas ] + * Update debathena-transform-example-1.0 to an example more likely to + work on modern systems. + * Fix a bug that would erroneously remove DEB_TRANSFORM_EXTENSION from + an explicitly-specified DEB_TRANSFORM_FILES_SOURCE. + * Fix some typos and misleading documentation. In particular, fix + build-dependencies and runtime dependencies of the examples. + * Remove an unnecessary parameter passed to undivert_unlink_divert in + divert.sh (Debathena: #1061). + * Undivert when a package is unconfigured, in addition to when it is + removed (partially addresses Debathena #388). + * Add self to uploaders, and change maintainer to the Debathena + project mailing list. + + -- Geoffrey Thomas Tue, 25 Sep 2012 13:24:06 -0400 + +config-package-dev (4.13) unstable; urgency=low + + * Fix DEB_CHECK_FILES and DEB_TRANSFORM_FILES with non-conffiles in + Multi-Arch: same packages. + * Fix encode script to work with Perl 5.12. While we’re at it, turn on + strict and warnings. + * Set LC_ALL=C when matching potentially localized dpkg output. + * Bump Standards-Version to 3.9.2 (no changes required). + * Add Vcs-Git, Vcs-Browser. + + -- Anders Kaseorg Tue, 25 Oct 2011 20:26:50 -0400 + +config-package-dev (4.12) unstable; urgency=low + + [ Tim Abbott ] + * Allow specifying DEB_TRANSFORM_SCRIPT_$package_$file in case you want + multiple binary packages transforming the same file differently. + (Thanks to Evan Broder for this patch). + * Add a decode script for undoing the file to virtual package name + transformation. (Thanks to Patrick Hurst for writing decode). + + [ Anders Kaseorg ] + * Fix a quoting bug that failed to disallow transformation of generated + conffiles. (Patch from Evan Broder.) + * Remove DEB_UNDIVERT_VERSION_file and DEB_UNREMOVE_VERSION_file, and + instead test for the undiverted file in the postinst. (Patch from + Evan Broder.) + * Write the prerm and postrm maintainer script fragments in reverse + order when DH_COMPAT ≥ 5, to match debhelper’s behavior. + * Bump debhelper compatibility level to 6. + * Bump Standards-Version to 3.9.1 (no changes required). + + -- Anders Kaseorg Sat, 05 Feb 2011 21:37:05 -0500 + +config-package-dev (4.11) unstable; urgency=low + + * Fix marking transform scripts as executable when + DEB_TRANSFORM_SCRIPT_package is used. + + -- Tim Abbott Sat, 05 Sep 2009 11:46:54 -0400 + +config-package-dev (4.10) unstable; urgency=low + + * Mark transform scripts as executable before attempting to execute them + (Closes: #528995). + + -- Tim Abbott Sun, 02 Aug 2009 19:48:33 -0400 + +config-package-dev (4.9) unstable; urgency=low + + [ Tim Abbott ] + * Fix destdir handling for multiple binary packages in + DEB_TRANSFORM_FILES (Closes: #510355). + * Add Anders Kaseorg to Uploaders. + + [ Anders Kaseorg ] + * Use set -e in multi-statement Makefile commands. + + -- Tim Abbott Wed, 31 Dec 2008 16:39:44 -0500 + +config-package-dev (4.8) unstable; urgency=low + + * Add additional documentation to the makefile fragments + * Add doc/ directory with pointer to online documentation + * Add examples/ directory (Closes: #486130). + * Rename configures- to diverts- as the prefix for the virtual packages + that cause packages diverting the same file to conflict, since that is + clearer. + + -- Tim Abbott Sun, 13 Jul 2008 01:54:48 -0400 + +config-package-dev (4.7) unstable; urgency=low + + * Move homepage field to source package section, so it works. + * Make DEB_TRANSFROM_FILES targets depend on common-build-arch and + common-build-indep, so it works with architecture-dependent packages. + * Remove useless clean code from transform-files.mk. + * Move divert.mk from binary-fixup to binary-post-install. + * Add debhelper.mk to divert.mk, since we use its + binary-post-install/package target. + * Change maintainer to me, rather than debathena@mit.edu, since I'll be + maintaining config-package-dev in Debian. + * Upload to Debian (Closes: #469107) + + -- Tim Abbott Sat, 03 May 2008 13:37:12 -0400 + +config-package-dev (4.6) unstable; urgency=low + + * Remove DEB_AUTO_UPDATE_DEBIAN_CONTROL so it can be uploaded to Debian. + * Add me as uploader. + * move homepage to homepage field. + + -- Tim Abbott Wed, 23 Apr 2008 17:08:15 -0400 + +config-package-dev (4.5) unstable; urgency=low + + * Rename DEB_REPLACE_FILES to DEB_TRANSFORM_FILES + * Create new config-package.mk as the outward-facing makefile fragment. + * Replace DEB_{UNREMOVE,UNDIVERT}_FILES_VERSION_file with + DEB_$1_VERSION_file + + -- Tim Abbott Mon, 21 Apr 2008 18:39:40 -0400 + +config-package-dev (4.4.1) unstable; urgency=low + + * Version bump, since 4.4~ << 4.4 causes build failures on Debathena. + + -- Tim Abbott Mon, 21 Apr 2008 17:51:02 -0400 + +config-package-dev (4.4) unstable; urgency=low + + * Add new DEB_REMOVE_FILES_$package variable designed for removing + files in .d directories. + * Move the "configure-" in the filename encoding from the encode script + to divert.mk, so that we can re-use the encoder for DEB_REMOVE_FILES. + * Add new DEB_UNDIVERT_FILES_package and DEB_UNREMOVE_FILES_package + API variables for having a new version of the package stop diverting a + file. + * Correct check for not generating an empty if clause when no files are + being diverted. + * Remove only the last DEB_DIVERT_EXTENSION from filenames. + + -- Tim Abbott Sat, 19 Apr 2008 21:03:02 -0400 + +config-package-dev (4.3) unstable; urgency=low + + * Fix bug where DEB_DIVERT code gets added twice if a package uses both + DEB_DIVERT_FILES and DEB_REPLACE_FILES. + + -- Tim Abbott Sun, 6 Apr 2008 19:41:45 -0400 + +config-package-dev (4.2) unstable; urgency=low + + * Rename DEB_REPLACE_FILES_SOURCE to DEB_CHECK_FILES_SOURCE, and + move it to check-files.mk, since it really is a check-files.mk + feature. + * Make check-files.mk include divert.mk. + * Don't directly include divert.mk in replace-files.mk. + + -- Tim Abbott Sun, 17 Feb 2008 23:01:08 -0500 + +config-package-dev (4.1) unstable; urgency=low + + * Rename various API variables to make interface cleaner. + * Rename variables involving DEBIAN to DEB in variable names. + * Rename CONFFILES to FILES in variable names. + * Rename divert:Diverted to divert:Files + * Replace DEB_CONFFILE_DEST with DEB_REPLACE_FILES_SOURCE, changing the + source rather than the destination. + * Rename replace-conffiles.mk and check-conffiles.mk to *-files.mk. + * Add support for multiple files with same basename to replace_files.mk + via the DEB_TRANSFORM_SCRIPT variable. + * Remove deprecated check-files interface. + * Rename DEB_DIVERT_SUFFIX to DEB_DIVERT_EXTENSION. + + -- Tim Abbott Mon, 4 Feb 2008 02:07:16 -0500 + +config-package-dev (4.0) unstable; urgency=low + + * Rename variables to be appropriate for non-MIT sites. + + -- Tim Abbott Thu, 31 Jan 2008 15:15:20 -0500 + +debathena-config-build-common (3.6) unstable; urgency=low + + * Add new debathena-replace-conffiles.mk, a more user-friendly wrapper + for debathena-check-conffiles.mk and debathena-divert.mk. + * Change debathena-check-conffiles.mk to allow checking md5sums of + packaged files which are not marked as configuration files + (e.g. /etc/adduser/adduser.conf). + * Change debathena-divert.mk to not set DEBATHENA_DIVERT_SUFFIX unless + it is not already set. + * Change debathena-divert.mk to support adding Provides: and Conflicts: + lines for each diverted configuration file. + * Change debathena-divert.mk to divert everything in + DEBATHENA_REPLACE_CONFFILES. + + -- Tim Abbott Wed, 30 Jan 2008 20:03:36 -0500 + +debathena-config-build-common (3.5) unstable; urgency=low + + * Change check-conffiles interface to make it work properly with + dpkg-diverted files. + + -- Anders Kaseorg Mon, 13 Aug 2007 17:59:43 -0400 + +debathena-config-build-common (3.4) unstable; urgency=low + + * Need [ -e ] || [ -L ] to check for existence, instead of just [ -e ]. + + -- Anders Kaseorg Mon, 06 Aug 2007 06:57:18 -0400 + +debathena-config-build-common (3.3) unstable; urgency=low + + * Add check-conffiles script. + + -- Anders Kaseorg Fri, 03 Aug 2007 17:50:20 -0400 + +debathena-config-build-common (3.2) unstable; urgency=low + + * Add debconf-hack script. + + -- Anders Kaseorg Tue, 24 Jul 2007 20:41:13 -0400 + +debathena-config-build-common (3.1) unstable; urgency=low + + * Divert with the current package name, not the empty string. + * Add this package as an automatic build dependency of anything that + uses it. + + -- Anders Kaseorg Wed, 18 Jul 2007 01:13:40 -0400 + +debathena-config-build-common (3.0debathena1) unstable; urgency=low + + * Fix divert script version. + + -- Anders Kaseorg Fri, 13 Jul 2007 15:57:19 -0400 + +debathena-config-build-common (3.0) unstable; urgency=low + + * Initial release. + + -- Anders Kaseorg Fri, 06 Jul 2007 19:30:41 -0400 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +7 diff --git a/debian/config-package-dev.docs b/debian/config-package-dev.docs new file mode 100644 index 0000000..30d29de --- /dev/null +++ b/debian/config-package-dev.docs @@ -0,0 +1 @@ +doc/* diff --git a/debian/config-package-dev.examples b/debian/config-package-dev.examples new file mode 100644 index 0000000..e39721e --- /dev/null +++ b/debian/config-package-dev.examples @@ -0,0 +1 @@ +examples/* diff --git a/debian/config-package-dev.install b/debian/config-package-dev.install new file mode 100644 index 0000000..efd6dbc --- /dev/null +++ b/debian/config-package-dev.install @@ -0,0 +1,11 @@ +displace.mk usr/share/cdbs/1/rules/ +debconf-divert.mk usr/share/cdbs/1/rules/ +check-files.mk usr/share/cdbs/1/rules/ +config-package.mk usr/share/cdbs/1/rules/ +transform-files.mk usr/share/cdbs/1/rules/ +encode usr/share/config-package-dev/ +decode usr/share/config-package-dev/ +displace.sh.in usr/share/debhelper/autoscripts/ +debconf-hack.sh usr/share/config-package-dev/ +dh_configpackage usr/bin/ +Debian usr/share/perl5/ diff --git a/debian/config-package-dev.manpages b/debian/config-package-dev.manpages new file mode 100644 index 0000000..20a2c56 --- /dev/null +++ b/debian/config-package-dev.manpages @@ -0,0 +1 @@ +dh_configpackage.1 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..c3a82cb --- /dev/null +++ b/debian/control @@ -0,0 +1,29 @@ +Source: config-package-dev +Section: devel +Priority: extra +Maintainer: Debathena Project +Uploaders: Tim Abbott , Anders Kaseorg , Geoffrey Thomas +Homepage: http://debathena.mit.edu/config-package-dev +Vcs-Git: git://debathena.mit.edu/config-package-dev.git +Vcs-Browser: http://debathena.mit.edu/trac/browser/config-package-dev/ +Build-Depends: debhelper (>= 7.0.50~) +Standards-Version: 3.9.4 + +Package: config-package-dev +Architecture: all +Depends: ${misc:Depends} +Description: Debhelper (and CDBS) modules for building configuration packages + This package contains a system of modules for creating Debian + configuration packages: packages that configure an existing Debian + system by using dpkg-divert on configuration files. These modules + attempt to make the process of creating configuration packages + efficient by checking the md5sums of upstream configuration files + that are to be modified and automatically generating the relevant + postinst code to perform the diversions using the standard debhelper + mechanism. In addition to a debhelper command and sequencer extension + module, CDBS modules are also included, but future development will + focus on the debhelper interface. + . + The config-package-dev modules are optimized for site defaults (i.e. + configuration for a university or a company), though they are useful + for other applications as well. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..f01fa27 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,22 @@ +Authors: Tim Abbott + Anders Kaseorg + +The upstream location for this software is now the Debian archive. + +It is also available from http://debathena.mit.edu/config-package-dev + +Copyright: (C) Tim Abbott and Anders Kaseorg 2006-2008 + (C) Geoffrey Thomas 2011-2013 + + 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 of the License, 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. + +On Debian systems, the complete text of the GNU General Public License +can be found in the file /usr/share/common-licenses/GPL-2. diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..638677f --- /dev/null +++ b/debian/rules @@ -0,0 +1,12 @@ +#!/usr/bin/make -f +version := $(shell dpkg-parsechangelog | sed -nr 's/^Version: (.*)/\1/p') +pod2man := pod2man -r "config-package-dev $(version)" -c config-package-dev + +%: + dh $@ + +override_dh_auto_build: + $(pod2man) --section=1 dh_configpackage dh_configpackage.1 + +override_dh_clean: + dh_clean dh_configpackage.1 diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/decode b/decode new file mode 100755 index 0000000..b9e1ec9 --- /dev/null +++ b/decode @@ -0,0 +1,12 @@ +#!/usr/bin/perl +# Reverse the encoding performed by the "encode" helper. +# +# This is not currently used by config-package-dev itself, but can by +# used by helper programs that want to determine what files are diverted +# by a package generated using this system. + +use strict; +use warnings; +use Debian::Debhelper::config_package; + +print decode($ARGV[0]); diff --git a/dh_configpackage b/dh_configpackage new file mode 100755 index 0000000..942766f --- /dev/null +++ b/dh_configpackage @@ -0,0 +1,457 @@ +#!/usr/bin/perl -w +# Copyright © 2007-2008 Anders Kaseorg and +# Tim Abbott +# Copyright © 2011-2012 Geoffrey Thomas +# +# 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, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. + + +=head1 NAME + +dh_configpackage - add maintainer script rules to displace, hide, or transform files + +=cut + +use strict; +use Debian::Debhelper::Dh_Lib; +use Debian::Debhelper::config_package; +use Digest::MD5; +use IPC::Open3; + + +=head1 SYNOPSIS + +B [B<--displace> I] [B<--hide> I] [B<--undisplace> I] [B<--unhide> I] [B<--transform> I] [S>] [B<-n>] + +=head1 DESCRIPTION + +B is a debhelper program to create "configuration +packages". These packages provide an ideal way to distribute +configurations to target systems while still affording local system +administrators a degree of control over their workstations. The +motivation and philosophy behind this style of packaging is described +in detail on the config-package-dev website. Configuration packages +make use of dpkg diversions and maintainer script snippets to provide +three primary operations: displacing, hiding, and transforming files. + +The I operation consists of replacing a file on the target +system. The original file is renamed out of the way and diverted in the +dpkg database. The replacement file is then installed by the package, +and the config-package-dev maintainer script snippets create a symlink +from the original name. A common use of this is to install a wrapper +script for an executable. + +The I operation is a special case of the displace operation. +At build time, a "transform script" is applied to the original source, +and the result is used as the replacement in the displace operation. A +common use of this is to change one value in a config file without +needing to re-type the entire config file (and risk bit-rot). + +The I operation is yet another special case of the displace +operation, namely that there is no replacement or symlink. Instead, the +file is diverted to a unique path on the target system, thus preserving +its contents. A common use of this is to suppress a snippet file in a +configuration directory (e.g. /etc/foo.d), thus disabling a specific +operation or configuration. + +The I is a suffix appended to the diverted versions +of files, and this suffix plus the string "-orig" is appended to the +original versions of the files. The default value is the first word of +the package name. For example, the extension for debathena-bin-example +would be ".debathena". So if debathena-bin-example displaced /bin/true, +the original /bin/true would be found at /bin/true.debathena-orig and +the new version (installed by e.g. dh_install) found at +/bin/true.debathena. /bin/true itself would become a symbolic link. +(For the remainder of this documentation, ".debathena" will be used as +the displace extension.) + +=head1 FILES + +=over 4 + +=item debian/I.displace + +List the files to displace, one per line, including the full path and +displace extension. For example, to displace /usr/bin/true to +/usr/bin/true.debathena, you would list "/usr/bin/true.debathena" in +the file. (As with other Debhelper commands, you can omit the initial +leading slash in pathnames in the package, but these examples retain +it.) + +=item debian/I.hide + +List the files to hide, one per line, including the full path and +displace extension. As noted above, these files won't actually be +removed, but merely diverted and renamed to a unique path below +/usr/share/I. + +=item debian/I.undisplace + +List the files to undisplace, one per line, including the full path and +displace extension. B This is only needed when a new version of +the package no longer needs to displace a file (for example, if an +upstream bug was fixed). Packages automatically undo all operations +upon removal or deconfiguration. + +=item debian/I.unhide + +List the files to unhide, one per line, including the full path +and displace extension. B As with undisplace, this is only needed +when a new version of the package no longer needs to hide a file. + +=item debian/I.transform + +Each line in the file specifies a transformation. A transformation +consists of two space-separated fields: the full path of the +target file including the displace extension and the transformation +command itself. The transformation can either be a single shell +command, or an executable file in the debian directory. The +transformation takes the original source of the file on stdin and prints +its transformation on stdout. Transformations are typically performed +by perl, sed, or awk, but there is no limitation on what can be used as +a transformation. + +For example, to transform /etc/school.conf by replacing all +occurrences of the word 'Harvard' with the word 'MIT', you might +specify the following line: + + /etc/school.conf.debathena sed -e 's/Harvard/MIT/g' + +Or, storing the command in a separate script: + + /etc/school.conf.debathena debian/transform_school.conf.pl + +If the transformation script fails, the package build fails. You can use +this with e.g. Perl's C syntax to make sure that the source +file of the transformation has not changed from what you expected. + +I: Under normal operation, the source (passed +on stdin) for the transformation is the name of the diversion without +the divert extension. In some cases, you may wish to use a different +source (e.g. a sample configuration file in /usr/share/doc). You can +specify this source as an optional field between the diversion +filename and the transformation. This field must begin with a '<' +immediately followed by the full path to the source. Taking the +example above, we might alter it as follows: + + /etc/school.conf.debathena There is no "untransform" operation. Because a transform +operation is a special case of a displace operation, the "undisplace" +operation is the correct way of removing a no-longer-needed +transformation in future versions of the package. + +=item debian/I.displace-extension + +This file is used to specify the displace extension for any files +diverted by this package, if you do not want to accept the default of +the first word in the package name. It will not normally be present. +(See L<"CAVEATS">.) + +=back + +=head1 OPTIONS + +=over 4 + +=item B<-n>, B<--noscripts> + +Do not modify maintainer scripts. This is a standard debhelper +option, though you are strongly discouraged from using it except for +debugging, as these operations rely heavily on the maintainer scripts. + +=item B<--displace> I + +=item B<--hide> I + +=item B<--undisplace> I + +=item B<--unhide> I + +=item B<--transform> I + +These options allow for specifying an operation on the command line. +The argument to the option is the same as a single line of the +corresponding file, as described above. You may specify multiple +occurrences of B<--displace>, or you may invoke B +repeatedly with different invocations. The most common use of this +format is in a rules file when performing conditional operations, in an +C target in the C file. See the +debathena-conffile-example-1.1 package in +/usr/share/doc/config-package-dev/EXAMPLES for one such use. + +=back + +=cut + +my (@arg_displace, @arg_hide, @arg_undisplace, @arg_unhide, @arg_transform); +my $args_present = 0; + +init(options => { + "displace=s" => \@arg_displace, + "hide=s" => \@arg_hide, + "undisplace=s" => \@arg_undisplace, + "unhide=s" => \@arg_unhide, + "transform=s" => \@arg_transform, +}); + +if (@arg_displace or @arg_hide or @arg_undisplace or @arg_unhide or @arg_transform) { + $args_present = 1; +} + +# We default the displace extension to a period followed by the first +# word of the package name, on the assumption that it is probably the +# site name (e.g., "debathena-kerberos-config" displaces to +# ".debathena"). You can set this extension explicitly in +# debian/$package.displace-extension or debian/displace-extension. +sub displace_extension { + my $package = shift; + my $file = pkgfile($package, "displace-extension"); + if ($file) { + open(my $fh, $file); + my $ret = <$fh>; + chomp $ret; + close $fh; + return $ret; + } + $package =~ s/-.*//; + return ".$package"; +} + +# Replace only the last instance of the displace extension in the +# filename, to make it possible to displace /path/foo.divert to +# foo.divert.divert-orig +sub displace_files_replace_name { + my ($package, $filename, $replacement) = @_; + my $extension = displace_extension($package); + $filename =~ s/(.*)\Q$extension\E/$1$replacement/; + return $filename; +} + +# Encode a full path into the path it should be diverted to if it's +# hidden +sub hide_files_name { + my ($filename, $package) = @_; + return "/usr/share/$package/" . encode($filename); +} + +# At compatibility levels 6 and above, prerms take effect in the +# opposite order from postinsts +sub reverse_if_6 { + if (compat(5)) { + return @_; + } else { + return reverse @_; + } +} + + +# check_file is used to verify that files on local disk have not +# been modified from the upstream packaged version. +# +# We check md5sums from both /var/lib/dpkg/info/$(package).md5sums +# (the md5sums database for non-conffiles) and the conffiles database +# used for prompting about conffiles being changed (via dpkg-query). +# +# There is some wrangling here because the formats of these sources differ. + +sub check_file { + my $name = shift; + my $truename = `dpkg-divert --truename $name`; + chomp $truename; + die "$truename missing\n" unless (-e $truename); + my $package = `LC_ALL=C dpkg -S $name | sed -n '/^diversion by /! s/: .*\$// p'`; + chomp $package; + die "$truename is not owned by any package\n" unless ($package); + + my $ctx = Digest::MD5->new; + open(my $fh, $truename); + binmode $fh; + $ctx->addfile($fh); + my $digest = $ctx->hexdigest; + close $fh; + + my $hassums = 0; + + FINDMD5: { + open($fh, "-|", qw(dpkg-query --showformat=${Conffiles}\n --show), $package); + while (<$fh>) { + next unless /^ \Q$name\E ([0-9a-f]{32})$/; + $hassums = 1; + if ($1 eq $digest) { + last FINDMD5; + } else { + die "md5sum mismatch on $name\n"; + } + } + close $fh; + + open(my $devnull, ">/dev/null"); + my $pid = open3(undef, my $dpkg_query, $devnull, qw(dpkg-query --control-path), $package, "md5sums"); + my $md5sums = <$dpkg_query>; + chomp $md5sums; + close $dpkg_query; + close $devnull; + waitpid $pid, 0; + + $md5sums ||= "/var/lib/dpkg/info/$package.md5sums"; + + if (-e $md5sums) { + $hassums = 1; + open($fh, $md5sums); + my $relname = $name; + $relname =~ s|^/||; + while (<$fh>) { + next unless /^([0-9a-f]{32}) \Q$relname\E$/; + if ($1 eq $digest) { + last FINDMD5; + } else { + die "md5sum mismatch on $name\n"; + } + } + close $fh; + } + + if ($hassums) { + die "$package contains no md5sums for $name. Is it a generated file?\n"; + } else { + print "config-package-dev: warning: $package does not include md5sums!\n"; + print "config-package-dev: warning: md5sum for $name not verified.\n"; + } + } + + return $truename; +} + +foreach my $package (@{$dh{DOPACKAGES}}) { + my (@displacefiles, @hidefiles, @undisplacefiles, @unhidefiles, @transformfiles); + + if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && $args_present) { + @displacefiles = @arg_displace; + @hidefiles = @arg_hide; + @undisplacefiles = @arg_undisplace; + @unhidefiles = @arg_unhide; + @transformfiles = map {[split]} @arg_transform; + } else { + my $displacefile = pkgfile($package, "displace"); + @displacefiles = filearray($displacefile) if $displacefile; + my $hidefile = pkgfile($package, "hide"); + @hidefiles = filearray($hidefile) if $hidefile; + my $undisplacefile = pkgfile($package, "undisplace"); + @undisplacefiles = filearray($undisplacefile) if $undisplacefile; + my $unhidefile = pkgfile($package, "unhide"); + @unhidefiles = filearray($unhidefile) if $unhidefile; + my $transformfile = pkgfile($package, "transform"); + @transformfiles = filedoublearray($transformfile) if $transformfile; + } + + my $tmp = tmpdir($package); + my $extension = displace_extension($package); + + if (! $dh{ONLYSCRIPTS} && @hidefiles) { + doit("install", "-d", "$tmp/usr/share/$package"); + } + + foreach my $line (@transformfiles) { + my $file = shift @$line; + $file =~ s|^/?|/|; + my $source; + if (@$line[0] =~ /^", "$tmp/$file"); + push @displacefiles, $file; + } + + # Add code to postinst to add/remove diversions as appropriate + if (! $dh{NOSCRIPTS}) { + if (@undisplacefiles || @unhidefiles || @displacefiles || @hidefiles) { + my $postinst = escape_shell(join "\\n", ( + 'if [ "$1" = "configure" ] || [ "$1" = "abort-remove" ]; then', + (map {" check_undisplace_unlink " . displace_files_replace_name($package, $_, " ")} @undisplacefiles), + (map {" check_undisplace_unhide $_ " . hide_files_name($_, $package)} @unhidefiles), + (map {" displace_link " . displace_files_replace_name($package, $_, " ")} @displacefiles), + (map {" displace_hide $_ " . hide_files_name($_, $package)} @hidefiles), + 'fi' + )); + autoscript($package, "postinst", "displace.sh.in", + "s/#PACKAGE#/$package/g; s/#DEB_DISPLACE_EXTENSION#/$extension/g; \\\$a\"$postinst\""); + } + if (@displacefiles || @hidefiles) { + my $prerm = escape_shell(join "\\n", ( + 'if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ]; then', + (map {" undisplace_unlink " . displace_files_replace_name($package, $_, " ")} reverse_if_6 (@displacefiles)), + (map {" undisplace_unhide $_ $package"} reverse_if_6 (@hidefiles)), + 'fi' + )); + autoscript($package, "prerm", "displace.sh.in", + "s/#PACKAGE#/$package/g; s/#DEB_DISPLACE_EXTENSION#/$extension/g; \\\$a\"$prerm\""); + } + } + + # Add an encoding of the names of the diverted files to the Provides: + # and Conflicts: lists. This prevents two packages diverting the same + # file from being installed simultaneously (it cannot work, and this + # produces a much less ugly error). Requires in debian/control: + # Provides: ${diverted-files} + # Conflicts: ${diverted-files} + foreach my $file (@displacefiles, @hidefiles) { + my $encodedfile = encode(displace_files_replace_name($package, $file, "")); + addsubstvar($package, "diverted-files", "diverts-$encodedfile"); + } +} + +=head1 CAVEATS + +Because the displace extension is automatically generated from the +package name, renaming the package can have unintended consequences. +If you must rename a package such that the first component of the name +changes, specify the old extension using the C file +(see above). + +=head1 SEE ALSO + +L, L + +This program is a part of config-package-dev. + +=head1 AUTHOR + +config-package-dev was written by Anders Kaseorg and +Tim Abbott . The debhelper port is by Geoffrey Thomas +. Documentation by Jonathan Reed . + +=cut diff --git a/displace.mk b/displace.mk new file mode 100644 index 0000000..3a4248f --- /dev/null +++ b/displace.mk @@ -0,0 +1,144 @@ +# -*- mode: makefile; coding: utf-8 -*- +# Copyright © 2007-2008 Anders Kaseorg and +# Tim Abbott +# +# 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, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. + +# Don't include displace.mk in your rules files directly; instead use +# config-package.mk. + +# displace.mk handles the low-level diversion logic. It includes +# displace.sh.in in the postinst and prerm scripts, and adds calls to +# the functions in displace.sh.in to add and remove diversions and +# symlinks at the appropriate points. + +ifndef _cdbs_rules_displace +_cdbs_rules_displace = 1 + +include /usr/share/cdbs/1/rules/debhelper.mk + +CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), config-package-dev (>= 5.0~) + +# displace.sh.in is included in the postinst/prerm scripts of packages +# installing diversions and symlinks using config-package-dev. +DEB_DISPLACE_SCRIPT = /usr/share/debhelper/autoscripts/displace.sh.in +# script used to encode the path of a file uniquely in a valid virtual +# package name. +DEB_DISPLACE_ENCODER = /usr/share/config-package-dev/encode + +DEB_DISPLACE_PACKAGES += $(foreach package,$(DEB_ALL_PACKAGES), \ + $(if $(DEB_TRANSFORM_FILES_$(package)),$(package), \ + $(if $(DEB_HIDE_FILES_$(package)),$(package), \ + $(if $(DEB_UNHIDE_FILES_$(package)),$(package), \ + $(if $(DEB_UNDISPLACE_FILES_$(package)),$(package), \ + $(if $(DEB_DISPLACE_FILES_$(package)),$(package), \ + $(if $(DEB_REMOVE_FILES_$(package)),$(package), \ + $(if $(DEB_UNREMOVE_FILES_$(package)),$(package), \ + $(if $(DEB_UNDIVERT_FILES_$(package)),$(package), \ + $(if $(DEB_DIVERT_FILES_$(package)),$(package))))))))))) + +ifeq ($(DEB_DISPLACE_EXTENSION),) +ifeq ($(DEB_DIVERT_EXTENSION),) +DEB_DISPLACE_EXTENSION = .divert +else +DEB_DISPLACE_EXTENSION = $(DEB_DIVERT_EXTENSION) +endif +endif + +# Replace only the last instance of DEB_DISPLACE_EXTENSION in the +# filename, to make it possible to displace /path/foo.divert to +# foo.divert.divert-orig +displace_files_replace_name = $(shell echo $(1) | perl -pe 's/(.*)\Q$(DEB_DISPLACE_EXTENSION)\E/$$1$(2)/') + +# Encode a full path into the path it should be diverted to if it's +# hidden +hide_files_name = /usr/share/$(cdbs_curpkg)/$(shell $(DEB_DISPLACE_ENCODER) $(1)) + +dh_compat_6 := $(shell if [ '$(DH_COMPAT)' -ge 6 ]; then echo y; fi) + +reverse = $(foreach n,$(shell seq $(words $(1)) -1 1),$(word $(n),$(1))) +reverse_dh_compat_6 = $(if $(dh_compat_6),$(call reverse,$(1)),$(1)) + +debian-displace/%: package = $(subst debian-displace/,,$@) +debian-displace/%: displace_files = $(DEB_DISPLACE_FILES_$(package)) $(DEB_DIVERT_FILES_$(package)) $(DEB_TRANSFORM_FILES_$(package)) +debian-displace/%: displace_hide_files = $(DEB_HIDE_FILES_$(package)) $(DEB_REMOVE_FILES_$(package)) +debian-displace/%: displace_undisplace_files = $(DEB_UNDISPLACE_FILES_$(package)) $(DEB_UNDIVERT_FILES_$(package)) +debian-displace/%: displace_unhide_files = $(DEB_UNHIDE_FILES_$(package)) $(DEB_UNREMOVE_FILES_$(package)) +debian-displace/%: displace_files_all = $(strip $(displace_files) $(displace_hide_files) $(displace_undisplace_files) $(displace_unhide_files)) +debian-displace/%: displace_files_thispkg = $(strip $(displace_files) $(displace_hide_files)) +$(patsubst %,debian-displace/%,$(DEB_DISPLACE_PACKAGES)) :: debian-displace/%: +# Writing shell scripts in makefiles sucks. Remember to $$ shell +# variables and include \ at the end of each line. +# Add code to postinst to add/remove diversions and symlinks as appropriate + set -e; \ + { \ + sed 's/#PACKAGE#/$(cdbs_curpkg)/g; s/#DEB_DISPLACE_EXTENSION#/$(DEB_DISPLACE_EXTENSION)/g' $(DEB_DISPLACE_SCRIPT); \ + $(if $(displace_files_all), \ + echo 'if [ "$$1" = "configure" ]; then'; \ + $(foreach file,$(displace_undisplace_files), \ + echo " check_undisplace_unlink $(call displace_files_replace_name,$(file), )"; )\ + $(foreach file,$(displace_unhide_files), \ + echo " check_undisplace_unhide $(file) $(call hide_files_name,$(file))"; )\ + $(foreach file,$(displace_files), \ + echo " displace_link $(call displace_files_replace_name,$(file), )";) \ + $(foreach file,$(displace_hide_files), \ + mkdir -p debian/$(cdbs_curpkg)/usr/share/$(cdbs_curpkg); \ + echo " displace_hide $(file) $(call hide_files_name,$(file))";) \ + echo 'fi'; \ + ) \ + } >> $(CURDIR)/debian/$(cdbs_curpkg).postinst.debhelper +# Add code to prerm script to undo diversions and symlinks when package is removed. + set -e; \ + { \ + $(if $(dh_compat_6),, \ + if [ -e $(CURDIR)/debian/$(cdbs_curpkg).prerm.debhelper ]; then \ + cat $(CURDIR)/debian/$(cdbs_curpkg).prerm.debhelper; \ + fi;) \ + sed 's/#PACKAGE#/$(cdbs_curpkg)/g; s/#DEB_DISPLACE_EXTENSION#/$(DEB_DISPLACE_EXTENSION)/g' $(DEB_DISPLACE_SCRIPT); \ + $(if $(displace_files_thispkg), \ + echo 'if [ "$$1" = "remove" ] || [ "$$1" = "deconfigure" ]; then'; \ + $(foreach file,$(call reverse_dh_compat_6,$(displace_files)), \ + echo " undisplace_unlink $(call displace_files_replace_name,$(file), )";) \ + $(foreach file,$(call reverse_dh_compat_6,$(displace_hide_files)), \ + echo " undisplace_unhide $(file) $(cdbs_curpkg)";) \ + echo 'fi'; \ + ) \ + $(if $(dh_compat_6), \ + if [ -e $(CURDIR)/debian/$(cdbs_curpkg).prerm.debhelper ]; then \ + cat $(CURDIR)/debian/$(cdbs_curpkg).prerm.debhelper; \ + fi;) \ + } >> $(CURDIR)/debian/$(cdbs_curpkg).prerm.debhelper.new + mv $(CURDIR)/debian/$(cdbs_curpkg).prerm.debhelper.new \ + $(CURDIR)/debian/$(cdbs_curpkg).prerm.debhelper +# Add an encoding of the names of the diverted files to the Provides: +# and Conflicts: lists. This prevents two packages diverting the same +# file from being installed simultaneously (it cannot work, and this +# produces a much less ugly error). Requires in debian/control: +# Provides: ${diverted-files} +# Conflicts: ${diverted-files} + set -e; \ + { \ + echo -n "diverted-files="; \ + $(foreach file,$(displace_files_thispkg),\ + echo -n "diverts-"; \ + ${DEB_DISPLACE_ENCODER} "$(call displace_files_replace_name,$(file))"; \ + echo -n ", ";) \ + echo; \ + } >> $(CURDIR)/debian/$(cdbs_curpkg).substvars + +$(patsubst %,binary-post-install/%,$(DEB_DISPLACE_PACKAGES)) :: binary-post-install/%: debian-displace/% + +endif diff --git a/displace.sh.in b/displace.sh.in new file mode 100644 index 0000000..c286ed4 --- /dev/null +++ b/displace.sh.in @@ -0,0 +1,159 @@ +# displace.sh.in: diversion helpers for maintainer scripts +# +# displace_link +# +# Ensures that the file is properly diverted to +# .divert-orig by this package, and becomes a +# symbolic link to either .divert (default) or +# .divert-orig. +# +# undisplace_unlink +# +# Undoes the action of displace_link specified +# above. +# +# Version: 4.0 +# +# Copyright © 2008–2012 Tim Abbott and Anders +# Kaseorg +# +# Permission is hereby granted, free of charge, to any person +# obtaining a copy of this software and associated documentation files +# (the “Software”), to deal in the Software without restriction, +# including without limitation the rights to use, copy, modify, merge, +# publish, distribute, sublicense, and/or sell copies of the Software, +# and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + +package=#PACKAGE# + +ours=#DEB_DISPLACE_EXTENSION# +theirs=#DEB_DISPLACE_EXTENSION#-orig + +displace_link_displace() +{ + file=$1 + ourfile=$2 + theirfile=$3 + if ! LC_ALL=C dpkg-divert --list "$package" | \ + grep -xFq "diversion of $file to $theirfile by $package"; then + dpkg-divert --divert "$theirfile" --rename --package "$package" --add "$file" + fi +} + +displace_link_symlink() +{ + file=$1 + ourfile=$2 + theirfile=$3 + if [ ! -L "$file" ] && [ ! -e "$file" ]; then + ln -s "$(basename "$ourfile")" "$file" + elif [ ! -L "$file" ] || \ + [ "$(readlink "$file")" != "$(basename "$ourfile")" -a \ + "$(readlink "$file")" != "$(basename "$theirfile")" ]; then + echo "*** OMINOUS WARNING ***: $file is not linked to either $(basename "$ourfile") or $(basename "$theirfile")" >&2 + fi +} + +displace_link() +{ + prefix=$1 + suffix=$2 + + file=$prefix$suffix + ourfile=$prefix$ours$suffix + theirfile=$prefix$theirs$suffix + displace_link_displace "$file" "$ourfile" "$theirfile" + displace_link_symlink "$file" "$ourfile" "$theirfile" +} + +displace_hide() +{ + file=$1 + ourfile="" + theirfile=$2 + displace_link_displace "$file" "$ourfile" "$theirfile" +} + +undisplace_unlink_symlink() +{ + file="$1" + ourfile="$2" + theirfile="$3" + if [ ! -L "$file" ] || \ + [ "$(readlink "$file")" != "$(basename "$ourfile")" -a \ + "$(readlink "$file")" != "$(basename "$theirfile")" ]; then + echo "*** OMINOUS WARNING ***: $file is not linked to either $(basename "$ourfile") or $(basename "$theirfile")" >&2 + else + rm -f "$file" + fi +} + +undisplace_unlink_displace() +{ + file="$1" + if [ ! -L "$file" ] && [ ! -e "$file" ]; then + dpkg-divert --remove --rename --package "$package" "$file" + else + echo "Not removing diversion of $file by $package" >&2 + fi +} + +undisplace_unlink() +{ + prefix=$1 + suffix=$2 + + file=$prefix$suffix + ourfile=$prefix$ours$suffix + theirfile=$prefix$theirs$suffix + + undisplace_unlink_symlink "$file" "$ourfile" "$theirfile" + undisplace_unlink_displace "$file" +} + +undisplace_unhide() +{ + file=$1 + undisplace_unlink_displace "$file" +} + +check_undisplace_unlink() +{ + prefix=$1 + suffix=$2 + + file=$prefix$suffix + ourfile=$prefix$ours$suffix + theirfile=$prefix$theirs$suffix + + if LC_ALL=C dpkg-divert --list "$package" | \ + grep -xFq "diversion of $file to $theirfile by $package"; then + undisplace_unlink "$prefix" "$suffix" + fi +} + +check_undisplace_unhide() +{ + file=$1 + hiddenfile=$2 + if LC_ALL=C dpkg-divert --list "$package" | \ + grep -xFq "diversion of $file to $hiddenfile by $package"; then + undisplace_unhide "$file" + fi +} + +# End of divert.sh.in diff --git a/doc/DOCUMENTATION b/doc/DOCUMENTATION new file mode 100644 index 0000000..0bea612 --- /dev/null +++ b/doc/DOCUMENTATION @@ -0,0 +1,11 @@ +Extensive documentation is available on the web at +. + +Several ready-to-use examples are available in +/usr/share/doc/config-package-dev/examples + +/usr/share/cdbs/1/rules/config-package.mk and the makefile fragments +that it includes also contain some basic documentation. They are +fairly short, but may not be easy to ready without consulting the GNU +Make Manual (http://www.gnu.org/software/make/manual/make.html) and +inspecting the core CDBS rules files as well. diff --git a/encode b/encode new file mode 100755 index 0000000..9add81d --- /dev/null +++ b/encode @@ -0,0 +1,18 @@ +#!/usr/bin/perl +# Encode name of a file in a Debian package name. +# +# The purpose of this encoding is to cause Debian configuration +# packages (potentially from different sites) that divert the same +# configuration file to conflict with each other. Thus, it is +# important that all sites using this Debian configuration package +# system use this encoding. +# +# This encoding is intended to be human-readable, so that users can +# determine the cause of conflicts between different configuration +# packages. + +use strict; +use warnings; +use Debian::Debhelper::config_package; + +print encode($ARGV[0]); diff --git a/examples/EXAMPLES b/examples/EXAMPLES new file mode 100644 index 0000000..38a73f1 --- /dev/null +++ b/examples/EXAMPLES @@ -0,0 +1,47 @@ +This directory contains example packages using the config-package-dev +system that you can start from in designing your own packages. + +debathena-conffile-example-1.0: + Displaces a configuration file and provides different configuration +debathena-conffile-example-1.1: + Transforms a configuration file if it exists at build time +debathena-bin-example-1.0: + Displaces a binary and provides a wrapper script +debathena-bin-example-1.1: + Upgrades debathena-bin-example-1.0 undoing one of the displacements +debathena-transform-example-1.0: + Transforms a configuration file +debathena-cron-example-1.0: + Hides a cron job + +Both CDBS and Debhelper 7+ versions are provided, in the cdbs/ and +debhelper/ directories, respectively. + + +If you are trying to build these packages out of a config-package-dev +source tree (e.g., because you are hacking on config-package-dev), note +that you will need to set a few environment variables to make things +work. For debuild, e.g., try the command + +debuild -e PERL5LIB=../../.. -e DH_AUTOSCRIPTDIR=../../.. --prepend-path=../../.. + +This trick will not work for CDBS, since debian/rules hard-codes an +absolute path to CDBS class and rules files. + + +For the CDBS examples, note that if you want the control files to be +regenerated from the control.in files, you need to add + +DEB_AUTO_UPDATE_DEBIAN_CONTROL=1 + +to the debian/rules files (or e.g. set it in your environment). + +We do not include DEB_AUTO_UPDATE_DEBIAN_CONTROL=1 in these example +rules files because option is banned in official Debian packages (see +the CDBS section of ). + + +config-package-dev supports older versions of debhelper, although +examples are not given. You can use it in your own packages by adding +dh_configpackage into the list of dh_* commands in debian/rules, before +dh_link. diff --git a/examples/cdbs/debathena-bin-example-1.0/debian/changelog b/examples/cdbs/debathena-bin-example-1.0/debian/changelog new file mode 100644 index 0000000..0367d39 --- /dev/null +++ b/examples/cdbs/debathena-bin-example-1.0/debian/changelog @@ -0,0 +1,5 @@ +debathena-bin-example (1.0) unstable; urgency=low + + * Initial release. + + -- Tim Abbott Sun, 13 Jul 2008 00:37:03 -0400 diff --git a/examples/cdbs/debathena-bin-example-1.0/debian/compat b/examples/cdbs/debathena-bin-example-1.0/debian/compat new file mode 100644 index 0000000..b8626c4 --- /dev/null +++ b/examples/cdbs/debathena-bin-example-1.0/debian/compat @@ -0,0 +1 @@ +4 diff --git a/examples/cdbs/debathena-bin-example-1.0/debian/control b/examples/cdbs/debathena-bin-example-1.0/debian/control new file mode 100644 index 0000000..bf9a7a4 --- /dev/null +++ b/examples/cdbs/debathena-bin-example-1.0/debian/control @@ -0,0 +1,17 @@ +Source: debathena-bin-example +Section: config +Priority: extra +Maintainer: Tim Abbott +Build-Depends: cdbs, + debhelper, + dh-buildinfo, + config-package-dev (>= 4.5~) +Standards-Version: 3.8.0 + +Package: debathena-bin-example +Architecture: all +Depends: ${misc:Depends}, elinks, less +Provides: ${diverted-files} +Conflicts: ${diverted-files} +Description: Example config-package-dev package + This is an example config-package-dev package. diff --git a/examples/cdbs/debathena-bin-example-1.0/debian/control.in b/examples/cdbs/debathena-bin-example-1.0/debian/control.in new file mode 100644 index 0000000..c99ccd1 --- /dev/null +++ b/examples/cdbs/debathena-bin-example-1.0/debian/control.in @@ -0,0 +1,14 @@ +Source: debathena-bin-example +Section: config +Priority: extra +Maintainer: Tim Abbott +Build-Depends: @cdbs@ +Standards-Version: 3.8.0 + +Package: debathena-bin-example +Architecture: all +Depends: ${misc:Depends}, elinks, less +Provides: ${diverted-files} +Conflicts: ${diverted-files} +Description: Example config-package-dev package + This is an example config-package-dev package. diff --git a/examples/cdbs/debathena-bin-example-1.0/debian/copyright b/examples/cdbs/debathena-bin-example-1.0/debian/copyright new file mode 100644 index 0000000..78007ae --- /dev/null +++ b/examples/cdbs/debathena-bin-example-1.0/debian/copyright @@ -0,0 +1,24 @@ +Example config-package-dev package. + +Author: Tim Abbott + +Copyright © 2008 Tim Abbott + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/examples/cdbs/debathena-bin-example-1.0/debian/debathena-bin-example.install b/examples/cdbs/debathena-bin-example-1.0/debian/debathena-bin-example.install new file mode 100644 index 0000000..04c9a48 --- /dev/null +++ b/examples/cdbs/debathena-bin-example-1.0/debian/debathena-bin-example.install @@ -0,0 +1,2 @@ +debian/elinks.debathena usr/bin +debian/less.debathena usr/bin diff --git a/examples/cdbs/debathena-bin-example-1.0/debian/elinks.debathena b/examples/cdbs/debathena-bin-example-1.0/debian/elinks.debathena new file mode 100644 index 0000000..dbda483 --- /dev/null +++ b/examples/cdbs/debathena-bin-example-1.0/debian/elinks.debathena @@ -0,0 +1,6 @@ +#!/bin/sh +# Wrapper to make elinks put its UNIX sockets under /tmp rather than in $HOME. +# Works around . +TMPDIR=mktemp -d +export ELINKS_CONFDIR=$TMPDIR +exec elinks.debathena-orig "$@"x diff --git a/examples/cdbs/debathena-bin-example-1.0/debian/less.debathena b/examples/cdbs/debathena-bin-example-1.0/debian/less.debathena new file mode 100644 index 0000000..207173d --- /dev/null +++ b/examples/cdbs/debathena-bin-example-1.0/debian/less.debathena @@ -0,0 +1,4 @@ +#!/bin/sh +# Wrapper to make less read tarballs and so on. +eval $(lesspipe) +exec less.debathena-orig "$@" diff --git a/examples/cdbs/debathena-bin-example-1.0/debian/rules b/examples/cdbs/debathena-bin-example-1.0/debian/rules new file mode 100755 index 0000000..6acda4d --- /dev/null +++ b/examples/cdbs/debathena-bin-example-1.0/debian/rules @@ -0,0 +1,20 @@ +#!/usr/bin/make -f + +DEB_DISPLACE_EXTENSION = .debathena +# Install wrapper scripts for /usr/bin/elinks and /usr/bin/less +DEB_DISPLACE_FILES_debathena-bin-example += \ + /usr/bin/elinks.debathena \ + /usr/bin/less.debathena + +# If these had materially different behavior from the original +# versions, one might displace the man pages as well +DEB_DISPLACE_FILES_debathena-bin-example += /usr/share/man/man1/elinks.debathena.1.gz +DEB_DISPLACE_FILES_debathena-bin-example += /usr/share/man/man1/less.debathena.1.gz + +# This isn't config-package-dev specific, but we may want to install symlinks instead. +DEB_DH_LINK_debathena-bin-example += \ + /usr/share/man/man1/elinks.debathena-orig.1.gz /usr/share/man/man1/elinks.debathena.1.gz \ + /usr/share/man/man1/less.debathena-orig.1.gz /usr/share/man/man1/less.debathena.1.gz + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/rules/config-package.mk diff --git a/examples/cdbs/debathena-bin-example-1.1/debian/changelog b/examples/cdbs/debathena-bin-example-1.1/debian/changelog new file mode 100644 index 0000000..5cf43da --- /dev/null +++ b/examples/cdbs/debathena-bin-example-1.1/debian/changelog @@ -0,0 +1,11 @@ +debathena-bin-example (1.1) unstable; urgency=low + + * suppose elinks bug is fixed; stop displacing elinks. + + -- Tim Abbott Sun, 13 Jul 2008 02:06:39 -0400 + +debathena-bin-example (1.0) unstable; urgency=low + + * Initial release. + + -- Tim Abbott Sun, 13 Jul 2008 00:37:03 -0400 diff --git a/examples/cdbs/debathena-bin-example-1.1/debian/compat b/examples/cdbs/debathena-bin-example-1.1/debian/compat new file mode 100644 index 0000000..b8626c4 --- /dev/null +++ b/examples/cdbs/debathena-bin-example-1.1/debian/compat @@ -0,0 +1 @@ +4 diff --git a/examples/cdbs/debathena-bin-example-1.1/debian/control b/examples/cdbs/debathena-bin-example-1.1/debian/control new file mode 100644 index 0000000..c344b84 --- /dev/null +++ b/examples/cdbs/debathena-bin-example-1.1/debian/control @@ -0,0 +1,17 @@ +Source: debathena-bin-example +Section: config +Priority: extra +Maintainer: Tim Abbott +Build-Depends: cdbs, + debhelper, + dh-buildinfo, + config-package-dev (>= 4.5~) +Standards-Version: 3.8.0 + +Package: debathena-bin-example +Architecture: all +Depends: ${misc:Depends}, less +Provides: ${diverted-files} +Conflicts: ${diverted-files} +Description: Example config-package-dev package + This is an example config-package-dev package. diff --git a/examples/cdbs/debathena-bin-example-1.1/debian/control.in b/examples/cdbs/debathena-bin-example-1.1/debian/control.in new file mode 100644 index 0000000..dcf6204 --- /dev/null +++ b/examples/cdbs/debathena-bin-example-1.1/debian/control.in @@ -0,0 +1,14 @@ +Source: debathena-bin-example +Section: config +Priority: extra +Maintainer: Tim Abbott +Build-Depends: @cdbs@ +Standards-Version: 3.8.0 + +Package: debathena-bin-example +Architecture: all +Depends: ${misc:Depends}, less +Provides: ${diverted-files} +Conflicts: ${diverted-files} +Description: Example config-package-dev package + This is an example config-package-dev package. diff --git a/examples/cdbs/debathena-bin-example-1.1/debian/copyright b/examples/cdbs/debathena-bin-example-1.1/debian/copyright new file mode 100644 index 0000000..78007ae --- /dev/null +++ b/examples/cdbs/debathena-bin-example-1.1/debian/copyright @@ -0,0 +1,24 @@ +Example config-package-dev package. + +Author: Tim Abbott + +Copyright © 2008 Tim Abbott + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/examples/cdbs/debathena-bin-example-1.1/debian/debathena-bin-example.install b/examples/cdbs/debathena-bin-example-1.1/debian/debathena-bin-example.install new file mode 100644 index 0000000..6e86e9c --- /dev/null +++ b/examples/cdbs/debathena-bin-example-1.1/debian/debathena-bin-example.install @@ -0,0 +1 @@ +debian/less.debathena usr/bin diff --git a/examples/cdbs/debathena-bin-example-1.1/debian/less.debathena b/examples/cdbs/debathena-bin-example-1.1/debian/less.debathena new file mode 100644 index 0000000..207173d --- /dev/null +++ b/examples/cdbs/debathena-bin-example-1.1/debian/less.debathena @@ -0,0 +1,4 @@ +#!/bin/sh +# Wrapper to make less read tarballs and so on. +eval $(lesspipe) +exec less.debathena-orig "$@" diff --git a/examples/cdbs/debathena-bin-example-1.1/debian/rules b/examples/cdbs/debathena-bin-example-1.1/debian/rules new file mode 100755 index 0000000..0aee67c --- /dev/null +++ b/examples/cdbs/debathena-bin-example-1.1/debian/rules @@ -0,0 +1,23 @@ +#!/usr/bin/make -f + +DEB_DISPLACE_EXTENSION = .debathena +# Install wrapper scripts for /usr/bin/elinks and /usr/bin/less +DEB_DISPLACE_FILES_debathena-bin-example += \ + /usr/bin/less.debathena + +# If these had materially different behavior from the original +# versions, one might divert the man pages as well +DEB_DISPLACE_FILES_debathena-bin-example += /usr/share/man/man1/less.debathena.1.gz + +# This isn't config-package-dev specific, but we may want to install symlinks instead. +DEB_DH_LINK_debathena-bin-example += \ + /usr/share/man/man1/less.debathena-orig.1.gz /usr/share/man/man1/less.debathena.1.gz + +# Remove elinks displacement on upgrade if it was previously in place on +# the target system +DEB_UNDISPLACE_FILES_debathena-bin-example += /usr/bin/elinks.debathena +# and the man page +DEB_UNDISPLACE_FILES_debathena-bin-example += /usr/share/man/man1/elinks.debathena.1.gz + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/rules/config-package.mk diff --git a/examples/cdbs/debathena-conffile-example-1.0/debian/changelog b/examples/cdbs/debathena-conffile-example-1.0/debian/changelog new file mode 100644 index 0000000..d11878d --- /dev/null +++ b/examples/cdbs/debathena-conffile-example-1.0/debian/changelog @@ -0,0 +1,5 @@ +debathena-conffile-example (1.0) unstable; urgency=low + + * Initial release. + + -- Tim Abbott Sun, 13 Jul 2008 00:37:03 -0400 diff --git a/examples/cdbs/debathena-conffile-example-1.0/debian/compat b/examples/cdbs/debathena-conffile-example-1.0/debian/compat new file mode 100644 index 0000000..b8626c4 --- /dev/null +++ b/examples/cdbs/debathena-conffile-example-1.0/debian/compat @@ -0,0 +1 @@ +4 diff --git a/examples/cdbs/debathena-conffile-example-1.0/debian/control b/examples/cdbs/debathena-conffile-example-1.0/debian/control new file mode 100644 index 0000000..00a7e74 --- /dev/null +++ b/examples/cdbs/debathena-conffile-example-1.0/debian/control @@ -0,0 +1,17 @@ +Source: debathena-conffile-example +Section: config +Priority: extra +Maintainer: Tim Abbott +Build-Depends: cdbs, + debhelper, + dh-buildinfo, + config-package-dev (>= 4.5~) +Standards-Version: 3.8.0 + +Package: debathena-conffile-example +Architecture: all +Depends: ${misc:Depends} +Provides: ${diverted-files} +Conflicts: ${diverted-files} +Description: Example config-package-dev package + This is an example config-package-dev package. diff --git a/examples/cdbs/debathena-conffile-example-1.0/debian/control.in b/examples/cdbs/debathena-conffile-example-1.0/debian/control.in new file mode 100644 index 0000000..e11c3de --- /dev/null +++ b/examples/cdbs/debathena-conffile-example-1.0/debian/control.in @@ -0,0 +1,14 @@ +Source: debathena-conffile-example +Section: config +Priority: extra +Maintainer: Tim Abbott +Build-Depends: @cdbs@ +Standards-Version: 3.8.0 + +Package: debathena-conffile-example +Architecture: all +Depends: ${misc:Depends} +Provides: ${diverted-files} +Conflicts: ${diverted-files} +Description: Example config-package-dev package + This is an example config-package-dev package. diff --git a/examples/cdbs/debathena-conffile-example-1.0/debian/copyright b/examples/cdbs/debathena-conffile-example-1.0/debian/copyright new file mode 100644 index 0000000..78007ae --- /dev/null +++ b/examples/cdbs/debathena-conffile-example-1.0/debian/copyright @@ -0,0 +1,24 @@ +Example config-package-dev package. + +Author: Tim Abbott + +Copyright © 2008 Tim Abbott + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/examples/cdbs/debathena-conffile-example-1.0/debian/debathena-conffile-example.install b/examples/cdbs/debathena-conffile-example-1.0/debian/debathena-conffile-example.install new file mode 100644 index 0000000..5b79850 --- /dev/null +++ b/examples/cdbs/debathena-conffile-example-1.0/debian/debathena-conffile-example.install @@ -0,0 +1 @@ +files/* / diff --git a/examples/cdbs/debathena-conffile-example-1.0/debian/rules b/examples/cdbs/debathena-conffile-example-1.0/debian/rules new file mode 100755 index 0000000..e34adaf --- /dev/null +++ b/examples/cdbs/debathena-conffile-example-1.0/debian/rules @@ -0,0 +1,11 @@ +#!/usr/bin/make -f + +DEB_DISPLACE_EXTENSION = .debathena +# Replace some base files with simple replacements. +DEB_DISPLACE_FILES_debathena-conffile-example += \ + /etc/issue.net.debathena +# These files are installed via dh_install from the files/ directory +# (see debian/debathena-conffile-example.install) + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/rules/config-package.mk diff --git a/examples/cdbs/debathena-conffile-example-1.0/files/etc/issue.net.debathena b/examples/cdbs/debathena-conffile-example-1.0/files/etc/issue.net.debathena new file mode 100644 index 0000000..f1f73cb --- /dev/null +++ b/examples/cdbs/debathena-conffile-example-1.0/files/etc/issue.net.debathena @@ -0,0 +1 @@ +Debian Linux running debathena-conffile-example version 1.0 diff --git a/examples/cdbs/debathena-conffile-example-1.1/debian/changelog b/examples/cdbs/debathena-conffile-example-1.1/debian/changelog new file mode 100644 index 0000000..a24bd5c --- /dev/null +++ b/examples/cdbs/debathena-conffile-example-1.1/debian/changelog @@ -0,0 +1,12 @@ +debathena-conffile-example (1.1) unstable; urgency=low + + * Remove /etc/sysctl.d/10-ptrace.conf if it exists. Once again, + convenience trumps security. + + -- Jonathan Reed Mon, 25 Feb 2013 15:22:59 -0500 + +debathena-conffile-example (1.0) unstable; urgency=low + + * Initial release. + + -- Tim Abbott Sun, 13 Jul 2008 00:37:03 -0400 diff --git a/examples/cdbs/debathena-conffile-example-1.1/debian/compat b/examples/cdbs/debathena-conffile-example-1.1/debian/compat new file mode 100644 index 0000000..b8626c4 --- /dev/null +++ b/examples/cdbs/debathena-conffile-example-1.1/debian/compat @@ -0,0 +1 @@ +4 diff --git a/examples/cdbs/debathena-conffile-example-1.1/debian/control b/examples/cdbs/debathena-conffile-example-1.1/debian/control new file mode 100644 index 0000000..232a583 --- /dev/null +++ b/examples/cdbs/debathena-conffile-example-1.1/debian/control @@ -0,0 +1,17 @@ +Source: debathena-conffile-example +Section: config +Priority: extra +Maintainer: Jonathan Reed +Build-Depends: cdbs, + debhelper, + dh-buildinfo, + config-package-dev (>= 4.5~) +Standards-Version: 3.8.0 + +Package: debathena-conffile-example +Architecture: all +Depends: ${misc:Depends} +Provides: ${diverted-files} +Conflicts: ${diverted-files} +Description: Example config-package-dev package + This is an example config-package-dev package. diff --git a/examples/cdbs/debathena-conffile-example-1.1/debian/control.in b/examples/cdbs/debathena-conffile-example-1.1/debian/control.in new file mode 100644 index 0000000..57f9652 --- /dev/null +++ b/examples/cdbs/debathena-conffile-example-1.1/debian/control.in @@ -0,0 +1,14 @@ +Source: debathena-conffile-example +Section: config +Priority: extra +Maintainer: Jonathan Reed +Build-Depends: @cdbs@ +Standards-Version: 3.8.0 + +Package: debathena-conffile-example +Architecture: all +Depends: ${misc:Depends} +Provides: ${diverted-files} +Conflicts: ${diverted-files} +Description: Example config-package-dev package + This is an example config-package-dev package. diff --git a/examples/cdbs/debathena-conffile-example-1.1/debian/copyright b/examples/cdbs/debathena-conffile-example-1.1/debian/copyright new file mode 100644 index 0000000..78007ae --- /dev/null +++ b/examples/cdbs/debathena-conffile-example-1.1/debian/copyright @@ -0,0 +1,24 @@ +Example config-package-dev package. + +Author: Tim Abbott + +Copyright © 2008 Tim Abbott + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/examples/cdbs/debathena-conffile-example-1.1/debian/debathena-conffile-example.install b/examples/cdbs/debathena-conffile-example-1.1/debian/debathena-conffile-example.install new file mode 100644 index 0000000..5b79850 --- /dev/null +++ b/examples/cdbs/debathena-conffile-example-1.1/debian/debathena-conffile-example.install @@ -0,0 +1 @@ +files/* / diff --git a/examples/cdbs/debathena-conffile-example-1.1/debian/rules b/examples/cdbs/debathena-conffile-example-1.1/debian/rules new file mode 100755 index 0000000..72beb61 --- /dev/null +++ b/examples/cdbs/debathena-conffile-example-1.1/debian/rules @@ -0,0 +1,16 @@ +#!/usr/bin/make -f + +DEB_DISPLACE_EXTENSION = .debathena +# Replace some base files with simple replacements. +DEB_DISPLACE_FILES_debathena-conffile-example += \ + /etc/issue.net.debathena +# These files are installed via dh_install from the files/ directory +# (see debian/debathena-conffile-example.install) + +ifneq ($(wildcard /etc/sysctl.d/10-ptrace.conf),) + DEB_HIDE_FILES_debathena-conffile-example += \ + /etc/sysctl.d/10-ptrace.conf +endif + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/rules/config-package.mk diff --git a/examples/cdbs/debathena-conffile-example-1.1/debian/transform_legal.debathena b/examples/cdbs/debathena-conffile-example-1.1/debian/transform_legal.debathena new file mode 100755 index 0000000..739f40c --- /dev/null +++ b/examples/cdbs/debathena-conffile-example-1.1/debian/transform_legal.debathena @@ -0,0 +1,6 @@ +#!/bin/sh + +cat +echo +echo "Use of Athena facilities is restricted to authorized holders of Athena" +echo "accounts (MIT students, faculty, staff, and other authorized guests.)" diff --git a/examples/cdbs/debathena-conffile-example-1.1/files/etc/issue.net.debathena b/examples/cdbs/debathena-conffile-example-1.1/files/etc/issue.net.debathena new file mode 100644 index 0000000..f1f73cb --- /dev/null +++ b/examples/cdbs/debathena-conffile-example-1.1/files/etc/issue.net.debathena @@ -0,0 +1 @@ +Debian Linux running debathena-conffile-example version 1.0 diff --git a/examples/cdbs/debathena-cron-example-1.0/debian/changelog b/examples/cdbs/debathena-cron-example-1.0/debian/changelog new file mode 100644 index 0000000..371611a --- /dev/null +++ b/examples/cdbs/debathena-cron-example-1.0/debian/changelog @@ -0,0 +1,5 @@ +debathena-cron-example (1.0) unstable; urgency=low + + * Initial release. + + -- Tim Abbott Sun, 13 Jul 2008 00:37:03 -0400 diff --git a/examples/cdbs/debathena-cron-example-1.0/debian/compat b/examples/cdbs/debathena-cron-example-1.0/debian/compat new file mode 100644 index 0000000..b8626c4 --- /dev/null +++ b/examples/cdbs/debathena-cron-example-1.0/debian/compat @@ -0,0 +1 @@ +4 diff --git a/examples/cdbs/debathena-cron-example-1.0/debian/control b/examples/cdbs/debathena-cron-example-1.0/debian/control new file mode 100644 index 0000000..876b8d4 --- /dev/null +++ b/examples/cdbs/debathena-cron-example-1.0/debian/control @@ -0,0 +1,17 @@ +Source: debathena-cron-example +Section: config +Priority: extra +Maintainer: Tim Abbott +Build-Depends: cdbs, + debhelper, + dh-buildinfo, + config-package-dev (>= 4.5~) +Standards-Version: 3.8.0 + +Package: debathena-cron-example +Architecture: all +Depends: ${misc:Depends}, logcheck +Provides: ${diverted-files} +Conflicts: ${diverted-files} +Description: Example config-package-dev package + This is an example config-package-dev package. diff --git a/examples/cdbs/debathena-cron-example-1.0/debian/control.in b/examples/cdbs/debathena-cron-example-1.0/debian/control.in new file mode 100644 index 0000000..a79b162 --- /dev/null +++ b/examples/cdbs/debathena-cron-example-1.0/debian/control.in @@ -0,0 +1,14 @@ +Source: debathena-cron-example +Section: config +Priority: extra +Maintainer: Tim Abbott +Build-Depends: @cdbs@ +Standards-Version: 3.8.0 + +Package: debathena-cron-example +Architecture: all +Depends: ${misc:Depends}, logcheck +Provides: ${diverted-files} +Conflicts: ${diverted-files} +Description: Example config-package-dev package + This is an example config-package-dev package. diff --git a/examples/cdbs/debathena-cron-example-1.0/debian/copyright b/examples/cdbs/debathena-cron-example-1.0/debian/copyright new file mode 100644 index 0000000..78007ae --- /dev/null +++ b/examples/cdbs/debathena-cron-example-1.0/debian/copyright @@ -0,0 +1,24 @@ +Example config-package-dev package. + +Author: Tim Abbott + +Copyright © 2008 Tim Abbott + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/examples/cdbs/debathena-cron-example-1.0/debian/debathena-cron-example.cron.d b/examples/cdbs/debathena-cron-example-1.0/debian/debathena-cron-example.cron.d new file mode 100644 index 0000000..81d8150 --- /dev/null +++ b/examples/cdbs/debathena-cron-example-1.0/debian/debathena-cron-example.cron.d @@ -0,0 +1,9 @@ +# /etc/cron.d/logcheck: crontab entries for the logcheck package + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +MAILTO=root + +@reboot logcheck if [ -x /usr/sbin/logcheck ]; then nice -n10 /usr/sbin/logcheck -R; fi +* * * * * logcheck if [ -x /usr/sbin/logcheck ]; then nice -n10 /usr/sbin/logcheck; fi + +# EOF diff --git a/examples/cdbs/debathena-cron-example-1.0/debian/rules b/examples/cdbs/debathena-cron-example-1.0/debian/rules new file mode 100755 index 0000000..c56de48 --- /dev/null +++ b/examples/cdbs/debathena-cron-example-1.0/debian/rules @@ -0,0 +1,17 @@ +#!/usr/bin/make -f + +DEB_DISPLACE_EXTENSION = .debathena + +# This will hide /etc/cron.d/logcheck +DEB_HIDE_FILES_debathena-cron-example += \ + /etc/cron.d/logcheck + +# We will install (using dh_installcron, by placing the new cron job +# at debian/debathena-cron-example.cron.d) a new version that runs +# every minute, rather than every 30 minutes. This will generate a +# lot of mail. Note that we cannot install a new file to the path +# /etc/cron.d/logcheck from which a file was hidden using +# DEB_HIDE_FILES. + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/rules/config-package.mk diff --git a/examples/cdbs/debathena-transform-example-1.0/debian/changelog b/examples/cdbs/debathena-transform-example-1.0/debian/changelog new file mode 100644 index 0000000..14716f4 --- /dev/null +++ b/examples/cdbs/debathena-transform-example-1.0/debian/changelog @@ -0,0 +1,5 @@ +debathena-transform-example (1.0) unstable; urgency=low + + * Initial release. + + -- Tim Abbott Sun, 13 Jul 2008 00:37:03 -0400 diff --git a/examples/cdbs/debathena-transform-example-1.0/debian/compat b/examples/cdbs/debathena-transform-example-1.0/debian/compat new file mode 100644 index 0000000..b8626c4 --- /dev/null +++ b/examples/cdbs/debathena-transform-example-1.0/debian/compat @@ -0,0 +1 @@ +4 diff --git a/examples/cdbs/debathena-transform-example-1.0/debian/control b/examples/cdbs/debathena-transform-example-1.0/debian/control new file mode 100644 index 0000000..6c130ea --- /dev/null +++ b/examples/cdbs/debathena-transform-example-1.0/debian/control @@ -0,0 +1,17 @@ +Source: debathena-transform-example +Section: config +Priority: extra +Maintainer: Tim Abbott +Build-Depends: cdbs, + debhelper, + dh-buildinfo, + config-package-dev (>= 4.5~), lynx +Standards-Version: 3.8.0 + +Package: debathena-transform-example +Architecture: all +Depends: ${misc:Depends}, lynx +Provides: ${diverted-files} +Conflicts: ${diverted-files} +Description: Example config-package-dev package + This is an example config-package-dev package. diff --git a/examples/cdbs/debathena-transform-example-1.0/debian/control.in b/examples/cdbs/debathena-transform-example-1.0/debian/control.in new file mode 100644 index 0000000..0e215b5 --- /dev/null +++ b/examples/cdbs/debathena-transform-example-1.0/debian/control.in @@ -0,0 +1,14 @@ +Source: debathena-transform-example +Section: config +Priority: extra +Maintainer: Tim Abbott +Build-Depends: @cdbs@, lynx +Standards-Version: 3.8.0 + +Package: debathena-transform-example +Architecture: all +Depends: ${misc:Depends}, lynx +Provides: ${diverted-files} +Conflicts: ${diverted-files} +Description: Example config-package-dev package + This is an example config-package-dev package. diff --git a/examples/cdbs/debathena-transform-example-1.0/debian/copyright b/examples/cdbs/debathena-transform-example-1.0/debian/copyright new file mode 100644 index 0000000..78007ae --- /dev/null +++ b/examples/cdbs/debathena-transform-example-1.0/debian/copyright @@ -0,0 +1,24 @@ +Example config-package-dev package. + +Author: Tim Abbott + +Copyright © 2008 Tim Abbott + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/examples/cdbs/debathena-transform-example-1.0/debian/rules b/examples/cdbs/debathena-transform-example-1.0/debian/rules new file mode 100755 index 0000000..c5925fc --- /dev/null +++ b/examples/cdbs/debathena-transform-example-1.0/debian/rules @@ -0,0 +1,8 @@ +#!/usr/bin/make -f + +DEB_DISPLACE_EXTENSION = .debathena +DEB_TRANSFORM_FILES_debathena-transform-example += \ + /etc/lynx-cur/lynx.cfg.debathena + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/rules/config-package.mk diff --git a/examples/cdbs/debathena-transform-example-1.0/debian/transform_lynx.cfg.debathena b/examples/cdbs/debathena-transform-example-1.0/debian/transform_lynx.cfg.debathena new file mode 100755 index 0000000..99dd4ae --- /dev/null +++ b/examples/cdbs/debathena-transform-example-1.0/debian/transform_lynx.cfg.debathena @@ -0,0 +1,9 @@ +#!/usr/bin/perl -0p +# perl -0p is useful for writing efficient transform scripts. + +# Set the default lynx home page to web.mit.edu. As noted in the +# comments in lynx.cfg, if the lynx home page is down, lynx will refuse +# to run. This caused a number of helpdesk complaints when the default +# lynx home page was down for a day. + +s|^#STARTFILE:.*$|$&\nSTARTFILE:http://web.mit.edu/|m or die; diff --git a/examples/debhelper/debathena-bin-example-1.0/debian/changelog b/examples/debhelper/debathena-bin-example-1.0/debian/changelog new file mode 100644 index 0000000..00c3807 --- /dev/null +++ b/examples/debhelper/debathena-bin-example-1.0/debian/changelog @@ -0,0 +1,5 @@ +debathena-bin-example (1.0) unstable; urgency=low + + * Initial release. + + -- Geoffrey Thomas Tue, 11 Sep 2012 12:39:03 -0700 diff --git a/examples/debhelper/debathena-bin-example-1.0/debian/compat b/examples/debhelper/debathena-bin-example-1.0/debian/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/examples/debhelper/debathena-bin-example-1.0/debian/compat @@ -0,0 +1 @@ +7 diff --git a/examples/debhelper/debathena-bin-example-1.0/debian/control b/examples/debhelper/debathena-bin-example-1.0/debian/control new file mode 100644 index 0000000..4197d0f --- /dev/null +++ b/examples/debhelper/debathena-bin-example-1.0/debian/control @@ -0,0 +1,14 @@ +Source: debathena-bin-example +Section: config +Priority: extra +Maintainer: Geoffrey Thomas +Build-Depends: debhelper (>= 7.0.0~), config-package-dev (>= 4.15~) +Standards-Version: 3.9.2 + +Package: debathena-bin-example +Architecture: all +Depends: ${misc:Depends}, elinks, less +Provides: ${diverted-files} +Conflicts: ${diverted-files} +Description: Example config-package-dev package + This is an example config-package-dev package. diff --git a/examples/debhelper/debathena-bin-example-1.0/debian/copyright b/examples/debhelper/debathena-bin-example-1.0/debian/copyright new file mode 100644 index 0000000..37bc6e7 --- /dev/null +++ b/examples/debhelper/debathena-bin-example-1.0/debian/copyright @@ -0,0 +1,25 @@ +Example config-package-dev package. + +Author: Tim Abbott + +Copyright © 2008 Tim Abbott +Copyright © 2012 Geoffrey Thomas + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/examples/debhelper/debathena-bin-example-1.0/debian/debathena-bin-example.displace b/examples/debhelper/debathena-bin-example-1.0/debian/debathena-bin-example.displace new file mode 100644 index 0000000..1ebb91d --- /dev/null +++ b/examples/debhelper/debathena-bin-example-1.0/debian/debathena-bin-example.displace @@ -0,0 +1,4 @@ +/usr/bin/elinks.debathena +/usr/bin/less.debathena +/usr/share/man/man1/elinks.debathena.1.gz +/usr/share/man/man1/less.debathena.1.gz diff --git a/examples/debhelper/debathena-bin-example-1.0/debian/debathena-bin-example.install b/examples/debhelper/debathena-bin-example-1.0/debian/debathena-bin-example.install new file mode 100644 index 0000000..04c9a48 --- /dev/null +++ b/examples/debhelper/debathena-bin-example-1.0/debian/debathena-bin-example.install @@ -0,0 +1,2 @@ +debian/elinks.debathena usr/bin +debian/less.debathena usr/bin diff --git a/examples/debhelper/debathena-bin-example-1.0/debian/debathena-bin-example.links b/examples/debhelper/debathena-bin-example-1.0/debian/debathena-bin-example.links new file mode 100644 index 0000000..221e7ed --- /dev/null +++ b/examples/debhelper/debathena-bin-example-1.0/debian/debathena-bin-example.links @@ -0,0 +1,2 @@ +/usr/share/man/man1/elinks.debathena-orig.1.gz /usr/share/man/man1/elinks.debathena.1.gz +/usr/share/man/man1/less.debathena-orig.1.gz /usr/share/man/man1/less.debathena.1.gz diff --git a/examples/debhelper/debathena-bin-example-1.0/debian/elinks.debathena b/examples/debhelper/debathena-bin-example-1.0/debian/elinks.debathena new file mode 100644 index 0000000..dbda483 --- /dev/null +++ b/examples/debhelper/debathena-bin-example-1.0/debian/elinks.debathena @@ -0,0 +1,6 @@ +#!/bin/sh +# Wrapper to make elinks put its UNIX sockets under /tmp rather than in $HOME. +# Works around . +TMPDIR=mktemp -d +export ELINKS_CONFDIR=$TMPDIR +exec elinks.debathena-orig "$@"x diff --git a/examples/debhelper/debathena-bin-example-1.0/debian/less.debathena b/examples/debhelper/debathena-bin-example-1.0/debian/less.debathena new file mode 100644 index 0000000..207173d --- /dev/null +++ b/examples/debhelper/debathena-bin-example-1.0/debian/less.debathena @@ -0,0 +1,4 @@ +#!/bin/sh +# Wrapper to make less read tarballs and so on. +eval $(lesspipe) +exec less.debathena-orig "$@" diff --git a/examples/debhelper/debathena-bin-example-1.0/debian/rules b/examples/debhelper/debathena-bin-example-1.0/debian/rules new file mode 100755 index 0000000..fb88cc4 --- /dev/null +++ b/examples/debhelper/debathena-bin-example-1.0/debian/rules @@ -0,0 +1,4 @@ +#!/usr/bin/make -f + +%: + dh $@ --with=config-package diff --git a/examples/debhelper/debathena-bin-example-1.0/debian/source/format b/examples/debhelper/debathena-bin-example-1.0/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/examples/debhelper/debathena-bin-example-1.0/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/examples/debhelper/debathena-bin-example-1.1/debian/changelog b/examples/debhelper/debathena-bin-example-1.1/debian/changelog new file mode 100644 index 0000000..26d4732 --- /dev/null +++ b/examples/debhelper/debathena-bin-example-1.1/debian/changelog @@ -0,0 +1,11 @@ +debathena-bin-example (1.1) unstable; urgency=low + + * suppose elinks bug is fixed; stop displacing elinks. + + -- Geoffrey Thomas Tue, 11 Sep 2012 12:50:13 -0700 + +debathena-bin-example (1.0) unstable; urgency=low + + * Initial release. + + -- Geoffrey Thomas Tue, 11 Sep 2012 12:39:03 -0700 diff --git a/examples/debhelper/debathena-bin-example-1.1/debian/compat b/examples/debhelper/debathena-bin-example-1.1/debian/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/examples/debhelper/debathena-bin-example-1.1/debian/compat @@ -0,0 +1 @@ +7 diff --git a/examples/debhelper/debathena-bin-example-1.1/debian/control b/examples/debhelper/debathena-bin-example-1.1/debian/control new file mode 100644 index 0000000..d4c2352 --- /dev/null +++ b/examples/debhelper/debathena-bin-example-1.1/debian/control @@ -0,0 +1,14 @@ +Source: debathena-bin-example +Section: config +Priority: extra +Maintainer: Geoffrey Thomas +Build-Depends: debhelper (>= 7.0.0~), config-package-dev (>= 4.15~) +Standards-Version: 3.9.2 + +Package: debathena-bin-example +Architecture: all +Depends: ${misc:Depends}, less +Provides: ${diverted-files} +Conflicts: ${diverted-files} +Description: Example config-package-dev package + This is an example config-package-dev package. diff --git a/examples/debhelper/debathena-bin-example-1.1/debian/copyright b/examples/debhelper/debathena-bin-example-1.1/debian/copyright new file mode 100644 index 0000000..37bc6e7 --- /dev/null +++ b/examples/debhelper/debathena-bin-example-1.1/debian/copyright @@ -0,0 +1,25 @@ +Example config-package-dev package. + +Author: Tim Abbott + +Copyright © 2008 Tim Abbott +Copyright © 2012 Geoffrey Thomas + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/examples/debhelper/debathena-bin-example-1.1/debian/debathena-bin-example.displace b/examples/debhelper/debathena-bin-example-1.1/debian/debathena-bin-example.displace new file mode 100644 index 0000000..832a630 --- /dev/null +++ b/examples/debhelper/debathena-bin-example-1.1/debian/debathena-bin-example.displace @@ -0,0 +1,2 @@ +/usr/bin/less.debathena +/usr/share/man/man1/less.debathena.1.gz diff --git a/examples/debhelper/debathena-bin-example-1.1/debian/debathena-bin-example.install b/examples/debhelper/debathena-bin-example-1.1/debian/debathena-bin-example.install new file mode 100644 index 0000000..6e86e9c --- /dev/null +++ b/examples/debhelper/debathena-bin-example-1.1/debian/debathena-bin-example.install @@ -0,0 +1 @@ +debian/less.debathena usr/bin diff --git a/examples/debhelper/debathena-bin-example-1.1/debian/debathena-bin-example.links b/examples/debhelper/debathena-bin-example-1.1/debian/debathena-bin-example.links new file mode 100644 index 0000000..0f40abb --- /dev/null +++ b/examples/debhelper/debathena-bin-example-1.1/debian/debathena-bin-example.links @@ -0,0 +1 @@ +/usr/share/man/man1/less.debathena-orig.1.gz /usr/share/man/man1/less.debathena.1.gz diff --git a/examples/debhelper/debathena-bin-example-1.1/debian/debathena-bin-example.undisplace b/examples/debhelper/debathena-bin-example-1.1/debian/debathena-bin-example.undisplace new file mode 100644 index 0000000..27f0b80 --- /dev/null +++ b/examples/debhelper/debathena-bin-example-1.1/debian/debathena-bin-example.undisplace @@ -0,0 +1,2 @@ +/usr/bin/elinks.debathena +/usr/share/man/man1/elinks.debathena.1.gz diff --git a/examples/debhelper/debathena-bin-example-1.1/debian/less.debathena b/examples/debhelper/debathena-bin-example-1.1/debian/less.debathena new file mode 100644 index 0000000..207173d --- /dev/null +++ b/examples/debhelper/debathena-bin-example-1.1/debian/less.debathena @@ -0,0 +1,4 @@ +#!/bin/sh +# Wrapper to make less read tarballs and so on. +eval $(lesspipe) +exec less.debathena-orig "$@" diff --git a/examples/debhelper/debathena-bin-example-1.1/debian/rules b/examples/debhelper/debathena-bin-example-1.1/debian/rules new file mode 100755 index 0000000..fb88cc4 --- /dev/null +++ b/examples/debhelper/debathena-bin-example-1.1/debian/rules @@ -0,0 +1,4 @@ +#!/usr/bin/make -f + +%: + dh $@ --with=config-package diff --git a/examples/debhelper/debathena-bin-example-1.1/debian/source/format b/examples/debhelper/debathena-bin-example-1.1/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/examples/debhelper/debathena-bin-example-1.1/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/examples/debhelper/debathena-conffile-example-1.0/debian/changelog b/examples/debhelper/debathena-conffile-example-1.0/debian/changelog new file mode 100644 index 0000000..1e9e47e --- /dev/null +++ b/examples/debhelper/debathena-conffile-example-1.0/debian/changelog @@ -0,0 +1,5 @@ +debathena-conffile-example (1.0) unstable; urgency=low + + * Initial release. + + -- Geoffrey Thomas Wed, 08 Aug 2012 18:37:54 -0700 diff --git a/examples/debhelper/debathena-conffile-example-1.0/debian/compat b/examples/debhelper/debathena-conffile-example-1.0/debian/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/examples/debhelper/debathena-conffile-example-1.0/debian/compat @@ -0,0 +1 @@ +7 diff --git a/examples/debhelper/debathena-conffile-example-1.0/debian/control b/examples/debhelper/debathena-conffile-example-1.0/debian/control new file mode 100644 index 0000000..40449aa --- /dev/null +++ b/examples/debhelper/debathena-conffile-example-1.0/debian/control @@ -0,0 +1,14 @@ +Source: debathena-conffile-example +Section: config +Priority: extra +Maintainer: Geoffrey Thomas +Build-Depends: debhelper (>= 7.0.0~), config-package-dev (>= 4.15~) +Standards-Version: 3.9.2 + +Package: debathena-conffile-example +Architecture: all +Depends: ${misc:Depends} +Provides: ${diverted-files} +Conflicts: ${diverted-files} +Description: Example config-package-dev package + This is an example config-package-dev package. diff --git a/examples/debhelper/debathena-conffile-example-1.0/debian/copyright b/examples/debhelper/debathena-conffile-example-1.0/debian/copyright new file mode 100644 index 0000000..37bc6e7 --- /dev/null +++ b/examples/debhelper/debathena-conffile-example-1.0/debian/copyright @@ -0,0 +1,25 @@ +Example config-package-dev package. + +Author: Tim Abbott + +Copyright © 2008 Tim Abbott +Copyright © 2012 Geoffrey Thomas + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/examples/debhelper/debathena-conffile-example-1.0/debian/debathena-conffile-example.displace b/examples/debhelper/debathena-conffile-example-1.0/debian/debathena-conffile-example.displace new file mode 100644 index 0000000..c00fab4 --- /dev/null +++ b/examples/debhelper/debathena-conffile-example-1.0/debian/debathena-conffile-example.displace @@ -0,0 +1 @@ +/etc/issue.net.debathena diff --git a/examples/debhelper/debathena-conffile-example-1.0/debian/debathena-conffile-example.install b/examples/debhelper/debathena-conffile-example-1.0/debian/debathena-conffile-example.install new file mode 100644 index 0000000..5b79850 --- /dev/null +++ b/examples/debhelper/debathena-conffile-example-1.0/debian/debathena-conffile-example.install @@ -0,0 +1 @@ +files/* / diff --git a/examples/debhelper/debathena-conffile-example-1.0/debian/rules b/examples/debhelper/debathena-conffile-example-1.0/debian/rules new file mode 100755 index 0000000..a089a9e --- /dev/null +++ b/examples/debhelper/debathena-conffile-example-1.0/debian/rules @@ -0,0 +1,4 @@ +#!/usr/bin/make -f + +%: + dh $@ --with config-package diff --git a/examples/debhelper/debathena-conffile-example-1.0/debian/source/format b/examples/debhelper/debathena-conffile-example-1.0/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/examples/debhelper/debathena-conffile-example-1.0/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/examples/debhelper/debathena-conffile-example-1.0/files/etc/issue.net.debathena b/examples/debhelper/debathena-conffile-example-1.0/files/etc/issue.net.debathena new file mode 100644 index 0000000..f1f73cb --- /dev/null +++ b/examples/debhelper/debathena-conffile-example-1.0/files/etc/issue.net.debathena @@ -0,0 +1 @@ +Debian Linux running debathena-conffile-example version 1.0 diff --git a/examples/debhelper/debathena-conffile-example-1.1/debian/changelog b/examples/debhelper/debathena-conffile-example-1.1/debian/changelog new file mode 100644 index 0000000..b7bb075 --- /dev/null +++ b/examples/debhelper/debathena-conffile-example-1.1/debian/changelog @@ -0,0 +1,12 @@ +debathena-conffile-example (1.1) unstable; urgency=low + + * Remove /etc/sysctl.d/10-ptrace.conf if it exists. Once again, + convenience trumps security. + + -- Geoffrey Thomas Thu, 13 Dec 2012 16:46:39 -0800 + +debathena-conffile-example (1.0) unstable; urgency=low + + * Initial release. + + -- Geoffrey Thomas Wed, 08 Aug 2012 18:37:54 -0700 diff --git a/examples/debhelper/debathena-conffile-example-1.1/debian/compat b/examples/debhelper/debathena-conffile-example-1.1/debian/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/examples/debhelper/debathena-conffile-example-1.1/debian/compat @@ -0,0 +1 @@ +7 diff --git a/examples/debhelper/debathena-conffile-example-1.1/debian/control b/examples/debhelper/debathena-conffile-example-1.1/debian/control new file mode 100644 index 0000000..9edec61 --- /dev/null +++ b/examples/debhelper/debathena-conffile-example-1.1/debian/control @@ -0,0 +1,14 @@ +Source: debathena-conffile-example +Section: config +Priority: extra +Maintainer: Geoffrey Thomas +Build-Depends: debhelper (>= 7.0.50~), config-package-dev (>= 4.15~) +Standards-Version: 3.9.2 + +Package: debathena-conffile-example +Architecture: all +Depends: ${misc:Depends} +Provides: ${diverted-files} +Conflicts: ${diverted-files} +Description: Example config-package-dev package + This is an example config-package-dev package. diff --git a/examples/debhelper/debathena-conffile-example-1.1/debian/copyright b/examples/debhelper/debathena-conffile-example-1.1/debian/copyright new file mode 100644 index 0000000..37bc6e7 --- /dev/null +++ b/examples/debhelper/debathena-conffile-example-1.1/debian/copyright @@ -0,0 +1,25 @@ +Example config-package-dev package. + +Author: Tim Abbott + +Copyright © 2008 Tim Abbott +Copyright © 2012 Geoffrey Thomas + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/examples/debhelper/debathena-conffile-example-1.1/debian/debathena-conffile-example.displace b/examples/debhelper/debathena-conffile-example-1.1/debian/debathena-conffile-example.displace new file mode 100644 index 0000000..c00fab4 --- /dev/null +++ b/examples/debhelper/debathena-conffile-example-1.1/debian/debathena-conffile-example.displace @@ -0,0 +1 @@ +/etc/issue.net.debathena diff --git a/examples/debhelper/debathena-conffile-example-1.1/debian/debathena-conffile-example.install b/examples/debhelper/debathena-conffile-example-1.1/debian/debathena-conffile-example.install new file mode 100644 index 0000000..5b79850 --- /dev/null +++ b/examples/debhelper/debathena-conffile-example-1.1/debian/debathena-conffile-example.install @@ -0,0 +1 @@ +files/* / diff --git a/examples/debhelper/debathena-conffile-example-1.1/debian/rules b/examples/debhelper/debathena-conffile-example-1.1/debian/rules new file mode 100755 index 0000000..b50a0b1 --- /dev/null +++ b/examples/debhelper/debathena-conffile-example-1.1/debian/rules @@ -0,0 +1,10 @@ +#!/usr/bin/make -f + +%: + dh $@ --with config-package + +override_dh_configpackage: + dh_configpackage +ifneq ($(wildcard /etc/sysctl.d/10-ptrace.conf),) + dh_configpackage --hide /etc/sysctl.d/10-ptrace.conf +endif diff --git a/examples/debhelper/debathena-conffile-example-1.1/debian/source/format b/examples/debhelper/debathena-conffile-example-1.1/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/examples/debhelper/debathena-conffile-example-1.1/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/examples/debhelper/debathena-conffile-example-1.1/debian/transform_legal.debathena b/examples/debhelper/debathena-conffile-example-1.1/debian/transform_legal.debathena new file mode 100755 index 0000000..739f40c --- /dev/null +++ b/examples/debhelper/debathena-conffile-example-1.1/debian/transform_legal.debathena @@ -0,0 +1,6 @@ +#!/bin/sh + +cat +echo +echo "Use of Athena facilities is restricted to authorized holders of Athena" +echo "accounts (MIT students, faculty, staff, and other authorized guests.)" diff --git a/examples/debhelper/debathena-conffile-example-1.1/files/etc/issue.net.debathena b/examples/debhelper/debathena-conffile-example-1.1/files/etc/issue.net.debathena new file mode 100644 index 0000000..f1f73cb --- /dev/null +++ b/examples/debhelper/debathena-conffile-example-1.1/files/etc/issue.net.debathena @@ -0,0 +1 @@ +Debian Linux running debathena-conffile-example version 1.0 diff --git a/examples/debhelper/debathena-cron-example-1.0/debian/changelog b/examples/debhelper/debathena-cron-example-1.0/debian/changelog new file mode 100644 index 0000000..1f9ea4a --- /dev/null +++ b/examples/debhelper/debathena-cron-example-1.0/debian/changelog @@ -0,0 +1,5 @@ +debathena-cron-example (1.0) unstable; urgency=low + + * Initial release. + + -- Geoffrey Thomas Mon, 17 Sep 2012 23:55:40 -0700 diff --git a/examples/debhelper/debathena-cron-example-1.0/debian/compat b/examples/debhelper/debathena-cron-example-1.0/debian/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/examples/debhelper/debathena-cron-example-1.0/debian/compat @@ -0,0 +1 @@ +7 diff --git a/examples/debhelper/debathena-cron-example-1.0/debian/control b/examples/debhelper/debathena-cron-example-1.0/debian/control new file mode 100644 index 0000000..3cc7f28 --- /dev/null +++ b/examples/debhelper/debathena-cron-example-1.0/debian/control @@ -0,0 +1,14 @@ +Source: debathena-cron-example +Section: config +Priority: extra +Maintainer: Geoffrey Thomas +Build-Depends: debhelper (>= 7.0.0~), config-package-dev (>= 4.15~) +Standards-Version: 3.9.2 + +Package: debathena-cron-example +Architecture: all +Depends: ${misc:Depends}, logcheck +Provides: ${diverted-files} +Conflicts: ${diverted-files} +Description: Example config-package-dev package + This is an example config-package-dev package. diff --git a/examples/debhelper/debathena-cron-example-1.0/debian/copyright b/examples/debhelper/debathena-cron-example-1.0/debian/copyright new file mode 100644 index 0000000..37bc6e7 --- /dev/null +++ b/examples/debhelper/debathena-cron-example-1.0/debian/copyright @@ -0,0 +1,25 @@ +Example config-package-dev package. + +Author: Tim Abbott + +Copyright © 2008 Tim Abbott +Copyright © 2012 Geoffrey Thomas + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/examples/debhelper/debathena-cron-example-1.0/debian/debathena-cron-example.cron.d b/examples/debhelper/debathena-cron-example-1.0/debian/debathena-cron-example.cron.d new file mode 100644 index 0000000..81d8150 --- /dev/null +++ b/examples/debhelper/debathena-cron-example-1.0/debian/debathena-cron-example.cron.d @@ -0,0 +1,9 @@ +# /etc/cron.d/logcheck: crontab entries for the logcheck package + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +MAILTO=root + +@reboot logcheck if [ -x /usr/sbin/logcheck ]; then nice -n10 /usr/sbin/logcheck -R; fi +* * * * * logcheck if [ -x /usr/sbin/logcheck ]; then nice -n10 /usr/sbin/logcheck; fi + +# EOF diff --git a/examples/debhelper/debathena-cron-example-1.0/debian/debathena-cron-example.hide b/examples/debhelper/debathena-cron-example-1.0/debian/debathena-cron-example.hide new file mode 100644 index 0000000..39e6145 --- /dev/null +++ b/examples/debhelper/debathena-cron-example-1.0/debian/debathena-cron-example.hide @@ -0,0 +1 @@ +/etc/cron.d/logcheck diff --git a/examples/debhelper/debathena-cron-example-1.0/debian/rules b/examples/debhelper/debathena-cron-example-1.0/debian/rules new file mode 100755 index 0000000..fb88cc4 --- /dev/null +++ b/examples/debhelper/debathena-cron-example-1.0/debian/rules @@ -0,0 +1,4 @@ +#!/usr/bin/make -f + +%: + dh $@ --with=config-package diff --git a/examples/debhelper/debathena-cron-example-1.0/debian/source/format b/examples/debhelper/debathena-cron-example-1.0/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/examples/debhelper/debathena-cron-example-1.0/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/examples/debhelper/debathena-transform-example-1.0/debian/changelog b/examples/debhelper/debathena-transform-example-1.0/debian/changelog new file mode 100644 index 0000000..e49f9db --- /dev/null +++ b/examples/debhelper/debathena-transform-example-1.0/debian/changelog @@ -0,0 +1,5 @@ +debathena-transform-example (1.0) unstable; urgency=low + + * Initial release. + + -- Geoffrey Thomas Mon, 17 Sep 2012 23:45:47 -0700 diff --git a/examples/debhelper/debathena-transform-example-1.0/debian/compat b/examples/debhelper/debathena-transform-example-1.0/debian/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/examples/debhelper/debathena-transform-example-1.0/debian/compat @@ -0,0 +1 @@ +7 diff --git a/examples/debhelper/debathena-transform-example-1.0/debian/control b/examples/debhelper/debathena-transform-example-1.0/debian/control new file mode 100644 index 0000000..b8090c8 --- /dev/null +++ b/examples/debhelper/debathena-transform-example-1.0/debian/control @@ -0,0 +1,14 @@ +Source: debathena-transform-example +Section: config +Priority: extra +Maintainer: Geoffrey Thomas +Build-Depends: debhelper (>= 7.0.0~), config-package-dev (>= 4.15), lynx +Standards-Version: 3.9.2 + +Package: debathena-transform-example +Architecture: all +Depends: ${misc:Depends}, lynx +Provides: ${diverted-files} +Conflicts: ${diverted-files} +Description: Example config-package-dev package + This is an example config-package-dev package. diff --git a/examples/debhelper/debathena-transform-example-1.0/debian/copyright b/examples/debhelper/debathena-transform-example-1.0/debian/copyright new file mode 100644 index 0000000..37bc6e7 --- /dev/null +++ b/examples/debhelper/debathena-transform-example-1.0/debian/copyright @@ -0,0 +1,25 @@ +Example config-package-dev package. + +Author: Tim Abbott + +Copyright © 2008 Tim Abbott +Copyright © 2012 Geoffrey Thomas + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/examples/debhelper/debathena-transform-example-1.0/debian/debathena-transform-example.transform b/examples/debhelper/debathena-transform-example-1.0/debian/debathena-transform-example.transform new file mode 100644 index 0000000..0764985 --- /dev/null +++ b/examples/debhelper/debathena-transform-example-1.0/debian/debathena-transform-example.transform @@ -0,0 +1 @@ +/etc/lynx-cur/lynx.cfg.debathena perl -0pe 's|^#STARTFILE:.*$|$&\nSTARTFILE:http://web.mit.edu/|m or die' diff --git a/examples/debhelper/debathena-transform-example-1.0/debian/rules b/examples/debhelper/debathena-transform-example-1.0/debian/rules new file mode 100755 index 0000000..fb88cc4 --- /dev/null +++ b/examples/debhelper/debathena-transform-example-1.0/debian/rules @@ -0,0 +1,4 @@ +#!/usr/bin/make -f + +%: + dh $@ --with=config-package diff --git a/examples/debhelper/debathena-transform-example-1.0/debian/source/format b/examples/debhelper/debathena-transform-example-1.0/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/examples/debhelper/debathena-transform-example-1.0/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/transform-files.mk b/transform-files.mk new file mode 100644 index 0000000..c75e861 --- /dev/null +++ b/transform-files.mk @@ -0,0 +1,57 @@ +# -*- mode: makefile; coding: utf-8 -*- +# Copyright © 2008 Tim Abbott and +# Anders Kaseorg +# +# 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, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. + +# Don't include transform-files.mk in your rules files directly; +# instead use config-package.mk. + +ifndef _cdbs_rules_transform_files +_cdbs_rules_transform_files = 1 + +include /usr/share/cdbs/1/rules/check-files.mk + +DEB_TRANSFORM_FILES = $(foreach package,$(DEB_ALL_PACKAGES),$(DEB_TRANSFORM_FILES_$(package))) + +DEB_TRANSFORM_FILES_TMPDIR=debian/transform_file_copies + +debian_transform_files = $(patsubst %,$(DEB_TRANSFORM_FILES_TMPDIR)%,$(1)) +undebian_transform_files = $(patsubst $(DEB_TRANSFORM_FILES_TMPDIR)%,%,$(1)) +debian_transform_script = $(if $(DEB_TRANSFORM_SCRIPT_$(cdbs_curpkg)_$(call undebian_transform_files,$(1))), \ + $(DEB_TRANSFORM_SCRIPT_$(cdbs_curpkg)_$(call undebian_transform_files,$(1))), \ + $(if $(DEB_TRANSFORM_SCRIPT_$(call undebian_transform_files,$(1))), \ + $(DEB_TRANSFORM_SCRIPT_$(call undebian_transform_files,$(1))), \ + debian/transform_$(notdir $(call undebian_transform_files,$(1))))) + +common-build-arch common-build-indep:: $(foreach file,$(DEB_TRANSFORM_FILES),$(call debian_transform_files,$(file))) + +$(call debian_transform_files,%): $(call debian_check_files,%) + mkdir -p $(@D) + chmod +x $(call debian_transform_script,$@) + $(call debian_transform_script,$@) < $< > $@ + +$(patsubst %,binary-install/%,$(DEB_ALL_PACKAGES)) :: binary-install/%: + set -e; \ + $(foreach file,$(DEB_TRANSFORM_FILES_$(cdbs_curpkg)), \ + install -d debian/$(cdbs_curpkg)/$(dir $(file)); \ + cp -a $(call debian_transform_files,$(file)) \ + debian/$(cdbs_curpkg)/$(dir $(file));) + +clean:: + rm -rf $(DEB_TRANSFORM_FILES_TMPDIR) + +endif -- 2.20.1