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.
64 if (! defined $dh{PRIORITY}) {
67 if (! defined $dh{FLAVOR}) {
71 foreach my $package (@{$dh{DOPACKAGES}}) {
72 my $tmp=tmpdir($package);
74 my $emacsen_install=pkgfile($package,"emacsen-install");
75 my $emacsen_remove=pkgfile($package,"emacsen-remove");
76 my $emacsen_startup=pkgfile($package,"emacsen-startup");
78 if ($emacsen_install ne '') {
79 if (! -d "$tmp/usr/lib/emacsen-common/packages/install") {
80 doit("install","-d","$tmp/usr/lib/emacsen-common/packages/install");
82 doit("install","-m0755",$emacsen_install,"$tmp/usr/lib/emacsen-common/packages/install/$package");
85 if ($emacsen_remove ne '') {
86 if (! -d "$tmp/usr/lib/emacsen-common/packages/remove") {
87 doit("install","-d","$tmp/usr/lib/emacsen-common/packages/remove");
89 doit("install","-m0755","$emacsen_remove","$tmp/usr/lib/emacsen-common/packages/remove/$package");
92 if ($emacsen_startup ne '') {
93 if (! -d "$tmp/etc/$dh{FLAVOR}/site-start.d/") {
94 doit("install","-d","$tmp/etc/$dh{FLAVOR}/site-start.d/");
96 doit("install","-m0644",$emacsen_startup,"$tmp/etc/$dh{FLAVOR}/site-start.d/$dh{PRIORITY}$package.el");
99 if ($emacsen_install ne '' || $emacsen_remove ne '') {
100 if (! $dh{NOSCRIPTS}) {
101 autoscript($package,"postinst","postinst-emacsen",
102 "s/#PACKAGE#/$package/");
103 autoscript($package,"prerm","prerm-emacsen",
104 "s/#PACKAGE#/$package/");
113 This program is a part of debhelper.
117 Joey Hess <joeyh@debian.org>