Sisyphus repository
Last update: 24 october 2014 | SRPMs: 15793 | Visits: 5884439
en ru br
ALT Linux repos
S:4.64L-alt8.1
5.0: 4.64L-alt5.1
4.1: 4.64L-alt5
4.0: 4.64L-alt4.1
3.0: 4.58L-alt4
+backports:4.64L-alt0.M30.4

Group :: Networking/Mail
RPM: pine

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

%define baseversion 4.64
%define ALTReleaseNo 4

#------------------ --------------------

# pam-based Linux (as in pine-4.58L-alt)
%define pinelinuxtype lnp
# Secure glibs Linux (as in SuSE)
#define pinelinuxtype slx
#------------------ --------------------
%def_with tinfo
%def_without pilot-package
%def_with ssl
# mlock --- external program to lock mailbox. in ALT, we use fcntl(),
# so def_with mlock with current /var/spool/mail premissions
# could cause pine to call external mlock, which impacts the perfomance.
# Nevertheless, on NFS mailboxes it is reasonable enough to use def_with mlock.
%def_without mlock
%define mlockname mlock
# Don't forget to edit the description & summary if you change this:
%def_with maildir
%def_with utf8
%def_with suse-specific
%def_with altmisc

# Otherwise we get too many unimportant warnings

%define optflags_warnings -Wundef -Wformat
%define CustomPineBuild 1


%def_without debug
%add_optflags %optflags_debug
%if 0
%remove_optflags %optflags_optimization
%endif


%define MergeConfPostInstall 1

# The packaging of the package should be a little cumbersome:

# the main PINE package must be built & packaged for specific arch's,
# but the tools subpackage is platform-independent (just scripts),
# so a "noarch" package must be made. The difference occurs only on the
# stage of making package files.

%define mainsummary A commonly used, MIME compliant mail and news reader.
%define name pine
%define exec %_bindir/%name
%define section Networking/Mail

%if %CustomPineBuild
%define fullversion %{baseversion}L
%else
%define fullversion %{baseversion}
%endif

%define utilver 1.0
%define utilrel ipl9

%define ldifver 0.1.4


# there are included parts of spec file for package pine (Version 4.64)

# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Bernhard Kaindl <bk at suse.de>
# URL: http://www.suse.de/~bk/pine/

Name:           pine
Version:        %{fullversion}
Release: alt%{ALTReleaseNo}.1
License:        Other License(s), see package, FSR
Group: %section
Summary: %mainsummary
Summary(ru_RU.KOI8-R): Широко используемая, соответствующая MIME программа для чтения почты и новостей.
URL:            http://www.washington.edu/pine
Packager: Igor Yu. Vlasenko <viy at altlinux.org>

# For nice work PINE should be able to use a spell checker

# XXX Which one? Consider pspell, aspell, ispell
# TODO: Requires: spellchecker
Requires: %_bindir/spell

Requires: url_handler

Requires(post): mktemp sed grep

Requires: pico = %version-%release
%if_with pilot-package
Requires: pilot = %version-%release
%endif

Source:         ftp://ftp.cac.washington.edu/pine/pine%{baseversion}.tar.bz2
Patch10:        http://www.math.washington.edu/~chappa/pine/patches/pine%{baseversion}/all.patch.gz
Patch11:        charset-editorial.diff
Patch14:        pico-ucs4all.patch
Patch15:        pico-ucs4GetKey.patch
Patch16:        pico-ucs4doublewidthchars.diff
Patch18:        pico-ucs4isspace.patch
Patch21:        pine-utf8-1b.patch
Patch22:        pine-utf8-1a-pine.h.patch
Patch23:        pine-utf8-1a-GFHP_HANDLES.patch
Patch24:        send-charset.patch
Patch26:        config-options.patch
Patch28:        iconv-no-explain.patch
Patch29:        utf8-mailindx.patch
Patch30:        mailindx-plusdraw.patch
Patch31:        gf_wrap-UTF8.patch
Patch32:        pine-no-stripwhitespace.patch
Patch33:        strings-iconv.patch
Patch34:        filter-iconv.patch
Patch35:        rfc1522_decode.patch
Patch36:        rfc1522_valid.patch
Patch37:        optionally_enter.patch
Patch38:        multipart-alternative-conversion.patch

