]> andersk Git - config-package-dev.git/commitdiff
Improve config-package-dev documentation and examples. 4.8
authorTim Abbott <tabbott@mit.edu>
Sun, 13 Jul 2008 06:25:18 +0000 (06:25 +0000)
committerTim Abbott <tabbott@mit.edu>
Sun, 13 Jul 2008 06:25:18 +0000 (06:25 +0000)
git-svn-id: svn+ssh://svn.mit.edu/athena/trunk/debathena/debathena/config-package-dev@23076 728af825-273c-0410-89f9-f7d3b574a069

54 files changed:
check-files.mk
config-package.mk
debian/changelog
debian/config-package-dev.docs [new file with mode: 0644]
debian/config-package-dev.examples [new file with mode: 0644]
debian/control
debian/control.in
debian/copyright
divert.mk
doc/DOCUMENTATION [new file with mode: 0644]
encode
examples/EXAMPLES [new file with mode: 0644]
examples/debathena-bin-example-1.0/debian/changelog [new file with mode: 0644]
examples/debathena-bin-example-1.0/debian/compat [new file with mode: 0644]
examples/debathena-bin-example-1.0/debian/control [new file with mode: 0644]
examples/debathena-bin-example-1.0/debian/control.in [new file with mode: 0644]
examples/debathena-bin-example-1.0/debian/copyright [new file with mode: 0644]
examples/debathena-bin-example-1.0/debian/debathena-bin-example.install [new file with mode: 0644]
examples/debathena-bin-example-1.0/debian/elinks.debathena [new file with mode: 0644]
examples/debathena-bin-example-1.0/debian/less.debathena [new file with mode: 0644]
examples/debathena-bin-example-1.0/debian/rules [new file with mode: 0755]
examples/debathena-bin-example-1.1/debian/changelog [new file with mode: 0644]
examples/debathena-bin-example-1.1/debian/compat [new file with mode: 0644]
examples/debathena-bin-example-1.1/debian/control [new file with mode: 0644]
examples/debathena-bin-example-1.1/debian/control.in [new file with mode: 0644]
examples/debathena-bin-example-1.1/debian/copyright [new file with mode: 0644]
examples/debathena-bin-example-1.1/debian/debathena-bin-example.install [new file with mode: 0644]
examples/debathena-bin-example-1.1/debian/less.debathena [new file with mode: 0644]
examples/debathena-bin-example-1.1/debian/rules [new file with mode: 0755]
examples/debathena-conffile-example-1.0/debian/changelog [new file with mode: 0644]
examples/debathena-conffile-example-1.0/debian/compat [new file with mode: 0644]
examples/debathena-conffile-example-1.0/debian/control [new file with mode: 0644]
examples/debathena-conffile-example-1.0/debian/control.in [new file with mode: 0644]
examples/debathena-conffile-example-1.0/debian/copyright [new file with mode: 0644]
examples/debathena-conffile-example-1.0/debian/debathena-conffile-example.install [new file with mode: 0644]
examples/debathena-conffile-example-1.0/debian/rules [new file with mode: 0755]
examples/debathena-conffile-example-1.0/files/etc/issue.net.debathena [new file with mode: 0644]
examples/debathena-conffile-example-1.0/files/etc/mailname.debathena [new file with mode: 0644]
examples/debathena-conffile-example-1.0/files/etc/papersize.debathena [new file with mode: 0644]
examples/debathena-cron-example-1.0/debian/changelog [new file with mode: 0644]
examples/debathena-cron-example-1.0/debian/compat [new file with mode: 0644]
examples/debathena-cron-example-1.0/debian/control [new file with mode: 0644]
examples/debathena-cron-example-1.0/debian/control.in [new file with mode: 0644]
examples/debathena-cron-example-1.0/debian/copyright [new file with mode: 0644]
examples/debathena-cron-example-1.0/debian/debathena-cron-example.cron.d [new file with mode: 0644]
examples/debathena-cron-example-1.0/debian/rules [new file with mode: 0755]
examples/debathena-transform-example-1.0/debian/changelog [new file with mode: 0644]
examples/debathena-transform-example-1.0/debian/compat [new file with mode: 0644]
examples/debathena-transform-example-1.0/debian/control [new file with mode: 0644]
examples/debathena-transform-example-1.0/debian/control.in [new file with mode: 0644]
examples/debathena-transform-example-1.0/debian/copyright [new file with mode: 0644]
examples/debathena-transform-example-1.0/debian/rules [new file with mode: 0755]
examples/debathena-transform-example-1.0/debian/transform_syslog.conf.debathena [new file with mode: 0755]
transform-files.mk

