Browse code

Add zookeeper package.

Harish Udaiya Kumar authored on 2015/06/17 04:31:01
Showing 2 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,79 @@
0
+Summary:	Highly reliable distributed coordination
1
+Name:		zookeeper
2
+Version:	3.4.6
3
+Release:	1%{?dist}
4
+URL:		http://zookeeper.apache.org/
5
+License:	Apache License, Version 2.0
6
+Group:		Applications/System
7
+Vendor:		VMware, Inc.
8
+Distribution: 	Photon
9
+Source:	http://www.carfab.com/apachesoftware/zookeeper/stable/%{name}-%{version}.tar.gz
10
+Requires: shadow, openjdk
11
+Provides: zookeeper
12
+%description
13
+ZooKeeper is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services. All of these kinds of services are used in some form or another by distributed applications. Each time they are implemented there is a lot of work that goes into fixing the bugs and race conditions that are inevitable. Because of the difficulty of implementing these kinds of services, applications initially usually skimp on them ,which make them brittle in the presence of change and difficult to manage. Even when done correctly, different implementations of these services lead to management complexity when the applications are deployed.
14
+
15
+%prep
16
+%setup -q
17
+
18
+%install
19
+mkdir -p %{buildroot}%{_prefix}
20
+mkdir -p %{buildroot}%{_bindir}
21
+mkdir -p %{buildroot}%{_libdir}
22
+mkdir -p %{buildroot}%{_var}/log/zookeeper
23
+mkdir -p %{buildroot}%{_sysconfdir}/zookeeper
24
+mkdir -p %{buildroot}%{_var}/run
25
+mkdir -p %{buildroot}/sbin
26
+mkdir -p %{buildroot}%{_prefix}/share/zookeeper/templates/conf
27
+mkdir -p %{buildroot}%{_var}/zookeeper
28
+mkdir -p %{buildroot}/etc/init.d
29
+
30
+cp zookeeper-%{version}.jar %{buildroot}%{_libdir}
31
+cp src/packages/rpm/init.d/zookeeper %{buildroot}/etc/init.d/zookeeper
32
+cp src/packages/update-zookeeper-env.sh %{buildroot}/sbin/update-zookeeper-env.sh
33
+cp src/packages/templates/conf/zookeeper-env.sh %{buildroot}%{_prefix}/share/zookeeper/templates/conf
34
+cp conf/zoo_sample.cfg %{buildroot}%{_prefix}/share/zookeeper/templates/conf/zoo.cfg
35
+chmod 0755 %{buildroot}/sbin/*
36
+chmod 0755 %{buildroot}/etc/init.d/zookeeper
37
+
38
+mv bin/* %{buildroot}%{_bindir}
39
+mv lib/* %{buildroot}%{_libdir}
40
+mv conf/zoo_sample.cfg %{buildroot}%{_sysconfdir}/zookeeper/zoo.cfg
41
+mv conf/* %{buildroot}%{_sysconfdir}/zookeeper
42
+cd ..
43
+rm -rf %{buildroot}/%{name}-%{version}
44
+
45
+%pre
46
+getent group hadoop 2>/dev/null >/dev/null || /usr/sbin/groupadd -r hadoop
47
+/usr/sbin/useradd --comment "ZooKeeper" --shell /bin/bash -M -r --groups hadoop --home %{_share_dir} zookeeper 2> /dev/null || :
48
+
49
+%post
50
+bash %{_prefix}/sbin/update-zookeeper-env.sh \
51
+       --prefix=%{_prefix} \
52
+       --conf-dir=%{_sysconfdir}/zookeeper \
53
+       --log-dir=%{_var}/log/zookeeper \
54
+       --pid-dir=%{_var}/run \
55
+       --var-dir=%{_var}/zookeeper
56
+
57
+%preun
58
+bash %{_prefix}/sbin/update-zookeeper-env.sh \
59
+       --prefix=%{_prefix} \
60
+       --conf-dir=%{_sysconfdir}/zookeeper \
61
+       --log-dir=%{_var}/log/zookeeper \
62
+       --pid-dir=%{_var}/run \
63
+       --var-dir=%{_var}/zookeeper \
64
+       --uninstall
65
+
66
+%postun	-p /sbin/ldconfig
67
+%files
68
+%defattr(-,root,root)
69
+%attr(0755,root,hadoop) %{_var}/log/zookeeper
70
+%attr(0775,root,hadoop) %{_var}/run
71
+%attr(0775,root,hadoop) /etc/init.d/zookeeper
72
+%attr(0775,root,hadoop) /sbin/update-zookeeper-env.sh
73
+%config(noreplace) %{_sysconfdir}/zookeeper/*
74
+%{_prefix}
75
+
76
+%changelog
77
+*	Thu Jun 11 2015 Harish Udaiya Kumar <hudaiyakumar@vmware.com> 3.4.6-1
78
+	Initial build. First version
... ...
@@ -68,7 +68,7 @@
68 68
                 "libaio","libaio-devel","thin-provisioning-tools","lvm2","lvm2-devel","lvm2-libs","lvm2-python-libs","lzo","lzo-devel","lzo-minilzo","swig",
69 69
                 "rpm-devel","pycurl","urlgrabber","yum-metadata-parser","yum", "rocket", "strace", "cracklib-python",
70 70
                 "haveged", "haveged-devel",
71
-                "postgresql", "openjdk", "apr", "apr-util", "httpd", "openvswitch", "eventlog", "syslog-ng"]
71
+                "postgresql", "openjdk", "apr", "apr-util", "httpd", "openvswitch", "eventlog", "syslog-ng", "zookeeper"]
72 72
 }
73 73
 
74 74