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 \ |
| 28 | | sed -e 's:.*:../& /usr/bin:' \ |
| 29 | > deb/debian/vpp.install ; \ |
Dave Barach | 1c11311 | 2016-02-03 12:59:38 -0500 | [diff] [blame] | 30 | \ |
| 31 | : need symbolic links in the lib pkg ; \ |
| 32 | find $(INSTALL_PREFIX)$(ARCH)/*/lib* \( -type f -o -type l \) \ |
| 33 | -print | egrep -e '*\.so\.*\.*\.*' \ |
Damjan Marion | ad476c7 | 2016-07-13 13:42:33 +0200 | [diff] [blame] | 34 | | grep -v plugins\/ \ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 35 | | sed -e 's:.*:../& /usr/lib/x86_64-linux-gnu:' \ |
| 36 | > deb/debian/vpp-lib.install ; \ |
| 37 | \ |
| 38 | : dev package ; \ |
| 39 | ./scripts/find-dev-contents $(INSTALL_PREFIX)$(ARCH) \ |
| 40 | deb/debian/vpp-dev.install ; \ |
| 41 | \ |
Damjan Marion | ad476c7 | 2016-07-13 13:42:33 +0200 | [diff] [blame] | 42 | : plugins package ; \ |
| 43 | ./scripts/find-plugins-contents $(INSTALL_PREFIX)$(ARCH) \ |
| 44 | deb/debian/vpp-plugins.install ; \ |
| 45 | \ |
Ed Warnicke | 6ce685d | 2016-10-28 22:52:36 +0000 | [diff] [blame^] | 46 | : python-api package ; \ |
| 47 | ./scripts/find-python-api-contents $(INSTALL_PREFIX)$(ARCH) \ |
| 48 | deb/debian/vpp-python-api.install ; \ |
| 49 | \ |
Dave Barach | 7457422 | 2016-02-01 12:05:52 -0500 | [diff] [blame] | 50 | : dpdk headers ; \ |
| 51 | ./scripts/find-dpdk-contents $(INSTALL_PREFIX)$(ARCH) \ |
| 52 | deb/debian/vpp-dpdk-dev.install ; \ |
| 53 | \ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 54 | : bin package needs startup config ; \ |
| 55 | echo ../../vpp/conf/startup.conf /etc/vpp \ |
| 56 | >> deb/debian/vpp.install ; \ |
| 57 | \ |
| 58 | : and sysctl config ; \ |
Miroslav Miklus | 8e08e74 | 2016-10-11 13:35:26 +0200 | [diff] [blame] | 59 | echo ../../vpp/conf/80-vpp.conf /etc/sysctl.d \ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 60 | >> deb/debian/vpp.install ; \ |
| 61 | \ |
| 62 | : dev package needs a couple of additions ; \ |
Ole Troan | 5f9dcff | 2016-08-01 04:59:13 +0200 | [diff] [blame] | 63 | echo ../build-tool-native/vppapigen/vppapigen /usr/bin \ |
| 64 | >> deb/debian/vpp-dev.install ; \ |
| 65 | echo ../../vppapigen/pyvppapigen.py /usr/bin \ |
| 66 | >> deb/debian/vpp-dev.install ; \ |
| 67 | echo ../../vpp-api/java/jvpp/gen/jvpp_gen.py /usr/bin \ |
| 68 | >> deb/debian/vpp-dev.install ; \ |
| 69 | for i in $$(ls ../vpp-api/java/jvpp/gen/jvppgen/*.py); do \ |
| 70 | echo ../$${i} /usr/lib/python2.7/dist-packages/jvppgen \ |
| 71 | >> deb/debian/vpp-dev.install; \ |
| 72 | done; \ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 73 | \ |
| 74 | : generate changelog; \ |
| 75 | ./scripts/generate-deb-changelog \ |
| 76 | \ |
| 77 | : Go fabricate the actual Debian packages ; \ |
| 78 | ( \ |
| 79 | cd deb && \ |
| 80 | dpkg-buildpackage -us -uc -b \ |
| 81 | ) |
| 82 | |
| 83 | .PHONY: install-rpm |
| 84 | install-rpm: $(patsubst %,%-find-source,$(ROOT_PACKAGES)) |
| 85 | @$(BUILD_ENV) ; \ |
| 86 | set -eu$(BUILD_DEBUG) ; \ |
| 87 | $(MAKE) -C $(MU_BUILD_ROOT_DIR) \ |
| 88 | $(patsubst %,%-install, \ |
| 89 | $(ROOT_PACKAGES)) || exit 1; \ |
| 90 | \ |
| 91 | cd rpm ; \ |
Sachin | 693b702 | 2016-06-18 15:28:08 +0530 | [diff] [blame] | 92 | rpmbuild -bb --define "_topdir $$PWD" --define \ |
| 93 | "_install_dir $(INSTALL_PREFIX)$(ARCH)" vpp.spec ; \ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 94 | mv $$(find RPMS -name \*.rpm -type f) .. |
| 95 | |