Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

i'm having some problems creating a .deb file with debuild

before reading some tutorials i managed to make the file but i always get this error:

    make: *** No rule to make target «build». Stop.
    dpkg-buildpackage: failure: debian/rules build gave error exit status 2
    debuild: fatal error at line 1329:
    dpkg-buildpackage -rfakeroot -D -us -uc -b failed

Any help??

This is my debian rules file:

    #!/usr/bin/make -f
    # -*- makefile -*-
    # Sample debian/rules that uses debhelper.
    # This file was originally written by Joey Hess and Craig Small.
    # As a special exception, when this file is copied by dh-make into a
    # dh-make output file, you may use that output file without restriction.
    # This special exception was added by Craig Small in version 0.37 of dh-make.

    # Uncomment this to turn on verbose mode.
    #export DH_VERBOSE=1

    build-stamp: configure-stamp 
        dh_testdir
        touch build-stamp

    clean:
        dh_testdir
        dh_testroot
        rm -f build-stamp configure-stamp
        dh_clean

    install: build
        dh_testdir
        dh_testroot
        dh_clean -k 
        dh_installdirs
        $(MAKE) install DESTDIR=$(CURDIR)/debian/pycounter
        mkdir -p $(CURDIR)/debian/pycounter

        # 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
share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.