]>
Commit | Line | Data |
---|---|---|
305407af | 1 | # TODO: apache (and other webservers?) configuration for prewikka WSGI |
5a89229d | 2 | Summary: Prelude IDS web application |
a1312073 | 3 | Summary(pl.UTF-8): Aplikacja WWW dla Prelude IDS |
5a89229d | 4 | Name: prewikka |
5a0ca727 | 5 | Version: 5.1.1 |
93287c70 | 6 | Release: 1 |
0edb9475 | 7 | License: GPL v2+ |
191a32e9 | 8 | Group: Applications/Networking |
305407af | 9 | #Source0Download: https://www.prelude-siem.org/projects/prelude/files |
5a0ca727 JR |
10 | Source0: https://www.prelude-siem.org/attachments/download/1182/%{name}-%{version}.tar.gz |
11 | # Source0-md5: aa5f3621ec027211f8e4bb4474821562 | |
93287c70 AM |
12 | Source1: %{name}.init |
13 | Source2: %{name}.sysconfig | |
305407af JB |
14 | Patch0: %{name}-localedir.patch |
15 | Patch1: %{name}-install.patch | |
5a0ca727 | 16 | Patch2: locale.patch |
305407af JB |
17 | URL: https://www.prelude-siem.org/ |
18 | BuildRequires: python >= 1:2.6 | |
5a0ca727 | 19 | BuildRequires: python-lesscpy |
305407af | 20 | BuildRequires: python-setuptools |
0edb9475 | 21 | BuildRequires: rpm-pythonprov |
305407af | 22 | BuildRequires: rpmbuild(macros) >= 1.714 |
9e12854b JB |
23 | Requires: python-Mako |
24 | Requires: python-PyYAML | |
305407af | 25 | Requires: python-babel |
5a0ca727 JR |
26 | Requires: python-libprelude >= 5.1.0 |
27 | Requires: python-libpreludedb >= 5.1.0 | |
9e12854b JB |
28 | Requires: python-modules >= 1:2.6 |
29 | Requires: python-pytz | |
30 | Requires: python-werkzeug | |
5a89229d AM |
31 | BuildArch: noarch |
32 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
33 | ||
34 | %description | |
f71f87df | 35 | Prewikka is a professional looking application providing advanced |
36 | feature like contextual filtering, aggregation, etc. | |
5a89229d | 37 | |
ac06ee93 JR |
38 | %description -l pl.UTF-8 |
39 | Prewikka to profesjonalnie wyglądająca aplikacja dająca zaawansowane | |
40 | możliwości, takie jak filtrowanie kontekstowe, agregację itp. | |
7ba8f1f7 | 41 | |
305407af JB |
42 | %package httpd |
43 | Summary: Standalone Prewikka HTTP server | |
44 | Summary(pl.UTF-8): Samodzielny serwer HTTP dla Prewikki | |
45 | Group: Daemons | |
46 | Requires(pre): /bin/id | |
47 | Requires(pre): /usr/bin/getgid | |
48 | Requires(pre): /usr/sbin/groupadd | |
49 | Requires(pre): /usr/sbin/useradd | |
50 | Requires(post,preun): /sbin/chkconfig | |
51 | Requires(postun): /usr/sbin/groupdel | |
52 | Requires(postun): /usr/sbin/userdel | |
53 | Requires: rc-scripts | |
54 | Provides: group(http) | |
55 | Provides: user(http) | |
56 | Requires: %{name} = %{version}-%{release} | |
57 | ||
58 | %description httpd | |
59 | Standalone Prewikka HTTP server. Allows to run Prewikka on user | |
60 | available port (>= 1024, 8000 by default). | |
61 | ||
62 | %description httpd -l pl.UTF-8 | |
63 | Samodzielny serwer HTTP dla Prewikki. Pozwala na uruchomienie Prewikki | |
64 | na porcie dostępnym dla użytkownika (>= 1024, domyślnie 8000). | |
65 | ||
5a89229d | 66 | %prep |
d05a2acc | 67 | %setup -q |
305407af JB |
68 | %patch0 -p1 |
69 | %patch1 -p1 | |
5a0ca727 | 70 | %patch2 -p1 |
5a89229d AM |
71 | |
72 | %build | |
305407af | 73 | %py_build |
5a89229d AM |
74 | |
75 | %install | |
76 | rm -rf $RPM_BUILD_ROOT | |
77 | ||
305407af | 78 | %py_install |
5a89229d | 79 | |
93287c70 AM |
80 | install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig} |
81 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} | |
82 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name} | |
83 | ||
f991dd18 | 84 | install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name} |
85 | install conf/prewikka.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{name} | |
86 | ||
305407af JB |
87 | install -d $RPM_BUILD_ROOT%{_datadir} |
88 | %{__mv} $RPM_BUILD_ROOT%{py_sitescriptdir}/prewikka/locale $RPM_BUILD_ROOT%{_datadir} | |
89 | ||
0edb9475 JB |
90 | %py_postclean |
91 | ||
92 | %find_lang %{name} | |
93 | ||
5a89229d AM |
94 | %clean |
95 | rm -rf $RPM_BUILD_ROOT | |
96 | ||
305407af JB |
97 | %pre httpd |
98 | %groupadd -g 51 http | |
99 | %useradd -u 51 -r -d /home/services/httpd -s /bin/false -c "HTTP User" -g http http | |
100 | ||
101 | %post httpd | |
93287c70 AM |
102 | /sbin/chkconfig --add prewikka |
103 | if [ "$1" = "1" ]; then | |
104 | %banner -e %{name} <<EOF | |
105 | ||
305407af JB |
106 | Create new database and database user for Prewikka (or update an existing |
107 | one if needed) and configure Prewikka. For reference visit: | |
108 | https://www.prelude-siem.org/projects/prelude/wiki/InstallingPreludePrewikka | |
93287c70 AM |
109 | |
110 | To connect to console point Your browser to: | |
0edb9475 | 111 | http://`hostname`:8000/ |
305407af | 112 | REMEMBER to change password for admin (default: admin) |
93287c70 AM |
113 | |
114 | EOF | |
115 | fi | |
116 | %service prewikka restart "Prewikka" | |
117 | ||
305407af | 118 | %preun httpd |
93287c70 | 119 | if [ "$1" = "0" ]; then |
d1452c63 | 120 | %service prewikka stop |
93287c70 AM |
121 | /sbin/chkconfig --del prewikka |
122 | fi | |
123 | ||
305407af JB |
124 | %postun httpd |
125 | if [ "$1" = "0" ]; then | |
126 | %userremove http | |
127 | %groupremove http | |
128 | fi | |
129 | ||
0edb9475 | 130 | %files -f %{name}.lang |
5a89229d | 131 | %defattr(644,root,root,755) |
305407af | 132 | %doc AUTHORS COPYING.* NEWS README |
5a0ca727 | 133 | %attr(755,root,root) %{_bindir}/prewikka-cli |
9e12854b | 134 | %attr(755,root,root) %{_bindir}/prewikka-crontab |
93287c70 | 135 | %dir %{_sysconfdir}/%{name} |
0edb9475 | 136 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/prewikka.conf |
9e12854b | 137 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/menu.yml |
305407af JB |
138 | %dir %{_datadir}/%{name} |
139 | %dir %{_datadir}/%{name}/prewikka.wsgi | |
140 | %{py_sitescriptdir}/prewikka | |
141 | %{py_sitescriptdir}/prewikka-%{version}-py*.egg-info | |
142 | %attr(770,root,http) %dir /var/lib/prewikka | |
143 | ||
144 | %files httpd | |
145 | %defattr(644,root,root,755) | |
146 | %attr(755,root,root) %{_bindir}/prewikka-httpd | |
93287c70 AM |
147 | %attr(754,root,root) /etc/rc.d/init.d/%{name} |
148 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name} |