1 Summary: LDAP query script for Mutt
2 Summary(pl.UTF-8): Skrypt odpytujący LDAP do Mutta
7 Group: Applications/Mail
9 #Source0: ftp://ftp.mutt.org/pub/mutt/contrib/%{name}-3.0.pl.gz
10 BuildRequires: rpm-perlprov
11 Requires(post,preun): grep
12 Requires(post,preun): mutt
13 Requires(preun): fileutils
18 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
21 This is a simple script, which can be used as Mutt external query
22 command. After installing this package you can use Mutt's "Q" command
23 to query LDAP database, or "^T" when Mutt asks you for email address.
25 %description -l pl.UTF-8
26 To jest prosty skrypt, który może być używany jako komenda
27 zewnętrznego zapytania. Po zainstalowaniu tego pakietu możesz używać
28 komendy Mutta "Q" do odpytania bazy LDAP lub "^T" kiedy Mutt pyta o
34 rm -rf $RPM_BUILD_ROOT
36 install -d $RPM_BUILD_ROOT%{_bindir}
37 install %{SOURCE0} $RPM_BUILD_ROOT%{_bindir}
40 rm -rf $RPM_BUILD_ROOT
44 # check if any query_command is already set
45 if ! grep -E -q "^[[:space:]]*set[[:space:]]+query_command" /etc/Muttrc ; then
46 cat >> /etc/Muttrc <<EOF;
47 set query_command="%{_bindir}/mutt_ldap_query.pl \"\`echo '%s'| iconv -f iso-8859-2 -t utf-8\`\" | iconv -f utf8 -t iso-8859-2"
53 # check if query command is set to mutt_ldap_query
54 if grep -E -q "^[[:space:]]*set[[:space:]]+query_command.*%{_bindir}/mutt_ldap_query.pl" /etc/Muttrc ; then
55 mv -f /etc/Muttrc /etc/Muttrc.bak && \
56 grep -E -v "^[[:space:]]*set[[:space:]]+query_command.*%{_bindir}/mutt_ldap_query.pl" \
57 /etc/Muttrc.bak > /etc/Muttrc
61 %defattr(644,root,root,755)
62 %attr(755,root,root) %{_bindir}/*