[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#797898: RFS: caffe/0.9999~rc2+git20150902+e8e660d3-1 [ITP]



Hi,

I've uploaded updated Caffe to mentors.
http://mentors.debian.net/package/caffe

On Thu, 2015-09-03 at 15:13 +0000, Gianfranco Costamagna wrote:
> libboost-all-dev (>= 1.55) | libboost1.55-all-dev (>= 1.55),
> what is the rationale for that? I guess libboost-all-dev is already enough...

Reduced one.

> Multi-Arch: no
> isn't that the default?

Stripped all Multi-Arch: no in d/control.

> "Pre-Depends: ${misc:Pre-Depends}"
> this should be useless

Removed.

> rules:
> --builddirectory=
> can be passed also in dh call, making useless everywhere
> 
> 
> "fakeroot dh binary"
> 
> well, I usually don't like such hacks in rules file :)

Then, how about splitting those custom target into another file?

e.g. debian/custom 
 $ debian/custom cpu
 $ debian/custom cuda

Such change can 1. reduce length of d/rules,
2. avoid confusion on custom matter.

> CUSTOM_JOBS   := "-j4"
> 
> well mips porters might hate you for this!

Well, I changed the default custom build jobs to -j2.

> isn't something like
> override_dh_auto_build:
> dh_auto_configure flags-build1
> dh_auto_build -O--parallel --builddirectory=build1
> dh_auto_configure flags-build2
> dh_auto_build -O--parallel --builddirectory=build2
> 
> not good for your purpose?

I still don't understand how to write working rules
like that ...

Full changes since last time mentors upload is attached.

Thank you :-)
diff --git a/debian/control b/debian/control
index 4fc3b87..a3a8379 100644
--- a/debian/control
+++ b/debian/control
@@ -5,7 +5,7 @@ Maintainer: Debian Science Maintainers <debian-science-maintainers@lists.alioth.
 Uploaders: Zhou Mo <cdluminate@gmail.com>
 Build-Depends: cmake, debhelper (>=9),
                libopencv-dev (>= 2.4),
-               libboost-all-dev (>= 1.55) | libboost1.55-all-dev (>= 1.55),
+               libboost-all-dev (>= 1.55),
                libopenblas-dev,
                libprotobuf-dev,
                libleveldb-dev,
@@ -26,15 +26,14 @@ Build-Depends: cmake, debhelper (>=9),
                nvidia-cuda-toolkit (>= 6.5.14) [amd64 i386]
 Standards-Version: 3.9.6
 Homepage: http://caffe.berkeleyvision.org
-Vcs-Git: https://github.com/BVLC/caffe.git
-X-Python-Version: >= 2.6
+Vcs-Browser: http://anonscm.debian.org/cgit/debian-science/packages/caffe.git
+Vcs-Git: https://anonscm.debian.org/git/debian-science/packages/caffe.git
+X-Python-Version: >= 2.7
 
 Package: caffe-cpu
 Architecture: any
-Multi-Arch: no
 Depends: libcaffe-cpu0 (= ${binary:Version}),
-         ${misc:Depends},
-         ${shlibs:Depends}
+         ${misc:Depends}, ${shlibs:Depends}
 Conflicts: caffe-cuda
 Description: Fast open framework for Deep Learning (Tools, CPU_ONLY)
  Caffe is a deep learning framework made with expression, speed, 
@@ -46,8 +45,6 @@ Description: Fast open framework for Deep Learning (Tools, CPU_ONLY)
 Package: libcaffe-cpu0
 Section: contrib/libs
 Architecture: any
-Multi-Arch: no
-Pre-Depends: ${misc:Pre-Depends}
 Depends: ${misc:Depends}, ${shlibs:Depends}
 Conflicts: libcaffe-cuda0
 Provides: libcaffe.so.0
@@ -61,10 +58,9 @@ Description: Fast open framework for Deep Learning (Lib, CPU_ONLY)
 Package: libcaffe-cpu-dev
 Section: contrib/libdevel
 Architecture: any
