Add RHEL support in spec file and remove fedora directory.
[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 1. Get a source tarball:
7 $git clone https://git.opendaylight.org/gerrit/p/controller.git
8 $cd controller
9 $git archive --prefix=opendaylight-controller-0.1.0/ d684dd4 | xz > opendaylight-controller-0.1.0.tar.xz
10
11 2. Build rpm:
12 $rpmbuild -ba opendaylight-controller.spec
13
14 3. install rpm:
15 #rpm -ivp opendaylight-controller-0.1.0-0.1.20131007gitd684dd4.fc19.noarch.rpm
16
17 4. Start the controller:
18 #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"
19 *** If you need the console then telnet 127.0.0.1 2400 logs
20
21 4. Stop the controller:
22 #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"
23
24 4. uninstall rpm:
25 #rpm -e opendaylight-controller-0.1.0-0.1.20131007gitd684dd4.fc19.noarch
26
27
28 Using yum for testing.
29
30 1. Create a local repo:
31 yum install createrepo
32 yum install vsftpd
33 systemctl start vsftpd.service
34
35 Add /etc/yum.repos.d/localftp.repo
36 [localftp]
37 name=Local FTP repo
38 baseurl=file://127.0.0.1/pub
39 enabled=0
40 gpgcheck=0
41 metadata_expire=1m
42
43 2. Add packages to local repo:
44 cp opendaylight-controller.spec /var/ftp/pub
45 cp opendaylight-controller-dependencies.spec /var/ftp/pub
46
47 3. Update local repo with new packages:
48 Change the enabled=0 to enabled=1 in the localftp.repo file.
49 createrepo /var/ftp/pub
50 yum clean expire-cache
51
52 4. Verify the repo is there:
53 yum repolist
54
55 Yum away...
56
57 You could also use a fiel based repo and change the baseurl to:
58 file:////var/ftp/pub.
59 This failed with a network error for me so I switched to ftp.
60
61
62 The file system after install should look like
63
64 /etc/opendaylight-controller/config.ini
65 /usr/share/java/opendaylight-dependencies/{all the non-opendaylight jars from
66 the lib and plugin directories
67 /usr/share/opendaylight-controller/run.bat, run.sh, ..
68 /usr/share/opendaylight-controller/configuration/...
69 /usr/share/opendaylight-controller/lib/*.jar ln's to /usr/share/java/opendaylight-dependencies/*.jar
70 /usr/share/opendaylight-controller/plugins/*.jar ln's to /usr/share/java/opendaylight-dependencies/*.jar
71 /var/lib/opendaylight-controller
72 /var/lib/opendaylight-controller/configuration/ ln's back to /usr/share/opendaylight-controller/configuration
73 /var/lib/opendaylight-controller/lib
74 /var/lib/opendaylight-controller/plugins