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.
27 If a file named debian/package.emacsen-install exists, then it is installed
29 usr/lib/emacsen-common/packages/install/package in the package build
30 directory. Similarly, debian/package.emacsen-remove is installed into
31 usr/lib/emacsen-common/packages/remove/package . And similarly,
32 debian/package.emacsen-startup is installed into
33 etc/emacs/site-start.d/50<package>.el (by default).
39 =item B<-n>, B<--noscripts>
41 Do not modify postinst/prerm scripts.
43 =item B<--priority=>I<n>
45 Sets the priority number of a site-start.d file. Default is 50.
47 =item B<--flavor=>I<foo>
49 Sets the flavor a site-start.d file will be installed in. Default is
50 "emacs", alternatives include "xemacs" and "emacs20".
56 Note that this command is not idempotent. L<dh_prep(1)> should be called
57 between invocations of this command. Otherwise, it may cause multiple
58 instances of the same text to be added to maintainer scripts.
63 "flavor=s" => \$dh{FLAVOR},
66 if (! defined $dh{PRIORITY}) {
69 if (! defined $dh{FLAVOR}) {
73 foreach my $package (@{$dh{DOPACKAGES}}) {
74 my $tmp=tmpdir($package);
76 my $emacsen_install=pkgfile($package,"emacsen-install");
77 my $emacsen_remove=pkgfile($package,"emacsen-remove");
78 my $emacsen_startup=pkgfile($package,"emacsen-startup");
80 if ($emacsen_install ne '') {
81 if (! -d "$tmp/usr/lib/emacsen-common/packages/install") {
82 doit("install","-d","$tmp/usr/lib/emacsen-common/packages/install");
84 doit("install","-m0755",$emacsen_install,"$tmp/usr/lib/emacsen-common/packages/install/$package");
87 if ($emacsen_remove ne '') {
88 if (! -d "$tmp/usr/lib/emacsen-common/packages/remove") {
89 doit("install","-d","$tmp/usr/lib/emacsen-common/packages/remove");
91 doit("install","-m0755","$emacsen_remove","$tmp/usr/lib/emacsen-common/packages/remove/$package");
94 if ($emacsen_startup ne '') {
95 if (! -d "$tmp/etc/$dh{FLAVOR}/site-start.d/") {
96 doit("install","-d","$tmp/etc/$dh{FLAVOR}/site-start.d/");
98 doit("install","-m0644",$emacsen_startup,"$tmp/etc/$dh{FLAVOR}/site-start.d/$dh{PRIORITY}$package.el");
101 if ($emacsen_install ne '' || $emacsen_remove ne '') {
102 if (! $dh{NOSCRIPTS}) {
103 autoscript($package,"postinst","postinst-emacsen",
104 "s/#PACKAGE#/$package/");
105 autoscript($package,"prerm","prerm-emacsen",
106 "s/#PACKAGE#/$package/");
115 This program is a part of debhelper.
119 Joey Hess <joeyh@debian.org>