]> git.pld-linux.org Git - SPECS.git/blob - nocc.spec
SPECS updated Mon 29 Apr 22:05:02 CEST 2024
[SPECS.git] / nocc.spec
1 Summary:        WebMail package
2 Summary(pl.UTF-8):      Poczta przez WWW
3 Name:           nocc
4 Version:        1.8.3
5 Release:        3
6 License:        GPL
7 Group:          Applications/Mail
8 Source0:        http://downloads.sourceforge.net/nocc/%{name}-%{version}.tar.gz
9 # Source0-md5:  731c8ab05a6de5131383be0810fe76a2
10 Source1:        %{name}.lighttpd
11 Patch0:         %{name}-config.patch
12 Patch1:         %{name}-pl.patch
13 URL:            http://nocc.sourceforge.net/
14 BuildRequires:  rpm-pythonprov
15 BuildRequires:  rpmbuild(macros) >= 1.566
16 BuildRequires:  sed >= 4.0
17 Requires:       php(iconv)
18 Requires:       php(imap)
19 Requires:       php(pcre)
20 Requires:       webapps
21 Requires:       webserver(php) >= 4.1.0
22 Provides:       webmail
23 Conflicts:      apache-base < 2.4.0-1
24 BuildArch:      noarch
25 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26
27 %define         _webapp         %{name}
28 %define         _webapps        /etc/webapps
29 %define         _sysconfdir     %{_webapps}/%{_webapp}
30 %define         _appdir         %{_datadir}/%{_webapp}
31
32 %description
33 NOCC is a webmail client written in PHP. It provides webmail access to
34 IMAP and POP3 accounts.
35
36 %description -l pl.UTF-8
37 NOCC jest klientem poczty napisanym w PHP. Umożliwia dostęp do kont
38 pocztowych IMAP i POP3 przez WWW.
39
40 %prep
41 %setup -q -c %{name}-%{version}
42
43 %undos -f php
44 %patch0 -p1
45 %patch1 -p1
46
47 cat > apache.conf <<'EOF'
48 Alias /%{name} %{_appdir}
49 <Directory %{_appdir}>
50         Allow from all
51 </Directory>
52 EOF
53
54 cat > httpd.conf <<'EOF'
55 Alias /%{name} %{_appdir}
56 <Directory %{_appdir}>
57         Require all granted
58 </Directory>
59 EOF
60
61 %build
62 find -type d -name CVS | while read cvsdir; do
63         rm -rf $cvsdir
64 done
65
66 %install
67 rm -rf $RPM_BUILD_ROOT
68
69 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir},%{_var}/lib/nocc}
70 install apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
71 install httpd.conf $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
72 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
73
74 install config/conf.php.dist config/conf.php
75 mv config $RPM_BUILD_ROOT%{_sysconfdir}/
76 cp -avR * $RPM_BUILD_ROOT%{_appdir}
77
78 ln -s %{_sysconfdir}/config $RPM_BUILD_ROOT%{_appdir}/
79
80 rm -rf $RPM_BUILD_ROOT%{_appdir}/docs
81 rm -f $RPM_BUILD_ROOT%{_appdir}/{COPYING,INSTALL,README,*.sh}
82 rm -rf $RPM_BUILD_ROOT%{_appdir}/debian
83 rm -f $RPM_BUILD_ROOT%{_appdir}/lang/*.sh
84
85 %triggerin -- apache1 < 1.3.37-3, apache1-base
86 %webapp_register apache %{_webapp}
87
88 %triggerun -- apache1 < 1.3.37-3, apache1-base
89 %webapp_unregister apache %{_webapp}
90
91 %triggerin -- apache-base
92 %webapp_register httpd %{_webapp}
93
94 %triggerun -- apache-base
95 %webapp_unregister httpd %{_webapp}
96
97 %triggerin -- lighttpd
98 %webapp_register lighttpd %{_webapp}
99
100 %triggerun -- lighttpd
101 %webapp_unregister lighttpd %{_webapp}
102
103 %clean
104 rm -rf $RPM_BUILD_ROOT
105
106 %files
107 %defattr(644,root,root,755)
108 %doc docs/*
109 %dir %attr(750,root,http) %{_sysconfdir}
110 %dir %attr(750,root,http) %{_sysconfdir}/config
111 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
112 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
113 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
114 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config/*
115 %attr(770,root,http) %dir %{_var}/lib/nocc
116 %{_appdir}
This page took 3.210433 seconds and 3 git commands to generate.