Sisyphus repository
Last update: 24 may 2018 | SRPMs: 18357 | Visits: 11548170
en ru br
ALT Linux repos
5.0: 4.64L-alt5.1
4.1: 4.64L-alt5
4.0: 4.64L-alt4.1
3.0: 4.58L-alt4

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

%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
%define fullversion %{baseversion}

%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>
# URL:

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 программа для чтения почты и новостей.
Packager: Igor Yu. Vlasenko <viy at>

# 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

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>

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

# 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

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
%if "%pinelinuxtype" == "slx"
BuildPreReq: libkrb5-devel

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

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.

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

%if_with utf8
%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"`
%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
# SUSE-specific patches last:
#%patch50 -p1
# fixed suse->alt 50->201
%patch201 -p1
%if_with suse-specific
%patch51 -p1
%patch52 -p1
%patch55 -p1
%patch56 -p1
%patch60 -p0

#----------- 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

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

%if_with tinfo
%patch207 -p1 -b .tinfo

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

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

##%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 \
pico/osdep/os-lnx.h \
pine/mailcap.c \
pine/osdep/os-lnx.h \
pine/pine-use.c \
pine/init.c \
   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/,/usr/lib/,' $i

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

-#define PINE_VERSION "%baseversion"
+#define PINE_VERSION "%fullversion"
#define PHONE_HOME_VERSION "-count"
#define PHONE_HOME_HOST ""


# 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

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


%ifarch ppc64
export RPM_OPT_FLAGS="$RPM_OPT_FLAGS -mminimal-toc -Wall"
# 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/ ]; then SASL=2;fi
if [ -e %_libdir/ ]; 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
# -Wno-pointer-sign removed. gcc-4 :(
./build CC=gcc \
-Wno-return-type -Wno-sign-compare -Wno-implicit-function-declaration \
-DLDAP_DEPRECATED -Wno-uninitialized \
-Wno-strict-aliasing -Wno-parentheses -Wno-switch -Wno-unused" \
%if_with ssl
SSLTYPE=unix \
       SSLCERTS=/usr/share/ssl/certs \
SSLINCLUDE=/usr/include/openssl \
SSLLIB=%{_libdir} \
SSLTYPE=none \
%if_with mlock
LOCKPGM=/usr/sbin/%{mlockname} \
%pinelinuxtype \
SYSTEM_PINERC="/etc/pine.conf" \
SYSTEM_PINERC_FIXED="/etc/pine.conf.fixed" \

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

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

pushd tech-notes
 # preparing for install:
 # Let's see how %%doc will pack it:
 mkdir -p "$txtDir" "$htDir"
 for n in *.html; do
   %__install -p -m0644 "$n" "$htDir/$n"
   %__install -p -m0644 "$txtn" "$txtDir/$txtn"
 for n in tech-notes.txt; do
   %__rm -f "$n"; %__install -m0644 -p %SOURCE15 "$n"
#------------ end ALT part --------------------

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}
#----------- 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

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

# Default: postmaster

%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/

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

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


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"

%__install -m0644 -p %SOURCE16 FAQ.where

# icons

%if %undefined _niconsdir
%define _niconsdir %_iconsdir

%__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
longtitle="%name: %mainsummary"

# (fg) Menu entry 2 (pico)

mkdir -p $RPM_BUILD_ROOT%_menudir
cat >$RPM_BUILD_ROOT%_menudir/pico <<EOF
longtitle="pico: default editor for pine"

%if_with pilot-package
# (fg) Menu entry 3 (pilot)
mkdir -p $RPM_BUILD_ROOT%_menudir
cat >$RPM_BUILD_ROOT%_menudir/pilot <<EOF
section="Applications/File tools"\\
longtitle="pilot: pine file browser"

# utils:

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

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

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

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")"

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

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

## add menu entry

%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
   SORT='sort -u'

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
     : item
       w $readItems
     : moved
       s/^/#$moved_msg: /
   cat $readItems \
   | grep -v 'disable-charset-conversions' \
   | sed -e "
       s/$first/ /
       s/^[[:space:]]\+/ /
     " \
   | $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

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

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

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

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

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


## remove menu entry

%post -n pico
## add menu entry

%postun -n pico
## remove menu entry

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

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

%defattr(-, root, root)
%if_with maildir
%doc README.maildir
%doc doc/brochure.txt doc/mailcap.unx doc/mime.types doc/pine-ports
#%doc doc/tech-notes.txt doc/tech-notes
%if_with mlock
%attr(2755, root, mail) %{_sbindir}/%{mlockname}

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

%doc contrib/bitmaps imap/docs/bugs.txt
#%attr(0644,root,root) %_libdir/mime.types
%if %CustomPineBuild
%attr(0644,root,root) %config(missingok) %_libdir/
# I like the "--no-dereference hack" ;-)
%doc --no-dereference doc/

%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)
%doc %{_man1dir}/pilot.*

%files -n pico
%defattr(-, root, root)
%doc %{_man1dir}/pico.*

#----------- 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