5 dh_installemacsen - register an emacs add on package
10 use Debian::Debhelper::Dh_Lib;
14 B<dh_installemacsen> [S<I<debhelper options>>] [B<-n>] [B<--priority=>I<n>] [B<--flavor=>I<foo>]
18 dh_installemacsen is a debhelper program that is responsible for installing
19 files used by the debian emacsen-common package into package build
22 It also automatically generates the postinst and prerm commands needed to
23 register a package as an emacs add on package. See L<dh_installdeb(1)>
24 for an explanation of how this works.
26 If a file named debian/package.emacsen-install exists, then it is installed
28 usr/lib/emacsen-common/packages/install/package in the package build
29 directory. Similarly, debian/package.emacsen-remove is installed into
30 usr/lib/emacsen-common/packages/remove/package . And similarly,
31 debian/package.emacsen-startup is installed into
32 etc/emacs/site-start.d/50<package>.el (by default).
38 =item B<-n>, B<--noscripts>
40 Do not modify postinst/prerm scripts.
42 =item B<--priority=>I<n>
44 Sets the priority number of a site-start.d file. Default is 50.
46 =item B<--flavor=>I<foo>
48 Sets the flavor a site-start.d file will be installed in. Default is
49 "emacs", alternatives include "xemacs" and "emacs20".
55 Note that this command is not idempotent. "dh_clean -k" should be called
56 between invocations of this command. Otherwise, it may cause multiple
57 instances of the same text to be added to maintainer scripts.
63 if (! defined $dh{PRIORITY}) {
66 if (! defined $dh{FLAVOR}) {
70 foreach my $package (@{$dh{DOPACKAGES}}) {
71 my $tmp=tmpdir($package);
73 my $emacsen_install=pkgfile($package,"emacsen-install");
74 my $emacsen_remove=pkgfile($package,"emacsen-remove");
75 my $emacsen_startup=pkgfile($package,"emacsen-startup");
77 if ($emacsen_install ne '') {
78 if (! -d "$tmp/usr/lib/emacsen-common/packages/install") {
79 doit("install","-d","$tmp/usr/lib/emacsen-common/packages/install");
81 doit("install","-m0755",$emacsen_install,"$tmp/usr/lib/emacsen-common/packages/install/$package");
84 if ($emacsen_remove ne '') {
85 if (! -d "$tmp/usr/lib/emacsen-common/packages/remove") {
86 doit("install","-d","$tmp/usr/lib/emacsen-common/packages/remove");
88 doit("install","-m0755","$emacsen_remove","$tmp/usr/lib/emacsen-common/packages/remove/$package");
91 if ($emacsen_startup ne '') {
92 if (! -d "$tmp/etc/$dh{FLAVOR}/site-start.d/") {
93 doit("install","-d","$tmp/etc/$dh{FLAVOR}/site-start.d/");
95 doit("install","-m0644",$emacsen_startup,"$tmp/etc/$dh{FLAVOR}/site-start.d/$dh{PRIORITY}$package.el");
98 if ($emacsen_install ne '' || $emacsen_remove ne '') {
99 if (! $dh{NOSCRIPTS}) {
100 autoscript($package,"postinst","postinst-emacsen",
101 "s/#PACKAGE#/$package/");
102 autoscript($package,"prerm","prerm-emacsen",
103 "s/#PACKAGE#/$package/");
112 This program is a part of debhelper.
116 Joey Hess <joeyh@debian.org>