# those 2 patches are disabled in recent SuSE (4.64N-6)

# cause crashes?
Patch39:        utf8-fillpara-color-signature.diff
Patch40:        unexpected-data-after-address.patch

Patch41:        warnings.patch
# SuSE-specific patches last:
Patch50:        pine4.61.dif
Patch51:        pine-passfile.patch
Patch52:        pine-urlquote.patch
Patch53:        pine-body.patch
Patch55:        quell-displaying-flowed-text.patch.4.60
Patch56:        quell-flowed-text-default.patch
Patch59:        pine-talk_disallow.patch
Patch60:        pine-gcc4.patch
Patch61:        pine-missing-protos.patch
Patch62:        pine-few_arguments.patch
Patch63:        pine-use-rpm_opt_flags.patch
Patch64:        pine-ldap_auth.patch

#----------- begin ALT part -------------------


Source2: %name-4.64L-alt4-conf.ALT
Source3: %name.conf.fixed
Source5: %{name}_16x16.xpm
Source6: %{name}_32x32.xpm
Source7: %{name}_48x48.xpm
Source9: filterpineconf

#Source8: imap-c-client-maildir.tar.bz2

# deprecated by Patch10:
# Maildir Driver By Eduardo Chappa <chappa at math.washington.edu>
# http://www.math.washington.edu/~chappa/pine/

Source11: %name-4.64-UW-docs.tar.bz2
Source12: %name-4.64L-info.ALT
Source13: %name-4.64L-ALT-longinfo.txt
Source14: %name-utils.readme
Source15: %name-4.42-substitute_technotes.txt
Source16: %name-4.42-substitute_FAQ.txt
Source17: http://www.suse.de/~bk/pine/FAQ.utf-8.html

# deprecated by iconv-based recoding engine

#Source50: z-recoding-engine-0.4.3.tar

# non-UW utils:

Source101: http://www.Physik.Uni-Dortmund.DE/~wacker/elm-to-pine
Source102: pine2Mutt
Source103: http://www.muc.de/~sam/pub/pine/ldif2pine-%ldifver.tar.bz2
Source110: %name-addrbk-utils-1.0-run-pwd2pine.sh

Patch201: pine4.61-suse-alt.patch

Patch205: pine-4.02-filter.patch
Patch221: pine-4.53-filter-local_nvtnl-reset.patch
Patch210: uw-imap-2002e-debian-portability.patch
Patch211: uw-imap-2001a-debian-nonull.patch
Patch213: uw-imap-2001a-overflow.patch

Patch204: uw-imap-2004-alt8-ALT-custom.patch
Patch206: uw-imap-2004-alt9-flocksim.patch

# build with tinfo instead of ncurses --- if_with tinfo

Patch207: pine-4.44L-tinfo.patch

# seems to be deprecated (old maildir patch)

Patch215: pine4.10-c-client_directory_with_driver.patch

Patch214: pine-4.21-fixhome.patch
Patch220: pine-4.55-boguswarning.patch
# adjusting build rules (merged from Lev's and RedHat's patches):
Patch270: pine-4.51-ALT-build.patch
# Filesystem paths patch: deprecated, replaced with subst below
Patch271: pine-4.55-ALT-path.patch

#------------ end ALT part --------------------



# Automatically added by buildreq on Wed Mar 01 2006

BuildRequires: libldap-devel libpam-devel libsasl2-devel libssl-devel
BuildPreReq: lynx
# it The LDAP library "ldap/libraries/libldap.a" is missing.
BuildPreReq: libldap-devel-static
%if "%pinelinuxtype" == "lnp"
BuildPreReq: libpam-devel
#BuildRequires: mailcap
%endif
%if "%pinelinuxtype" == "slx"
BuildPreReq: libkrb5-devel
%endif

%if_with tinfo
BuildPreReq: libtinfo-devel
%else
BuildPreReq: libncurses-devel
%endif


