Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions common/debian/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ PACKAGES = contrail-libs-deb \
contrail-dns-deb \
contrail-vrouter-deb \
contrail-vrouter-init-deb \
contrail-vrouter-src-dkms-deb \
contrail-config-venv-deb \
contrail-config-deb \
contrail-config-extension-deb \
Expand Down
6 changes: 6 additions & 0 deletions common/debian/contrail-vrouter-src-dkms/debian/changelog.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
contrail-vrouter-src-dkms (BUILDTAG) anandhk; urgency=low

[anandhk ]
* debian/changelog: changelog

-- anandhk <anandhk@juniper.net> Fri, 11 April 2014 8:00:11 +0800
1 change: 1 addition & 0 deletions common/debian/contrail-vrouter-src-dkms/debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8
14 changes: 14 additions & 0 deletions common/debian/contrail-vrouter-src-dkms/debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Source: contrail-vrouter-src-dkms
Maintainer: anandhk <anandhk@juniper.net>
Section: misc
Priority: optional
Standards-Version: 1.0
Build-Depends:

Package: contrail-vrouter-src-dkms
Architecture: all
Maintainer: anandhk <anandhk@juniper.net>
Depends: dkms
Section: contrail-vrouter-src-dkms
Priority: extra
Description: Contrail Openstack vRouter kernel source debian package
5 changes: 5 additions & 0 deletions common/debian/contrail-vrouter-src-dkms/debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Name: contrail-vrouter-src-dkms
Maintainer: anandhk <anandhk@juniper.net>
License: Commercial
Files: *
Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
12 changes: 12 additions & 0 deletions common/debian/contrail-vrouter-src-dkms/debian/postinst.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh
set -e
version="BUILDTAG"

case "$1" in
configure)
cd /usr/src/vrouter-$version/
dkms add -m vrouter -v $version
;;
*)
;;
esac
16 changes: 16 additions & 0 deletions common/debian/contrail-vrouter-src-dkms/debian/prerm.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh

set -e
version="BUILDTAG"

case "$1" in
upgrade|remove)
cd /usr/src/vrouter-$version/
dkms remove -m vrouter -v $version --all
make clean
cd /usr/src
rm -rf vrouter-$version
;;
*)
;;
esac
143 changes: 143 additions & 0 deletions common/debian/contrail-vrouter-src-dkms/debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.
# Uncomment this to turn on verbose mode.
#
export DH_VERBOSE=1

export BUILDTIME := $(shell date -u +%y%m%d%H%M)
export SB_TOP := $(shell pwd | sed -re "s/(.*)\/tools\/packaging\/(.*)/\1/")
export buildroot := $(SB_TOP)/build/debian/contrail-vrouter-src-dkms
export _srcdir := ${SB_TOP}/vrouter/
export _sandesh_srcdir := ${SB_TOP}/tools/sandesh/
export _builddir := $(SB_TOP)/build/debug/vrouter/

BUILDTAG =
ifdef TAG
BUILDTAG = $(TAG)
else
BUILDTAG = $(BUILDTIME)
endif

export _target_srcroot := /usr/src/vrouter-$(BUILDTAG)/
export _packagedir := $(buildroot)/$(_target_srcroot)
export _package_builddir := $(buildroot)/$(_target_builddir)
export _arch := x86_64


%:
dh $@ --tmpdir=${buildroot} --destdir=${SB_TOP}/build/debian

override_dh_auto_build:
sed 's,BUILDTAG,$(BUILDTAG),g' debian/changelog.in > debian/changelog
sed 's,BUILDTAG,$(BUILDTAG),g' debian/postinst.in > debian/postinst
sed 's,BUILDTAG,$(BUILDTAG),g' debian/prerm.in > debian/prerm
(cd ${SB_TOP}; scons --target=$(_arch) $(BUILD_ARCH_TARGETS) $(_srcdir)/sandesh)

override_dh_auto_install:
install -d -m 755 $(_packagedir)/dp-core
install -d -m 755 $(_packagedir)/include
install -d -m 755 $(_packagedir)/linux
install -d -m 755 $(_packagedir)/sandesh
install -d -m 755 $(_packagedir)/sandesh/gen-c/
install -d -m 755 $(_packagedir)/sandesh/library/c
install -d -m 755 $(_packagedir)/sandesh/library/c/protocol
install -d -m 755 $(_packagedir)/sandesh/library/c/transport

