Re: why dpkg-buildpackage doesn't care my build targets in debian/rule

2015-05-23 Thread lumin
I got it.

Thank you,
 Santiago, Jakub, Johannes, Mattia and Wookey !

:)
-- 
Regards,
  C.D.Luminate


-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/1432439429.7146.3.ca...@gmail.com



Re: why dpkg-buildpackage doesn't care my build targets in debian/rule

2015-05-22 Thread Jakub Wilk

* Wookey , 2015-05-22, 19:08:

override_dh_auto_build:
# well. let's copy config back again.
cp ./debian/my/Makefile.config.cpuonly ./Makefile.config
debian/my/00-fix-caffe-include-path-debian.sh
$(MAKE) all
$(MAKE) test
$(MAKE) runtest


also, that test things should go in a override_dh_auto_test target, 
not in the build one.


Right, so that DEB_BUILD_OPTIONS=nocheck works, which is often 
important for cross-building.


Right. But keep in mind that putting stuff in override_dh_auto_test is 
not enough to make your d/rules honour DEB_BUILD_OPTIONS=nocheck. See 
bug #568897.


--
Jakub Wilk


--
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/20150522182449.ga7...@jwilk.net



Re: why dpkg-buildpackage doesn't care my build targets in debian/rule

2015-05-22 Thread Wookey
+++ Mattia Rizzolo [2015-05-22 17:04 +0200]:
> On Fri, May 22, 2015 at 6:31 AM, lumin  wrote:
> > override_dh_auto_build:
> > # well. let's copy config back again.
> > cp ./debian/my/Makefile.config.cpuonly ./Makefile.config
> > debian/my/00-fix-caffe-include-path-debian.sh
> > $(MAKE) all
> > $(MAKE) test
> > $(MAKE) runtest
> 
> also, that test things should go in a override_dh_auto_test target,
> not in the build one.

Right, so that DEB_BUILD_OPTIONS=nocheck works, which is often
important for cross-building.

Wookey
-- 
Principal hats:  Linaro, Debian, Wookware, ARM
http://wookware.org/


-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/20150522180834.go24...@halon.org.uk



Re: why dpkg-buildpackage doesn't care my build targets in debian/rule

2015-05-22 Thread Mattia Rizzolo
On Fri, May 22, 2015 at 6:31 AM, lumin  wrote:
> override_dh_auto_build:
> # well. let's copy config back again.
> cp ./debian/my/Makefile.config.cpuonly ./Makefile.config
> debian/my/00-fix-caffe-include-path-debian.sh
> $(MAKE) all
> $(MAKE) test
> $(MAKE) runtest

also, that test things should go in a override_dh_auto_test target,
not in the build one.

-- 
regards,
Mattia Rizzolo

GPG Key: 4096R/B9444540 http://goo.gl/I8TMB
more about me: http://mapreri.org
Launchpad User: https://launchpad.net/~mapreri
Ubuntu Wiki page: https://wiki.ubuntu.com/MattiaRizzolo


-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
https://lists.debian.org/cahkymes4s6pn8b4fhqnlwxdc2ezfe3rek4srajdh+f4ga9e...@mail.gmail.com



Re: why dpkg-buildpackage doesn't care my build targets in debian/rule

2015-05-21 Thread Johannes Schauer
Hi,

Quoting lumin (2015-05-22 06:31:34)
> override_dh_auto_clean:
> cp ./debian/my/Makefile.config.cpuonly ./Makefile.config
> dh_auto_clean
> # without following line the the source tree 
> # would be not clean. Hence dpkg-buildpackage
> # refuse to build.
> rm Makefile.config

instead of calling rm explicitly in your d/rules, you can also add
Makefile.config to debian/clean instead which might be considered a bit more
clean :)

cheers, josch


signature.asc
Description: signature


Re: why dpkg-buildpackage doesn't care my build targets in debian/rule

2015-05-21 Thread lumin
Hi mentors,

I solved this problem, after line-by-line reviewing the
screen output of those commands.

It turns out that, the "clean" target of Makefile
needs the Makefile.config too.

this rules file makes dpkg-buildpackage continue building.
(I deleted some comments )
---
#!/usr/bin/make -f
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk

%:
dh $@ 

override_dh_auto_clean:
cp ./debian/my/Makefile.config.cpuonly ./Makefile.config
dh_auto_clean
# without following line the the source tree 
# would be not clean. Hence dpkg-buildpackage
# refuse to build.
rm Makefile.config  

