openvswitch: Use libtool and allow building shared libs
[sliver-openvswitch.git] / rhel / openvswitch-fedora.spec.in
1 # Spec file for Open vSwitch.
2
3 # Copyright (C) 2009, 2010, 2013 Nicira Networks, Inc.
4 #
5 # Copying and distribution of this file, with or without modification,
6 # are permitted in any medium without royalty provided the copyright
7 # notice and this notice are preserved.  This file is offered as-is,
8 # without warranty of any kind.
9
10 #%define kernel 2.6.40.4-5.fc15.x86_64
11
12 Name: openvswitch
13 Summary: Open vSwitch
14 Group: System Environment/Daemons
15 URL: http://www.openvswitch.org/
16 Version: @VERSION@
17
18 # The entire source code is ASL 2.0 except datapath/ which is GPLv2
19 License: ASL 2.0
20 Release: 1%{?dist}
21 Source: openvswitch-%{version}.tar.gz
22 #Source1: openvswitch-init
23 Buildroot: /tmp/openvswitch-fedora-rpm
24
25 Requires(post):  systemd-units
26 Requires(preun): systemd-units
27 Requires(postun): systemd-units
28
29 %description
30 Open vSwitch provides standard network bridging functions augmented with
31 support for the OpenFlow protocol for remote per-flow control of
32 traffic.
33
34 %prep
35 %setup -q -n openvswitch-%{version}
36
37 %build
38 ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=%{_localstatedir} --enable-ssl
39 make %{_smp_mflags}
40
41 %install
42 rm -rf $RPM_BUILD_ROOT
43 make install DESTDIR=$RPM_BUILD_ROOT
44 install -d -m 755 $RPM_BUILD_ROOT/etc
45 install -d -m 755 $RPM_BUILD_ROOT/etc/openvswitch
46 install -p -D -m 0644 rhel/usr_lib_systemd_system_openvswitch.service \
47         $RPM_BUILD_ROOT%{_unitdir}/openvswitch.service
48 install -m 755 rhel/etc_init.d_openvswitch \
49         $RPM_BUILD_ROOT%{_datadir}/openvswitch/scripts/openvswitch.init
50 install -d -m 755 $RPM_BUILD_ROOT/etc/sysconfig
51 install -d -m 755 $RPM_BUILD_ROOT/etc/logrotate.d
52 install -m 755 rhel/etc_logrotate.d_openvswitch \
53         $RPM_BUILD_ROOT/etc/logrotate.d/openvswitch
54 install -d -m 755 $RPM_BUILD_ROOT/etc/profile.d
55 install -m 644 vswitchd/vswitch.ovsschema \
56         $RPM_BUILD_ROOT/usr/share/openvswitch/vswitch.ovsschema
57 install -d -m 755 $RPM_BUILD_ROOT/usr/share/openvswitch/scripts
58 install -d -m 0755 $RPM_BUILD_ROOT/etc/sysconfig/network-scripts/
59 install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifdown-ovs \
60         $RPM_BUILD_ROOT/etc/sysconfig/network-scripts/ifdown-ovs
61 install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifup-ovs \
62         $RPM_BUILD_ROOT/etc/sysconfig/network-scripts/ifup-ovs
63 install -p -D -m 0644 rhel/usr_share_openvswitch_scripts_sysconfig.template \
64         $RPM_BUILD_ROOT/etc/sysconfig/openvswitch
65 install -d -m 755 $RPM_BUILD_ROOT/usr/share/openvswitch/scripts
66
67 install python/compat/uuid.py $RPM_BUILD_ROOT/usr/share/openvswitch/python
68 install python/compat/argparse.py $RPM_BUILD_ROOT/usr/share/openvswitch/python
69
70 install -d -m 755 $RPM_BUILD_ROOT/var/lib/openvswitch
71
72 # Get rid of stuff we don't want to make RPM happy.
73 rm -rf $RPM_BUILD_ROOT/%{_lib}
74
75 %clean
76 rm -rf $RPM_BUILD_ROOT
77
78 %preun
79 # Package removal, not upgrade
80 systemctl stop openvswitch.service
81 systemctl disable openvswitch.service
82
83 %post
84 if test ! -e /etc/openvswitch/conf.db; then
85     install -d -m 755 -o root -g root /etc/openvswitch
86
87     # Create ovs-vswitchd config database
88     ovsdb-tool -vANY:console:emer create /etc/openvswitch/conf.db \
89             /usr/share/openvswitch/vswitch.ovsschema
90
91     # Create initial table in config database
92     ovsdb-tool -vANY:console:emer transact /etc/openvswitch/conf.db \
93             '[{"op": "insert", "table": "Open_vSwitch", "row": {}}]' \
94             > /dev/null
95 fi
96 # Initial installation
97 systemctl enable openvswitch.service
98 systemctl start openvswitch.service
99
100 %postun
101
102 %files
103 %defattr(-,root,root)
104 %config /etc/sysconfig/openvswitch
105 %config /etc/logrotate.d/openvswitch
106 %{_unitdir}/openvswitch.service
107 %{_datadir}/openvswitch/scripts/openvswitch.init
108 %{_sysconfdir}/sysconfig/network-scripts/ifup-ovs
109 %{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs
110 /usr/share/openvswitch/bugtool-plugins/
111 /usr/share/openvswitch/python/ovs/__init__.py*
112 /usr/share/openvswitch/python/ovs/daemon.py*
113 /usr/share/openvswitch/python/ovs/db/__init__.py*
114 /usr/share/openvswitch/python/ovs/db/data.py*
115 /usr/share/openvswitch/python/ovs/db/error.py*
116 /usr/share/openvswitch/python/ovs/db/idl.py*
117 /usr/share/openvswitch/python/ovs/db/parser.py*
118 /usr/share/openvswitch/python/ovs/db/schema.py*
119 /usr/share/openvswitch/python/ovs/db/types.py*
120 /usr/share/openvswitch/python/ovs/dirs.py*
121 /usr/share/openvswitch/python/ovs/fatal_signal.py*
122 /usr/share/openvswitch/python/ovs/json.py*
123 /usr/share/openvswitch/python/ovs/jsonrpc.py*
124 /usr/share/openvswitch/python/ovs/ovsuuid.py*
125 /usr/share/openvswitch/python/ovs/poller.py*
126 /usr/share/openvswitch/python/ovs/process.py*
127 /usr/share/openvswitch/python/ovs/reconnect.py*
128 /usr/share/openvswitch/python/ovs/socket_util.py*
129 /usr/share/openvswitch/python/ovs/stream.py*
130 /usr/share/openvswitch/python/ovs/timeval.py*
131 /usr/share/openvswitch/python/ovs/util.py*
132 /usr/share/openvswitch/python/ovs/version.py*
133 /usr/share/openvswitch/python/ovs/unixctl/__init__.py*
134 /usr/share/openvswitch/python/ovs/unixctl/client.py*
135 /usr/share/openvswitch/python/ovs/unixctl/server.py*
136 /usr/share/openvswitch/python/uuid.py*
137 /usr/share/openvswitch/python/argparse.py*
138 /usr/share/openvswitch/python/ovs/vlog.py*
139 /usr/share/openvswitch/python/ovstest/__init__.py*
140 /usr/share/openvswitch/python/ovstest/args.py*
141 /usr/share/openvswitch/python/ovstest/rpcserver.py*
142 /usr/share/openvswitch/python/ovstest/tcp.py*
143 /usr/share/openvswitch/python/ovstest/udp.py*
144 /usr/share/openvswitch/python/ovstest/util.py*
145 /usr/share/openvswitch/python/ovstest/vswitch.py*
146 /usr/share/openvswitch/python/ovstest/tests.py*
147 /usr/share/openvswitch/scripts/ovs-bugtool-*
148 /usr/share/openvswitch/scripts/ovs-check-dead-ifs
149 /usr/share/openvswitch/scripts/ovs-lib
150 /usr/share/openvswitch/scripts/ovs-vtep
151 %config /usr/share/openvswitch/vswitch.ovsschema
152 %config /usr/share/openvswitch/vtep.ovsschema
153 /usr/sbin/ovs-bugtool
154 /usr/sbin/ovs-vswitchd
155 /usr/sbin/ovsdb-server
156 /usr/bin/ovs-appctl
157 /usr/bin/ovs-dpctl
158 /usr/bin/ovs-dpctl-top
159 /usr/bin/ovs-ofctl
160 /usr/bin/ovs-vsctl
161 /usr/bin/ovsdb-client
162 /usr/bin/ovsdb-tool
163 /usr/bin/ovs-pki
164 /usr/bin/ovs-test
165 /usr/bin/ovs-l3ping
166 /usr/bin/vtep-ctl
167 %doc /usr/share/man/man8/ovs-pki.8.gz
168 %doc /usr/share/man/man1/ovsdb-client.1.gz
169 %doc /usr/share/man/man1/ovsdb-server.1.gz
170 %doc /usr/share/man/man1/ovsdb-tool.1.gz
171 %doc /usr/share/man/man5/ovs-vswitchd.conf.db.5.gz
172 %doc /usr/share/man/man5/vtep.5.gz
173 %doc /usr/share/man/man8/ovs-appctl.8.gz
174 %doc /usr/share/man/man8/ovs-bugtool.8.gz
175 %doc /usr/share/man/man8/ovs-dpctl.8.gz
176 %doc /usr/share/man/man8/ovs-dpctl-top.8.gz
177 %doc /usr/share/man/man8/ovs-ofctl.8.gz
178 %doc /usr/share/man/man8/ovs-parse-backtrace.8.gz
179 %doc /usr/share/man/man8/ovs-vsctl.8.gz
180 %doc /usr/share/man/man8/ovs-vswitchd.8.gz
181 %doc /usr/share/man/man8/ovs-test.8.gz
182 %doc /usr/share/man/man8/ovs-l3ping.8.gz
183 %doc /usr/share/man/man8/vtep-ctl.8.gz
184 /var/lib/openvswitch
185 /var/log/openvswitch
186 /usr/share/openvswitch/scripts/ovs-ctl
187 %exclude /etc/openvswitch
188 %exclude /usr/bin/ovs-benchmark
189 %exclude /usr/bin/ovs-parse-backtrace
190 %exclude /usr/bin/ovs-pcap
191 %exclude /usr/bin/ovs-tcpundump
192 %exclude /usr/bin/ovs-vlan-test
193 %exclude /usr/sbin/ovs-vlan-bug-workaround
194 %exclude /usr/share/man/man1/ovs-benchmark.1.gz
195 %exclude /usr/share/man/man1/ovs-pcap.1.gz
196 %exclude /usr/share/man/man1/ovs-tcpundump.1.gz
197 %exclude /usr/share/man/man8/ovs-ctl.8.gz
198 %exclude /usr/share/man/man8/ovs-vlan-bug-workaround.8.gz
199 %exclude /usr/share/man/man8/ovs-vlan-test.8.gz
200 %exclude /usr/share/openvswitch/scripts/ovs-save
201
202 %changelog
203 * Wed Jan 12 2011 Ralf Spenneberg <ralf@os-s.net>
204 - First build on F14