%description
A text-based, but menu-driven and thus easy-to-use e-mail program. It
is very customizable from easy(default) to very powerful(for
powerusers) thru it's internal config menu.

It has many features, e.g. from Color support, threading and an
integrated help system.

Pine is a very popular, easy to use, full-featured email user agent
which includes a simple text editor called pico. Pine supports MIME
extensions and can also be used to read news.  Pine also supports
IMAP, mail, MH and Maildir (used by qmail) style folders.

Pine should be installed to make possible managing mail in a text terminal;
its interface is rather handy in that sense that it allows you to start
using the program without reading any additional documenation. It is a very
commonly used email user agent and it is currently in development.

Be careful when using %name with Maildir folders: the Maildir support
is brought into %name by a non-native code and might not work as stable
as other functions.

%description -l ru_RU.KOI8-R
Pine ("Сосна") -- Program for Internet News & Email. Это популярный,
простой в использовнии, полноценный пользовательский почтовый
агент (Mail User Agent), включающий в себя
простой текстовый редактор под названием pico. Pine поддерживает
расширения MIME; может быть использован для чтения новостей. Он умеет
работать с почтовыми ящиками в формате mail, MH и Maildir (с ними
работает qmail), а также ящиками, предоставляемыми по IMAP.

Его стоит установить, чтобы иметь возможность работать с почтой в текстовом терминале;
его интерфейс удобен тем, что позволяет начать пользоваться программой, не читая
дополнительной документации. Очень широко распространен; постоянно дорабатывается и
пополняется новыми возможностями.

Будьте осторожны, используя %name с ящиками в формате Maildir:
эта возможность добавлена в %name не авторами и может функционировать
не так стабильно, как остальные составляющие.

%package doc
Summary: More documentation for %name.
Summary(ru_RU.KOI8-R): Больше документации по %name.
Group: %section

#' (syntax highlight cheater)

# Documentation can be installed independently of binaries
# (to get acquainted, to print out, ...),
# but if the binaries are installed, the doc-pkg should correspond
# to their version. This is expressed by the following conflicts.
Conflicts: %name < %fullversion
Conflicts: %name > %fullversion

%description doc
Three major groups of the additional documentation that supplemets the
%name package are:
- User guide (tutorial)
- Technical notes
- FAQs
- historical notes.

There are also a few other minor doc-files not so important for the main package. Some
of the documentation is distributed along with the source of %name by UW
(University of Washington), some is published separately on their site.

The Technical Notes included can be of some interest and use not only
to PINE developers and hackers, but also (and even much more) for users
getting "advanced".

%description doc -l ru_RU.KOI8-R
Три основные группы, на которые разбивается документация, дополняющая
пакет %name, это:
- Руководство пользователя (обучающее)
- Технические заметки
- FAQs (Frequently Asked Questions -- Часто Задаваемые Вопросы)
- Исторические заметки.

Также включено и несколько небольших, не очень важных для главного
пакета файлов с описаниями. Часть из включенной документации
распространяется UW (University of Washington) вместе с исходниками
%name, часть публикуется на их сайте.

Технические заметки, входящие в состав пакета, могут быть интересны не
только (и даже не столько) программистам-разработчикам и хакерам, но и
пользователям, желающим стать "продвинутыми".

%package addrbk-tools
Summary: A set of tools dealing with %name addressbook files.
Summary(ru_RU.KOI8-R): Набор инструментов для работы с записными книжками (adress books) %name.
Group: File tools
Version: %utilver
Release: %utilrel.1.1
Prefix: %prefix
# It should be a "noarch" package

#

#There is a separate package with tools for mailbox conversions.

%description addrbk-tools
Most of these tools are scripts either contributed to Pine project or
written independently. All of them are intended to make PINE
addressbooks by extracting appropriate information from a file with account
information stored/used by another similar program (mail user agent).
A vice versa conversion may also be possible.

You should install %name-addrbk-tools if you wouldd like to migrate between %name
and Mutt, elm, mail, Netscape, or if you want just to have the same
address lists available in several mail user agents.

