Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37376347
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
+backports:4.64L-alt0.M30.4

Group :: Networking/Mail
RPM: pine

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

# It is possible to pass %update value
# in the command line args to rpmbuild.
%if "%{?update:1}" == ""
%define update 0
%endif

%define baseversion 4.58
%define ALTReleaseNo 4

%if "%update" != "0"
%define release alt0.update%update.%ALTReleaseNo
%endif

# It is possible to pass %release value

# in the command line args to rpmbuild.
%if "%{?release:1}" == ""
%define release alt%ALTReleaseNo
%endif


# Otherwise we get too many unimportant warnings

%define optflags_warnings -Wundef -Wformat
%define WithRecode 1

%define WithSSL 1
%if "%_without_ssl" == "--without-ssl"
%define WithSSL 0
%endif

# Don't forget to edit the description & summary if you change this:

%define WithMaildir 1
%if "%_without_maildir" == "--without-maildir"
%define WithMaildir 0
%endif

%define WithDebug 0
%add_optflags %optflags_debug
%if 0
%remove_optflags %optflags_optimization
%endif

%define MergeConfPostInstall 1
%if "%update" != "0"
%define MergeConfPostInstall 0
%endif

# 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 %WithRecode
%define fullversion %{baseversion}L
%else
%define fullversion %{baseversion}
%endif

%define utilver 1.0
%define utilrel ipl9

%define ldifver 0.1.4

Name: %name
Version: %fullversion
Release: %release
License: distributable
Group: %section
Summary: %mainsummary
Summary(ru_RU.KOI8-R): Широко используемая, соответствующая MIME программа для чтения почты и новостей.
Url: http://www.washington.edu/%name
Packager: Ivan Zakharyaschev <imz 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

%define mailspooldir %_var/mail
%if "%update" == "2.0"
%define mailspooldir %_var/spool/mail
%endif

# Fallback values if openssl-config is not available:

%define _ssldir %_localstatedir/ssl
%if "%update" == "2.0"
%define _ssldir %_libdir/ssl
%endif

%if %WithSSL

%if "%update" != "2.0"
# for openssl-config:
BuildRequires(build): openssl >= 0.9.6g-alt2
%define _ssldir %(openssl-config --openssldir)
%endif

# It seems that this is applicable only to the server,

# for the client the location is not important, comment out:
# the location of certificates is hardcoded into the binaries (hence Requires)
#Requires: /var/lib/ssl

%endif #WithSSL

%define _pemdir %_ssldir/certs

Source0: ftp://ftp.cac.washington.edu/%name/%name%baseversion.tar.bz

Source2: %name-4.55L-alt2-conf.ALT
Source3: %name.conf.fixed
Source5: %{name}_16x16.xpm
Source6: %{name}_32x32.xpm
Source7: %{name}_48x48.xpm
Source8: imap-c-client-maildir.tar.bz2

Source11: %name-4.58-UW-docs.tar.bz2
Source12: %name-4.42L-info.ALT
Source13: %name-4.42L-ALT-longinfo.txt
Source14: %name-utils.readme
Source15: %name-4.42-substitute_technotes.txt
Source16: %name-4.42-substitute_FAQ.txt

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

# included for comparing with Mdk/RH, it isn't applied:

Patch0: pine4.30-RH-otherOS.patch
# for glibc 2.2.2
Patch1: uw-imap-2001a-glibc-time.patch
Patch7: pine-4.44L-tinfo.patch

Patch4: uw-imap-2001a-alt7-ALT-custom.patch

# XXX is sigchild patch still necessary???

#Patch3: pine-3.96-sigchld.patch
# redone for 4.30:
Patch3: pine4.30-sigchld.patch
# though it isn't applied

Patch5: pine-4.02-filter.patch

# The maildir support (turned on by %WithMaildir)

# is supplied by three source pieces:
# the tarball (Source8) with the module and README,
# a general patch that embeds the maildir module into the build
# process, and a patch special for Pine client (not the imap server).
Patch8: uw-imap-2001a-maildir-embed.patch

Patch2: uw-imap-maildir-glibc-time.patch
Patch9: pine-maildir-specialconf.patch

Patch6: uw-imap-2001a-alt7-flocksim.patch

Patch10: uw-imap-2002e-debian-portability.patch
Patch11: uw-imap-2001a-debian-nonull.patch
# moved to oldpatches/ in Debian (uw-imap_2002a.dev.snap.0212051126debian-2)
Patch12: uw-imap-2001a-debian-blackbox-inbox.patch
Patch13: uw-imap-2001a-overflow.patch

Patch15: pine4.10-c-client_directory_with_driver.patch

# patches 12, 13 from Mdk

# insetred into one of the "path"-patches

Patch14: pine-4.21-fixhome.patch

Patch17: uw-imap-2002e-alt-openssl.patch

Patch20: pine-4.55-boguswarning.patch

Patch21: pine-4.53-filter-local_nvtnl-reset.patch
# adjusting build rules (merged from Lev's and RedHat's patches):
Patch120: pine-4.51-ALT-build.patch
# Filesystem paths patch:
Patch121: pine-4.55-ALT-path.patch

