summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/oh-gencontrol14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/oh-gencontrol b/src/oh-gencontrol
index 62a6eef..03acc3d 100644
--- a/src/oh-gencontrol
+++ b/src/oh-gencontrol
@@ -91,6 +91,7 @@ gen_control_bin()
printf 'oh-gencontrol: Generating control directory for package "%s"...\n' \
"${binpkg}"
+ data_dir="${binpkg}.data"
control_dir="${binpkg}.control"
control="${control_dir}/control"
@@ -121,6 +122,7 @@ gen_control_bin()
copy_required_field ${binpkg} Description ${control}
copy_optional_field Homepage ${control}
+ # Maintainer scripts.
for script in preinst postinst prerm postrm; do
if [ -f ../${binpkg}.pkg/${script} ]; then
cp ../${binpkg}.pkg/${script} ${control_dir}
@@ -128,6 +130,18 @@ gen_control_bin()
# TODO: Handle links?
fi
done
+
+ # Conffiles.
+ # Adapted from dh_installdeb of debhelper.
+ if [ -d ${data_dir}/etc ]; then
+ find ${data_dir}/etc -type f | sed "s@^${data_dir}@@" \
+ >> ${control_dir}/conffiles
+ if [ -z "$(cat ${control_dir}/conffiles)" ]; then
+ rm -f ${control_dir}/conffiles
+ else
+ chmod 644 ${control_dir}/conffiles
+ fi
+ fi
}
if [ ${#} -eq 0 ]; then