debian/rules error "No rule to make target"

Solution 1:

As the error message says, there is no build target in your rules file. Your install target lists it as a requirement. debian/rules files are Makefiles. You might want to read up on those a bit.

But you could simplify this a lot by using the simple helper dh. You rules file would look something like:

#!/usr/bin/make -f

%:
        dh $@

override_dh_auto_install:
    # Copy .py files
    cp pycounter.py $(CURDIR)/debian/pycounter/opt/extras.ubuntu.com/pycounter/pycounter.py
    cp prefs.py $(CURDIR)/debian/pycounter/opt/extras.ubuntu.com/pycounter/prefs.py

    # desktop copyright and others (not complete, check)
    cp extras-pycounter.desktop $(CURDIR)/debian/pycounter/usr/share/applications/extras-pycounter.desktop
    dh_auto_install

I'd also suggest looking into using dh_install rather than cp I.e.:

dh_install prefs.py /opt/extras.ubuntu.com/pycounter/

See both the manpage for the dh command Manpage icon and the manpage for the dh_install command Manpage icon