[Dist] Rebased porting patches for 1.13.1
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Tue, 11 Jun 2019 12:14:15 +0000 (21:14 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Tue, 11 Jun 2019 12:21:49 +0000 (21:21 +0900)
Selectively rebased and merged.

Change-Id: I77ac6ece2f9496adfa99b6dafa6d3489b828cf93
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
31 files changed:
debian/changelog [new file with mode: 0644]
debian/compat [new file with mode: 0644]
debian/control [new file with mode: 0644]
debian/copyright [new file with mode: 0644]
debian/rules [new file with mode: 0755]
debian/tensorflow-dev.install [new file with mode: 0644]
debian/tensorflow-lite-dev.install [new file with mode: 0644]
packaging/double_conversion.tar.gz [new file with mode: 0644]
packaging/downloads.tar.gz [new file with mode: 0644]
packaging/grpc.tar.gz.00 [new file with mode: 0644]
packaging/grpc.tar.gz.01 [new file with mode: 0644]
packaging/grpc.tar.gz.02 [new file with mode: 0644]
packaging/grpc.tar.gz.03 [new file with mode: 0644]
packaging/grpc.tar.gz.04 [new file with mode: 0644]
packaging/grpc.tar.gz.05 [new file with mode: 0644]
packaging/grpc.tar.gz.06 [new file with mode: 0644]
packaging/grpc.tar.gz.07 [new file with mode: 0644]
packaging/grpc.tar.gz.08 [new file with mode: 0644]
packaging/highwayhash.tar.gz [new file with mode: 0644]
packaging/jsoncpp.tar.gz [new file with mode: 0644]
packaging/nsync.tar.gz [new file with mode: 0644]
packaging/protobuf.tar.gz.00 [new file with mode: 0644]
packaging/protobuf.tar.gz.01 [new file with mode: 0644]
packaging/re2.tar.gz [new file with mode: 0644]
packaging/snappy.tar.gz [new file with mode: 0644]
packaging/tensorflow.manifest [new file with mode: 0644]
packaging/tensorflow.pc.in [new file with mode: 0644]
packaging/tensorflow.spec [new file with mode: 0644]
packaging/tf_core_framework_patch.txt [new file with mode: 0644]
packaging/zlib.tar.gz [new file with mode: 0644]
tensorflow/contrib/cmake/external/png.cmake

diff --git a/debian/changelog b/debian/changelog
new file mode 100644 (file)
index 0000000..62e6c50
--- /dev/null
@@ -0,0 +1,5 @@
+tensorflow (1.9.0) xenial; urgency=medium
+
+  * Initial debian dist files added
+
+ -- Sangjung Woo <sangjung.woo@samsung.com>  Thu, 5 Jul 2017 17:22:01 +0900
diff --git a/debian/compat b/debian/compat
new file mode 100644 (file)
index 0000000..ec63514
--- /dev/null
@@ -0,0 +1 @@
+9
diff --git a/debian/control b/debian/control
new file mode 100644 (file)
index 0000000..33b35bf
--- /dev/null
@@ -0,0 +1,21 @@
+Source: tensorflow
+Section: devel
+Priority: optional
+Maintainer: Sangjung Woo <sangjung.woo@samsung.com>
+Build-Depends: debhelper (>=9), sed, zlib1g-dev, cmake (>=3.9), python, git, python-numpy, swig, python-dev, libc6-dev, libc6-dev-i386, unzip
+Standards-Version: 1.9.0_rc1
+Homepage: https://github.sec.samsung.net/RS7-STAR/Tensorflow
+
+Package: tensorflow-dev
+Architecture: any
+Depends: ${shlibs:Depends}
+Description: Tensorflow development headers and object file
+ This package contains the Tensorflow development header and
+ static library.
+
+Package: tensorflow-lite-dev
+Architecture: any
+Depends: ${shlibs:Depends}
+Description: Tensorflow Lite development headers and object file
+ This package contains the Tensorflow Lite development header and
+ static library.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644 (file)
index 0000000..15ae421
--- /dev/null
@@ -0,0 +1,203 @@
+Copyright 2017 The TensorFlow Authors.  All rights reserved.
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright 2017, The TensorFlow Authors.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..ad93098
--- /dev/null
@@ -0,0 +1,205 @@
+#!/usr/bin/make -f
+
+ARCH := $(shell arch)
+
+CXXFLAGS = -Wno-sign-compare -Wno-unused-but-set-variable -Wno-format-security -Wno-format -fPIC
+CFLAGS = -Wno-sign-compare -Wno-unused-but-set-variable -Wno-format-security -Wno-format -fPIC
+
+name=tensorflow
+topdir=$(shell pwd)
+buildroot=${topdir}/debian/tmp
+_libdir ?= /usr/lib
+_includedir ?= /usr/include
+packagingdir=${topdir}/packaging
+
+SOURCE20010=grpc.tar.gz.00
+SOURCE20011=grpc.tar.gz.01
+SOURCE20012=grpc.tar.gz.02
+SOURCE20013=grpc.tar.gz.03
+SOURCE20014=grpc.tar.gz.04
+SOURCE20015=grpc.tar.gz.05
+SOURCE20016=grpc.tar.gz.06
+SOURCE20017=grpc.tar.gz.07
+SOURCE20018=grpc.tar.gz.08
+SOURCE2002=highwayhash.tar.gz
+SOURCE2003=jsoncpp.tar.gz
+SOURCE2004=nsync.tar.gz
+SOURCE20050=protobuf.tar.gz.00
+SOURCE20051=protobuf.tar.gz.01
+SOURCE2006=re2.tar.gz
+SOURCE2007=snappy.tar.gz
+SOURCE2008=zlib.tar.gz
+SOURCE2009=double_conversion.tar.gz
+SOURCE3001=downloads.tar.gz
+SOURCE4001=tensorflow.pc.in
+SOURCE5001=tf_core_framework_patch.txt
+
+build:
+       dh_testdir
+       patch -p0 < ${packagingdir}/${SOURCE5001}
+       cp ${packagingdir}/${SOURCE4001} ${topdir}/tensorflow/contrib/cmake/
+       mkdir -p ${topdir}/build
+       cat ${packagingdir}/${SOURCE20010} ${packagingdir}/${SOURCE20011} ${packagingdir}/${SOURCE20012} ${packagingdir}/${SOURCE20013} ${packagingdir}/${SOURCE20014} ${packagingdir}/${SOURCE20015} ${packagingdir}/${SOURCE20016} ${packagingdir}/${SOURCE20017} ${packagingdir}/${SOURCE20018} > ${topdir}/build/grpc.tar.gz
+       mkdir -p ${topdir}/build/grpc/src
+       tar -xf ${topdir}/build/grpc.tar.gz -C ${topdir}/build/grpc/src
+
+       mkdir -p ${topdir}/build/highwayhash/src
+       tar -xf ${packagingdir}/${SOURCE2002} -C ${topdir}/build/highwayhash/src
+
+       mkdir -p ${topdir}/build/jsoncpp/src
+       tar -xf ${packagingdir}/${SOURCE2003} -C ${topdir}/build/jsoncpp/src
+
+       mkdir -p ${topdir}/build/nsync/src
+       tar -xf ${packagingdir}/${SOURCE2004} -C ${topdir}/build/nsync/src
+
+       cat ${packagingdir}/${SOURCE20050} ${packagingdir}/${SOURCE20051} > ${topdir}/build/protobuf.tar.gz
+       mkdir -p ${topdir}/build/protobuf/src
+       tar -xf ${topdir}/build/protobuf.tar.gz -C ${topdir}/build/protobuf/src
+
+       mkdir -p ${topdir}/build/re2/src
+       tar -xf ${packagingdir}/${SOURCE2006} -C ${topdir}/build/re2/src
+
+       mkdir -p ${topdir}/build/snappy/src
+       tar -xf ${packagingdir}/${SOURCE2007} -C ${topdir}/build/snappy/src
+
+       mkdir -p ${topdir}/build/zlib/src
+       tar -xf ${packagingdir}/${SOURCE2008} -C ${topdir}/build/zlib/src
+
+       mkdir -p ${topdir}/build/double_conversion/src
+       tar -xf ${packagingdir}/${SOURCE2009} -C ${topdir}/build/double_conversion/src
+
+       tar -xf ${packagingdir}/${SOURCE3001} -C ${topdir}/build
+
+       mkdir -p ${topdir}/build/eigen/src
+       tar -xf ${topdir}/build/downloads/6913f0cf7d06.tar.gz -C ${topdir}/build/eigen/src
+       mv ${topdir}/build/eigen/src/eigen-eigen-6913f0cf7d06 ${topdir}/build/eigen/src/eigen
+
+       mkdir -p ${topdir}/build/lmdb/src
+       tar -xf ${topdir}/build/downloads/LMDB_0.9.19.tar.gz -C ${topdir}/build/lmdb/src
+       mv ${topdir}/build/lmdb/src/lmdb-LMDB_0.9.19 ${topdir}/build/lmdb/src/lmdb
+
+       mkdir -p ${topdir}/build/png/src
+       tar -xf ${topdir}/build/downloads/v1.6.34.tar.gz -C ${topdir}/build/png/src
+       mv ${topdir}/build/png/src/libpng-1.6.34 ${topdir}/build/png/src/png
+
+       mkdir -p ${topdir}/build/gemmlowp/src
+       unzip ${topdir}/build/downloads/38ebac7b059e84692f53e5938f97a9943c120d98.zip -d ${topdir}/build/gemmlowp/src
+       mv ${topdir}/build/gemmlowp/src/gemmlowp-38ebac7b059e84692f53e5938f97a9943c120d98 ${topdir}/build/gemmlowp/src/gemmlowp
+
+       mkdir -p ${topdir}/build/cub/src
+       unzip ${topdir}/build/downloads/1.8.0.zip -d ${topdir}/build/cub/src
+       mv ${topdir}/build/cub/src/cub-1.8.0 ${topdir}/build/cub/src/cub
+
+       mkdir -p ${topdir}/build/farmhash/src
+       tar -xf ${topdir}/build/downloads/816a4ae622e964763ca0862d9dbd19324a1eaf45.tar.gz -C ${topdir}/build/farmhash/src
+       mv ${topdir}/build/farmhash/src/farmhash-816a4ae622e964763ca0862d9dbd19324a1eaf45 ${topdir}/build/farmhash/src/farmhash
+
+       mkdir -p ${topdir}/build/fft2d/src
+       tar -xf ${topdir}/build/downloads/fft.tgz -C ${topdir}/build/fft2d/src
+       mv ${topdir}/build/fft2d/src/fft ${topdir}/build/fft2d/src/fft2d
+
+       mkdir -p ${topdir}/build/gif/src
+       tar -xf ${topdir}/build/downloads/giflib-5.1.4.tar.gz -C ${topdir}/build/gif/src
+       mv ${topdir}/build/gif/src/giflib-5.1.4 ${topdir}/build/gif/src/gif
+
+       mkdir -p ${topdir}/build/jpeg/src
+       tar -xf ${topdir}/build/downloads/jpegsrc.v9a.tar.gz -C ${topdir}/build/jpeg/src
+       mv ${topdir}/build/jpeg/src/jpeg-9a ${topdir}/build/jpeg/src/jpeg
+
+       mkdir -p ${topdir}/build/sqlite/src
+       unzip ${topdir}/build/downloads/sqlite-amalgamation-3230100.zip -d ${topdir}/build/sqlite/src
+       mv ${topdir}/build/sqlite/src/sqlite-amalgamation-3230100/ ${topdir}/build/sqlite/src/sqlite
+
+       sed -i "s|^# Options$$|# Options\nset_property(DIRECTORY PROPERTY EP_UPDATE_DISCONNECTED 1)|" tensorflow/contrib/cmake/CMakeLists.txt
+
+       sed -i "s|ExternalProject_Add(\\(.*\\)$$|ExternalProject_add(\\1\\n\\tDOWNLOAD_COMMAND echo\\n\\tUPDATE_DISCONNECTED 1\\n|" tensorflow/contrib/cmake/external/*.cmake
+
+       cd ${topdir}/build && cmake ../tensorflow/contrib/cmake -DCMAKE_INSTALL_PREFIX=/usr -DLIB_INSTALL_DIR=/usr/lib -DINCLUDE_INSTALL_DIR=/usr/include
+
+       printf 'PWD=`pwd`\n' > temp.sh
+       printf 'for F in *.cmake ; do\n' >> temp.sh
+       printf '\tsed -i "s|/qemu: Unsupported syscall: ...|/\"|" $${PWD}/$$F\n' >> temp.sh
+       printf '\tcat $${PWD}/$$F | tr '"'"'\\n'"'"' '"'"'\\r'"'"' | sed -e '"'"'s|qemu: Unsupported syscall: ...\\r/|  "|'"'"' | sed -e '"'"'s|qemu: Unsupported syscall: ...\\r||g'"'"' | tr '"'"'\\r'"'"' '"'"'\\n'"'"' > $${PWD}/$${F}_mod\n' >> temp.sh
+       printf '\tmv $${PWD}/$${F}_mod $${PWD}/$$F\n'>>temp.sh
+       printf 'done\n'>>temp.sh
+       printf 'for F in *.make ; do\n'>>temp.sh
+       printf '\tcat $${PWD}/$$F | tr '"'"'\\n'"'"' '"'"'\\r'"'"' | sed -e '"'"'s|/qemu: Unsupported syscall: ...\\r|/\" |'"'"' | sed -e '"'"'s|qemu: Unsupported syscall: ...\\r/|  -I"/|'"'"' | sed -e '"'"'s|qemu: Unsupported syscall: ...\\r||g'"'"' | tr '"'"'\\r'"'"' '"'"'\\n'"'"' > $${PWD}/$${F}_mod\n' >> temp.sh
+       printf '\tmv $${PWD}/$${F}_mod $${PWD}/$$F\n' >> temp.sh
+       printf 'done\n'>>temp.sh
+       chmod +x temp.sh
+
+       cd ${topdir}/build/CMakeFiles/pywrap_tensorflow_internal.dir && ${topdir}/temp.sh
+
+       cd ${topdir}/build && make
+
+       make -f tensorflow/contrib/lite/Makefile TARGET=TIZEN OS=LINUX TIZEN_CXXFLAGS="${CXXFLAGS}" TIZEN_CFLAGS="${CFLAGS}"
+
+install: build
+       dh_testdir
+       dh_testroot
+
+       install -d ${buildroot}
+       install -d ${buildroot}${_libdir}
+       install -d ${buildroot}${_libdir}/pkgconfig
+       install -d ${buildroot}${_includedir}/tensorflow/contrib/lite
+       install -d ${buildroot}${_includedir}/tensorflow/contrib/lite/kernels
+       install -d ${buildroot}${_includedir}/tensorflow/contrib/lite/tools
+       install -d ${buildroot}${_includedir}/tensorflow/contrib/lite/schema
+       install -d ${buildroot}${_includedir}/tensorflow/contrib/lite/profiling
+       install -d ${buildroot}${_includedir}/flatbuffers
+
+       install -m 0644 tensorflow/contrib/lite/gen/lib/libtensorflow-lite.a ${buildroot}${_libdir}/
+       install -m 0644 tensorflow/contrib/lite/*.h ${buildroot}${_includedir}/tensorflow/contrib/lite/
+       install -m 0644 tensorflow/contrib/lite/kernels/*.h ${buildroot}${_includedir}/tensorflow/contrib/lite/kernels
+       install -m 0644 tensorflow/contrib/lite/tools/*.h ${buildroot}${_includedir}/tensorflow/contrib/lite/tools
+       install -m 0644 tensorflow/contrib/lite/schema/*.h ${buildroot}${_includedir}/tensorflow/contrib/lite/schema
+       install -m 0644 tensorflow/contrib/lite/profiling/*.h ${buildroot}${_includedir}/tensorflow/contrib/lite/profiling
+       install -m 0644 tensorflow/contrib/lite/downloads/flatbuffers/include/flatbuffers/*.h ${buildroot}${_includedir}/flatbuffers
+       install -m 0644 tensorflow/contrib/lite/tensorflow-lite.pc.in ${buildroot}${_libdir}/pkgconfig/tensorflow-lite.pc
+
+       # Make pkgconfig file
+       sed -i -e "s:@libdir@:${_libdir}:g" -e "s:@includedir@:${_includedir}:g" ${buildroot}${_libdir}/pkgconfig/tensorflow-lite.pc
+
+       mkdir -p ${buildroot}${_libdir}/python2.7
+       cp -R -p ${topdir}/build/tf_python* ${buildroot}${_libdir}/python2.7
+       touch ${buildroot}${_libdir}/python2.7/tf_python/__init__.py
+       install -p -m 0755 ${topdir}/build/*.so ${buildroot}${_libdir}
+       find tensorflow -name "*.h" -exec dirname {} \; | uniq | xargs -I {} mkdir ${buildroot}${_includedir}/${name}/{} -p
+       find tensorflow -name "*.h" -exec cp {} ${buildroot}${_includedir}/${name}/{} -aPv \;
+       find third_party/eigen3/ -type f ! -name '*.cc' ! -name '*.cpp' ! -name '*.c' -exec dirname {} \; | uniq | xargs -I {} mkdir ${buildroot}${_includedir}/${name}/{} -p
+       find third_party/eigen3/ -type f ! -name '*.cc' ! -name '*.cpp' ! -name '*.c' -exec cp {} ${buildroot}${_includedir}/${name}/{} -aPv \;
+
+       cd ${topdir}/build && find tensorflow -name "*.h" -exec dirname {} \; | uniq | xargs -I {} bash -c 'if [ ! -d ${buildroot}${_includedir}/${name}/{} ] ; then mkdir ${buildroot}${_includedir}/${name}/{} -p ; fi'
+       cd ${topdir}/build && find tensorflow -name "*.h" -exec cp {} ${buildroot}${_includedir}/${name}/{} -aPv \;
+
+       cd ${topdir}/build/protobuf/src/protobuf/src/ && find google -name "*.h" -exec dirname {} \; | uniq | xargs -I {} mkdir ${buildroot}${_includedir}/${name}/{} -p
+       cd ${topdir}/build/protobuf/src/protobuf/src/ && find google -name "*.h" -exec cp {} ${buildroot}${_includedir}/${name}/{} -aPv \;
+
+       cd ${topdir}/build/ && cp -R -p eigen/src/eigen/Eigen ${buildroot}${_includedir}/${name}/
+       cd ${topdir}/build/ && cp -R -p eigen/src/eigen ${buildroot}${_includedir}/${name}/
+
+       cd ${topdir}/build/protobuf/src/protobuf/src/ && find google -name "*.h" -exec dirname {} \; | uniq | xargs -I {} mkdir ${buildroot}${_includedir}/${name}/{} -p
+       cd ${topdir}/build/protobuf/src/protobuf/src/ && find google -name "*.h" -exec cp {} ${buildroot}${_includedir}/${name}/{} -aPv \;
+
+       cd ${topdir}/build/eigen/src/eigen && find . -type f ! -name '*.cc' ! -name '*.cpp' ! -name '*.c' -exec dirname {} \; | uniq | xargs -I {} bash -c 'if [ ! -d ${buildroot}${_includedir}/${name}/third_party/eigen3/{} ] ; then mkdir ${buildroot}${_includedir}/${name}/third_party/eigen3/{} -p ; fi'
+       cd ${topdir}/build/eigen/src/eigen && find . -type f ! -name  '*.cc' ! -name '*.cpp' ! -name '*.c' -exec cp {} ${buildroot}${_includedir}/${name}/third_party/eigen3/{} -aPv \;
+
+       cd ${topdir}/build && cp -p nsync/install/include/*.h ${buildroot}${_includedir}/${name}/
+
+       cd ${topdir}/build && cp -p tensorflow.pc ${buildroot}${_libdir}/pkgconfig/
+
+binary: build install
+       dh_testdir
+       dh_testroot
+       dh_installdocs
+       dh_install --sourcedir=debian/tmp
+       dh_strip
+       dh_gencontrol
+       dh_md5sums
+       dh_builddeb
+
+clean:
+       dh_testdir
+       dh_testroot
+       make -f tensorflow/contrib/lite/Makefile TARGET=TIZEN OS=LINUX clean
+       dh_clean
diff --git a/debian/tensorflow-dev.install b/debian/tensorflow-dev.install
new file mode 100644 (file)
index 0000000..a69f066
--- /dev/null
@@ -0,0 +1,9 @@
+/usr/include/tensorflow/*.h
+/usr/include/tensorflow/eigen
+/usr/include/tensorflow/Eigen
+/usr/include/tensorflow/google
+/usr/include/tensorflow/tensorflow
+/usr/include/tensorflow/third_party
+/usr/lib/*.so
+/usr/lib/pkgconfig/tensorflow.pc
+/usr/lib/python2.7/*
diff --git a/debian/tensorflow-lite-dev.install b/debian/tensorflow-lite-dev.install
new file mode 100644 (file)
index 0000000..3e57f6b
--- /dev/null
@@ -0,0 +1,4 @@
+/usr/include/flatbuffers
+/usr/include/tensorflow/contrib/lite
+/usr/lib/libtensorflow-lite.a
+/usr/lib/pkgconfig/tensorflow-lite.pc
diff --git a/packaging/double_conversion.tar.gz b/packaging/double_conversion.tar.gz
new file mode 100644 (file)
index 0000000..6fc7c97
Binary files /dev/null and b/packaging/double_conversion.tar.gz differ
diff --git a/packaging/downloads.tar.gz b/packaging/downloads.tar.gz
new file mode 100644 (file)
index 0000000..8307d84
Binary files /dev/null and b/packaging/downloads.tar.gz differ
diff --git a/packaging/grpc.tar.gz.00 b/packaging/grpc.tar.gz.00
new file mode 100644 (file)
index 0000000..7608b8a
Binary files /dev/null and b/packaging/grpc.tar.gz.00 differ
diff --git a/packaging/grpc.tar.gz.01 b/packaging/grpc.tar.gz.01
new file mode 100644 (file)
index 0000000..bf2bf84
Binary files /dev/null and b/packaging/grpc.tar.gz.01 differ
diff --git a/packaging/grpc.tar.gz.02 b/packaging/grpc.tar.gz.02
new file mode 100644 (file)
index 0000000..ecfdf88
Binary files /dev/null and b/packaging/grpc.tar.gz.02 differ
diff --git a/packaging/grpc.tar.gz.03 b/packaging/grpc.tar.gz.03
new file mode 100644 (file)
index 0000000..f7d096b
Binary files /dev/null and b/packaging/grpc.tar.gz.03 differ
diff --git a/packaging/grpc.tar.gz.04 b/packaging/grpc.tar.gz.04
new file mode 100644 (file)
index 0000000..9ab148a
Binary files /dev/null and b/packaging/grpc.tar.gz.04 differ
diff --git a/packaging/grpc.tar.gz.05 b/packaging/grpc.tar.gz.05
new file mode 100644 (file)
index 0000000..07b2020
Binary files /dev/null and b/packaging/grpc.tar.gz.05 differ
diff --git a/packaging/grpc.tar.gz.06 b/packaging/grpc.tar.gz.06
new file mode 100644 (file)
index 0000000..7c2df6a
Binary files /dev/null and b/packaging/grpc.tar.gz.06 differ
diff --git a/packaging/grpc.tar.gz.07 b/packaging/grpc.tar.gz.07
new file mode 100644 (file)
index 0000000..3a4a89d
Binary files /dev/null and b/packaging/grpc.tar.gz.07 differ
diff --git a/packaging/grpc.tar.gz.08 b/packaging/grpc.tar.gz.08
new file mode 100644 (file)
index 0000000..f14f9ec
Binary files /dev/null and b/packaging/grpc.tar.gz.08 differ
diff --git a/packaging/highwayhash.tar.gz b/packaging/highwayhash.tar.gz
new file mode 100644 (file)
index 0000000..0c8e3c2
Binary files /dev/null and b/packaging/highwayhash.tar.gz differ
diff --git a/packaging/jsoncpp.tar.gz b/packaging/jsoncpp.tar.gz
new file mode 100644 (file)
index 0000000..8efc18a
Binary files /dev/null and b/packaging/jsoncpp.tar.gz differ
diff --git a/packaging/nsync.tar.gz b/packaging/nsync.tar.gz
new file mode 100644 (file)
index 0000000..bc26f9f
Binary files /dev/null and b/packaging/nsync.tar.gz differ
diff --git a/packaging/protobuf.tar.gz.00 b/packaging/protobuf.tar.gz.00
new file mode 100644 (file)
index 0000000..9708dab
Binary files /dev/null and b/packaging/protobuf.tar.gz.00 differ
diff --git a/packaging/protobuf.tar.gz.01 b/packaging/protobuf.tar.gz.01
new file mode 100644 (file)
index 0000000..06ebf12
Binary files /dev/null and b/packaging/protobuf.tar.gz.01 differ
diff --git a/packaging/re2.tar.gz b/packaging/re2.tar.gz
new file mode 100644 (file)
index 0000000..722ece3
Binary files /dev/null and b/packaging/re2.tar.gz differ
diff --git a/packaging/snappy.tar.gz b/packaging/snappy.tar.gz
new file mode 100644 (file)
index 0000000..1bcd15f
Binary files /dev/null and b/packaging/snappy.tar.gz differ
diff --git a/packaging/tensorflow.manifest b/packaging/tensorflow.manifest
new file mode 100644 (file)
index 0000000..017d22d
--- /dev/null
@@ -0,0 +1,5 @@
+<manifest>
+ <request>
+    <domain name="_"/>
+ </request>
+</manifest>
diff --git a/packaging/tensorflow.pc.in b/packaging/tensorflow.pc.in
new file mode 100644 (file)
index 0000000..8a95d1c
--- /dev/null
@@ -0,0 +1,10 @@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=${prefix}
+libdir=@LIB_INSTALL_DIR@
+includedir=@INCLUDE_INSTALL_DIR@/tensorflow
+
+Name: @SERVICE_NAME@
+Description: @PACKAGE_DESCRIPTION@
+Version: @VERSION@
+Libs: -L${libdir} -lpywrap_tensorflow_internal
+Cflags: -I${includedir}
diff --git a/packaging/tensorflow.spec b/packaging/tensorflow.spec
new file mode 100644 (file)
index 0000000..58ccd83
--- /dev/null
@@ -0,0 +1,382 @@
+Name:       tensorflow
+Summary:    Tensorflow
+Version:    v1.13.1
+Release:    1
+License:    Apache-2.0
+Source0:    %{name}-%{version}.tar.gz
+Source1001:     tensorflow.manifest
+Source20010:    grpc.tar.gz.00
+Source20011:    grpc.tar.gz.01
+Source20012:    grpc.tar.gz.02
+Source20013:    grpc.tar.gz.03
+Source20014:    grpc.tar.gz.04
+Source20015:    grpc.tar.gz.05
+Source20016:    grpc.tar.gz.06
+Source20017:    grpc.tar.gz.07
+Source20018:    grpc.tar.gz.08
+Source2002:     highwayhash.tar.gz
+Source2003:     jsoncpp.tar.gz
+Source2004:     nsync.tar.gz
+Source20050:    protobuf.tar.gz.00
+Source20051:    protobuf.tar.gz.01
+Source2006:     re2.tar.gz
+Source2007:     snappy.tar.gz
+Source2008:     zlib.tar.gz
+Source2009:     double_conversion.tar.gz
+Source3001:     downloads.tar.gz
+Source4001:     tensorflow.pc.in
+
+BuildRequires:  pkgconfig(zlib)
+BuildRequires:  pkgconfig(gmock)
+
+%ifarch %arm aarch64 x86_64
+BuildRequires:  unzip
+BuildRequires:  cmake
+BuildRequires:  swig
+BuildRequires:  python = 2.7
+BuildRequires:  libpython
+BuildRequires:  python-numpy
+BuildRequires:  python-numpy-devel
+BuildRequires:  python-devel
+%endif
+
+%description
+TensorFlow is an open source software library for numerical computation using
+data flow graphs. Nodes in the graph represent mathematical operations, while
+the graph edges represent the multidimensional data arrays (tensors)
+communicated between them. The flexible architecture allows you to deploy
+computation to one or more CPUs or GPUs in a desktop, server, or mobile device
+with a single API. TensorFlow was originally developed by researchers and
+engineers working on the Google Brain Team within Google's Machine Intelligence
+research organization for the purposes of conducting machine learning and deep
+neural networks research, but the system is general enough to be applicable in
+a wide variety of other domains as well.
+
+%{!?tflite_single_build: %define tflite_single_build 1}
+
+%ifarch %arm aarch64 x86_64
+%package devel
+Summary:        Tensorflow devel packages
+Group:          Development/Libraries
+Requires:       %{name} = %{version}-%{release}
+
+# Note that there are different versions between Tizen (tf1.7) and TAOS (tf1.4) repositories.
+# In this case, let's specify different version and postfix (e.g., -taos) with "Provides"
+# to classify a different version from redundant package names.
+Provides:       %{name}-devel = %{version}
+Provides:       %{name}-devel-taos = %{version}
+
+%description devel
+TensorFlow is an open source software library for numerical computation using
+data flow graphs.
+%endif
+
+%package -n tensorflow-lite-devel
+Summary: Tensorflow Lite development headers and object file
+
+%description -n tensorflow-lite-devel
+Tensorflow Lite development headers and object file
+
+%prep
+%setup -q
+
+%ifarch %arm aarch64 x86_64
+cp %{SOURCE1001} .
+cp %{SOURCE4001} ./tensorflow/contrib/cmake/
+
+# Make it think git is there and returns OK in GBS/OBS environment
+cat << EOF > ./git
+#!/bin/sh
+echo "git version 2.7.4"
+EOF
+chmod a+x ./git
+export PATH=${PATH}:`pwd`
+
+mkdir -p build
+pushd build
+
+cat %{SOURCE20010} %{SOURCE20011} %{SOURCE20012} %{SOURCE20013} %{SOURCE20014} %{SOURCE20015} %{SOURCE20016} %{SOURCE20017} %{SOURCE20018} > grpc.tar.gz
+mkdir -p grpc/src
+pushd grpc/src
+tar -xf ../../grpc.tar.gz
+popd
+
+mkdir -p highwayhash/src
+pushd highwayhash/src
+tar -xf %{SOURCE2002}
+popd
+
+mkdir -p jsoncpp/src
+pushd jsoncpp/src
+tar -xf %{SOURCE2003}
+popd
+
+mkdir -p nsync/src
+pushd nsync/src
+tar -xf %{SOURCE2004}
+popd
+
+cat %{SOURCE20050} %{SOURCE20051} > protobuf.tar.gz
+mkdir -p protobuf/src
+pushd protobuf/src
+tar -xf ../../protobuf.tar.gz
+popd
+
+mkdir -p re2/src
+pushd re2/src
+tar -xf %{SOURCE2006}
+popd
+
+mkdir -p snappy/src
+pushd snappy/src
+tar -xf %{SOURCE2007}
+popd
+
+mkdir -p zlib/src
+pushd zlib/src
+tar -xf %{SOURCE2008}
+popd
+
+mkdir -p double_conversion/src
+pushd double_conversion/src
+tar -xf %{SOURCE2009}
+popd
+
+tar -xf %{SOURCE3001}
+
+mkdir -p eigen/src
+pushd eigen/src
+tar -xf ../../downloads/6913f0cf7d06.tar.gz
+mv eigen-eigen-6913f0cf7d06 eigen
+popd
+
+mkdir -p lmdb/src
+pushd lmdb/src
+tar -xf ../../downloads/LMDB_0.9.19.tar.gz
+mv lmdb-LMDB_0.9.19 lmdb
+popd
+
+mkdir -p png/src
+pushd png/src
+tar -xf ../../downloads/v1.6.34.tar.gz
+mv libpng-1.6.34 png
+popd
+
+mkdir -p gemmlowp/src
+pushd gemmlowp/src
+unzip ../../downloads/38ebac7b059e84692f53e5938f97a9943c120d98.zip
+mv gemmlowp-38ebac7b059e84692f53e5938f97a9943c120d98 gemmlowp
+popd
+
+mkdir -p cub/src
+pushd cub/src
+unzip ../../downloads/1.8.0.zip
+mv cub-1.8.0 cub
+popd
+
+mkdir -p farmhash/src
+pushd farmhash/src
+tar -xf ../../downloads/816a4ae622e964763ca0862d9dbd19324a1eaf45.tar.gz
+mv farmhash-816a4ae622e964763ca0862d9dbd19324a1eaf45 farmhash
+popd
+
+mkdir -p fft2d/src
+pushd fft2d/src
+tar -xf ../../downloads/fft.tgz
+mv fft fft2d
+popd
+
+mkdir -p gif/src
+pushd gif/src
+tar -xf ../../downloads/giflib-5.1.4.tar.gz
+mv giflib-5.1.4 gif
+popd
+
+mkdir -p jpeg/src
+pushd jpeg/src
+tar -xf ../../downloads/jpegsrc.v9a.tar.gz
+mv jpeg-9a jpeg
+popd
+
+mkdir -p sqlite/src
+pushd sqlite/src
+unzip ../../downloads/sqlite-amalgamation-3230100.zip
+mv sqlite-amalgamation-3230100/ sqlite
+popd
+
+popd
+
+# Disable auto update with CMAKE ExternalProject
+sed -i "s|^# Options$|# Options\nset_property(DIRECTORY PROPERTY EP_UPDATE_DISCONNECTED 1)|" tensorflow/contrib/cmake/CMakeLists.txt
+
+sed -i "s|ExternalProject_Add(\\(.*\\)$|ExternalProject_add(\\1\\n\\tDOWNLOAD_COMMAND echo\\n\\tUPDATE_DISCONNECTED 1\\n|" tensorflow/contrib/cmake/external/*.cmake
+
+%ifarch aarch64
+# Update farmhash to support aarch64
+sed -i "s|^    arm.:Linux:|    aarch64:Linux:*:*)\n        echo \$\{UNAME_MACHINE\}-unknown-linux-gnu\n        exit ;;\n    arm*:Linux:|" build/farmhash/src/farmhash/config.guess
+sed -i "s|set(farmhash_HASH.*||" tensorflow/contrib/cmake/external/farmhash.cmake
+%endif
+
+# It appears that our emulator-i586/686 has error with CPU feature (SSE)
+%ifarch i586 i686
+sed -i "s|LOG(FATAL)|LOG(WARNING)|" tensorflow/core/platform/cpu_feature_guard.cc
+%endif
+
+%build
+
+%if "%{tflite_single_build}" == "0"
+
+export PATH=${PATH}:`pwd`
+# Downgrade compiler flags for google code.
+CFLAGS=`echo $CFLAGS | sed -e "s|-Wformat-security||"`
+CXXFLAGS=`echo $CXXFLAGS | sed -e "s|-Wformat-security||"`
+CFLAGS=`echo $CFLAGS | sed -e "s|-Wall|-Wno-sign-compare -Wno-unused-but-set-variable -Wno-format-security -Wno-format|"`
+CXXFLAGS=`echo $CXXFLAGS | sed -e "s|-Wall|-Wno-sign-compare -Wno-unused-but-set-variable -Wno-format-security -Wno-format|"`
+
+%ifarch %ix86
+# For emulator env, disable advanced SSE, which required modern qemu (if SDK/Infra upgrade qemu, we can ignore this
+CFLAGS="${CFLAGS} -m32 -march=i686 -mtune=i686 -mfpmath=sse -fasynchronous-unwind-tables -fno-omit-frame-pointer -mno-sse -mno-sse2 -mno-sse3 -mno-sse4.1 -mno-sse4.2 -mno-avx"
+CXXFLAGS="${CXXFLAGS} -m32 -march=i686 -mtune=i686 -mfpmath=sse -fasynchronous-unwind-tables -fno-omit-frame-pointer -mno-sse -mno-sse2 -mno-sse3 -mno-sse4.1 -mno-sse4.2 -mno-avx"
+%endif
+
+%ifarch %arm arm armv7l
+CFLAGS="${CFLAGS} -DARM_NON_MOBILE -mfpu=neon -mno-unaligned-access"
+CXXFLAGS="${CXXFLAGS} -DARM_NON_MOBILE -mfpu=neon -mno-unaligned-access"
+%endif
+
+pushd build
+# Seems some arguments of %%cmake is causing errors.
+cmake ../tensorflow/contrib/cmake -DCMAKE_INSTALL_PREFIX=/usr -DLIB_INSTALL_DIR=/usr/lib -DINCLUDE_INSTALL_DIR=/usr/include
+
+# QEMU unsupported syscall error is being writtin into .cmake files
+pushd CMakeFiles/pywrap_tensorflow_internal.dir
+for F in *.cmake ; do
+  sed -i "s|/qemu: Unsupported syscall: ...|/\"|" $F
+  cat $F | tr '\n' '\r' | sed -e 's|qemu: Unsupported syscall: ...\r/|  "/|' | sed -e 's|qemu: Unsupported syscall: ...\r||g' | tr '\r' '\n' > ${F}_mod
+  mv ${F}_mod $F
+done
+for F in *.make ; do
+  cat $F | tr '\n' '\r' | sed -e 's|/qemu: Unsupported syscall: ...\r|/\" |' | sed -e 's|qemu: Unsupported syscall: ...\r/|  -I"/|' | sed -e 's|qemu: Unsupported syscall: ...\r||g' | tr '\r' '\n' > ${F}_mod
+  mv ${F}_mod $F
+done
+popd
+
+# Note that '-jN' option can sometimes generate a intermittent build error.
+# In case of the "-l N" option, it is heuristice value to avoid Out-Of-Memory(OOM)
+# by reading /proc/loadavg while building source code with '-jN'.
+# %maxp_cpu: let's subtract 1 from #CPUs for user responsibility
+# %max_load: let's use CPU resource until 50% to avoid OOM situation
+# VM Guest OS Spec of SPIN-OBS Server: 4CPUs (Intel), 6GB RAM (DDR3)
+%define max_cpus "$((`getconf _NPROCESSORS_ONLN`-1))"
+%define max_load "$((`getconf _NPROCESSORS_ONLN`*20/100))"
+make -j%{?max_cpus} -l %{max_load}
+popd
+
+%endif
+
+%endif
+
+# build for tensorflow lite
+%ifarch arm armv7l aarch64
+make -f tensorflow/lite/tools/make/Makefile TARGET=TIZEN TARGET_ARCH=%{_target_cpu} TIZEN_CXXFLAGS="${CXXFLAGS} -D__ARM_NEON" TIZEN_CFLAGS="${CFLAGS} -D__ARM_NEON"
+%else
+make -f tensorflow/lite/tools/make/Makefile TARGET=TIZEN TARGET_ARCH=%{_target_cpu} TIZEN_CXXFLAGS="${CXXFLAGS}" TIZEN_CFLAGS="${CFLAGS}"
+%endif
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%install
+
+%if "%{tflite_single_build}" == "0"
+%ifarch %arm aarch64 x86_64
+pushd build
+mkdir -p %{buildroot}%{_libdir}
+mkdir -p %{buildroot}%{python_sitelib}
+cp -R -p tf_python/* %{buildroot}%{python_sitelib}
+install -p -m 0755 *.so %{buildroot}%{_libdir}
+popd
+
+find tensorflow -name "*.h" -exec dirname {} \; | uniq | xargs -I {} mkdir %{buildroot}%{_includedir}/%{name}/{} -p
+find tensorflow -name "*.h" -exec cp {} %{buildroot}%{_includedir}/%{name}/{} -aPv \;
+
+find third_party/eigen3/ -type f ! -name '*.cc' ! -name '*.cpp' ! -name '*.c' -exec dirname {} \; | uniq | xargs -I {} mkdir %{buildroot}%{_includedir}/%{name}/{} -p
+find third_party/eigen3/ -type f ! -name '*.cc' ! -name '*.cpp' ! -name '*.c' -exec cp {} %{buildroot}%{_includedir}/%{name}/{} -aPv \;
+
+pushd build
+
+find tensorflow -name "*.h" -exec dirname {} \; | uniq | xargs -I {} bash -c 'if [ ! -d %{buildroot}%{_includedir}/%{name}/{} ] ; then mkdir %{buildroot}%{_includedir}/%{name}/{} -p ; fi'
+find tensorflow -name "*.h" -exec cp {} %{buildroot}%{_includedir}/%{name}/{} -aPv \;
+
+pushd protobuf/src/protobuf/src
+find google -name "*.h" -exec dirname {} \; | uniq | xargs -I {} mkdir %{buildroot}%{_includedir}/%{name}/{} -p
+find google -name "*.h" -exec cp {} %{buildroot}%{_includedir}/%{name}/{} -aPv \;
+popd
+
+cp -R -p eigen/src/eigen/Eigen %{buildroot}%{_includedir}/%{name}/
+cp -R -p eigen/src/eigen %{buildroot}%{_includedir}/%{name}/
+
+pushd protobuf/src/protobuf/src
+find google -name "*.h" -exec dirname {} \; | uniq | xargs -I {} mkdir %{buildroot}%{_includedir}/%{name}/{} -p
+find google -name "*.h" -exec cp {} %{buildroot}%{_includedir}/%{name}/{} -aPv \;
+popd
+
+pushd eigen/src/eigen
+find . -type f ! -name '*.cc' ! -name '*.cpp' ! -name '*.c' -exec dirname {} \; | uniq | xargs -I {} bash -c 'if [ ! -d %{buildroot}%{_includedir}/%{name}/third_party/eigen3/{} ] ; then mkdir %{buildroot}%{_includedir}/%{name}/third_party/eigen3/{} -p ; fi'
+find . -type f ! -name  '*.cc' ! -name '*.cpp' ! -name '*.c' -exec cp {} %{buildroot}%{_includedir}/%{name}/third_party/eigen3/{} -aPv \;
+popd
+
+cp -p nsync/install/include/*.h %{buildroot}%{_includedir}/%{name}/
+
+mkdir %{buildroot}%{_libdir}/pkgconfig/
+cp -p tensorflow.pc %{buildroot}%{_libdir}/pkgconfig/
+popd
+%endif
+%endif
+
+#install for tensorflow lite
+mkdir -p %{buildroot}%{_libdir}
+mkdir -p %{buildroot}%{_libdir}/pkgconfig
+mkdir -p %{buildroot}%{_includedir}/tensorflow/contrib/lite
+mkdir -p %{buildroot}%{_includedir}/tensorflow/contrib/lite/kernels
+mkdir -p %{buildroot}%{_includedir}/tensorflow/contrib/lite/tools
+mkdir -p %{buildroot}%{_includedir}/tensorflow/contrib/lite/schema
+mkdir -p %{buildroot}%{_includedir}/tensorflow/contrib/lite/profiling
+mkdir -p %{buildroot}%{_includedir}/flatbuffers
+
+sed -i 's:@libdir@:%{_libdir}:g
+       s:@includedir@:%{_includedir}:g' tensorflow/contrib/lite/tensorflow-lite.pc.in
+
+install -m 0644 tensorflow/contrib/lite/tools/make/gen/TIZEN_%{_target_cpu}/lib/libtensorflow-lite.a %{buildroot}%{_libdir}/
+install -m 0644 tensorflow/contrib/lite/*.h %{buildroot}%{_includedir}/tensorflow/contrib/lite/
+install -m 0644 tensorflow/contrib/lite/kernels/*.h %{buildroot}%{_includedir}/tensorflow/contrib/lite/kernels
+install -m 0644 tensorflow/contrib/lite/tools/*.h %{buildroot}%{_includedir}/tensorflow/contrib/lite/tools
+install -m 0644 tensorflow/contrib/lite/schema/*.h %{buildroot}%{_includedir}/tensorflow/contrib/lite/schema
+install -m 0644 tensorflow/contrib/lite/profiling/*.h %{buildroot}%{_includedir}/tensorflow/contrib/lite/profiling
+install -m 0644 tensorflow/contrib/lite/tools/make/downloads/flatbuffers/include/flatbuffers/*.h %{buildroot}%{_includedir}/flatbuffers
+install -m 0644 tensorflow/contrib/lite/tensorflow-lite.pc.in %{buildroot}%{_libdir}/pkgconfig/tensorflow-lite.pc
+
+
+%if "%{tflite_single_build}" == "0"
+%files
+%ifarch %arm aarch64 x86_64
+%manifest tensorflow.manifest
+%{_libdir}/*.so
+%{python_sitelib}/tensorflow
+%{python_sitelib}/tensorflow/*
+%endif
+%endif
+
+%ifarch %arm aarch64 x86_64
+%files devel
+%manifest %{name}.manifest
+%defattr(-, root, root)
+%{_includedir}/%{name}
+%{_libdir}/pkgconfig/*
+%endif
+
+%files -n tensorflow-lite-devel
+%{_libdir}/libtensorflow-lite.a
+%{_libdir}/pkgconfig/tensorflow-lite.pc
+%{_includedir}/tensorflow/contrib/lite
+%{_includedir}/flatbuffers
diff --git a/packaging/tf_core_framework_patch.txt b/packaging/tf_core_framework_patch.txt
new file mode 100644 (file)
index 0000000..b544763
--- /dev/null
@@ -0,0 +1,10 @@
+--- tensorflow/contrib/cmake/tf_core_framework.cmake.org       2018-08-06 15:23:36.821538872 +0900
++++ tensorflow/contrib/cmake/tf_core_framework.cmake   2018-08-06 13:51:39.762504016 +0900
+@@ -127,6 +127,7 @@
+     "${tensorflow_source_dir}/tensorflow/core/*.proto"
+     "${tensorflow_source_dir}/tensorflow/contrib/boosted_trees/proto/*.proto"
+     "${tensorflow_source_dir}/tensorflow/contrib/tpu/proto/*.proto"
++    "${tensorflow_source_dir}/tensorflow/python/framework/*.proto"
+ )
+ RELATIVE_PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS
diff --git a/packaging/zlib.tar.gz b/packaging/zlib.tar.gz
new file mode 100644 (file)
index 0000000..800fabf
Binary files /dev/null and b/packaging/zlib.tar.gz differ
index 32e6d78e508e25f76bd263e9d52b6574ca315f6c..1ee8eea4118afae745f575dc1acf2707e2bcee66 100644 (file)
@@ -58,6 +58,7 @@ ExternalProject_Add(png
         -DCMAKE_BUILD_TYPE:STRING=Release
         -DCMAKE_VERBOSE_MAKEFILE:BOOL=OFF
         -DCMAKE_INSTALL_PREFIX:STRING=${png_INSTALL}
+        -DCMAKE_INSTALL_LIBDIR:PATH=${CMAKE_BINARY_DIR}/png/install/lib
        -DZLIB_ROOT:STRING=${ZLIB_INSTALL}
   -DPNG_TESTS:BOOL=OFF
 )