# 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/divert.mk
-DEB_CHECK_FILES_DIR = debian/check_file_copies
+DEB_CHECK_FILES_TMPDIR = debian/check_file_copies
debian_check_files_source = $(if $(DEB_CHECK_FILES_SOURCE_$(1)),$(DEB_CHECK_FILES_SOURCE_$(1)),$(1))
debian_check_files_check = $(call divert_files_replace_name,$(call debian_check_files_source,$(1)))
-debian_check_files = $(patsubst %,$(DEB_CHECK_FILES_DIR)%,$(1))
-undebian_check_files = $(patsubst $(DEB_CHECK_FILES_DIR)%,%,$(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_check,$(target))
$(call debian_check_files_tmp,%): truename = $(shell /usr/sbin/dpkg-divert --truename $(name))
/var/lib/dpkg/info/$(package).md5sums); \
[ -n "$$md5" ] && echo "$$md5" | md5sum -c; \
else \
- echo "warning: $(package) does not include md5sums!"; \
- echo "warning: md5sum for $(name) not verified."; \
+ 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_DIR)
+ rm -rf $(DEB_CHECK_FILES_TMPDIR)
endif
# 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_DIVERT_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_DIVERT_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_DIVERT_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_DIVERT_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_DIVERT_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.
+#
+# DEB_REMOVE_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_DIVERT_FILES.
+#
+# DEB_UNDIVERT_FILES_package += /path/file.divert
+# DEB_UNDIVERT_VERSION_/path/file.divert = 1.0-1
+#
+# List of absolute paths to files whose diversions caused by
+# DEB_DIVERT_FILES are to be removed upon installing this package.
+# This is primarily useful for removing a now-unecessary diversion
+# provided by a previous version of this package on an upgrade.
+#
+# The DEB_UNDIVERT_VERSION_file variable should be set to the
+# version number of this package at which you added
+# DEB_UNDIVERT_FILES_path/file.divert; it is used to avoid attempting
+# to remove the diversions again on future upgrades.
+#
+# DEB_UNREMOVE_FILES_package += /path/file
+# DEB_UNREMOVE_VERSION_/path/file = 1.0-1
+#
+# This works like DEB_UNDIVERT_FILES_package, except that it only
+# removes the diversion (not a symlink) and the version number is
+# specified with DEB_UNREMOVE_VERSION_/path/file.
+
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
+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 <tabbott@mit.edu> 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.
--- /dev/null
+examples/*
Section: devel
Priority: extra
Maintainer: Tim Abbott <tabbott@mit.edu>
-Homepage: http://debathena.mit.edu/config-packages/
+Homepage: http://debathena.mit.edu/config-package-dev
Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 4.2.0)
-Standards-Version: 3.7.3
+Standards-Version: 3.8.0
Package: config-package-dev
Architecture: all
Section: devel
Priority: extra
Maintainer: Tim Abbott <tabbott@mit.edu>
-Homepage: http://debathena.mit.edu/config-packages/
+Homepage: http://debathena.mit.edu/config-package-dev
Build-Depends: @cdbs@
-Standards-Version: 3.7.3
+Standards-Version: 3.8.0
Package: config-package-dev
Architecture: all
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
This program is free software; you can redistribute it and/or modify
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
# 02111-1307 USA.
+# Don't include divert.mk in your rules files directly; instead use
+# config-package.mk.
+
+# divert.mk handles the low-level diversion logic. It includes
+# divert.sh.in in the postinst and prerm scripts, and adds
+
ifndef _cdbs_rules_divert
_cdbs_rules_divert = 1
CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), config-package-dev (>= 4.5~)
+# divert.sh.in is included in the postinst/prerm scripts of packages
+# installing diversions using config-package-dev.
DEB_DIVERT_SCRIPT = /usr/share/config-package-dev/divert.sh.in
+# script used to encode the path of a file uniquely in a valid virtual
+# package name.
+DEB_DIVERT_ENCODER = /usr/share/config-package-dev/encode
DEB_DIVERT_PACKAGES += $(foreach package,$(DEB_ALL_PACKAGES), \
$(if $(DEB_TRANSFORM_FILES_$(package)),$(package), \
DEB_DIVERT_EXTENSION = .divert
endif
-DEB_DIVERT_ENCODER = /usr/share/config-package-dev/encode
-
+# Replace only the last instance of DEB_DIVERT_EXTENSION in the
+# filename, to make it possible to divert /path/foo.divert to
+# foo.divert.divert-orig
divert_files_replace_name = $(shell echo $(1) | perl -pe 's/(.*)\Q$(DEB_DIVERT_EXTENSION)\E/$$1$(2)/')
debian-divert/%: package = $(subst debian-divert/,,$@)
debian-divert/%: divert_files_all = $(strip $(divert_files) $(divert_remove_files) $(divert_undivert_files) $(divert_unremove_files))
debian-divert/%: divert_files_thispkg = $(strip $(divert_files) $(divert_remove_files))
$(patsubst %,debian-divert/%,$(DEB_DIVERT_PACKAGES)) :: debian-divert/%:
+# 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 as appropriate
( \
sed 's/#PACKAGE#/$(cdbs_curpkg)/g; s/#DEB_DIVERT_EXTENSION#/$(DEB_DIVERT_EXTENSION)/g' $(DEB_DIVERT_SCRIPT); \
$(if $(divert_files_all), \
echo 'fi'; \
) \
) >> $(CURDIR)/debian/$(cdbs_curpkg).postinst.debhelper
+# Add code to prerm script to undo diversions when package is removed.
( \
sed 's/#PACKAGE#/$(cdbs_curpkg)/g; s/#DEB_DIVERT_EXTENSION#/$(DEB_DIVERT_EXTENSION)/g' $(DEB_DIVERT_SCRIPT); \
$(if $(divert_files_thispkg), \
echo 'fi'; \
) \
) >> $(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)
( \
echo -n "diverted-files="; \
$(foreach file,$(divert_files_thispkg),\
- echo -n "configures-"; \
+ echo -n "diverts-"; \
${DEB_DIVERT_ENCODER} "$(call divert_files_replace_name,$(file))"; \
echo -n ", ";) \
echo \
--- /dev/null
+Extensive documentation is available on the web at
+<http://debathena.mit.edu/config-package-dev>.
+
+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.
#!/usr/bin/perl
# Encode name of a file in a Debian package name.
#
-# DO NOT CHANGE THIS FUNCTION OR WE WILL ALL BURN IN CONFLICT HELL
-#
# 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
--- /dev/null
+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: Example package using DEB_DIVERT_FILES to divert configuration files
+debathena-bin-example-1.0: Example package diverting binaries using DEB_DIVERT_FILES
+debathena-bin-example-1.1: Upgrade of debathena-bin-example-1.0 removing one of the diversions using DEB_UNDIVERT_FILES.
+debathena-transform-example-1.0: Example package using DEB_TRANSFORM_FILES
+debathena-cron-example-1.0: Example package using DEB_REMOVE_FILES to disable a cron job
+
+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 <http://ftp-master.debian.org/REJECT-FAQ.html>).
--- /dev/null
+debathena-bin-example (1.0) unstable; urgency=low
+
+ * Initial release.
+
+ -- Tim Abbott <tabbott@mit.edu> Sun, 13 Jul 2008 00:37:03 -0400
--- /dev/null
+Source: debathena-bin-example
+Section: config
+Priority: extra
+Maintainer: Tim Abbott <tabbott@mit.edu>
+Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 4.2.0), config-package-dev (>= 4.5~)
+Standards-Version: 3.8.0
+
+Package: debathena-bin-example
+Architecture: all
+Depends: cdbs, ${misc:Depends}, elinks
+Provides: ${diverted-files}
+Conflicts: ${diverted-files}
+Description: Example config-packag-dev package
+ This is an example config-package-dev package.
--- /dev/null
+Source: debathena-bin-example
+Section: config
+Priority: extra
+Maintainer: Tim Abbott <tabbott@mit.edu>
+Build-Depends: @cdbs@
+Standards-Version: 3.8.0
+
+Package: debathena-bin-example
+Architecture: all
+Depends: cdbs, ${misc:Depends}, elinks
+Provides: ${diverted-files}
+Conflicts: ${diverted-files}
+Description: Example config-packag-dev package
+ This is an example config-package-dev package.
--- /dev/null
+Example config-package-dev package.
+
+Author: Tim Abbott <tabbott@mit.edu>
+
+Copyright © 2008 Tim Abbott <tabbott@mit.edu>
+
+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.
--- /dev/null
+debian/elinks.debathena usr/bin
+debian/less.debathena usr/bin
--- /dev/null
+#!/bin/sh
+# Wrapper to make elinks put its UNIX sockets under /tmp rather than in $HOME.
+# Works around <http://bugs.debian.org/460336>.
+TMPDIR=mktemp -d
+export ELINKS_CONFDIR=$TMPDIR
+exec elinks.debathena-orig "$@"x
--- /dev/null
+#!/bin/sh
+# Wrapper to make less read tarballs and so on.
+eval $(lesspipe)
+exec less.debathena-orig "$@"
--- /dev/null
+#!/usr/bin/make -f
+
+DEB_DIVERT_EXTENSION = .debathena
+# Install wrapper scripts for /usr/bin/elinks and /usr/bin/less
+DEB_DIVERT_FILES_debathena-bin-example += \
+ /usr/bin/elinks.debathena \
+ /usr/bin/less.debathena
+
+# If these had materially different behavior from the original
+# versions, one might divert the man pages as well
+DEB_DIVERT_FILES_debathena-bin-example += /usr/share/man/man1/elinks.debathena.1.gz
+DEB_DIVERT_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
--- /dev/null
+debathena-bin-example (1.1) unstable; urgency=low
+
+ * suppose elinks bug is fixed; stop diverting elinks.
+
+ -- Tim Abbott <tabbott@mit.edu> Sun, 13 Jul 2008 02:06:39 -0400
+
+debathena-bin-example (1.0) unstable; urgency=low
+
+ * Initial release.
+
+ -- Tim Abbott <tabbott@mit.edu> Sun, 13 Jul 2008 00:37:03 -0400
--- /dev/null
+Source: debathena-bin-example
+Section: config
+Priority: extra
+Maintainer: Tim Abbott <tabbott@mit.edu>
+Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 4.2.0), config-package-dev (>= 4.5~)
+Standards-Version: 3.8.0
+
+Package: debathena-bin-example
+Architecture: all
+Depends: cdbs, ${misc:Depends}, elinks
+Provides: ${diverted-files}
+Conflicts: ${diverted-files}
+Description: Example config-packag-dev package
+ This is an example config-package-dev package.
--- /dev/null
+Source: debathena-bin-example
+Section: config
+Priority: extra
+Maintainer: Tim Abbott <tabbott@mit.edu>
+Build-Depends: @cdbs@
+Standards-Version: 3.8.0
+
+Package: debathena-bin-example
+Architecture: all
+Depends: cdbs, ${misc:Depends}, elinks
+Provides: ${diverted-files}
+Conflicts: ${diverted-files}
+Description: Example config-packag-dev package
+ This is an example config-package-dev package.
--- /dev/null
+Example config-package-dev package.
+
+Author: Tim Abbott <tabbott@mit.edu>
+
+Copyright © 2008 Tim Abbott <tabbott@mit.edu>
+
+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.
--- /dev/null
+debian/less.debathena usr/bin
--- /dev/null
+#!/bin/sh
+# Wrapper to make less read tarballs and so on.
+eval $(lesspipe)
+exec less.debathena-orig "$@"
--- /dev/null
+#!/usr/bin/make -f
+
+DEB_DIVERT_EXTENSION = .debathena
+# Install wrapper scripts for /usr/bin/elinks and /usr/bin/less
+DEB_DIVERT_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_DIVERT_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 diversion on upgrade from version(s) prior to 1.1
+DEB_UNDIVERT_FILES_debathena-bin-example += /usr/bin/elinks.debathena
+DEB_UNDIVERT_VERSION_/usr/bin/elinks.debathena = 1.1
+# and the man page
+DEB_UNDIVERT_FILES_debathena-bin-example += /usr/share/man/man1/elinks.debathena.1.gz
+DEB_UNDIVERT_VERSION_/usr/share/man/man1/elinks.debathena.1.gz = 1.1
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/rules/config-package.mk
--- /dev/null
+debathena-conffile-example (1.0) unstable; urgency=low
+
+ * Initial release.
+
+ -- Tim Abbott <tabbott@mit.edu> Sun, 13 Jul 2008 00:37:03 -0400
--- /dev/null
+Source: debathena-conffile-example
+Section: config
+Priority: extra
+Maintainer: Tim Abbott <tabbott@mit.edu>
+Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 4.2.0), config-package-dev (>= 4.5~)
+Standards-Version: 3.8.0
+
+Package: debathena-conffile-example
+Architecture: all
+Depends: cdbs, ${misc:Depends}
+Provides: ${diverted-files}
+Conflicts: ${diverted-files}
+Description: Example config-packag-dev package
+ This is an example config-package-dev package.
--- /dev/null
+Source: debathena-conffile-example
+Section: config
+Priority: extra
+Maintainer: Tim Abbott <tabbott@mit.edu>
+Build-Depends: @cdbs@
+Standards-Version: 3.8.0
+
+Package: debathena-conffile-example
+Architecture: all
+Depends: cdbs, ${misc:Depends}
+Provides: ${diverted-files}
+Conflicts: ${diverted-files}
+Description: Example config-packag-dev package
+ This is an example config-package-dev package.
--- /dev/null
+Example config-package-dev package.
+
+Author: Tim Abbott <tabbott@mit.edu>
+
+Copyright © 2008 Tim Abbott <tabbott@mit.edu>
+
+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.
--- /dev/null
+#!/usr/bin/make -f
+
+DEB_DIVERT_EXTENSION = .debathena
+# Replace some base files with simple replacements.
+DEB_DIVERT_FILES_debathena-conffile-example += \
+ /etc/issue.net.debathena \
+ /etc/mailname.debathena \
+ /etc/papersize.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
--- /dev/null
+Debian Linux running debathena-conffile-example version 1.0
--- /dev/null
+debathena-cron-example (1.0) unstable; urgency=low
+
+ * Initial release.
+
+ -- Tim Abbott <tabbott@mit.edu> Sun, 13 Jul 2008 00:37:03 -0400
--- /dev/null
+Source: debathena-cron-example
+Section: config
+Priority: extra
+Maintainer: Tim Abbott <tabbott@mit.edu>
+Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 4.2.0), config-package-dev (>= 4.5~)
+Standards-Version: 3.8.0
+
+Package: debathena-cron-example
+Architecture: all
+Depends: cdbs, ${misc:Depends}, logcheck
+Provides: ${diverted-files}
+Conflicts: ${diverted-files}
+Description: Example config-packag-dev package
+ This is an example config-package-dev package.
--- /dev/null
+Source: debathena-cron-example
+Section: config
+Priority: extra
+Maintainer: Tim Abbott <tabbott@mit.edu>
+Build-Depends: @cdbs@
+Standards-Version: 3.8.0
+
+Package: debathena-cron-example
+Architecture: all
+Depends: cdbs, ${misc:Depends}, logcheck
+Provides: ${diverted-files}
+Conflicts: ${diverted-files}
+Description: Example config-packag-dev package
+ This is an example config-package-dev package.
--- /dev/null
+Example config-package-dev package.
+
+Author: Tim Abbott <tabbott@mit.edu>
+
+Copyright © 2008 Tim Abbott <tabbott@mit.edu>
+
+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.
--- /dev/null
+# /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
--- /dev/null
+#!/usr/bin/make -f
+
+DEB_DIVERT_EXTENSION = .debathena
+
+# This will remove /etc/cron.d/logcheck
+DEB_REMOVE_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 removed using
+# DEB_REMOVE_FILES.
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/rules/config-package.mk
--- /dev/null
+debathena-transform-example (1.0) unstable; urgency=low
+
+ * Initial release.
+
+ -- Tim Abbott <tabbott@mit.edu> Sun, 13 Jul 2008 00:37:03 -0400
--- /dev/null
+Source: debathena-transform-example
+Section: config
+Priority: extra
+Maintainer: Tim Abbott <tabbott@mit.edu>
+Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 4.2.0), config-package-dev (>= 4.5~)
+Standards-Version: 3.8.0
+
+Package: debathena-transform-example
+Architecture: all
+Depends: cdbs, ${misc:Depends}, elinks
+Provides: ${diverted-files}
+Conflicts: ${diverted-files}
+Description: Example config-packag-dev package
+ This is an example config-package-dev package.
--- /dev/null
+Source: debathena-transform-example
+Section: config
+Priority: extra
+Maintainer: Tim Abbott <tabbott@mit.edu>
+Build-Depends: @cdbs@
+Standards-Version: 3.8.0
+
+Package: debathena-transform-example
+Architecture: all
+Depends: cdbs, ${misc:Depends}, elinks
+Provides: ${diverted-files}
+Conflicts: ${diverted-files}
+Description: Example config-packag-dev package
+ This is an example config-package-dev package.
--- /dev/null
+Example config-package-dev package.
+
+Author: Tim Abbott <tabbott@mit.edu>
+
+Copyright © 2008 Tim Abbott <tabbott@mit.edu>
+
+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.
--- /dev/null
+#!/usr/bin/make -f
+
+DEB_DIVERT_EXTENSION = .debathena
+DEB_TRANSFORM_FILES_debathena-transform-example += \
+ /etc/syslog.conf.debathena
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/rules/config-package.mk
--- /dev/null
+#!/usr/bin/perl -0p
+# perl -0p is useful for writing efficient transform scripts.
+
+# Disable sending to all users 'emerg' level syslog messages.
+
+# This prevents CVS (or any other applications that wants to) from
+# spamming all terminals.
+
+s/^(\*\.emerg.*\*)/# $1/m or die;
# 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
DEB_TRANSFORM_FILES = $(foreach package,$(DEB_ALL_PACKAGES),$(DEB_TRANSFORM_FILES_$(package)))
-DEB_TRANSFORM_FILES_DIR=debian/transform_file_copies
+DEB_TRANSFORM_FILES_TMPDIR=debian/transform_file_copies
-debian_transform_files = $(patsubst %,$(DEB_TRANSFORM_FILES_DIR)%,$(1))
-undebian_transform_files = $(patsubst $(DEB_TRANSFORM_FILES_DIR)%,%,$(1))
+debian_transform_files = $(patsubst %,$(DEB_TRANSFORM_FILES_TMPDIR)%,$(1))
+undebian_transform_files = $(patsubst $(DEB_TRANSFORM_FILES_TMPDIR)%,%,$(1))
common-build-arch common-build-indep:: $(foreach file,$(DEB_TRANSFORM_FILES),$(call debian_transform_files,$(file)))
$(patsubst %,binary-install/%,$(DEB_ALL_PACKAGES)) :: binary-install/%:
$(foreach file,$(DEB_TRANSFORM_FILES_$(cdbs_curpkg)), \
install -d $(DEB_DESTDIR)/$(dir $(file)); \
- cp -a $(DEB_TRANSFORM_FILES_DIR)$(file) \
+ cp -a $(call debian_transform_files,$(file)) \
$(DEB_DESTDIR)/$(dir $(file));)
clean::
- rm -rf $(DEB_TRANSFORM_FILES_DIR)
+ rm -rf $(DEB_TRANSFORM_FILES_TMPDIR)
endif