This package is relocatable. That means that if you need any of the
tools included in the package and you are not the administrator at your
site, you should be able to install the package locally to your homedir,
without having root-permissions, and use the tools. Read RPM
documentation on how to do so.

%description addrbk-tools -l ru_RU.KOI8-R
Основная часть этих инструментов -- скрипты, добавленные в проект Pine
как вклады со стороны (contributions) или написанные независимо от
него. Все они нацелены на то, чтобы создавать записную книжку для %name
путем извлечения информации из аналогичных файлов, созданных другими
похожими программами (mail user agents -- пользовательскими почтовыми
агентами) в других форматах. Обратное преобразование может быть тоже
возможно.

Стоит установить %name-addrbk-tools, если Вы хотите перейти с
использования Mutt, elm, mail, Netscape на использование %name (или
наоборот) или если Вы просто хотите иметь доступ к одним и тем же
записям (спискам адресов) сразу в нескольких почтовых агентах.

Этот пакет является перемещаемым (relocatable). Это должно позволить Вам в случае,
когда Вам нужен один из скриптов-преобразователей из этого пакета, но Вы
не являетесь администратором системы, установить его к себе в домашнюю
директорию и пользоваться им. Как это сделать -- см. описание RPM.



%package -n pico
Summary:        A small, easy to use editor
Group:          Editors
Version:        %{fullversion}

%description -n pico
Pico is a simple, display-oriented text editor based on the Pine
message system composer. As with Pine, commands are displayed at the
bottom of the screen, and context-sensitive help is provided.
Characters are inserted into the text as they are typed.

%if_with pilot-package
%package -n pilot
Summary:        Simple file system browser
Group:          File tools
Version:        %{fullversion}

%description -n pilot
Pilot is a simple, display-oriented file system browser based on the
Pine message system composer. As with Pine, commands are displayed at
the bottom of the screen, and context-sensitive help is provided.
%endif


%prep
%setup -q -n pine%{baseversion}
%if_with maildir
%patch10 -p1
#cd ..
#rm -rf      pine%{baseversion}.chappa
#cp -al pine%{baseversion} pine%{baseversion}.chappa
#cd -
%endif

%if_with utf8
%patch11
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch18 -p1
%patch21 -p1
%patch22 -p1
%patch23 -p1
%patch24 -p1
%patch26 -p1
%patch28 -p1
%patch29 -p1
%patch30 -p1
%patch31 -p1
%patch32 -p1
%patch33 -p1
%patch34 -p1
%patch35 -p1
%patch36 -p1
%patch37 -p1
%patch38 -p1
#%patch39 -p1
#%patch40 -p1
rm `find -name "*.orig"`
%endif
%if_with maildir
#cd ..
#%define patchver pine%{baseversion}/utf-2c-%{baseversion}
#rm -rf      pine%{baseversion}.utf-2c
#cp -al pine%{version} pine%{baseversion}.utf-2c
#diff -rNup pine%{baseversion}.chappa pine%{baseversion}.utf-2c >%{patchver} ||
#cd -
%patch41 -p0
%endif
# SUSE-specific patches last:
#%patch50 -p1
# fixed suse->alt 50->201
%patch201 -p1
%if_with suse-specific
%patch51 -p1
%patch52 -p1
%patch53
%patch55 -p1
%patch56 -p1
%patch59
%patch60 -p0
%patch61
%patch62
%patch63
%patch64
%endif


#----------- begin ALT part -------------------

%if_with altmisc
%patch205 -p1 -b .filter
%patch221 -p1 -b .filter-reset

pushd imap
##%patch201 -p1 -b .glibc-time
%patch210 -p1 -b .deb-port
%patch211 -p1 -b .deb-nonull
%patch213 -p1 -b .overflow
##
### old maildir patch!!!!
#####patch209 -p2 -b .forPine
#####patch202 -p1 -b .glibc-time
popd

%patch204 -p1 -b .ALT
%patch206 -p1 -b .flock
%endif

