summaryrefslogtreecommitdiff
path: root/rhel/automake.mk
blob: 1c5bf153cc77d3c3a9c32e97d0d0cb632d161287 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Copyright (C) 2009, 2010, 2011, 2012, 2014 Nicira, Inc.
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved.  This file is offered as-is,
# without warranty of any kind.

EXTRA_DIST += \
	rhel/README.RHEL.rst \
	rhel/automake.mk \
	rhel/etc_init.d_openvswitch \
	rhel/etc_logrotate.d_openvswitch \
	rhel/etc_openvswitch_default.conf \
	rhel/etc_sysconfig_network-scripts_ifdown-ovs \
	rhel/etc_sysconfig_network-scripts_ifup-ovs \
	rhel/openvswitch-dkms.spec \
	rhel/openvswitch-dkms.spec.in \
	rhel/kmod-openvswitch-rhel6.spec \
	rhel/kmod-openvswitch-rhel6.spec.in \
	rhel/openvswitch-kmod-fedora.spec \
	rhel/openvswitch-kmod-fedora.spec.in \
	rhel/openvswitch.spec \
	rhel/openvswitch.spec.in \
	rhel/openvswitch-fedora.spec \
	rhel/openvswitch-fedora.spec.in \
	rhel/ovn-fedora.spec \
	rhel/ovn-fedora.spec.in \
	rhel/usr_share_openvswitch_scripts_ovs-systemd-reload \
	rhel/usr_share_openvswitch_scripts_sysconfig.template \
	rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \
	rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh \
	rhel/usr_lib_udev_rules.d_91-vfio.rules \
	rhel/usr_lib_systemd_system_openvswitch.service \
	rhel/usr_lib_systemd_system_ovsdb-server.service \
	rhel/usr_lib_systemd_system_ovs-vswitchd.service.in \
	rhel/usr_lib_systemd_system_ovs-delete-transient-ports.service \
	rhel/usr_lib_systemd_system_ovn-controller.service \
	rhel/usr_lib_systemd_system_ovn-controller-vtep.service \
	rhel/usr_lib_systemd_system_ovn-northd.service \
	rhel/usr_lib_systemd_system_openvswitch-ipsec.service \
	rhel/usr_lib_firewalld_services_ovn-central-firewall-service.xml \
	rhel/usr_lib_firewalld_services_ovn-host-firewall-service.xml

DISTCLEANFILES += rhel/usr_lib_systemd_system_ovs-vswitchd.service

update_rhel_spec = \
  $(AM_V_GEN)($(ro_shell) && sed -e 's,[@]VERSION[@],$(VERSION),g') \
    < $(srcdir)/rhel/$(@F).in > $(@F).tmp || exit 1; \
  if cmp -s $(@F).tmp $@; then touch $@; rm $(@F).tmp; else mv $(@F).tmp $@; fi

$(srcdir)/rhel/openvswitch-dkms.spec: rhel/openvswitch-dkms.spec.in $(top_builddir)/config.status
	$(update_rhel_spec)

$(srcdir)/rhel/kmod-openvswitch-rhel6.spec: rhel/kmod-openvswitch-rhel6.spec.in $(top_builddir)/config.status
	$(update_rhel_spec)

$(srcdir)/rhel/openvswitch-kmod-fedora.spec: rhel/openvswitch-kmod-fedora.spec.in $(top_builddir)/config.status
	$(update_rhel_spec)

$(srcdir)/rhel/openvswitch.spec: rhel/openvswitch.spec.in $(top_builddir)/config.status
	$(update_rhel_spec)

$(srcdir)/rhel/openvswitch-fedora.spec: rhel/openvswitch-fedora.spec.in $(top_builddir)/config.status
	$(update_rhel_spec)

RPMBUILD_TOP := $(abs_top_builddir)/rpm/rpmbuild
RPMBUILD_OPT ?= --without check

# Build user-space RPMs
rpm-fedora: dist $(srcdir)/rhel/openvswitch-fedora.spec
	${MKDIR_P} ${RPMBUILD_TOP}/SOURCES
	cp ${DIST_ARCHIVES} ${RPMBUILD_TOP}/SOURCES
	rpmbuild ${RPMBUILD_OPT} \
                 -D "_topdir ${RPMBUILD_TOP}" \
                 -ba $(srcdir)/rhel/openvswitch-fedora.spec

rpm-fedora-ovn: dist $(srcdir)/rhel/ovn-fedora.spec
	${MKDIR_P} ${RPMBUILD_TOP}/SOURCES
	cp ${DIST_ARCHIVES} ${RPMBUILD_TOP}/SOURCES
	rpmbuild ${RPMBUILD_OPT} \
                 -D "_topdir ${RPMBUILD_TOP}" \
                 -ba $(srcdir)/rhel/ovn-fedora.spec

# Build kernel datapath RPM
rpm-fedora-kmod: dist $(srcdir)/rhel/openvswitch-kmod-fedora.spec
	${MKDIR_P} ${RPMBUILD_TOP}/SOURCES
	cp ${DIST_ARCHIVES} ${RPMBUILD_TOP}/SOURCES
	rpmbuild -D "kversion $(shell uname -r)" ${RPMBUILD_OPT} \
                 -D "_topdir ${RPMBUILD_TOP}" \
                 -ba $(srcdir)/rhel/openvswitch-kmod-fedora.spec