-Multi-Arch: no
 Conflicts: libcaffe-cuda-dev
 Depends: libcaffe-cpu0 (= ${binary:Version}), ${misc:Depends}
-Description: Fast open framework for Deep Learning (LibDev, CPU_ONLY)
+Description: Fast open framework for Deep Learning (Dev, CPU_ONLY)
  Caffe is a deep learning framework made with expression, speed, 
  and modularity in mind. It is developed by the Berkeley Vision
  and Learning Center (BVLC) and community contributors.
@@ -74,10 +70,8 @@ Description: Fast open framework for Deep Learning (LibDev, CPU_ONLY)
 Package: caffe-cuda
 # CUDA is available only on i386 and amd64
 Architecture: i386 amd64
-Multi-Arch: no
 Depends: libcaffe-cuda0 (= ${binary:Version}),
-         ${misc:Depends},
-         ${shlibs:Depends}
+         ${misc:Depends}, ${shlibs:Depends}
 Conflicts: caffe-cpu
 Description: Fast open framework for Deep Learning (Tools, CUDA)
  Caffe is a deep learning framework made with expression, speed, 
@@ -90,8 +84,6 @@ Package: libcaffe-cuda0
 Section: contrib/libs
 # CUDA is available only on i386 and amd64
 Architecture: i386 amd64
-Multi-Arch: no
-Pre-Depends: ${misc:Pre-Depends}
 Depends: ${misc:Depends}, ${shlibs:Depends}
 Conflicts: libcaffe-cpu0
 Provides: libcaffe.so.0
@@ -106,10 +98,9 @@ Package: libcaffe-cuda-dev
 Section: contrib/libdevel
 # CUDA is available only on i386 and amd64
 Architecture: i386 amd64
-Multi-Arch: no
 Depends: libcaffe-cuda0 (= ${binary:Version}), ${misc:Depends}
 Conflicts: libcaffe-cpu-dev
-Description: Fast open framework for Deep Learning (LibDev, CUDA)
+Description: Fast open framework for Deep Learning (Dev, CUDA)
  Caffe is a deep learning framework made with expression, speed, 
  and modularity in mind. It is developed by the Berkeley Vision
  and Learning Center (BVLC) and community contributors.
@@ -119,7 +110,8 @@ Description: Fast open framework for Deep Learning (LibDev, CUDA)
 Package: python-caffe-cpu
 Section: contrib/python
 Architecture: any
-Depends: libcaffe-cpu0 (= ${binary:Version}), ${misc:Depends}, ${python:Depends}, ${shlibs:Depends}
+Depends: libcaffe-cpu0 (= ${binary:Version}), ${misc:Depends},
+         ${python:Depends}, ${shlibs:Depends}
 Conflicts: python-caffe-cuda
 Description: Fast open framework for Deep Learning (Python2, CPU_ONLY)
  Caffe is a deep learning framework made with expression, speed, 
@@ -131,7 +123,8 @@ Description: Fast open framework for Deep Learning (Python2, CPU_ONLY)
 Package: python-caffe-cuda
 Section: contrib/python
 Architecture: i386 amd64
-Depends: libcaffe-cuda0 (= ${binary:Version}), ${misc:Depends}, ${python:Depends}, ${shlibs:Depends}
+Depends: libcaffe-cuda0 (= ${binary:Version}), ${misc:Depends},
+         ${python:Depends}, ${shlibs:Depends}
 Conflicts: python-caffe-cpu
 Description: Fast open framework for Deep Learning (Python2, CUDA)
  Caffe is a deep learning framework made with expression, speed, 
diff --git a/debian/rules b/debian/rules
index 0bf8f5f..bd95c85 100755
--- a/debian/rules
+++ b/debian/rules
@@ -11,6 +11,11 @@ ORIG_SOURCE   := "https://github.com/BVLC/caffe/archive/master.tar.gz";
 export CAFFE_CPU_BUILDDIR="caffe_cpu_build"
 export CAFFE_CUDA_BUILDDIR="caffe_cuda_build"
 