%if_with tinfo
%patch207 -p1 -b .tinfo
%endif

%if_with altmisc
##%patch215 -p1 -b .cclientdir
#patch -p1 --suffix=.cclientdir --fuzz=3 < %PATCH215

%patch214 -p1
%patch220 -p1
%patch270 -p1 -b .buildconf
%endif

##%patch271 -p1 -b .path

# replaced by subst commands below
###############################
for i in doc/tech-notes/{cmd-line,low-level,background,config,config-notes,installation,porting}.html \
doc/pine.1 \
doc/tech-notes.txt \
README \
pico/osdep/os-lnx.h \
pine/mailcap.c \
pine/osdep/os-lnx.h \
pine/pine-use.c \
pine/init.c \
pine/pine.hlp
do
   echo fixing $i ...
   %__subst 's,/usr/local/lib/pine.conf,/etc/pine.conf,' $i
   %__subst 's,/usr/local/bin,/usr/bin,' $i
   %__subst 's,/usr/spool/mail,/var/spool/mail,' $i
   %__subst 's,/usr/spool/news,/var/spool/news,' $i
   %__subst 's,/usr/lib/news/active,/var/lib/news/active,' $i
   %__subst 's,/usr/local/lib/pine.info,/usr/lib/pine.info,' $i
done

%if %CustomPineBuild
patch -p1 pine/pine.h <<'EOF'
at  at  -63,7 +63,7  at  at
#ifndef _PINE_INCLUDED
#define _PINE_INCLUDED

-#define PINE_VERSION "%baseversion"
+#define PINE_VERSION "%fullversion"
#define PHONE_HOME_VERSION "-count"
#define PHONE_HOME_HOST "docserver.cac.washington.edu"

EOF
%endif


# utils:

install -p -m755 %SOURCE101 contrib/utils/elm2pine
install -p -m755 %SOURCE102 contrib/utils/pine2Mutt

# just in case this wants /usr/local/bin/perl

find contrib -type f |
xargs fgrep -l /usr/local/bin/perl |
xargs perl -pi -e 's|/usr/local/bin/perl|%_bindir/perl|'

%setup -qDT -a103 -n %name%baseversion
pushd ldif2pine-%ldifver
for n in ldif2pine; do
 { echo '#!%_bindir/perl -w'; cat $n.pl; } > $n
done
popd

#------------ end ALT part --------------------


%build

%ifarch ppc64
export RPM_OPT_FLAGS="$RPM_OPT_FLAGS -mminimal-toc -Wall"
%endif
#
# Prepare thebuild with LDAP support:
#
install -d ldap
ln -fs /usr/include ldap/include
ln -fs %{_libdir}/ ldap/libraries
#
# Determine if we need to link with libsasl2 or libsasl:
#
if [ -e %_libdir/libsasl2.so.2 ]; then SASL=2;fi
if [ -e %_libdir/libsasl2.so ]; then SASL=2;fi
#
# -Wall is useless with pine to find the real problems because the standard
# warnings happen in mass during a full compile since there is apparently
# no quality control done by developers regarding warnings:
#
# In case you need to debug, decomment this line:
%if_with debug
DEBUG="-DDEBUG -g3"
%else
DEBUG=""
%endif
# -Wno-pointer-sign removed. gcc-4 :(
./build CC=gcc \
EXTRACFLAGS="${RPM_OPT_FLAGS/-O2/-Os} \
-Wno-return-type -Wno-sign-compare -Wno-implicit-function-declaration \
-DLDAP_DEPRECATED -Wno-uninitialized \
-Wno-strict-aliasing -Wno-parentheses -Wno-switch -Wno-unused" \
DEBUG="$DEBUG"\
%if_with ssl
SSLTYPE=unix \
       SSLCERTS=/usr/share/ssl/certs \
SSLINCLUDE=/usr/include/openssl \
SSLLIB=%{_libdir} \
EXTRALDFLAGS="-lsasl$SASL" \
%else
SSLTYPE=none \
NOSSL \
%endif
%if_with mlock
LOCKPGM=/usr/sbin/%{mlockname} \
%endif
%pinelinuxtype \
SYSTEM_PINERC="/etc/pine.conf" \
SYSTEM_PINERC_FIXED="/etc/pine.conf.fixed" \
PASSWD_PROG="/usr/bin/passwd"


