From 567091347bd3fe6087395e06f4d50dd24ff0571c Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Sun, 13 Jul 2008 06:25:18 +0000 Subject: [PATCH] Improve config-package-dev documentation and examples. git-svn-id: svn+ssh://svn.mit.edu/athena/trunk/debathena/debathena/config-package-dev@23076 728af825-273c-0410-89f9-f7d3b574a069 --- check-files.mk | 34 +++++-- config-package.mk | 88 +++++++++++++++++++ debian/changelog | 11 +++ debian/config-package-dev.docs | 1 + debian/config-package-dev.examples | 1 + debian/control | 4 +- debian/control.in | 4 +- debian/copyright | 2 + divert.mk | 28 +++++- doc/DOCUMENTATION | 11 +++ encode | 2 - examples/EXAMPLES | 19 ++++ .../debian/changelog | 5 ++ .../debathena-bin-example-1.0/debian/compat | 1 + .../debathena-bin-example-1.0/debian/control | 14 +++ .../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 | 14 +++ .../debian/control.in | 14 +++ .../debian/copyright | 24 +++++ .../debian/debathena-bin-example.install | 1 + .../debian/less.debathena | 4 + .../debathena-bin-example-1.1/debian/rules | 24 +++++ .../debian/changelog | 5 ++ .../debian/compat | 1 + .../debian/control | 14 +++ .../debian/control.in | 14 +++ .../debian/copyright | 24 +++++ .../debian/debathena-conffile-example.install | 1 + .../debian/rules | 13 +++ .../files/etc/issue.net.debathena | 1 + .../files/etc/mailname.debathena | 1 + .../files/etc/papersize.debathena | 1 + .../debian/changelog | 5 ++ .../debathena-cron-example-1.0/debian/compat | 1 + .../debathena-cron-example-1.0/debian/control | 14 +++ .../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 | 14 +++ .../debian/control.in | 14 +++ .../debian/copyright | 24 +++++ .../debian/rules | 8 ++ .../debian/transform_syslog.conf.debathena | 9 ++ transform-files.mk | 13 +-- 54 files changed, 615 insertions(+), 20 deletions(-) create mode 100644 debian/config-package-dev.docs create mode 100644 debian/config-package-dev.examples create mode 100644 doc/DOCUMENTATION create mode 100644 examples/EXAMPLES create mode 100644 examples/debathena-bin-example-1.0/debian/changelog create mode 100644 examples/debathena-bin-example-1.0/debian/compat create mode 100644 examples/debathena-bin-example-1.0/debian/control create mode 100644 examples/debathena-bin-example-1.0/debian/control.in create mode 100644 examples/debathena-bin-example-1.0/debian/copyright create mode 100644 examples/debathena-bin-example-1.0/debian/debathena-bin-example.install create mode 100644 examples/debathena-bin-example-1.0/debian/elinks.debathena create mode 100644 examples/debathena-bin-example-1.0/debian/less.debathena create mode 100755 examples/debathena-bin-example-1.0/debian/rules create mode 100644 examples/debathena-bin-example-1.1/debian/changelog create mode 100644 examples/debathena-bin-example-1.1/debian/compat create mode 100644 examples/debathena-bin-example-1.1/debian/control create mode 100644 examples/debathena-bin-example-1.1/debian/control.in create mode 100644 examples/debathena-bin-example-1.1/debian/copyright create mode 100644 examples/debathena-bin-example-1.1/debian/debathena-bin-example.install create mode 100644 examples/debathena-bin-example-1.1/debian/less.debathena create mode 100755 examples/debathena-bin-example-1.1/debian/rules create mode 100644 examples/debathena-conffile-example-1.0/debian/changelog create mode 100644 examples/debathena-conffile-example-1.0/debian/compat create mode 100644 examples/debathena-conffile-example-1.0/debian/control create mode 100644 examples/debathena-conffile-example-1.0/debian/control.in create mode 100644 examples/debathena-conffile-example-1.0/debian/copyright create mode 100644 examples/debathena-conffile-example-1.0/debian/debathena-conffile-example.install create mode 100755 examples/debathena-conffile-example-1.0/debian/rules create mode 100644 examples/debathena-conffile-example-1.0/files/etc/issue.net.debathena create mode 100644 examples/debathena-conffile-example-1.0/files/etc/mailname.debathena create mode 100644 examples/debathena-conffile-example-1.0/files/etc/papersize.debathena create mode 100644 examples/debathena-cron-example-1.0/debian/changelog create mode 100644 examples/debathena-cron-example-1.0/debian/compat create mode 100644 examples/debathena-cron-example-1.0/debian/control create mode 100644 examples/debathena-cron-example-1.0/debian/control.in create mode 100644 examples/debathena-cron-example-1.0/debian/copyright create mode 100644 examples/debathena-cron-example-1.0/debian/debathena-cron-example.cron.d create mode 100755 examples/debathena-cron-example-1.0/debian/rules create mode 100644 examples/debathena-transform-example-1.0/debian/changelog create mode 100644 examples/debathena-transform-example-1.0/debian/compat create mode 100644 examples/debathena-transform-example-1.0/debian/control create mode 100644 examples/debathena-transform-example-1.0/debian/control.in create mode 100644 examples/debathena-transform-example-1.0/debian/copyright create mode 100755 examples/debathena-transform-example-1.0/debian/rules create mode 100755 examples/debathena-transform-example-1.0/debian/transform_syslog.conf.debathena diff --git a/check-files.mk b/check-files.mk index a6d61d8..d43b0a2 100644 --- a/check-files.mk +++ b/check-files.mk @@ -17,25 +17,47 @@ # 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 diff --git a/config-package.mk b/config-package.mk index 55d8cd4..2f67112 100644 --- a/config-package.mk +++ b/config-package.mk @@ -17,9 +17,97 @@ # 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 diff --git a/debian/changelog b/debian/changelog index 4821a39..0444fce 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 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 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/control b/debian/control index e99a252..c9d79fc 100644 --- a/debian/control +++ b/debian/control @@ -2,9 +2,9 @@ Source: config-package-dev Section: devel Priority: extra Maintainer: Tim Abbott -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 diff --git a/debian/control.in b/debian/control.in index 705974e..e93c442 100644 --- a/debian/control.in +++ b/debian/control.in @@ -2,9 +2,9 @@ Source: config-package-dev Section: devel Priority: extra Maintainer: Tim Abbott -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 diff --git a/debian/copyright b/debian/copyright index 2915f5e..c794e15 100644 --- a/debian/copyright +++ b/debian/copyright @@ -3,6 +3,8 @@ Authors: Tim Abbott 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 diff --git a/divert.mk b/divert.mk index 5b90efe..483c9a9 100644 --- a/divert.mk +++ b/divert.mk @@ -17,6 +17,12 @@ # 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 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 index 2a787b4..48ba732 100755 --- 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 index 0000000..744c293 --- /dev/null +++ b/examples/EXAMPLES @@ -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 ). diff --git a/examples/debathena-bin-example-1.0/debian/changelog b/examples/debathena-bin-example-1.0/debian/changelog new file mode 100644 index 0000000..0367d39 --- /dev/null +++ b/examples/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/debathena-bin-example-1.0/debian/compat b/examples/debathena-bin-example-1.0/debian/compat new file mode 100644 index 0000000..b8626c4 --- /dev/null +++ b/examples/debathena-bin-example-1.0/debian/compat @@ -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 index 0000000..3daa78c --- /dev/null +++ b/examples/debathena-bin-example-1.0/debian/control @@ -0,0 +1,14 @@ +Source: debathena-bin-example +Section: config +Priority: extra +Maintainer: Tim Abbott +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 index 0000000..e8d2e1d --- /dev/null +++ b/examples/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: 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 index 0000000..78007ae --- /dev/null +++ b/examples/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/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 index 0000000..04c9a48 --- /dev/null +++ b/examples/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/debathena-bin-example-1.0/debian/elinks.debathena b/examples/debathena-bin-example-1.0/debian/elinks.debathena new file mode 100644 index 0000000..dbda483 --- /dev/null +++ b/examples/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/debathena-bin-example-1.0/debian/less.debathena b/examples/debathena-bin-example-1.0/debian/less.debathena new file mode 100644 index 0000000..207173d --- /dev/null +++ b/examples/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/debathena-bin-example-1.0/debian/rules b/examples/debathena-bin-example-1.0/debian/rules new file mode 100755 index 0000000..00c95a1 --- /dev/null +++ b/examples/debathena-bin-example-1.0/debian/rules @@ -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 index 0000000..796f167 --- /dev/null +++ b/examples/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 diverting 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/debathena-bin-example-1.1/debian/compat b/examples/debathena-bin-example-1.1/debian/compat new file mode 100644 index 0000000..b8626c4 --- /dev/null +++ b/examples/debathena-bin-example-1.1/debian/compat @@ -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 index 0000000..3daa78c --- /dev/null +++ b/examples/debathena-bin-example-1.1/debian/control @@ -0,0 +1,14 @@ +Source: debathena-bin-example +Section: config +Priority: extra +Maintainer: Tim Abbott +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 index 0000000..e8d2e1d --- /dev/null +++ b/examples/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: 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 index 0000000..78007ae --- /dev/null +++ b/examples/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/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 index 0000000..6e86e9c --- /dev/null +++ b/examples/debathena-bin-example-1.1/debian/debathena-bin-example.install @@ -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 index 0000000..207173d --- /dev/null +++ b/examples/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/debathena-bin-example-1.1/debian/rules b/examples/debathena-bin-example-1.1/debian/rules new file mode 100755 index 0000000..50a8249 --- /dev/null +++ b/examples/debathena-bin-example-1.1/debian/rules @@ -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 index 0000000..d11878d --- /dev/null +++ b/examples/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/debathena-conffile-example-1.0/debian/compat b/examples/debathena-conffile-example-1.0/debian/compat new file mode 100644 index 0000000..b8626c4 --- /dev/null +++ b/examples/debathena-conffile-example-1.0/debian/compat @@ -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 index 0000000..55fe3be --- /dev/null +++ b/examples/debathena-conffile-example-1.0/debian/control @@ -0,0 +1,14 @@ +Source: debathena-conffile-example +Section: config +Priority: extra +Maintainer: Tim Abbott +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 index 0000000..44a1bf3 --- /dev/null +++ b/examples/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: 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 index 0000000..78007ae --- /dev/null +++ b/examples/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/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 index 0000000..5b79850 --- /dev/null +++ b/examples/debathena-conffile-example-1.0/debian/debathena-conffile-example.install @@ -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 index 0000000..2099f70 --- /dev/null +++ b/examples/debathena-conffile-example-1.0/debian/rules @@ -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 index 0000000..f1f73cb --- /dev/null +++ b/examples/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/debathena-conffile-example-1.0/files/etc/mailname.debathena b/examples/debathena-conffile-example-1.0/files/etc/mailname.debathena new file mode 100644 index 0000000..731f0e4 --- /dev/null +++ b/examples/debathena-conffile-example-1.0/files/etc/mailname.debathena @@ -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 index 0000000..40e0a6f --- /dev/null +++ b/examples/debathena-conffile-example-1.0/files/etc/papersize.debathena @@ -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 index 0000000..371611a --- /dev/null +++ b/examples/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/debathena-cron-example-1.0/debian/compat b/examples/debathena-cron-example-1.0/debian/compat new file mode 100644 index 0000000..b8626c4 --- /dev/null +++ b/examples/debathena-cron-example-1.0/debian/compat @@ -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 index 0000000..d30d179 --- /dev/null +++ b/examples/debathena-cron-example-1.0/debian/control @@ -0,0 +1,14 @@ +Source: debathena-cron-example +Section: config +Priority: extra +Maintainer: Tim Abbott +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 index 0000000..9d8e5e4 --- /dev/null +++ b/examples/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: 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 index 0000000..78007ae --- /dev/null +++ b/examples/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/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 index 0000000..81d8150 --- /dev/null +++ b/examples/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/debathena-cron-example-1.0/debian/rules b/examples/debathena-cron-example-1.0/debian/rules new file mode 100755 index 0000000..f005830 --- /dev/null +++ b/examples/debathena-cron-example-1.0/debian/rules @@ -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 index 0000000..14716f4 --- /dev/null +++ b/examples/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/debathena-transform-example-1.0/debian/compat b/examples/debathena-transform-example-1.0/debian/compat new file mode 100644 index 0000000..b8626c4 --- /dev/null +++ b/examples/debathena-transform-example-1.0/debian/compat @@ -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 index 0000000..9a6c34c --- /dev/null +++ b/examples/debathena-transform-example-1.0/debian/control @@ -0,0 +1,14 @@ +Source: debathena-transform-example +Section: config +Priority: extra +Maintainer: Tim Abbott +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 index 0000000..4546aa9 --- /dev/null +++ b/examples/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@ +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 index 0000000..78007ae --- /dev/null +++ b/examples/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/debathena-transform-example-1.0/debian/rules b/examples/debathena-transform-example-1.0/debian/rules new file mode 100755 index 0000000..98a2091 --- /dev/null +++ b/examples/debathena-transform-example-1.0/debian/rules @@ -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 index 0000000..2626ba0 --- /dev/null +++ b/examples/debathena-transform-example-1.0/debian/transform_syslog.conf.debathena @@ -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; diff --git a/transform-files.mk b/transform-files.mk index 43ab6c0..d0de55a 100644 --- a/transform-files.mk +++ b/transform-files.mk @@ -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 -- 2.45.0