Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 1 | # Copyright (c) 2015 Cisco and/or its affiliates. |
| 2 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 3 | # you may not use this file except in compliance with the License. |
| 4 | # You may obtain a copy of the License at: |
| 5 | # |
| 6 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 7 | # |
| 8 | # Unless required by applicable law or agreed to in writing, software |
| 9 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 | # See the License for the specific language governing permissions and |
| 12 | # limitations under the License. |
| 13 | |
| 14 | # Pick up per-platform makefile fragments |
| 15 | $(foreach d,$(SOURCE_PATH_BUILD_DATA_DIRS), \ |
| 16 | $(eval -include $(d)/platforms/*.mk)) |
| 17 | |
| 18 | .PHONY: install-deb |
| 19 | install-deb: $(patsubst %,%-find-source,$(ROOT_PACKAGES)) |
| 20 | @$(BUILD_ENV) ; \ |
| 21 | set -eu$(BUILD_DEBUG) ; \ |
| 22 | $(MAKE) -C $(MU_BUILD_ROOT_DIR) \ |
| 23 | $(patsubst %,%-install, \ |
| 24 | $(ROOT_PACKAGES)) || exit 1; \ |
| 25 | \ |
| 26 | : generate file manifests ; \ |
| 27 | find $(INSTALL_PREFIX)$(ARCH)/*/bin -type f -print \ |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 28 | | sed -e 's:.*:../& /usr/bin:' | grep -v vppapigen \ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 29 | > deb/debian/vpp.install ; \ |
Dave Barach | 1c11311 | 2016-02-03 12:59:38 -0500 | [diff] [blame] | 30 | \ |
Ole Troan | f14e3bf | 2016-12-01 21:49:03 +0100 | [diff] [blame] | 31 | : core api definitions ; \ |
| 32 | ./scripts/find-api-core-contents $(INSTALL_PREFIX)$(ARCH) \ |
| 33 | deb/debian/vpp.install ; \ |
| 34 | \ |
Dave Barach | 1c11311 | 2016-02-03 12:59:38 -0500 | [diff] [blame] | 35 | : need symbolic links in the lib pkg ; \ |
| 36 | find $(INSTALL_PREFIX)$(ARCH)/*/lib* \( -type f -o -type l \) \ |
| 37 | -print | egrep -e '*\.so\.*\.*\.*' \ |
Damjan Marion | ad476c7 | 2016-07-13 13:42:33 +0200 | [diff] [blame] | 38 | | grep -v plugins\/ \ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 39 | | sed -e 's:.*:../& /usr/lib/x86_64-linux-gnu:' \ |
| 40 | > deb/debian/vpp-lib.install ; \ |
| 41 | \ |
Ole Troan | f14e3bf | 2016-12-01 21:49:03 +0100 | [diff] [blame] | 42 | : vnet api definitions ; \ |
| 43 | ./scripts/find-api-lib-contents $(INSTALL_PREFIX)$(ARCH) \ |
| 44 | deb/debian/vpp-lib.install ; \ |
| 45 | \ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 46 | : dev package ; \ |
| 47 | ./scripts/find-dev-contents $(INSTALL_PREFIX)$(ARCH) \ |
| 48 | deb/debian/vpp-dev.install ; \ |
| 49 | \ |
Damjan Marion | ad476c7 | 2016-07-13 13:42:33 +0200 | [diff] [blame] | 50 | : plugins package ; \ |
| 51 | ./scripts/find-plugins-contents $(INSTALL_PREFIX)$(ARCH) \ |
| 52 | deb/debian/vpp-plugins.install ; \ |
| 53 | \ |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 54 | : vpp-api-lua package ; \ |
| 55 | ./scripts/find-vpp-api-lua-contents $(INSTALL_PREFIX)$(ARCH) \ |
| 56 | deb/debian/vpp-api-lua.install ; \ |
| 57 | \ |
| 58 | : vpp-api-java package ; \ |
| 59 | ./scripts/find-vpp-api-java-contents $(INSTALL_PREFIX)$(ARCH) \ |
| 60 | deb/debian/vpp-api-java.install ; \ |
| 61 | \ |
| 62 | : vpp-api-python package ; \ |
| 63 | ./scripts/find-vpp-api-python-contents $(INSTALL_PREFIX)$(ARCH) \ |
| 64 | deb/debian/vpp-api-python.install ; \ |
Ed Warnicke | 6ce685d | 2016-10-28 22:52:36 +0000 | [diff] [blame] | 65 | \ |
Dave Barach | 7457422 | 2016-02-01 12:05:52 -0500 | [diff] [blame] | 66 | : dpdk headers ; \ |
| 67 | ./scripts/find-dpdk-contents $(INSTALL_PREFIX)$(ARCH) \ |
| 68 | deb/debian/vpp-dpdk-dev.install ; \ |
| 69 | \ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 70 | : bin package needs startup config ; \ |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 71 | echo ../../src/vpp/conf/startup.conf /etc/vpp \ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 72 | >> deb/debian/vpp.install ; \ |
| 73 | \ |
| 74 | : and sysctl config ; \ |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 75 | echo ../../src/vpp/conf/80-vpp.conf /etc/sysctl.d \ |
Padraig Connolly | d995c75 | 2016-11-29 17:17:20 +0000 | [diff] [blame] | 76 | >> deb/debian/vpp.install ; \ |
| 77 | \ |
| 78 | : bash completion for vppctl ; \ |
| 79 | echo ../../src/scripts/vppctl_completion /etc/bash_completion.d \ |
| 80 | >> deb/debian/vpp.install ; \ |
| 81 | \ |
| 82 | : move dictionary of vppctl commands ; \ |
| 83 | echo ../docs/siphon_docs/clicmd.itemlist /usr/share/vpp \ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 84 | >> deb/debian/vpp.install ; \ |
| 85 | \ |
| 86 | : dev package needs a couple of additions ; \ |
Damjan Marion | 0be5ec3 | 2016-12-28 17:51:56 +0100 | [diff] [blame] | 87 | echo ../$(INSTALL_PREFIX)$(ARCH)/vpp/bin/vppapigen /usr/bin \ |
Ole Troan | 5f9dcff | 2016-08-01 04:59:13 +0200 | [diff] [blame] | 88 | >> deb/debian/vpp-dev.install ; \ |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 89 | echo ../../src/vpp-api/java/jvpp/gen/jvpp_gen.py /usr/bin \ |
Ole Troan | 5f9dcff | 2016-08-01 04:59:13 +0200 | [diff] [blame] | 90 | >> deb/debian/vpp-dev.install ; \ |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 91 | for i in $$(ls ../src/vpp-api/java/jvpp/gen/jvppgen/*.py); do \ |
Ole Troan | 5f9dcff | 2016-08-01 04:59:13 +0200 | [diff] [blame] | 92 | echo ../$${i} /usr/lib/python2.7/dist-packages/jvppgen \ |
| 93 | >> deb/debian/vpp-dev.install; \ |
| 94 | done; \ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 95 | \ |
| 96 | : generate changelog; \ |
| 97 | ./scripts/generate-deb-changelog \ |
| 98 | \ |
| 99 | : Go fabricate the actual Debian packages ; \ |
| 100 | ( \ |
| 101 | cd deb && \ |
| 102 | dpkg-buildpackage -us -uc -b \ |
| 103 | ) |
| 104 | |
| 105 | .PHONY: install-rpm |
| 106 | install-rpm: $(patsubst %,%-find-source,$(ROOT_PACKAGES)) |
| 107 | @$(BUILD_ENV) ; \ |
| 108 | set -eu$(BUILD_DEBUG) ; \ |
| 109 | $(MAKE) -C $(MU_BUILD_ROOT_DIR) \ |
| 110 | $(patsubst %,%-install, \ |
| 111 | $(ROOT_PACKAGES)) || exit 1; \ |
| 112 | \ |
| 113 | cd rpm ; \ |
Thomas F Herbert | 20a29c7 | 2016-10-13 18:36:50 -0400 | [diff] [blame] | 114 | mkdir -p SOURCES ; \ |
| 115 | if test -f *.tar.gz ; then mv *.tar.gz SOURCES ; fi ; \ |
Sachin | 693b702 | 2016-06-18 15:28:08 +0530 | [diff] [blame] | 116 | rpmbuild -bb --define "_topdir $$PWD" --define \ |
Thomas F Herbert | 20a29c7 | 2016-10-13 18:36:50 -0400 | [diff] [blame] | 117 | "_install_dir $(INSTALL_PREFIX)$(ARCH)" \ |
| 118 | --define "_mu_build_root_dir $(MU_BUILD_ROOT_DIR)" \ |
| 119 | vpp.spec ; \ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 120 | mv $$(find RPMS -name \*.rpm -type f) .. |
| 121 | |