#----------- begin ALT part -------------------

# Making docs
pushd doc
%__rm -f tech-notes.txt

pushd tech-notes
 make
 # preparing for install:
 #targetDir=$RPM_BUILD_ROOT%_docdir/%name-%fullversion-%release/tech-notes
 # Let's see how %%doc will pack it:
 txtDir=tech-notes
 htDir=tech-notes/HTML
 mkdir -p "$txtDir" "$htDir"
 for n in *.html; do
   %__install -p -m0644 "$n" "$htDir/$n"
txtn="${n%%.html}.txt"
   %__install -p -m0644 "$txtn" "$txtDir/$txtn"
 done
 for n in tech-notes.txt; do
   %__rm -f "$n"; %__install -m0644 -p %SOURCE15 "$n"
 done
#------------ end ALT part --------------------


%install
mkdir -p $RPM_BUILD_ROOT%{_bindir} $RPM_BUILD_ROOT/%{_man1dir} $RPM_BUILD_ROOT/etc $RPM_BUILD_ROOT/%{_libdir}
install bin/{mtest,pine,pico,pilot,rpdump,rpload,mailutil} $RPM_BUILD_ROOT%{_bindir}/
install -m 644 doc/{pine.1,pico.1,pilot.1,rpdump.1,rpload.1} $RPM_BUILD_ROOT%{_man1dir}/
install -m 644 imap/src/mailutil/mailutil.1 $RPM_BUILD_ROOT%{_man1dir}/
#%%suse_update_desktop_file -i pine ConsoleOnly Email
rm -f $RPM_BUILD_ROOT/usr/share/pixmaps/email.png
# (-f is needed here for building on older dists where this file does not exist)



#----------- end suse part --------------------


#----------- begin ws part -------------------

%if_with mlock
install -D -m755 imap/mlock/mlock $RPM_BUILD_ROOT%{_sbindir}/%{mlockname}
%endif
#----------- end   ws part --------------------

#----------- begin ALT part -------------------

# data: perhaps put it in shared?
#install -p -m644 doc/mime.types $RPM_BUILD_ROOT%_libdir/mime.types

# config files

install -p -m644 -D %SOURCE2 $RPM_BUILD_ROOT%_sysconfdir/pine.conf
install -p -m644 -D %SOURCE3 $RPM_BUILD_ROOT%_sysconfdir/pine.conf.fixed
cat >> $RPM_BUILD_ROOT%_sysconfdir/pine.conf.fixed <<EOF
# Full name for "local support" address used by "Report Bug" command.
# Default: Local Support
local-fullname=%packagerName

# Email address used to send to "local support".

# Default: postmaster
local-address=%packagerAddress
EOF

%if %CustomPineBuild

# pine-info: also a kind of data mixed with docs - shared?

{
 echo -e "You are probably using PINE %fullversion configured for %distribution.\n"
 %__cat %SOURCE12
} > "$RPM_BUILD_ROOT"%_libdir/pine.info

# overriding the source with a symlink - requires a hack in the %files

# section, otherwise it will be copied, not linked
%__ln_s -f %_libdir/pine.info doc/pine.info

%endif

install -p -m755 -D %SOURCE9 $RPM_BUILD_ROOT%{_bindir}/filterpineconf

# docs:

bzcat %SOURCE11 | tar x
pushd doc

install -p -m644 -D %SOURCE13 ALT-packaging-info
install -p -m644 -D %SOURCE14 README.addrbk-tools
install -p -m644 -D %SOURCE17 .

# Rename txt files that we don't want to be included in the main

# package:
for n in FAQs; do
 mv "$n.txt" "$n"
done

%__install -m0644 -p %SOURCE16 FAQ.where
popd

# icons

%if %undefined _niconsdir
%define _niconsdir %_iconsdir
 %endif