# (Russian Edition) recode:

Patch130: pine-4.58L-alt2-0.4.1.diff
Patch131: pine-4.42L-0.2.3-hlp.fuzzy-patch

# Do not use libpam0-devel in Reqs -- for compatibility with 2.0:

# Automatically added by buildreq on Mon Sep 15 2003
BuildRequires: libpam-devel lynx mailcap

%if "%update" == "2.0"
BuildPreReq: libncurses-devel
%else
BuildPreReq: libtinfo-devel
%endif

%if %WithSSL
%if "%update" == "2.0"
BuildPreReq: openssl-devel
%else
BuildPreReq: libssl-devel
%endif
BuildPreReq: openssl
%endif #%WithSSL

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

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

%prep
%setup -q -n %name%baseversion -a 8
%patch5 -p1 -b .filter
%patch21 -p1 -b .filter-reset

pushd imap
%patch1 -p1 -b .glibc-time
%patch4 -p1 -b .ALT

%patch10 -p1 -b .deb-port
%patch11 -p1 -b .deb-nonull
#patch12 -p1 -b .deb-blackbox
%patch13 -p1 -b .overflow

%patch6 -p1 -b .flock

%if %WithMaildir
%patch8 -p1 -b .maildir
%endif

%patch9 -p2 -b .forPine
%patch2 -p1 -b .glibc-time
%patch17 -p1 -b .ssl
popd

%if "%update" != "2.0"
%patch7 -p1 -b .tinfo
%endif
#% patch15 -p1 -b .cclientdir
patch -p1 --suffix=.cclientdir --fuzz=3 < %PATCH15

%patch14 -p1

%patch20 -p1

%patch120 -p1 -b .buildconf
%patch121 -p1 -b .path

%if %WithRecode

pushd pine
tar xvf %SOURCE50
popd

patch -p1 --suffix=.fuzzyLev --fuzz=3 < %PATCH131
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
%patch130 -p1 -b .Lev

%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

%build
# force re-confinguration:
#%__rm imap/OSTYPE

# 1. mbox driver can be excluded here

# 2. SSLCERTS path can be set here
MAKEFLAGS="$MAKEFLAGS --print-directory" \
./build \
%if !%WithDebug
   DEBUG="" \
%endif
   OPTIMIZE="$RPM_OPT_FLAGS" \
%if %WithSSL
   SSLTYPE=unix \
%else
   SSLTYPE=none \
   NOSSL \
%endif
%if %WithMaildir
   EXTRADRIVERS='mbox maildir' \
%else
   EXTRADRIVERS='mbox' \
%endif
   EXTRASPECIALS='MAILSPOOL=%mailspooldir SSLDIR=%_ssldir SSLINCLUDE=/usr/include SSLLIB=/usr/lib SSLCERTS=%_pemdir' \
   lnp

# mbox is turned on by default, so we

# do not need an %%else case for %%if %%WithMaildir here


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

popd
# end making docs

%install
%__mkdir_p "$RPM_BUILD_ROOT"{%_bindir,%_libdir,%_docdir,%_mandir/man1}

# data: perhaps put it in shared?

install -p -m644 doc/mime.types $RPM_BUILD_ROOT%_libdir/mime.types

# binaries

for n in pi{ne,co,lot} rp{dump,load}; do
   install -p -m755 bin/$n $RPM_BUILD_ROOT%_bindir/$n
done

# 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

# man-pages

for n in pi{ne,co,lot}.1 rp{dump,load}.1; do
   %__install -p -m644 "doc/$n" "$RPM_BUILD_ROOT"%_mandir/man1
done

%if %WithRecode

# 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

# docs:

bzcat %SOURCE11 | tar x
pushd doc

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

# 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

%__install -p -m644 -D %SOURCE5 $RPM_BUILD_ROOT%_miconsdir/%name.xpm
%__install -p -m644 -D %SOURCE6 $RPM_BUILD_ROOT%_iconsdir/%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(%name):\\
command="%_bindir/pico"\\
needs="text"\\
icon="%name.xpm"\\
section="Applications/Editors"\\
title="pico"\\
longtitle="pico: default editor for pine"
EOF

# 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

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

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

%files
%doc README CPYRIGHT doc/{*.txt,mailcap.unx,FAQ.where} contrib/bitmaps imap/docs/bugs.txt
# special docs:
# (RE):
%doc doc/ALT-packaging-info
%doc doc/tech-notes/tech-notes.txt
%doc doc/credits.html

%_bindir/pine
%_bindir/pico
%_bindir/pilot
%_bindir/rpdump
%_bindir/rpload
%_mandir/man1/*
%attr(0644,root,root) %_libdir/mime.types

%if %WithRecode
%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

%_menudir/%name
%_menudir/pico
%_iconsdir/%name.xpm
%_miconsdir/%name.xpm
%_liconsdir/%name.xpm

%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

%changelog

Full changelog you can see here

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