echo "MAKE[0]=\"'make' -C . KERNELDIR=/lib/modules/\$${kernelver}/build\"" >> $(_packagedir)/dkms.conf
echo "CLEAN[0]=\"'make' -C . KERNELDIR=/lib/modules/\$${kernelver}/build\"" >> $(_packagedir)/dkms.conf
echo "DEST_MODULE_LOCATION[0]=\"/kernel/extra/net/vrouter\"" >> $(_packagedir)/dkms.conf
echo "BUILT_MODULE_NAME[0]=\"vrouter\"" >> $(_packagedir)/dkms.conf
echo "PACKAGE_NAME=vrouter" >> $(_packagedir)/dkms.conf
echo "PACKAGE_VERSION=$(BUILDTAG)" >> $(_packagedir)/dkms.conf
echo "AUTOINSTALL=\"yes\"" >> $(_packagedir)/dkms.conf


install -p -m 755 $(_srcdir)/dp-core/SConscript $(_packagedir)/dp-core/SConscript
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of individually selecting each of the files, can't we tar the entire directory and put the tarball?

This way whenever we add or delete files in the source, we don't have to modify the spec/rules file.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello ND,

There are a couple of problems in tar-ing (though, none are signifcant). Firstly,

it is possible that there could be binary files in the same directory. Secondly, not

all the files inside the vrouter directory is copied. Thirdly, all the sources don't

actually come from the same directory. However, I agree to the point that people

can forget adding files into the spec file. I do not have a good solution for this.

Let me know.

Thanks,

Anand


