fedora-spec: the db and id must be owned
authorFlavio Leitner <fbl@redhat.com>
Thu, 6 Nov 2014 18:45:35 +0000 (16:45 -0200)
committerBen Pfaff <blp@nicira.com>
Thu, 6 Nov 2014 22:10:25 +0000 (14:10 -0800)
Both conf.db and system-id.conf needs to be owned, so
spec now list them in the %files section.  However,
they are not shipped with the rpm (%ghost)

Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
rhel/openvswitch-fedora.spec.in

index 03bf0b2..3834339 100644 (file)
@@ -93,7 +93,7 @@ make %{?_smp_mflags}
 rm -rf $RPM_BUILD_ROOT
 make install DESTDIR=$RPM_BUILD_ROOT
 install -d -m 755 $RPM_BUILD_ROOT/etc
-install -d -m 755 $RPM_BUILD_ROOT/etc/openvswitch
+install -d -m 0755 $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch
 install -p -D -m 0644 rhel/usr_lib_systemd_system_openvswitch.service \
         $RPM_BUILD_ROOT%{_unitdir}/openvswitch.service
 install -p -D -m 0644 rhel/usr_lib_systemd_system_openvswitch-nonetwork.service \
@@ -136,6 +136,9 @@ install -d -m 0755 $RPM_BUILD_ROOT%{_includedir}/openflow
 install -p -D -m 0644 include/openflow/*.h \
        -t $RPM_BUILD_ROOT%{_includedir}/openflow
 
+touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/conf.db
+touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/system-id.conf
+
 %check
 %if %{with check}
     if make check TESTSUITEFLAGS='%{_smp_mflags}' ||
@@ -194,7 +197,10 @@ systemctl start openvswitch.service
 
 %files
 %defattr(-,root,root)
-%config /etc/sysconfig/openvswitch
+%dir %{_sysconfdir}/openvswitch
+%config %ghost %{_sysconfdir}/openvswitch/conf.db
+%config %ghost %{_sysconfdir}/openvswitch/system-id.conf
+%config(noreplace) %{_sysconfdir}/sysconfig/openvswitch
 %config /etc/logrotate.d/openvswitch
 %{_unitdir}/openvswitch.service
 %{_unitdir}/openvswitch-nonetwork.service
@@ -243,7 +249,6 @@ systemctl start openvswitch.service
 /var/lib/openvswitch
 /var/log/openvswitch
 /usr/share/openvswitch/scripts/ovs-ctl
-%exclude /etc/openvswitch
 %exclude /usr/bin/ovs-benchmark
 %exclude /usr/bin/ovs-parse-backtrace
 %exclude /usr/bin/ovs-pcap