+SUITE_CPU    := caffe-cpu  libcaffe-cpu0  libcaffe-cpu-dev  python-caffe-cpu
+SUITE_CUDA   := caffe-cuda libcaffe-cuda0 libcaffe-cuda-dev python-caffe-cuda
+SUITE_CPU_P  := $(foreach PKG, $(SUITE_CPU),  --package=$(PKG))
+SUITE_CUDA_P := $(foreach PKG, $(SUITE_CUDA), --package=$(PKG))
+
 ifeq (amd64, $(DEB_HOST_ARCH))
 	flag_build_caffe_cuda := y
 endif
@@ -106,38 +111,19 @@ endif
 
 override_dh_makeshlibs:
 	dh_makeshlibs \
-		--package=caffe-cpu \
-		--package=libcaffe-cpu0 \
-		--package=libcaffe-cpu-dev
-	dh_makeshlibs \
-		--package=python-caffe-cpu \
-		-X/usr/lib/python
+		--package=python-caffe-cpu -X/usr/lib/python
 ifeq (y, $(flag_build_caffe_cuda))
 	dh_makeshlibs \
-		--package=caffe-cuda \
-		--package=libcaffe-cuda0 \
-		--package=libcaffe-cuda-dev
-	dh_makeshlibs \
-		--package=python-caffe-cuda \
-		-X/usr/lib/python
+		--package=python-caffe-cuda -X/usr/lib/python
 endif
+	dh_makeshlibs --remaining-packages
 
 override_dh_shlibdeps:
-	dh_shlibdeps \
-		--package=caffe-cpu \
-		--package=libcaffe-cpu0 \
-		--package=libcaffe-cpu-dev \
-		--package=python-caffe-cpu \
-		-- \
-		-xlibcaffe-cuda0
+	dh_shlibdeps $(SUITE_CPU_P) \
+		-- -xlibcaffe-cuda0
 ifeq (y, $(flag_build_caffe_cuda))
-	dh_shlibdeps \
-		--package=caffe-cuda \
-		--package=libcaffe-cuda0 \
-		--package=libcaffe-cuda-dev \
-		--package=python-caffe-cuda \
-		-- \
-		-xlibcaffe-cpu0
+	dh_shlibdeps $(SUITE_CUDA_P) \
+		-- -xlibcaffe-cpu0
 endif
 
 get-orig-source:
@@ -146,7 +132,7 @@ get-orig-source:
 # Since the Distributed Binary Caffe can not play the best performance
 # of user's machines, it's good to provide a custom build target,
 # allowing users to build their locally performance-optimized packages.
-CUSTOM_JOBS   := "-j4"
+CUSTOM_JOBS   := "-j2"
 CONFFLAG_CPU_CUSTOM = \
 	-DBLAS="Open" \
 	-DCMAKE_SKIP_RPATH=TRUE \
@@ -197,11 +183,7 @@ custom-cpu:
 	cd ${CAFFE_CPU_BUILDDIR}; cmake -DCMAKE_INSTALL_CONFIG_NAME="Release" \
 		-P cmake_install.cmake
 	$(RM) debian/*.symbols
-	fakeroot dh binary \
-		--package=caffe-cpu \
-		--package=libcaffe-cpu0 \
-		--package=libcaffe-cpu-dev \
-		--package=python-caffe-cpu
+	fakeroot dh binary $(SUITE_CPU_P)
 custom-cuda:
 	dch --local='+custom' "Custom build of caffe-cuda on `uname -a`"
 	dpkg-source --after-build ./
@@ -219,8 +201,4 @@ custom-cuda:
 	cd ${CAFFE_CUDA_BUILDDIR}; cmake -DCMAKE_INSTALL_CONFIG_NAME="Release" \
 		-P cmake_install.cmake
 	$(RM) debian/*.symbols
-	fakeroot dh binary \
-		--package=caffe-cuda \
-		--package=libcaffe-cuda0 \
-		--package=libcaffe-cuda-dev \
-		--package=python-caffe-cuda
+	fakeroot dh binary $(SUITE_CUDA_P)

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: