This repository has been archived by the owner on Dec 20, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wok.spec
161 lines (134 loc) · 3.71 KB
/
wok.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
Name: wok
Version: 2.5.0
Release: 2%{?dist}
Summary: Wok - Webserver Originated from Kimchi
BuildRoot: %{_topdir}/BUILD/%{name}-%{version}-%{release}
BuildArch: noarch
Group: System Environment/Base
License: LGPL/ASL2
Source0: %{name}-%{version}.tar.gz
Patch1: wok-2.3.1-pidof-friendly.patch
Requires: gettext
Requires: python-cherrypy >= 3.2.0
Requires: python-cheetah
Requires: m2crypto
Requires: PyPAM
Requires: python-jsonschema >= 1.3.0
Requires: python-lxml
Requires: nginx
Requires: python-ldap
Requires: python-psutil >= 0.6.0
Requires: logrotate
Requires: openssl
Requires: python-websockify
Requires: fontawesome-fonts
BuildRequires: automake
BuildRequires: autoconf
BuildRequires: gettext-devel
BuildRequires: libxslt
BuildRequires: python-lxml
%global with_systemd 1
%if 0%{?with_systemd}
Requires: systemd
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
%endif
%if 0%{?with_systemd}
BuildRequires: systemd-units
%endif
%description
Wok is Webserver Originated from Kimchi.
%prep
%setup -q
%patch1 -p1 -b .pidof
%build
./autogen.sh --system
%configure
make
%install
rm -rf %{buildroot}
make DESTDIR=%{buildroot} install
%if 0%{?rhel} == 6
# Install the upstart script
install -Dm 0755 contrib/wokd-upstart.conf.fedora %{buildroot}/etc/init/wokd.conf
%endif
%if 0%{?rhel} == 5
# Install the SysV init scripts
install -Dm 0755 contrib/wokd.sysvinit %{buildroot}%{_initrddir}/wokd
%endif
%post
if [ ! -e /etc/wok/dhparams.pem ]; then
openssl dhparam -dsaparam -out /etc/wok/dhparams.pem 2048 >/dev/null 2>&1 || :
fi
if [ ! -e /etc/wok/wok-key.pem ] || [ ! -e /etc/wok/wok-cert.pem ]; then
openssl req -x509 -newkey rsa:4096 -keyout /etc/wok/wok-key.pem -out /etc/wok/wok-cert.pem -days 365 -nodes -subj "/C=US/CN=wok/O=kimchi-project.org" >/dev/null 2>&1 || :
fi
if [ $1 -eq 1 ] ; then
# Initial installation
/bin/systemctl enable wokd.service >/dev/null 2>&1 || :
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi
%preun
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
/bin/systemctl --no-reload disable wokd.service > /dev/null 2>&1 || :
/bin/systemctl stop wokd.service > /dev/null 2>&1 || :
fi
exit 0
%postun
if [ "$1" -ge 1 ] ; then
/bin/systemctl try-restart wokd.service >/dev/null 2>&1 || :
else
rm /etc/wok/wok-key.pem /etc/wok/wok-cert.pem
fi
exit 0
%clean
rm -rf $RPM_BUILD_ROOT
%files
%attr(-,root,root)
%{_bindir}/wokd
%{python_sitelib}/wok/*.py*
%{python_sitelib}/wok/control/*.py*
%{python_sitelib}/wok/model/*.py*
%{python_sitelib}/wok/xmlutils/*.py*
%{python_sitelib}/wok/API.json
%{python_sitelib}/wok/plugins/*.py*
%{python_sitelib}/wok/
%{_prefix}/share/locale/*/LC_MESSAGES/wok.mo
%{_prefix}/lib/firewalld/services/wokd.xml
%{_datadir}/wok/ui/
%{_datadir}/wok
%config(noreplace) %{_sysconfdir}/wok/wok.conf
%dir %{_sysconfdir}/wok/
%{_sysconfdir}/logrotate.d/wokd
%{_mandir}/man8/wokd.8.gz
%if 0%{?with_systemd}
%{_sysconfdir}/nginx/conf.d/wok.conf
%{_sharedstatedir}/wok/
%{_localstatedir}/log/wok/*
%dir %{_localstatedir}/log/wok/
%{_unitdir}/wokd.service
%endif
%if 0%{?rhel} == 6
/etc/init/wokd.conf
%endif
%if 0%{?rhel} == 5
%{_initrddir}/wokd
%endif
%changelog
* Tue Nov 14 2017 eGloo <[email protected]> 2.5.0
- Build 2.5.0
* Tue Jan 24 2017 eGloo <[email protected]> 2.3.1
- First build
* Fri Jun 19 2015 Lucio Correia <[email protected]> 2.0
- Rename to wokd
- Remove kimchi specifics
* Thu Feb 26 2015 Frédéric Bonnard <[email protected]> 1.4.0
- Add man page for kimchid
* Tue Feb 11 2014 Crístian Viana <[email protected]> 1.1.0
- Add help pages and XSLT dependency
* Tue Jul 16 2013 Adam Litke <[email protected]> 0.1.0-1
- Adapted for autotools build
* Thu Apr 04 2013 Aline Manera <[email protected]> 0.0-1
- First build