%__install -p -m644 -D %SOURCE5 $RPM_BUILD_ROOT%_miconsdir/%name.xpm
%__install -p -m644 -D %SOURCE6 $RPM_BUILD_ROOT%_niconsdir/%name.xpm
%__install -p -m644 -D %SOURCE7 $RPM_BUILD_ROOT%_liconsdir/%name.xpm

# (fg) Menu entry 1 (pine)

mkdir -p $RPM_BUILD_ROOT%_menudir
cat >$RPM_BUILD_ROOT%_menudir/%name <<EOF
?package(%name):\\
command="%exec"\\
needs="text"\\
icon="%name.xpm"\\
section="%section"\\
title="%name"\\
longtitle="%name: %mainsummary"
EOF

# (fg) Menu entry 2 (pico)

mkdir -p $RPM_BUILD_ROOT%_menudir
cat >$RPM_BUILD_ROOT%_menudir/pico <<EOF
?package(pico):\\
command="%_bindir/pico"\\
needs="text"\\
icon="%name.xpm"\\
section="Applications/Editors"\\
title="pico"\\
longtitle="pico: default editor for pine"
EOF

%if_with pilot-package
# (fg) Menu entry 3 (pilot)
mkdir -p $RPM_BUILD_ROOT%_menudir
cat >$RPM_BUILD_ROOT%_menudir/pilot <<EOF
?package(%name):\\
command="%_bindir/pilot"\\
needs="text"\\
icon="%name.xpm"\\
section="Applications/File tools"\\
title="pilot"\\
longtitle="pilot: pine file browser"
EOF
%endif

# utils:

for n in pine2Mutt elm2pine; do
 %__install -p -m0755 "contrib/utils/$n" "$RPM_BUILD_ROOT"%_bindir/"$n"
done

for n in brk2pine; do
 %__install -p -m0755 "contrib/utils/$n.sh" "$RPM_BUILD_ROOT"%_bindir/"$n"
done

for n in ldif2pine-%ldifver/ldif2pine; do
 %__install -p -m0755 "$n" "$RPM_BUILD_ROOT"%_bindir
done

for n in "%_libdir/pwd2pine"; do
%__install -p -m0644 "contrib/utils/$(basename "$n")" "$RPM_BUILD_ROOT$n"
%__install -p -m0755 %SOURCE110 "$RPM_BUILD_ROOT%_bindir/$(basename "$n")"
done

#------------ end ALT part --------------------



#----------- begin ALT part -------------------

%post
## add menu entry
%update_menus

%if %MergeConfPostInstall

# Set up system-wide defaults for pine by merging the config file

# already present in the system with some new settings. (The old
# settings are appended at the end of the new, so that the old ones
# override the new.)
# All this is just cosmetic.
# The enormous script is rather ugly. A better solution would be to
# teach pine to accept multiple additive feature-lists in one file.
# And to let it verify the set of options.

# hack:

# removed disable-charset-conversions

function collectItems() {
local SORT
if [[ "$1" == "-nosort" ]]; then
   SORT=cat; shift
else
   SORT='sort -u'
fi

local listID="$1"
local moved_msg="${2:-'Moved by RPM'}"

local first="^$listID="
local last='[^,]$'

local readItems="$(mktemp "$listID.XXXXXX")"

 sed -e "
     /$first\$/ b moved
     /$first.*$last/  b item
     /$first/,/$last/ b item
     b
     : item
       w $readItems
     : moved
       s/^/#$moved_msg: /
"
   echo
   cat $readItems \
   | grep -v 'disable-charset-conversions' \
   | sed -e "
       s/$first/ /
       s/^[[:space:]]*\$//
       s/^[[:space:]]\+/ /
       s/$last/&,/
     " \
   | $SORT \
   | cat --squeeze-blank \
   | sed -e "
       1  s/^[[:space:]]*/$listID=/
       \$ s/,\$//
     "
   rm -f "$readItems"
}

