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. The commands are added to
24 the maintainer scripts by dh_installdeb. See L<dh_installdeb(1)>
25 for an explanation of how this works.
31 =item debian/I<package>.emacsen-install
33 Installed into usr/lib/emacsen-common/packages/install/package in the
34 package build directory.
36 =item debian/I<package>.emacsen-remove
38 Installed into usr/lib/emacsen-common/packages/remove/package in the
39 package build directory.
41 =item debian/I<package>.emacsen-startup
43 Installed into etc/emacs/site-start.d/50I<package>.el in the package
44 build directory. Use --priority to use a different priority than 50.
52 =item B<-n>, B<--noscripts>
54 Do not modify postinst/prerm scripts.
56 =item B<--priority=>I<n>
58 Sets the priority number of a site-start.d file. Default is 50.
60 =item B<--flavor=>I<foo>
62 Sets the flavor a site-start.d file will be installed in. Default is
63 "emacs", alternatives include "xemacs" and "emacs20".
69 Note that this command is not idempotent. L<dh_prep(1)> should be called
70 between invocations of this command. Otherwise, it may cause multiple
71 instances of the same text to be added to maintainer scripts.
76 "flavor=s" => \$dh{FLAVOR},
79 if (! defined $dh{PRIORITY}) {
82 if (! defined $dh{FLAVOR}) {
86 foreach my $package (@{$dh{DOPACKAGES}}) {
87 my $tmp=tmpdir($package);
89 my $emacsen_install=pkgfile($package,"emacsen-install");
90 my $emacsen_remove=pkgfile($package,"emacsen-remove");
91 my $emacsen_startup=pkgfile($package,"emacsen-startup");
93 if ($emacsen_install ne '') {
94 if (! -d "$tmp/usr/lib/emacsen-common/packages/install") {
95 doit("install","-d","$tmp/usr/lib/emacsen-common/packages/install");
97 doit("install","-m0755",$emacsen_install,"$tmp/usr/lib/emacsen-common/packages/install/$package");
100 if ($emacsen_remove ne '') {
101 if (! -d "$tmp/usr/lib/emacsen-common/packages/remove") {
102 doit("install","-d","$tmp/usr/lib/emacsen-common/packages/remove");
104 doit("install","-m0755","$emacsen_remove","$tmp/usr/lib/emacsen-common/packages/remove/$package");
107 if ($emacsen_startup ne '') {
108 if (! -d "$tmp/etc/$dh{FLAVOR}/site-start.d/") {
109 doit("install","-d","$tmp/etc/$dh{FLAVOR}/site-start.d/");
111 doit("install","-m0644",$emacsen_startup,"$tmp/etc/$dh{FLAVOR}/site-start.d/$dh{PRIORITY}$package.el");
114 if ($emacsen_install ne '' || $emacsen_remove ne '') {
115 if (! $dh{NOSCRIPTS}) {
116 autoscript($package,"postinst","postinst-emacsen",
117 "s/#PACKAGE#/$package/");
118 autoscript($package,"prerm","prerm-emacsen",
119 "s/#PACKAGE#/$package/");
128 This program is a part of debhelper.
132 Joey Hess <joeyh@debian.org>