Packaging update to support building ODL distributions.
[integration/packaging.git] / packaging / rpm / README
1 The Fedora RPM spec is a work in progress. The current spec can build an
2 RPM package for Fedora that still relies on Maven to include the JAVA
3 artifacts. The plan is to create a dependencies RPM to package up all the
4 artifacts.
5
6 Release 0.1.0-0.4.0
7 1. Build
8 Build all the required packages:
9 rpmbuild opendaylight-controller.spec
10 rpmbuild opendaylight-ovsdb.spec
11 rpmbuild opendaylight-dependencies.spec
12 rpmbuild opendaylight-distribution.spec
13
14 2. Install
15 rpm -Uvh opendaylight-distribution
16 * This will install all required packages.
17
18 3. Start/Stop
19 sudo systemctl start opendaylight-controller.service
20 sudo systemctl stop opendaylight-controller.service
21 * to get the osgi console: telnet 127.0.0.1 2400
22
23 4. Distribution
24 Edit the sysconfig file to change the type of distribution:
25 sudo vi /etc/sysconfig/opendaylight-controller
26 Set ODL_DIST to the desired distribution, i.e.
27 ODL_DEST="-virt ovsdb" or ODL_DEST="-virt opendove"
28
29 Release <0.1.0-0.4.0
30
31 1. Get a source tarball:
32 $git clone https://git.opendaylight.org/gerrit/p/controller.git
33 $cd controller
34 $git archive --prefix=opendaylight-controller-0.1.0/ d684dd4 | xz > opendaylight-controller-0.1.0.tar.xz
35
36 2. Build rpm:
37 $rpmbuild -ba opendaylight-controller.spec
38
39 3. install rpm:
40 #rpm -ivp opendaylight-controller-0.1.0-0.1.20131007gitd684dd4.fc19.noarch.rpm
41
42 4. Start the controller:
43 #su - opendaylight -s /bin/sh -c "export ODL_BASEDIR=/var/lib/opendaylight-controller && export ODL_DATADIR=/var/lib/opendaylight-controller && cd /var/lib/opendaylight-controller && /usr/share/opendaylight-controller/run.sh -start"
44 *** If you need the console then telnet 127.0.0.1 2400 logs
45
46 4. Stop the controller:
47 #su - opendaylight -s /bin/sh -c "export ODL_BASEDIR=/var/lib/opendaylight-controller && export ODL_DATADIR=/var/lib/opendaylight-controller && cd /var/lib/opendaylight-controller && /usr/share/opendaylight-controller/run.sh -stop"
48
49 4. uninstall rpm:
50 #rpm -e opendaylight-controller-0.1.0-0.1.20131007gitd684dd4.fc19.noarch
51
52
53 Using yum for testing.
54
55 1. Create a local repo:
56 yum install createrepo
57 yum install vsftpd
58 systemctl start vsftpd.service
59
60 Add /etc/yum.repos.d/localftp.repo
61 [localftp]
62 name=Local FTP repo
63 baseurl=file://127.0.0.1/pub
64 enabled=0
65 gpgcheck=0
66 metadata_expire=1m
67
68 2. Add packages to local repo:
69 cp opendaylight-controller.spec /var/ftp/pub
70 cp opendaylight-controller-dependencies.spec /var/ftp/pub
71
72 3. Update local repo with new packages:
73 Change the enabled=0 to enabled=1 in the localftp.repo file.
74 createrepo /var/ftp/pub
75 yum clean expire-cache
76
77 4. Verify the repo is there:
78 yum repolist
79
80 Yum away...
81
82 You could also use a fiel based repo and change the baseurl to:
83 file:////var/ftp/pub.
84 This failed with a network error for me so I switched to ftp.
85
86
87 The file system after install should look like
88
89 /etc/opendaylight-controller/config.ini
90 /usr/share/java/opendaylight-dependencies/{all the non-opendaylight jars from
91 the lib and plugin directories
92 /usr/share/opendaylight-controller/run.bat, run.sh, ..
93 /usr/share/opendaylight-controller/configuration/...
94 /usr/share/opendaylight-controller/lib/*.jar ln's to /usr/share/java/opendaylight-dependencies/*.jar
95 /usr/share/opendaylight-controller/plugins/*.jar ln's to /usr/share/java/opendaylight-dependencies/*.jar
96 /var/lib/opendaylight-controller
97 /var/lib/opendaylight-controller/configuration/ ln's back to /usr/share/opendaylight-controller/configuration
98 /var/lib/opendaylight-controller/lib
99 /var/lib/opendaylight-controller/plugins