override_dh_auto_build:
# well. let's copy config back again.
cp ./debian/my/Makefile.config.cpuonly ./Makefile.config
debian/my/00-fix-caffe-include-path-debian.sh
$(MAKE) all
$(MAKE) test
$(MAKE) runtest
-

> It's hard to tell what went wrong without seeing complete d/rules, or at
> least complete build log. I guess the bug lies in the part of
> debian/rules you snipped.

Thank you Jakub for the hint.
However my snipped part of rules was fine, the problem is,
I didn't notice the need of "Make clean" for a Makefile.config.
Therefore dpkg-buildpackage aborted at 

dpkg-buildpackage: host architecture amd64
 dpkg-source --before-build caffe-20150521~rc2
 fakeroot debian/rules clean
dh clean <---  currently no Makefile.config, abort.

rather than dh build.
-- 
Regards,
  C.D.Luminate


-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/1432269094.2378.17.ca...@gmail.com



Re: why dpkg-buildpackage doesn't care my build targets in debian/rule

2015-05-21 Thread lumin
Hi,

I modified the debian/rules[1] according to 
Santiago and Jakub (thank you both!),
and tested again. The result was the same.

"dh build" works while "dpkg-buildpackage" doesn't.

[1] --- the whole debian/rules
  1 #!/usr/bin/make -f
  2 # See debhelper(7) (uncomment to enable)
  3 # output every command that modifies files on the build system.
  4 DH_VERBOSE = 1
  5 
  6 # see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
  7 DPKG_EXPORT_BUILDFLAGS = 1
  8 include /usr/share/dpkg/default.mk
  9 
 10 # main packaging script based on dh7 syntax
 11 %:
 12 dh $@ 
 13 
 14 # debmake generated override targets
 15 override_dh_auto_build:
 16 cp ./debian/my/Makefile.config.cpuonly ./Makefile.config
 17 debian/my/00-fix-caffe-include-path-debian.sh
 18 $(MAKE) all
 19 $(MAKE) test
 20 $(MAKE) runtest
-end debian/rules--


-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/1432252944.5003.6.ca...@gmail.com



Re: why dpkg-buildpackage doesn't care my build targets in debian/rule

2015-05-21 Thread Jakub Wilk

* lumin , 2015-05-21, 14:30:

I'd like to take over the whole build process, so I wrote:

32 override_dh_auto_build: build_cpuonly
33
34 build_cpuonly: config_cpuonly
35 $(shell debian/my/00-fix-caffe-include-path-debian.sh)


As Santiago noticed, you should almost certainly not use $(shell ...) 
here.



36 $(MAKE) -j4 all
37 $(MAKE) -j4 test


Please don't hardcode number of jobs. You should honour 
DEB_BUILD_OPTIONS=parallel=N (see Debian policy ยง4.9.1).



in file debian/rules.
Then I tested it with

   $ dh build

It works fine, but when I test the rules file with

   $ dpkg-buildpackage -us -uc


It's hard to tell what went wrong without seeing complete d/rules, or at 
least complete build log. I guess the bug lies in the part of 
debian/rules you snipped.


--
Jakub Wilk


--
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/20150521184757.ga7...@jwilk.net



Re: why dpkg-buildpackage doesn't care my build targets in debian/rule

2015-05-21 Thread Santiago Vila
On Thu, May 21, 2015 at 02:30:58PM +, lumin wrote:
> I'm trying to package caffe as said [1] at debian-science@ .
> However I encountered a problem when writing debian/rules.
> 
> I'd like to take over the whole build process, so I wrote:
> 
>  32 override_dh_auto_build: build_cpuonly
>  33 
>  34 build_cpuonly: config_cpuonly
>  35 $(shell debian/my/00-fix-caffe-include-path-debian.sh)
>  36 $(MAKE) -j4 all
>  37 $(MAKE) -j4 test
>  38 $(MAKE) runtest
>  39 
>  40 config_cpuonly:
>  41 cp debian/my/Makefile.config.cpuonly Makefile.config
>  42 
>  43 .PHONY: config_cpuonly build_cpuonly

I would try this instead:

override_dh_auto_build: 
cp debian/my/Makefile.config.cpuonly Makefile.config
debian/my/00-fix-caffe-include-path-debian.sh 
$(MAKE) -j4 all
$(MAKE) -j4 test
$(MAKE) runtest

Then, if it works, you can make it more complex until it stops working again.


-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/20150521180437.ga32...@cantor.unex.es