index a6d61d8e57eb3730501352d2f0e8133b3142972c..d43b0a266c42088b125929c016fec90f57d2e492 100644 (file)
 # 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))
@@ -53,11 +75,11 @@ $(call debian_check_files_tmp,%): $(truename)
                /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
index 55d8cd457fcd4081850d34442c7663041dee4a44..2f6711266719ec88c1690aea66539e6333e4926b 100644 (file)
 # 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
index 4821a39ac1b50751da9f9b53091aa2d87598882c..0444fcef085812a7beed281e02312ea5abfebe6f 100644 (file)
@@ -1,3 +1,14 @@
+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.
diff --git a/debian/config-package-dev.docs b/debian/config-package-dev.docs
new file mode 100644 (file)
index 0000000..30d29de
--- /dev/null
@@ -0,0 +1 @@
+doc/*
diff --git a/debian/config-package-dev.examples b/debian/config-package-dev.examples
new file mode 100644 (file)
index 0000000..e39721e
--- /dev/null
@@ -0,0 +1 @@
+examples/*
index e99a252e0e5ab6898d4d36b5f8250e0917b0f86b..c9d79fcb69fa45dce0b603cca3392b9d9acc8478 100644 (file)
@@ -2,9 +2,9 @@ Source: config-package-dev
 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
index 705974e4eb651dbd7ba63e6e19bf4579ecc266ea..e93c442ada9c82fff5267d197d7e6e78ba11e892 100644 (file)
@@ -2,9 +2,9 @@ Source: config-package-dev
 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
index 2915f5e3b669486ff9692c116589e9f06ef53caa..c794e1538674288e18d9498f733ad7892ac7d654 100644 (file)
@@ -3,6 +3,8 @@ Authors: Tim Abbott <tabbott@mit.edu>
 
 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
index 5b90efeb844e38f964133b027237a8baee2f1393..483c9a944c99d23836d1e8ce4d406e5a4fdf6970 100644 (file)
--- a/divert.mk
+++ b/divert.mk
 # 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
 
@@ -24,7 +30,12 @@ include /usr/share/cdbs/1/rules/debhelper.mk
 
 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), \
@@ -37,8 +48,9 @@ ifeq ($(DEB_DIVERT_EXTENSION),)
 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/,,$@)
@@ -49,6 +61,9 @@ debian-divert/%: divert_unremove_files = $(DEB_UNREMOVE_FILES_$(package))
 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), \
@@ -75,6 +90,7 @@ $(patsubst %,debian-divert/%,$(DEB_DIVERT_PACKAGES)) :: debian-divert/%:
                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), \
@@ -86,10 +102,16 @@ $(patsubst %,debian-divert/%,$(DEB_DIVERT_PACKAGES)) :: debian-divert/%:
                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 \
diff --git a/doc/DOCUMENTATION b/doc/DOCUMENTATION
new file mode 100644 (file)
index 0000000..0bea612
--- /dev/null
@@ -0,0 +1,11 @@
+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.
diff --git a/encode b/encode
index 2a787b4701f41ab73be148776ff02954e5796b86..48ba732618051343c8c3d9f3a8b5442ccc024aff 100755 (executable)
--- a/encode
+++ b/encode
@@ -1,8 +1,6 @@
 #!/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
diff --git a/examples/EXAMPLES b/examples/EXAMPLES
new file mode 100644 (file)
index 0000000..744c293
--- /dev/null
@@ -0,0 +1,19 @@
+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>).
diff --git a/examples/debathena-bin-example-1.0/debian/changelog b/examples/debathena-bin-example-1.0/debian/changelog
new file mode 100644 (file)
index 0000000..0367d39
--- /dev/null
@@ -0,0 +1,5 @@
+debathena-bin-example (1.0) unstable; urgency=low
+
+  * Initial release.
+
+ -- Tim Abbott <tabbott@mit.edu>  Sun, 13 Jul 2008 00:37:03 -0400
diff --git a/examples/debathena-bin-example-1.0/debian/compat b/examples/debathena-bin-example-1.0/debian/compat
new file mode 100644 (file)
index 0000000..b8626c4
--- /dev/null
@@ -0,0 +1 @@
+4
diff --git a/examples/debathena-bin-example-1.0/debian/control b/examples/debathena-bin-example-1.0/debian/control
new file mode 100644 (file)
index 0000000..3daa78c
--- /dev/null
@@ -0,0 +1,14 @@
+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.
diff --git a/examples/debathena-bin-example-1.0/debian/control.in b/examples/debathena-bin-example-1.0/debian/control.in
new file mode 100644 (file)
index 0000000..e8d2e1d
--- /dev/null
@@ -0,0 +1,14 @@
+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.
diff --git a/examples/debathena-bin-example-1.0/debian/copyright b/examples/debathena-bin-example-1.0/debian/copyright
new file mode 100644 (file)
index 0000000..78007ae
--- /dev/null
@@ -0,0 +1,24 @@
+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.
diff --git a/examples/debathena-bin-example-1.0/debian/debathena-bin-example.install b/examples/debathena-bin-example-1.0/debian/debathena-bin-example.install
new file mode 100644 (file)
index 0000000..04c9a48
--- /dev/null
@@ -0,0 +1,2 @@
+debian/elinks.debathena usr/bin
+debian/less.debathena usr/bin
diff --git a/examples/debathena-bin-example-1.0/debian/elinks.debathena b/examples/debathena-bin-example-1.0/debian/elinks.debathena
new file mode 100644 (file)
index 0000000..dbda483
--- /dev/null
@@ -0,0 +1,6 @@
+#!/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
diff --git a/examples/debathena-bin-example-1.0/debian/less.debathena b/examples/debathena-bin-example-1.0/debian/less.debathena
new file mode 100644 (file)
index 0000000..207173d
--- /dev/null
@@ -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/debathena-bin-example-1.0/debian/rules b/examples/debathena-bin-example-1.0/debian/rules
new file mode 100755 (executable)
index 0000000..00c95a1
--- /dev/null
@@ -0,0 +1,20 @@
+#!/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
diff --git a/examples/debathena-bin-example-1.1/debian/changelog b/examples/debathena-bin-example-1.1/debian/changelog
new file mode 100644 (file)
index 0000000..796f167
--- /dev/null
@@ -0,0 +1,11 @@
+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
diff --git a/examples/debathena-bin-example-1.1/debian/compat b/examples/debathena-bin-example-1.1/debian/compat
new file mode 100644 (file)
index 0000000..b8626c4
--- /dev/null
@@ -0,0 +1 @@
+4
diff --git a/examples/debathena-bin-example-1.1/debian/control b/examples/debathena-bin-example-1.1/debian/control
new file mode 100644 (file)
index 0000000..3daa78c
--- /dev/null
@@ -0,0 +1,14 @@
+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.
diff --git a/examples/debathena-bin-example-1.1/debian/control.in b/examples/debathena-bin-example-1.1/debian/control.in
new file mode 100644 (file)
index 0000000..e8d2e1d
--- /dev/null
@@ -0,0 +1,14 @@
+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.
diff --git a/examples/debathena-bin-example-1.1/debian/copyright b/examples/debathena-bin-example-1.1/debian/copyright
new file mode 100644 (file)
index 0000000..78007ae
--- /dev/null
@@ -0,0 +1,24 @@
+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.
diff --git a/examples/debathena-bin-example-1.1/debian/debathena-bin-example.install b/examples/debathena-bin-example-1.1/debian/debathena-bin-example.install
new file mode 100644 (file)
index 0000000..6e86e9c
--- /dev/null
@@ -0,0 +1 @@
+debian/less.debathena usr/bin
diff --git a/examples/debathena-bin-example-1.1/debian/less.debathena b/examples/debathena-bin-example-1.1/debian/less.debathena
new file mode 100644 (file)
index 0000000..207173d
--- /dev/null
@@ -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/debathena-bin-example-1.1/debian/rules b/examples/debathena-bin-example-1.1/debian/rules
new file mode 100755 (executable)
index 0000000..50a8249
--- /dev/null
@@ -0,0 +1,24 @@
+#!/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
diff --git a/examples/debathena-conffile-example-1.0/debian/changelog b/examples/debathena-conffile-example-1.0/debian/changelog
new file mode 100644 (file)
index 0000000..d11878d
--- /dev/null
@@ -0,0 +1,5 @@
+debathena-conffile-example (1.0) unstable; urgency=low
+
+  * Initial release.
+
+ -- Tim Abbott <tabbott@mit.edu>  Sun, 13 Jul 2008 00:37:03 -0400
diff --git a/examples/debathena-conffile-example-1.0/debian/compat b/examples/debathena-conffile-example-1.0/debian/compat
new file mode 100644 (file)
index 0000000..b8626c4
--- /dev/null
@@ -0,0 +1 @@
+4
diff --git a/examples/debathena-conffile-example-1.0/debian/control b/examples/debathena-conffile-example-1.0/debian/control
new file mode 100644 (file)
index 0000000..55fe3be
--- /dev/null
@@ -0,0 +1,14 @@
+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.
diff --git a/examples/debathena-conffile-example-1.0/debian/control.in b/examples/debathena-conffile-example-1.0/debian/control.in
new file mode 100644 (file)
index 0000000..44a1bf3
--- /dev/null
@@ -0,0 +1,14 @@
+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.
diff --git a/examples/debathena-conffile-example-1.0/debian/copyright b/examples/debathena-conffile-example-1.0/debian/copyright
new file mode 100644 (file)
index 0000000..78007ae
--- /dev/null
@@ -0,0 +1,24 @@
+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.
diff --git a/examples/debathena-conffile-example-1.0/debian/debathena-conffile-example.install b/examples/debathena-conffile-example-1.0/debian/debathena-conffile-example.install
new file mode 100644 (file)
index 0000000..5b79850
--- /dev/null
@@ -0,0 +1 @@
+files/* /
diff --git a/examples/debathena-conffile-example-1.0/debian/rules b/examples/debathena-conffile-example-1.0/debian/rules
new file mode 100755 (executable)
index 0000000..2099f70
--- /dev/null
@@ -0,0 +1,13 @@
+#!/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
diff --git a/examples/debathena-conffile-example-1.0/files/etc/issue.net.debathena b/examples/debathena-conffile-example-1.0/files/etc/issue.net.debathena
new file mode 100644 (file)
index 0000000..f1f73cb
--- /dev/null
@@ -0,0 +1 @@
+Debian Linux running debathena-conffile-example version 1.0
diff --git a/examples/debathena-conffile-example-1.0/files/etc/mailname.debathena b/examples/debathena-conffile-example-1.0/files/etc/mailname.debathena
new file mode 100644 (file)
index 0000000..731f0e4
--- /dev/null
@@ -0,0 +1 @@
+mit.edu
diff --git a/examples/debathena-conffile-example-1.0/files/etc/papersize.debathena b/examples/debathena-conffile-example-1.0/files/etc/papersize.debathena
new file mode 100644 (file)
index 0000000..40e0a6f
--- /dev/null
@@ -0,0 +1 @@
+letter
diff --git a/examples/debathena-cron-example-1.0/debian/changelog b/examples/debathena-cron-example-1.0/debian/changelog
new file mode 100644 (file)
index 0000000..371611a
--- /dev/null
@@ -0,0 +1,5 @@
+debathena-cron-example (1.0) unstable; urgency=low
+
+  * Initial release.
+
+ -- Tim Abbott <tabbott@mit.edu>  Sun, 13 Jul 2008 00:37:03 -0400
diff --git a/examples/debathena-cron-example-1.0/debian/compat b/examples/debathena-cron-example-1.0/debian/compat
new file mode 100644 (file)
index 0000000..b8626c4
--- /dev/null
@@ -0,0 +1 @@
+4
diff --git a/examples/debathena-cron-example-1.0/debian/control b/examples/debathena-cron-example-1.0/debian/control
new file mode 100644 (file)
index 0000000..d30d179
--- /dev/null
@@ -0,0 +1,14 @@
+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.
diff --git a/examples/debathena-cron-example-1.0/debian/control.in b/examples/debathena-cron-example-1.0/debian/control.in
new file mode 100644 (file)
index 0000000..9d8e5e4
--- /dev/null
@@ -0,0 +1,14 @@
+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.
diff --git a/examples/debathena-cron-example-1.0/debian/copyright b/examples/debathena-cron-example-1.0/debian/copyright
new file mode 100644 (file)
index 0000000..78007ae
--- /dev/null
@@ -0,0 +1,24 @@
+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.
diff --git a/examples/debathena-cron-example-1.0/debian/debathena-cron-example.cron.d b/examples/debathena-cron-example-1.0/debian/debathena-cron-example.cron.d
new file mode 100644 (file)
index 0000000..81d8150
--- /dev/null
@@ -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/debathena-cron-example-1.0/debian/rules b/examples/debathena-cron-example-1.0/debian/rules
new file mode 100755 (executable)
index 0000000..f005830
--- /dev/null
@@ -0,0 +1,17 @@
+#!/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
diff --git a/examples/debathena-transform-example-1.0/debian/changelog b/examples/debathena-transform-example-1.0/debian/changelog
new file mode 100644 (file)
index 0000000..14716f4
--- /dev/null
@@ -0,0 +1,5 @@
+debathena-transform-example (1.0) unstable; urgency=low
+
+  * Initial release.
+
+ -- Tim Abbott <tabbott@mit.edu>  Sun, 13 Jul 2008 00:37:03 -0400
diff --git a/examples/debathena-transform-example-1.0/debian/compat b/examples/debathena-transform-example-1.0/debian/compat
new file mode 100644 (file)
index 0000000..b8626c4
--- /dev/null
@@ -0,0 +1 @@
+4
diff --git a/examples/debathena-transform-example-1.0/debian/control b/examples/debathena-transform-example-1.0/debian/control
new file mode 100644 (file)
index 0000000..9a6c34c
--- /dev/null
@@ -0,0 +1,14 @@
+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.
diff --git a/examples/debathena-transform-example-1.0/debian/control.in b/examples/debathena-transform-example-1.0/debian/control.in
new file mode 100644 (file)
index 0000000..4546aa9
--- /dev/null
@@ -0,0 +1,14 @@
+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.
diff --git a/examples/debathena-transform-example-1.0/debian/copyright b/examples/debathena-transform-example-1.0/debian/copyright
new file mode 100644 (file)
index 0000000..78007ae
--- /dev/null
@@ -0,0 +1,24 @@
+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.
diff --git a/examples/debathena-transform-example-1.0/debian/rules b/examples/debathena-transform-example-1.0/debian/rules
new file mode 100755 (executable)
index 0000000..98a2091
--- /dev/null
@@ -0,0 +1,8 @@
+#!/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
diff --git a/examples/debathena-transform-example-1.0/debian/transform_syslog.conf.debathena b/examples/debathena-transform-example-1.0/debian/transform_syslog.conf.debathena
new file mode 100755 (executable)
index 0000000..2626ba0
--- /dev/null
@@ -0,0 +1,9 @@
+#!/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;
index 43ab6c02a6146a01797b932d77f8de5614612e76..d0de55a99a924449d8d0342097dc219873b04653 100644 (file)
@@ -17,6 +17,9 @@
 # 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
 
@@ -24,10 +27,10 @@ include /usr/share/cdbs/1/rules/check-files.mk
 
 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)))
 
@@ -40,10 +43,10 @@ $(call debian_transform_files,%): $(call debian_check_files,%)
 $(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
This page took 0.132234 seconds and 5 git commands to generate.