1

We are trying to create a deb package, to install and auto-start a couple of monitoring scripts we have.

Here is the rules file:

#!/usr/bin/make -f
%:
    dh $@ --with=systemd --with=python2

override_dh_installinit:
    dh_systemd_enable -pmonitor --name=monitor monitor.service
    dh_installinit -pmonitor--no-start --noscripts
    dh_systemd_start -pmonitor

When building this package, I get the following error from the rules file:

dpkg-buildpackage -rfakeroot -us -uc -ui
dpkg-buildpackage: warning: using a gain-root-command while being root
dpkg-buildpackage: info: source package vm-perf-mon
dpkg-buildpackage: info: source version 2018.07.24.211328
dpkg-buildpackage: info: source distribution RELEASED
dpkg-buildpackage: info: source changed by root <root@034f0c4becfc>
 dpkg-source --before-build debbuild
dpkg-buildpackage: info: host architecture amd64
 fakeroot debian/rules clean
make: 
: No such file or directory
make: *** No rule to make target '
'.  Stop.
dpkg-buildpackage: error: fakeroot debian/rules clean subprocess returned exit status 2
debuild: fatal error at line 1152:
dpkg-buildpackage -rfakeroot -us -uc -ui failed

................................................................................ Issues:

  1. It claims that there is no rule to make a target, but the actual target name is blank.
  2. The rules file has no targets, except the default % as a catch-all, and the over-riden dh_installinit target. As far as I know, % is supposed to catch all undefined targets, and take care of it1.

Since the make target is blank, I'm not even sure where to start. I was wondering if anyone has either faced this before, or has any idea what this is or why this is happening.

I did read this, but in the OPs case there, it specified a target that had no rule.


  1. https://www.debian.org/doc/manuals/maint-guide/dreq.en.html#defaultrules
Sagar
  • 113

1 Answers1

1

When looking at the output, I noticed that "No such file or directory" and "No rule to make target" both appear to be a newline character. I managed to replicate similar error output by adding a carriage return to the end of the first line.

You should check that there are not any unusual characters in the debian/rules file.

Jason Conti
  • 2,371