echo $"Re-generating system-wide config files on the base of the old ones:"
for n in %_sysconfdir/pine.conf; do
 old="$n.rpmorig"
 new="$n.rpmnew"

 if [[ -e "$new" ]]; then cp -f "$new"{,.last}; fi

 echo -n "$n: "
 {
   cp -f "$n" "$old"

   filter=''
   for listID in feature-list '-nosort url-viewers'; do
     filter="$filter | collectItems $listID"
   done
   eval "cat '$new' '$old' 2> /dev/null" "$filter" > "$n"
   unset filter

   if [[ "$n" == %_sysconfdir/pine.conf ]]; then
     %exec -conf > "$new" && mv -f "$new" "$n"
   fi

   # We do not need an identical file saved in $old
   if diff -q "$old" "$n" &> /dev/null; then
     rm -f "$old"
   else
     printf $"original saved to %%s, " "$old"
   fi
 } && echo -e $"\tre-generated successfully :-)" \
   || echo $"\tre-generation failed :-("
 unset old new
done

%endif

%postun
## remove menu entry
%clean_menus



%post -n pico
## add menu entry
%update_menus

%postun -n pico
## remove menu entry
%clean_menus

%if_with pilot-package
%post -n pilot
## add menu entry
%update_menus

%postun -n pilot
## remove menu entry
%clean_menus
%endif
#------------ end ALT part --------------------


%files
%defattr(-, root, root)
%{_man1dir}/pine.1.*
%{_man1dir}/rpdump.1.*
%{_man1dir}/rpload.1.*
%{_man1dir}/mailutil.1.*
%doc CPYRIGHT README
%if_with maildir
%doc README.maildir
%endif
#README.SuSE
%doc doc/brochure.txt doc/mailcap.unx doc/mime.types doc/pine-ports
#%doc doc/tech-notes.txt doc/tech-notes
%{_bindir}/mtest
%{_bindir}/pine
%{_bindir}/rpdump
%{_bindir}/rpload
%{_bindir}/mailutil
%if_with mlock
%attr(2755, root, mail) %{_sbindir}/%{mlockname}
%endif
#/usr/share/applications/pine.desktop

#----------- begin ALT part -------------------

%{_bindir}/filterpineconf
%doc contrib/bitmaps imap/docs/bugs.txt
%{_menudir}/pine
%_miconsdir/%name.xpm
%_niconsdir/%name.xpm
%_liconsdir/%name.xpm
#%attr(0644,root,root) %_libdir/mime.types
%if %CustomPineBuild
%attr(0644,root,root) %config(missingok) %_libdir/pine.info
# I like the "--no-dereference hack" ;-)
%doc --no-dereference doc/pine.info
%endif

%attr(0644,root,root) %config(noreplace) %_sysconfdir/pine.conf
%attr(0644,root,root) %config(noreplace) %_sysconfdir/pine.conf.fixed

## special docs:

## (RE):
%doc doc/ALT-packaging-info
%doc doc/tech-notes/tech-notes.txt
%doc doc/credits.html
# SuSE site
%doc doc/FAQ.utf-8.html
#------------ end ALT part --------------------

%if_with pilot-package
%files -n pilot
%defattr(-, root, root)
%{_menudir}/pilot
%endif
%{_bindir}/pilot
%doc %{_man1dir}/pilot.*

%files -n pico
%defattr(-, root, root)
%{_bindir}/pico
%{_menudir}/pico
%doc %{_man1dir}/pico.*
%_miconsdir/%name.xpm
%_niconsdir/%name.xpm
%_liconsdir/%name.xpm

#----------- begin ALT part -------------------

%files doc
%doc doc/{tutorial.4,FAQs,faq}
%doc doc/tech-notes/tech-notes
%doc doc/{pine-ports,pine-info.txt}
%doc doc/{project-history,changes}.html

%files addrbk-tools
%doc doc/README.addrbk-tools ldif2pine-%ldifver/*.txt
%attr(0755,root,root) %_bindir/*2pine
%attr(0755,root,root) %_bindir/pine2*
%attr(0644,root,root) %_libdir/pwd2pine
#------------ end ALT part --------------------

%changelog -n pine

Full changelog you can see here

 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin