[lua-torch-nn] 01/01: Initialize packaging

Zhou Mo cdluminate-guest at moszumanska.debian.org
Wed Jun 22 04:10:17 UTC 2016


This is an automated email from the git hooks/post-receive script.

cdluminate-guest pushed a commit to branch master
in repository lua-torch-nn.

commit 34fa44d6e1ba87e5c2aa7f44ee995aa334bdf003
Author: Zhou Mo <cdluminate at gmail.com>
Date:   Wed Jun 22 04:10:03 2016 +0000

    Initialize packaging
---
 debian/changelog                            |  5 ++
 debian/clean                                |  6 +++
 debian/compat                               |  1 +
 debian/control                              | 69 +++++++++++++++++++++++++++
 debian/copyright                            | 69 +++++++++++++++++++++++++++
 debian/libtorch-thnn.install.in             |  1 +
 debian/libtorch-thnn.links.in               |  1 +
 debian/libtorch-thnn.lintian-overrides      |  2 +
 debian/lua-torch-nn.docs                    |  3 ++
 debian/lua5.1.dh-lua.conf                   |  8 ++++
 debian/patches/THNN-assume-torch-is-present | 15 ++++++
 debian/patches/cmake-only-generate-lua      | 23 +++++++++
 debian/patches/series                       |  2 +
 debian/rules                                | 74 +++++++++++++++++++++++++++++
 debian/source/format                        |  1 +
 debian/source/local-options                 |  2 +
 16 files changed, 282 insertions(+)

diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..60996e2
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+lua-torch-nn (0~20160604-gd23a8f5-1) experimental; urgency=low
+
+  * Initial release. Closes: #826794
+
+ -- Zhou Mo <cdluminate at gmail.com>  Mon, 06 Jun 2016 03:50:31 +0000
diff --git a/debian/clean b/debian/clean
new file mode 100644
index 0000000..09383cc
--- /dev/null
+++ b/debian/clean
@@ -0,0 +1,6 @@
+debian/lua-torch-nn-dev.install
+debian/lua-torch-nn.install
+debian/lua_versions
+debian/trash
+debian/libtorch-thnn.install
+debian/libtorch-thnn.links
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..58ae2a9
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,69 @@
+Source: lua-torch-nn
+Section: interpreters
+Priority: optional
+Maintainer: Zhou Mo <cdluminate at gmail.com>
+Build-Depends: cmake,
+               debhelper (>=9),
+               dh-lua,
+               libtorch-th-dev,
+               lua-torch-torch7,
+               luajit
+Standards-Version: 3.9.8
+Homepage: https://github.com/torch/nn
+Vcs-Git: https://anonscm.debian.org/git/debian-science/packages/lua-torch-nn.git
+Vcs-Browser: https://anonscm.debian.org/cgit/debian-science/packages/lua-torch-nn.git
+
+Package: lua-torch-nn
+Architecture: any
+Multi-Arch: same
+Depends: libtorch-thnn (= ${binary:Version}),
+         lua-torch-torch7,
+         lua5.1 | luajit,
+         ${misc:Depends},
+         ${shlibs:Depends}
+Suggests: luajit
+XB-Lua-Versions: ${lua:Versions}
+Description: Neural Network Package for Torch Framework
+ This package provides an easy and modular way to build and train
+ simple or complex neural networks using Torch Framework:
+ .
+  * Modules are the bricks used to build neural networks.
+    Each are themselves neural networks, but can be combined with
+    other networks using containers to create complex neural networks:
+ .
+    + Module: abstract class inherited by all modules.
+    + Containers: container classes.
+    + Transfer functions: non-linear functions.
+    + Simple layers: simple network layer like `Linear`.
+    + Table layers: layers for manipulating `table`s.
+    + Convolution layers: several kinds of convolutions.
+ .
+  * Criterions compute a gradient according to a given loss function
+    given an input and a target:
+ .
+    + Criterions: a list of all criterions.
+    + `MSECriterion`: the Mean Squared Error criterion used for regression;
+    + `ClassNLLCriterion`: the Negative Log Likelihood criterion used for
+      classification.
+ .
+  * Additional documentation:
+ .
+   + Overview of the package essentials including modules, containers
+     and training.
+   + Training: how to train a neural network using optim.
+   + Testing: how to test your modules.
+   + Experimental Modules: a package containing experimental modules and
+     criteria.
+ .
+ This package is a core part of the Torch Framework.
+
+Package: libtorch-thnn
+Architecture: any
+Section: libs
+Multi-Arch: same
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: libTHNN.so of Neural Network Package for Torch Framework
+ This package provides an easy and modular way to build and train
+ simple or complex neural networks using Torch Framework.
+ .
+ This package contains libTHNN.so , backend library for lua-torch-nn.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..f4f3a0a
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,69 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: torch/nn
+Source: http://github.com/torch/nn
+
+Files: *
+Copyright:
+ Copyright (c) 2011-2014 Idiap Research Institute (Ronan Collobert)
+ Copyright (c) 2012-2014 Deepmind Technologies (Koray Kavukcuoglu)
+ Copyright (c) 2011-2012 NEC Laboratories America (Koray Kavukcuoglu)
+ Copyright (c) 2011-2013 NYU (Clement Farabet)
+ Copyright (c) 2006-2010 NEC Laboratories America (Ronan Collobert, Leon Bottou, Iain Melvin, Jason Weston)
+ Copyright (c) 2006      Idiap Research Institute (Samy Bengio)
+ Copyright (c) 2001-2004 Idiap Research Institute (Ronan Collobert, Samy Bengio, Johnny Mariethoz)
+ .
+ All rights reserved.
+License: Torch-BSD-3-Clause
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ .
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+ .
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+ .
+ 3. Neither the names of Deepmind Technologies, NYU, NEC Laboratories America 
+    and IDIAP Research Institute nor the names of its contributors may be 
+    used to endorse or promote products derived from this software without 
+    specific prior written permission.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+
+Files: debian/*
+Copyright: 2016 Zhou Mo <cdluminate at gmail.com>
+License: BSD-3-Clause
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+ 3. Neither the name of the University nor the names of its contributors
+    may be used to endorse or promote products derived from this software
+    without specific prior written permission.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
+ A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE HOLDERS OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/debian/libtorch-thnn.install.in b/debian/libtorch-thnn.install.in
new file mode 100644
index 0000000..0873192
--- /dev/null
+++ b/debian/libtorch-thnn.install.in
@@ -0,0 +1 @@
+usr/lib/libTHNN.so usr/lib/#DEB_HOST_MULTIARCH#/
diff --git a/debian/libtorch-thnn.links.in b/debian/libtorch-thnn.links.in
new file mode 100644
index 0000000..b958d52
--- /dev/null
+++ b/debian/libtorch-thnn.links.in
@@ -0,0 +1 @@
+usr/lib/#DEB_HOST_MULTIARCH#/libTHNN.so /usr/lib/#DEB_HOST_MULTIARCH#/lua/5.1/libTHNN.so
diff --git a/debian/libtorch-thnn.lintian-overrides b/debian/libtorch-thnn.lintian-overrides
new file mode 100644
index 0000000..7c3ff67
--- /dev/null
+++ b/debian/libtorch-thnn.lintian-overrides
@@ -0,0 +1,2 @@
+# upstream makes no releases
+libtorch-thnn: sharedobject-in-library-directory-missing-soname usr/lib/x86_64-linux-gnu/libTHNN.so
diff --git a/debian/lua-torch-nn.docs b/debian/lua-torch-nn.docs
new file mode 100644
index 0000000..9198145
--- /dev/null
+++ b/debian/lua-torch-nn.docs
@@ -0,0 +1,3 @@
+CONTRIBUTING.md
+README.md
+doc/
diff --git a/debian/lua5.1.dh-lua.conf b/debian/lua5.1.dh-lua.conf
new file mode 100644
index 0000000..871d755
--- /dev/null
+++ b/debian/lua5.1.dh-lua.conf
@@ -0,0 +1,8 @@
+PKG_NAME=torch-nn
+LUA_MODNAME=
+LUA_VERSION=5.1
+
+LUA_SOURCES=$(wildcard nn/*.lua) nn/THNN_h.lua
+LUA_HEADER=
+CLIB_OBJS=
+LUA_TEST=
diff --git a/debian/patches/THNN-assume-torch-is-present b/debian/patches/THNN-assume-torch-is-present
new file mode 100644
index 0000000..529a05d
--- /dev/null
+++ b/debian/patches/THNN-assume-torch-is-present
@@ -0,0 +1,15 @@
+Change upstream cmake behaviour.
+Forward: no, keeping this patch downstrem.
+--- a/lib/THNN/CMakeLists.txt
++++ b/lib/THNN/CMakeLists.txt
+@@ -1,10 +1,6 @@
+ CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
+ CMAKE_POLICY(VERSION 2.6)
+ 
+-IF(NOT Torch_FOUND)
+-  FIND_PACKAGE(Torch REQUIRED)
+-ENDIF()
+-
+ IF(NOT THNN_INSTALL_LIB_SUBDIR)
+   SET(THNN_INSTALL_LIB_SUBDIR "lib" CACHE PATH "THNN install library directory")
+ ENDIF()
diff --git a/debian/patches/cmake-only-generate-lua b/debian/patches/cmake-only-generate-lua
new file mode 100644
index 0000000..3b6aa31
--- /dev/null
+++ b/debian/patches/cmake-only-generate-lua
@@ -0,0 +1,23 @@
+Change upstream cmake bahaviour
+Forward: keep it downstream
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,18 +1,7 @@
+ CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
+ CMAKE_POLICY(VERSION 2.6)
+ 
+-FIND_PACKAGE(Torch REQUIRED)
+-
+-ADD_SUBDIRECTORY(lib)
+-
+ FILE(STRINGS lib/THNN/generic/THNN.h THNN_headers NEWLINE_CONSUME)
+ FILE(WRITE THNN_h.lua "return [[")
+ FILE(APPEND THNN_h.lua ${THNN_headers})
+ FILE(APPEND THNN_h.lua "]]")
+-
+-FILE(GLOB luasrc *.lua)
+-
+-ADD_TORCH_PACKAGE(nn "" "${luasrc}")
+-
+-INSTALL(DIRECTORY "doc" DESTINATION "${Torch_INSTALL_LUA_PATH_SUBDIR}/nn")
+-INSTALL(FILES "README.md" DESTINATION "${Torch_INSTALL_LUA_PATH_SUBDIR}/nn")
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..8c179d9
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,2 @@
+THNN-assume-torch-is-present
+cmake-only-generate-lua
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..602affd
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,74 @@
+#!/usr/bin/make -f
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
+export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
+
+DEB_HOST_MULTIARCH=$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+TMP=$(shell pwd)/debian/tmp
+LUA51=/usr/bin/lua5.1
+LUAJIT=/usr/bin/luajit
+ROOTDIR=$(shell pwd)
+
+TORCH_FLAGS_5_1= \
+ -DLUA=/usr/bin/lua5.1 \
+ -DLUA_INCDIR=/usr/include/lua5.1 \
+ -DLUA_LIBDIR=/usr/lib \
+ -DLUA_BINDIR=/usr/bin \
+ -DLIBDIR=/usr/lib \
+ -DLUALIB=lua5.1 \
+ -DTorch_INSTALL_BIN_SUBDIR=bin/ \
+ -DTorch_INSTALL_LIB_SUBDIR=lib/$(DEB_HOST_MULTIARCH)/ \
+ -DTorch_INSTALL_INCLUDE_SUBDIR=include/ \
+ -DCMAKE_VERBOSE_MAKEFILE=ON \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_C_FLAGS=-I/usr/include/TH \
+ -DTORCH_FOUND=ON
+
+%:
+	dh $@ --buildsystem=lua --with lua --parallel
+
+override_dh_auto_configure:
+	ln -s . nn
+	# generate THNN_h.lua
+	set -e; mkdir build; cd build; cmake ..; cd ..; rm -rf build
+	# configure libTHNN.so
+	set -e; if ! test -d THNN.build; then mkdir THNN.build; fi
+	set -e; cd THNN.build; cmake ../lib/THNN $(TORCH_FLAGS_5_1) \
+		-DTorch_INSTALL_CMAKE_SUBDIR=/usr/share/libtorch-thnn-dev/
+	# configure the rest lua stuff
+	dh_auto_configure --buildsystem=lua
+	# configure install template
+	sed -e 's/#DEB_HOST_MULTIARCH#/$(DEB_HOST_MULTIARCH)/g' \
+		< debian/libtorch-thnn.install.in > debian/libtorch-thnn.install
+	sed -e 's/#DEB_HOST_MULTIARCH#/$(DEB_HOST_MULTIARCH)/g' \
+		< debian/libtorch-thnn.links.in > debian/libtorch-thnn.links
+
+override_dh_auto_build:
+	# build libTHNN.so
+	dh_auto_build --buildsystem=cmake -B THNN.build/ --parallel
+	# build the rest lua stuff
+	dh_auto_build --buildsystem=lua
+
+override_dh_auto_test:
+	-$(RM) -rf deb.test
+	# prepare lua files to launch a "torch.test()"
+	set -e; if ! test -d deb.test/nn; then mkdir -p deb.test/nn; fi
+	set -e; find . -name '*.so*' -exec cp -v '{}' deb.test/ \;
+	set -e; find . -name '*.lua' -exec cp -v '{}' deb.test/nn/ \;
+	set -e; cd deb.test; ln -s nn/init.lua nn.lua;
+	set -e; cd deb.test; \
+		LD_LIBRARY_PATH=$(ROOTDIR)/deb.test \
+		$(LUAJIT) -e "require 'nn'; nn.test();"
+	dh_auto_test
+
+override_dh_auto_install:
+	# install libTHNN.so
+	dh_auto_install --buildsystem=cmake -B THNN.build
+	# install the rest lua stuff
+	dh_auto_install --buildsystem=lua
+
+override_dh_auto_clean:
+	-$(RM) nn THNN_h.lua
+	-$(RM) -rf THNN.build 5.1-torch-nn .pc deb.test
+	dh_auto_clean
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/source/local-options b/debian/source/local-options
new file mode 100644
index 0000000..00131ee
--- /dev/null
+++ b/debian/source/local-options
@@ -0,0 +1,2 @@
+#abort-on-upstream-changes
+#unapply-patches

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/lua-torch-nn.git



More information about the debian-science-commits mailing list