This repository has been archived by the owner on Sep 18, 2021. It is now read-only.
forked from liquidgecka/twitcher
-
Notifications
You must be signed in to change notification settings - Fork 9
/
twitcher.spec
60 lines (46 loc) · 1.48 KB
/
twitcher.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
%define VERSION 1.6
%define RELEASE 3
Name: twitcher
Version: %{VERSION}
Release: %{RELEASE}
Summary: A zookeeper watch daemon.
Group: Tools/Twitcher
License: Internal
Url: http://github.com/twitter/twitcher
Source: twitcher.tar
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
Requires: python26
BuildRequires: python26
%description
A basic daemon that watches znodes in ZooKeeper and runs scripts on the
system when they change.
%prep
rm -rf "${RPM_BUILD_DIR}"/twitcher
mkdir -p "${RPM_BUILD_DIR}"/twitcher
tar -C "${RPM_BUILD_DIR}"/twitcher -xvf "${RPM_SOURCE_DIR}"/twitcher.tar
%install
mkdir -p "$RPM_BUILD_ROOT/usr/sbin"
cp "${RPM_BUILD_DIR}"/twitcher/bin/twitcher "${RPM_BUILD_ROOT}/usr/sbin"
mkdir -p "$RPM_BUILD_ROOT/etc/init.d"
cp "${RPM_BUILD_DIR}"/twitcher/init-twitcher \
"${RPM_BUILD_ROOT}/etc/init.d/twitcher"
mkdir -p "$RPM_BUILD_ROOT/usr/lib/python2.6/site-packages"
cp -rf "${RPM_BUILD_DIR}"/twitcher/twitcher \
"${RPM_BUILD_ROOT}/usr/lib/python2.6/site-packages"
mkdir -p "${RPM_BUILD_ROOT}"/etc/twitcher
# Generate the proper .pyc and .pyo files.
/usr/lib/rpm/brp-python-bytecompile /usr/bin/python26
%clean
rm -rf "${RPM_BUILD_ROOT}"
%post
/sbin/chkconfig twitcher on
/etc/init.d/twitcher start
%preun
/sbin/chkconfig twitcher off
/etc/init.d/twitcher stop
%files
%defattr(-,root,root,-)
/etc/twitcher
/etc/init.d/twitcher
/usr/sbin/twitcher
/usr/lib/python2.6/site-packages/twitcher