rhel: Add 'rpm-fedora' and 'rpm-fedora-kmod' targets
[cascardo/ovs.git] / rhel / automake.mk
index 7bc8520..dc30715 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2009, 2010, 2011, 2012 Nicira, Inc.
+# 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
@@ -12,9 +12,8 @@ EXTRA_DIST += \
        rhel/etc_logrotate.d_openvswitch \
        rhel/etc_sysconfig_network-scripts_ifdown-ovs \
        rhel/etc_sysconfig_network-scripts_ifup-ovs \
-       rhel/kmodtool-openvswitch-el5.sh \
-       rhel/openvswitch-kmod-rhel5.spec \
-       rhel/openvswitch-kmod-rhel5.spec.in \
+       rhel/openvswitch-dkms.spec \
+       rhel/openvswitch-dkms.spec.in \
        rhel/openvswitch-kmod-rhel6.spec \
        rhel/openvswitch-kmod-rhel6.spec.in \
        rhel/openvswitch-kmod.files \
@@ -25,14 +24,19 @@ EXTRA_DIST += \
        rhel/openvswitch-fedora.spec \
        rhel/openvswitch-fedora.spec.in \
        rhel/usr_share_openvswitch_scripts_sysconfig.template \
-       rhel/usr_lib_systemd_system_openvswitch.service
+       rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \
+       rhel/usr_lib_systemd_system_openvswitch.service \
+       rhel/usr_lib_systemd_system_openvswitch-nonetwork.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
 
 update_rhel_spec = \
-  ($(ro_shell) && sed -e 's,[@]VERSION[@],$(VERSION),g') \
+  $(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-kmod-rhel5.spec: rhel/openvswitch-kmod-rhel5.spec.in $(top_builddir)/config.status
+$(srcdir)/rhel/openvswitch-dkms.spec: rhel/openvswitch-dkms.spec.in $(top_builddir)/config.status
        $(update_rhel_spec)
 
 $(srcdir)/rhel/openvswitch-kmod-rhel6.spec: rhel/openvswitch-kmod-rhel6.spec.in $(top_builddir)/config.status
@@ -46,3 +50,21 @@ $(srcdir)/rhel/openvswitch.spec: rhel/openvswitch.spec.in $(top_builddir)/config
 
 $(srcdir)/rhel/openvswitch-fedora.spec: rhel/openvswitch-fedora.spec.in $(top_builddir)/config.status
        $(update_rhel_spec)
+
+RPMBUILD_TOP := $(abs_top_builddir)/rpm/rpmbuild
+
+# 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}" \
+                 -bb $(srcdir)/rhel/openvswitch-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}" \
+                 -bb $(srcdir)/rhel/openvswitch-kmod-fedora.spec