blob: 59c28090281d11d516f1d861e2af0ba747717b13 [file] [log] [blame]
Ed Warnickecb9cada2015-12-08 15:45:58 -07001# 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
19install-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 Barach1c113112016-02-03 12:59:38 -050030 \
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 Marionad476c72016-07-13 13:42:33 +020034 | grep -v plugins\/ \
Ed Warnickecb9cada2015-12-08 15:45:58 -070035 | 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 Marionad476c72016-07-13 13:42:33 +020042 : plugins package ; \
43 ./scripts/find-plugins-contents $(INSTALL_PREFIX)$(ARCH) \
44 deb/debian/vpp-plugins.install ; \
45 \
Dave Barach74574222016-02-01 12:05:52 -050046 : dpdk headers ; \
47 ./scripts/find-dpdk-contents $(INSTALL_PREFIX)$(ARCH) \
48 deb/debian/vpp-dpdk-dev.install ; \
49 \
Ed Warnickecb9cada2015-12-08 15:45:58 -070050 : bin package needs startup config ; \
51 echo ../../vpp/conf/startup.conf /etc/vpp \
52 >> deb/debian/vpp.install ; \
53 \
54 : and sysctl config ; \
Miroslav Miklus822af5c2016-09-27 13:23:09 +020055 echo ../../vpp/conf/80-vpp.conf /usr/lib/sysctl.d \
Ed Warnickecb9cada2015-12-08 15:45:58 -070056 >> deb/debian/vpp.install ; \
57 \
58 : dev package needs a couple of additions ; \
Ole Troan5f9dcff2016-08-01 04:59:13 +020059 echo ../build-tool-native/vppapigen/vppapigen /usr/bin \
60 >> deb/debian/vpp-dev.install ; \
61 echo ../../vppapigen/pyvppapigen.py /usr/bin \
62 >> deb/debian/vpp-dev.install ; \
63 echo ../../vpp-api/java/jvpp/gen/jvpp_gen.py /usr/bin \
64 >> deb/debian/vpp-dev.install ; \
65 for i in $$(ls ../vpp-api/java/jvpp/gen/jvppgen/*.py); do \
66 echo ../$${i} /usr/lib/python2.7/dist-packages/jvppgen \
67 >> deb/debian/vpp-dev.install; \
68 done; \
Ed Warnickecb9cada2015-12-08 15:45:58 -070069 \
70 : generate changelog; \
71 ./scripts/generate-deb-changelog \
72 \
73 : Go fabricate the actual Debian packages ; \
74 ( \
75 cd deb && \
76 dpkg-buildpackage -us -uc -b \
77 )
78
79.PHONY: install-rpm
80install-rpm: $(patsubst %,%-find-source,$(ROOT_PACKAGES))
81 @$(BUILD_ENV) ; \
82 set -eu$(BUILD_DEBUG) ; \
83 $(MAKE) -C $(MU_BUILD_ROOT_DIR) \
84 $(patsubst %,%-install, \
85 $(ROOT_PACKAGES)) || exit 1; \
86 \
87 cd rpm ; \
Sachin693b7022016-06-18 15:28:08 +053088 rpmbuild -bb --define "_topdir $$PWD" --define \
89 "_install_dir $(INSTALL_PREFIX)$(ARCH)" vpp.spec ; \
Ed Warnickecb9cada2015-12-08 15:45:58 -070090 mv $$(find RPMS -name \*.rpm -type f) ..
91