From: ndramesh notifications@github.com
Sent: Saturday, April 5, 2014 6:44 AM
To: Juniper/contrail-packaging
Cc: Anand H Krishnan
Subject: Re: [contrail-packaging] DKMS changes (#200)

In common/debian/contrail-vrouter-src-dkms/debian/rules:

  • install -d -m 755 $(_packagedir)/sandesh
    
  • install -d -m 755 $(_packagedir)/sandesh/gen-c/
    
  • install -d -m 755 $(_packagedir)/sandesh/library/c
    
  • install -d -m 755 $(_packagedir)/sandesh/library/c/protocol
    
  • install -d -m 755 $(_packagedir)/sandesh/library/c/transport
    
  • echo "MAKE[0]=\"'make' -C . KERNELDIR=/lib/modules/\$${kernelver}/build\"" >> $(_packagedir)/dkms.conf
    
  • echo "CLEAN[0]=\"'make' -C . KERNELDIR=/lib/modules/\$${kernelver}/build\"" >> $(_packagedir)/dkms.conf
    
  • echo "DEST_MODULE_LOCATION[0]=\"/kernel/extra/net/vrouter\"" >> $(_packagedir)/dkms.conf
    
  • echo "BUILT_MODULE_NAME[0]=\"vrouter\"" >> $(_packagedir)/dkms.conf
    
  • echo "PACKAGE_NAME=vrouter" >> $(_packagedir)/dkms.conf
    
  • echo "PACKAGE_VERSION=$(BUILDTAG)" >> $(_packagedir)/dkms.conf
    
  • echo "AUTOINSTALL=\"yes\"" >> $(_packagedir)/dkms.conf
    
  • install -p -m 755 $(_srcdir)/dp-core/SConscript $(_packagedir)/dp-core/SConscript
    

Instead of individually selecting each of the files, can't we tar the entire directory and put the tarball?

This way whenever we add or delete files in the source, we don't have to modify the spec/rules file.

Reply to this email directly or view it on GitHubhttps://github.com//pull/200/files#r11319153.

install -p -m 755 $(_srcdir)/dp-core/vnsw_ip4_mtrie.c $(_packagedir)/dp-core/vnsw_ip4_mtrie.c
install -p -m 755 $(_srcdir)/dp-core/vr_bridge.c $(_packagedir)/dp-core/vr_bridge.c
install -p -m 755 $(_srcdir)/dp-core/vr_btable.c $(_packagedir)/dp-core/vr_btable.c
install -p -m 755 $(_srcdir)/dp-core/vr_datapath.c $(_packagedir)/dp-core/vr_datapath.c
install -p -m 755 $(_srcdir)/dp-core/vr_flow.c $(_packagedir)/dp-core/vr_flow.c
install -p -m 755 $(_srcdir)/dp-core/vr_fragment.c $(_packagedir)/dp-core/vr_fragment.c
install -p -m 755 $(_srcdir)/dp-core/vr_htable.c $(_packagedir)/dp-core/vr_htable.c
install -p -m 755 $(_srcdir)/dp-core/vr_index_table.c $(_packagedir)/dp-core/vr_index_table.c
install -p -m 755 $(_srcdir)/dp-core/vr_interface.c $(_packagedir)/dp-core/vr_interface.c
install -p -m 755 $(_srcdir)/dp-core/vr_mcast.c $(_packagedir)/dp-core/vr_mcast.c
install -p -m 755 $(_srcdir)/dp-core/vr_message.c $(_packagedir)/dp-core/vr_message.c
install -p -m 755 $(_srcdir)/dp-core/vr_mirror.c $(_packagedir)/dp-core/vr_mirror.c
install -p -m 755 $(_srcdir)/dp-core/vr_mpls.c $(_packagedir)/dp-core/vr_mpls.c
install -p -m 755 $(_srcdir)/dp-core/vr_nexthop.c $(_packagedir)/dp-core/vr_nexthop.c
install -p -m 755 $(_srcdir)/dp-core/vrouter.c $(_packagedir)/dp-core/vrouter.c
install -p -m 755 $(_srcdir)/dp-core/vr_packet.c $(_packagedir)/dp-core/vr_packet.c
install -p -m 755 $(_srcdir)/dp-core/vr_proto_ip.c $(_packagedir)/dp-core/vr_proto_ip.c
install -p -m 755 $(_srcdir)/dp-core/vr_queue.c $(_packagedir)/dp-core/vr_queue.c
install -p -m 755 $(_srcdir)/dp-core/vr_response.c $(_packagedir)/dp-core/vr_response.c
install -p -m 755 $(_srcdir)/dp-core/vr_route.c $(_packagedir)/dp-core/vr_route.c
install -p -m 755 $(_srcdir)/dp-core/vr_sandesh.c $(_packagedir)/dp-core/vr_sandesh.c
install -p -m 755 $(_srcdir)/dp-core/vr_stats.c $(_packagedir)/dp-core/vr_stats.c
install -p -m 755 $(_srcdir)/dp-core/vr_vrf_assign.c $(_packagedir)/dp-core/vr_vrf_assign.c
install -p -m 755 $(_srcdir)/dp-core/vr_vxlan.c $(_packagedir)/dp-core/vr_vxlan.c

install -p -m 755 $(_srcdir)/include/nl_util.h $(_packagedir)/include/nl_util.h
install -p -m 755 $(_srcdir)/include/udp_util.h $(_packagedir)/include/udp_util.h
install -p -m 755 $(_srcdir)/include/ulinux.h $(_packagedir)/include/ulinux.h
install -p -m 755 $(_srcdir)/include/vhost.h $(_packagedir)/include/vhost.h
install -p -m 755 $(_srcdir)/include/vnsw_ip4_mtrie.h $(_packagedir)/include/vnsw_ip4_mtrie.h
install -p -m 755 $(_srcdir)/include/vr_bridge.h $(_packagedir)/include/vr_bridge.h
install -p -m 755 $(_srcdir)/include/vr_btable.h $(_packagedir)/include/vr_btable.h
install -p -m 755 $(_srcdir)/include/vr_compat.h $(_packagedir)/include/vr_compat.h
install -p -m 755 $(_srcdir)/include/vr_defs.h $(_packagedir)/include/vr_defs.h
install -p -m 755 $(_srcdir)/include/vr_flow.h $(_packagedir)/include/vr_flow.h
install -p -m 755 $(_srcdir)/include/vr_fragment.h $(_packagedir)/include/vr_fragment.h
install -p -m 755 $(_srcdir)/include/vr_genetlink.h $(_packagedir)/include/vr_genetlink.h
install -p -m 755 $(_srcdir)/include/vr_hash.h $(_packagedir)/include/vr_hash.h
install -p -m 755 $(_srcdir)/include/vr_htable.h $(_packagedir)/include/vr_htable.h
install -p -m 755 $(_srcdir)/include/vr_index_table.h $(_packagedir)/include/vr_index_table.h
install -p -m 755 $(_srcdir)/include/vr_interface.h $(_packagedir)/include/vr_interface.h
install -p -m 755 $(_srcdir)/include/vr_linux.h $(_packagedir)/include/vr_linux.h
install -p -m 755 $(_srcdir)/include/vr_mcast.h $(_packagedir)/include/vr_mcast.h
install -p -m 755 $(_srcdir)/include/vr_message.h $(_packagedir)/include/vr_message.h
install -p -m 755 $(_srcdir)/include/vr_mirror.h $(_packagedir)/include/vr_mirror.h
install -p -m 755 $(_srcdir)/include/vr_mpls.h $(_packagedir)/include/vr_mpls.h
install -p -m 755 $(_srcdir)/include/vr_nexthop.h $(_packagedir)/include/vr_nexthop.h
install -p -m 755 $(_srcdir)/include/vr_os.h $(_packagedir)/include/vr_os.h
install -p -m 755 $(_srcdir)/include/vrouter.h $(_packagedir)/include/vrouter.h
install -p -m 755 $(_srcdir)/include/vr_packet.h $(_packagedir)/include/vr_packet.h
install -p -m 755 $(_srcdir)/include/vr_proto.h $(_packagedir)/include/vr_proto.h
install -p -m 755 $(_srcdir)/include/vr_queue.h $(_packagedir)/include/vr_queue.h
install -p -m 755 $(_srcdir)/include/vr_response.h $(_packagedir)/include/vr_response.h
install -p -m 755 $(_srcdir)/include/vr_route.h $(_packagedir)/include/vr_route.h
install -p -m 755 $(_srcdir)/include/vr_sandesh.h $(_packagedir)/include/vr_sandesh.h
install -p -m 755 $(_srcdir)/include/vr_vxlan.h $(_packagedir)/include/vr_vxlan.h

install -p -m 755 $(_srcdir)/linux/vhost_dev.c $(_packagedir)/linux/vhost_dev.c
install -p -m 755 $(_srcdir)/linux/vr_genetlink.c $(_packagedir)/linux/vr_genetlink.c
install -p -m 755 $(_srcdir)/linux/vr_host_interface.c $(_packagedir)/linux/vr_host_interface.c
install -p -m 755 $(_srcdir)/linux/vr_mem.c $(_packagedir)/linux/vr_mem.c
install -p -m 755 $(_srcdir)/linux/vrouter_mod.c $(_packagedir)/linux/vrouter_mod.c

install -p -m 755 $(_builddir)/sandesh/gen-c/vr_types.c $(_packagedir)/sandesh/gen-c/vr_types.c
install -p -m 755 $(_builddir)/sandesh/gen-c/vr_types.h $(_packagedir)/sandesh/gen-c/vr_types.h

install -p -m 755 $(_sandesh_srcdir)/library/c/sandesh.c $(_packagedir)/sandesh/library/c/sandesh.c
install -p -m 755 $(_sandesh_srcdir)/library/c/sandesh.h $(_packagedir)/sandesh/library/c/sandesh.h
install -p -m 755 $(_sandesh_srcdir)/library/c/thrift.h $(_packagedir)/sandesh/library/c/thrift.h

install -p -m 755 $(_sandesh_srcdir)/library/c/protocol/thrift_binary_protocol.c $(_packagedir)/sandesh/library/c/protocol/thrift_binary_protocol.c
install -p -m 755 $(_sandesh_srcdir)/library/c/protocol/thrift_binary_protocol.h $(_packagedir)/sandesh/library/c/protocol/thrift_binary_protocol.h
install -p -m 755 $(_sandesh_srcdir)/library/c/protocol/thrift_protocol.c $(_packagedir)/sandesh/library/c/protocol/thrift_protocol.c
install -p -m 755 $(_sandesh_srcdir)/library/c/protocol/thrift_protocol.h $(_packagedir)/sandesh/library/c/protocol/thrift_protocol.h

install -p -m 755 $(_sandesh_srcdir)/library/c/transport/thrift_fake_transport.c $(_packagedir)/sandesh/library/c/transport/thrift_fake_transport.c
install -p -m 755 $(_sandesh_srcdir)/library/c/transport/thrift_fake_transport.h $(_packagedir)/sandesh/library/c/transport/thrift_fake_transport.h
install -p -m 755 $(_sandesh_srcdir)/library/c/transport/thrift_memory_buffer.c $(_packagedir)/sandesh/library/c/transport/thrift_memory_buffer.c
install -p -m 755 $(_sandesh_srcdir)/library/c/transport/thrift_memory_buffer.h $(_packagedir)/sandesh/library/c/transport/thrift_memory_buffer.h
install -p -m 755 $(_sandesh_srcdir)/library/c/transport/thrift_transport.c $(_packagedir)/sandesh/library/c/transport/thrift_transport.c
install -p -m 755 $(_sandesh_srcdir)/library/c/transport/thrift_transport.h $(_packagedir)/sandesh/library/c/transport/thrift_transport.h

install -p -m 755 $(_srcdir)/Makefile $(_packagedir)/Makefile
6 changes: 5 additions & 1 deletion common/rpm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ contrail-vrouter: $(PREP) $(LOCAL_PY)
@echo making rpm for contrail-vrouter
rpmbuild $(RPMBLDOPTS) contrail-vrouter.spec $(G_TAG) $(RPM_PY)

contrail-vrouter-src-dkms: $(PREP) $(LOCAL_PY)
@echo making rpm for contrail-vrouter-src-dkms
rpmbuild $(RPMBLDOPTS) contrail-vrouter-src-dkms.spec $(G_TAG)

contrail-nova-vif: $(PREP) $(LOCAL_PY)
@echo making rpm for contrail-nova-vif
rpmbuild $(RPMBLDOPTS) contrail-nova-vif.spec $(G_TAG)
Expand Down Expand Up @@ -212,7 +216,7 @@ contrail-database: $(PREP) $(LOCAL_PY)
all: $(PREP) contrail-analytics contrail-api-extension contrail-api-lib contrail-config \
contrail-control contrail-dns contrail-interface-name contrail-libs contrail-vrouter \
contrail-setup contrail-openstack-all contrail-webui contrail-nodejs venv-packages \
contrail-database contrail-nova-vif
contrail-database contrail-nova-vif contrail-vrouter-src-dkms

clean:
@echo clean
Expand Down
Loading