Skip to content

Commit

Permalink
rhel: Fix creation of symlink for ocf script
Browse files Browse the repository at this point in the history
The policy is to use %files to track installed files.

If %files is not used the resulting file is not owned by any package.

Before this commit:
 # rpm -qf /usr/lib/ocf/resource.d/ovn/ovndb-servers
 file /usr/lib/ocf/resource.d/ovn/ovndb-servers is not owned by any package

After this commit:
 # rpm -qf /usr/lib/ocf/resource.d/ovn/ovndb-servers
 openvswitch-ovn-common-2.7.90-1.fc26.x86_64

Fixes: a4245b7 ("ovn: Add ovn db servers ocf script in fedora packager")

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
Acked-by: Numan Siddique <nusiddiq@redhat.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
  • Loading branch information
drizzt authored and russellb committed Jul 21, 2017
1 parent 8294d78 commit b5ca033
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions rhel/openvswitch-fedora.spec.in
Expand Up @@ -282,6 +282,10 @@ install -p -m 0644 rhel/usr_lib_firewalld_services_ovn-central-firewall-service.
install -p -m 0644 rhel/usr_lib_firewalld_services_ovn-host-firewall-service.xml \
$RPM_BUILD_ROOT%{_prefix}/lib/firewalld/services/ovn-host-firewall-service.xml

install -d -m 0755 $RPM_BUILD_ROOT%{_prefix}/lib/ocf/resource.d/ovn
ln -s %{_datadir}/openvswitch/scripts/ovndb-servers.ocf \
$RPM_BUILD_ROOT%{_prefix}/lib/ocf/resource.d/ovn/ovndb-servers

# remove unpackaged files
rm -f $RPM_BUILD_ROOT%{_bindir}/ovs-parse-backtrace \
$RPM_BUILD_ROOT%{_sbindir}/ovs-vlan-bug-workaround \
Expand Down Expand Up @@ -360,10 +364,6 @@ rm -rf $RPM_BUILD_ROOT
fi
%endif

%post ovn-common
mkdir -p /usr/lib/ocf/resource.d/ovn
ln -sf %{_datadir}/openvswitch/scripts/ovndb-servers.ocf /usr/lib/ocf/resource.d/ovn/ovndb-servers

%post ovn-central
%if 0%{?systemd_post:1}
%systemd_post ovn-northd.service
Expand Down Expand Up @@ -404,12 +404,6 @@ ln -sf %{_datadir}/openvswitch/scripts/ovndb-servers.ocf /usr/lib/ocf/resource.d
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
%endif

%postun ovn-common
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
rm -rf /usr/lib/ocf/resource.d/ovn
fi

%postun ovn-central
%if 0%{?systemd_postun:1}
%systemd_postun ovn-northd.service
Expand Down Expand Up @@ -555,6 +549,7 @@ fi
%{_mandir}/man8/ovn-sbctl.8*
%{_mandir}/man5/ovn-nb.5*
%{_mandir}/man5/ovn-sb.5*
%{_prefix}/lib/ocf/resource.d/ovn/ovndb-servers

%files ovn-central
%{_bindir}/ovn-northd
Expand Down

0 comments on commit b5ca033

Please sign in to comment.