[8839] in athena10
Troubles using DEB_REMOVE_FILES in config-package-dev
daemon@ATHENA.MIT.EDU (Vincent Schultz)
Fri Feb 24 06:09:42 2012
Message-ID: <4F476FF0.9000805@orange.com>
Date: Fri, 24 Feb 2012 12:09:36 +0100
From: Vincent Schultz <vincent.schultz@orange.com>
MIME-Version: 1.0
To: debathena@mit.edu
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-complaints-to: abuse@cvf.fr
Hello,
As I did not find any mailing list about config-package-dev, I send my message directly to you.
I experience some troubles using the DEB_REMOVE_FILES directive. I am a newbie with config-package-dev, but I managed to build 2 packages using DEB_DIVERT_FILES without any problem.
I read your example for debathena-cron-example-1.0 but I did not manage to do the same.
I use config-package-dev on Debian Squeeze :
# dpkg -l | grep config-package-dev
ii config-package-dev 4.12~debian6.0~0.3 CDBS modules for building configuration packages
So my aim is to have a package called clamav-config-mbs that configures clamav :
1) divert /etc/clamav.conf
2) divert /etc/freshclam.conf
3) Remove /etc/logrotate.d/clamav-freshclam in order to remplace it with /etc/logrotate.d/mbs-clamav-freshclam (don't want to have 2 such files in this directory)
My debian/rules :
---------------------------------------------------------------------
#!/usr/bin/make -f
DEB_DIVERT_EXTENSION = .mbs
DEB_DIVERT_FILES_clamav-config-mbs += /etc/clamav/clamd.conf.mbs \
/etc/clamav/freshclam.conf.mbs
DEB_REMOVE_FILES_clamav-config-mbs += /etc/logrotate.d/clamav-freshclam
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/rules/config-package.mk
#include /usr/share/cdbs/1/class/makefile.mk
# Add here any variable or target overrides you need.
---------------------------------------------------------------------
I have the following files in directory files/ :
$ tree files/
files/
└── etc
├── clamav
│ ├── clamd.conf.mbs
│ └── freshclam.conf.mbs
└── logrotate.d
└── mbs-clamav-freshclam
My debian/clamav-config-mbs.install :
------------------------------------------------
files/* /
--------------------------------------------------
My results :
- So the point 1) and 2) are ok, no problem.
- For the point 3, the file mbs-clamav-freshclam is installed but the original /etc/logrotate.d/clamav-freshclam from clamav package is still in /etc/logrotate.d/
- the directory /usr/share/clamav-config-mbs/ is created, but empty.
When I install the package I have :
# aptitude install clamav-config-mbs
The following NEW packages will be installed:
clamav-config-mbs
0 packages upgraded, 1 newly installed, 0 to remove and 40 not upgraded.
Need to get 5,014 B of archives. After unpacking 81.9 kB will be used.
Get:1 http://miroir.srvc.cvf/debian-mbs/ squeeze/squeeze-mbs clamav-config-mbs all 1.0.0-8 [5,014 B]
Fetched 5,014 B in 0s (128 kB/s)
Selecting previously deselected package clamav-config-mbs.
(Reading database ... 51100 files and directories currently installed.)
Unpacking clamav-config-mbs (from .../clamav-config-mbs_1.0.0-8_all.deb) ...
Setting up clamav-config-mbs (1.0.0-8) ...
Adding 'diversion of /etc/clamav/clamd.conf to /etc/clamav/clamd.conf.mbs-orig by clamav-config-mbs'
Adding 'diversion of /etc/clamav/freshclam.conf to /etc/clamav/freshclam.conf.mbs-orig by clamav-config-mbs'
#
=> nothing about /etc/logrotate.d/clamav-freshclam
I have in /etc/logrotate.d/
# ls -l /etc/logrotate.d/
...
-rw-r--r-- 1 root root 230 Feb 24 11:29 clamav-freshclam
-rw-r--r-- 1 root root 255 Feb 24 11:17 mbs-clamav-freshclam
...
Please, can you tell me where I made a mistake, I did not understand why it does not work.
Thank you A LOT for your help,
Best regards
Vincent
PS when I have a look at clamav-config-mbs.postinst, I can see :
--------------------------------------------------------
...
if [ "$1" = "configure" ]; then
divert_link /etc/clamav/clamd.conf
divert_link /etc/clamav/freshclam.conf
divert_remove /etc/logrotate.d/clamav-freshclam /usr/share/clamav-config-mbs/etc++logrotate.d++clamav-freshclam
fi
...
--------------------------------------------------------