ALT Linux Team development discussions
 help / color / mirror / Atom feed
* [devel] [spec-lynch] vim.spec
@ 2009-10-11 13:10 Alexey I. Froloff
  2009-10-11 14:55 ` Sergey Vlasov
  0 siblings, 1 reply; 5+ messages in thread
From: Alexey I. Froloff @ 2009-10-11 13:10 UTC (permalink / raw)
  To: ALT Devel discussion list

[-- Attachment #1: Type: text/plain, Size: 6755 bytes --]

Присоединюсь к Дамиру в плане линчевания и начну с себя.  Это
спек с многолетней историей, многие вещи уже успели устареть.

   4 # {{{ Perl/Python/Ruby/Tcl/MzScheme support

Folding это хорошая, годная фича.  Так гораздо удобнее читать
спек.

  58 %define oname vim
  59 %define major           7
  60 %define minor           2
  61 #define pre
  62 %define patchlevel      262
  67 Version: %major.%minor%{?pre:.000.%pre}%{?patchlevel:.%patchlevel}

Не самый удачный способ кодирования версии.  Во первых такую
конструкцию не понимает gear, во вторых она не работает как надо.

Немного расскажу про версионирование vim.  Есть Версия вида
MAJOR.MINOR.  Для этой версии периодически выходят Патчи.  Сам
vim показывает это как

VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Sep 23 2009 09:55:52)
Included patches: 1-262

При смене Версии сначала выкладывается серия пререлизов, у
которых к Версии добавляются буквы (a, b, ..., z, aa, ab, ...)
обозначающие пререлиз.  Для этих пререлизов тоже могут выходить
патчи.  Условия для обновления пакета следующие:

 - версия с патчами должна быть больше версии первого релиза;
 - версия пререлиза должна быть больше версии предыдущего релиза
   с любыми патчами;
 - версия пререлиза должна быть больше версии предыдущего
   пререлиза с любыми патчами;
 - версия релиза должна быть больше версии любого пререлиза этой
   ветки;

С такой версией пакета эти правила не выполняются чуть более чем
наполовину и огребается куча проблем с gear.

  90 # Automatically added by buildreq on Mon Apr 28 2003 and filtered by raorn

Комментарий немного не соответствует действительности.  Все
сборочные зависимости были добавлены полуавтоматически и
отсортированы вручную.  Давно не обновлялись.

 101 # man commandline check
 102 BuildPreReq: man
 103 # ctags commandline check
 104 BuildPreReq: ctags

Не самый оптимальный способ сказать configure где находится та
или иная программа.  Лучше экспортировать переменные ac_cv_foo.

 167 %package common
 171 PreReq: coreutils

Зачем нужна эта зависимость?  Никто не помнит, но есть нехорошее
подозрение, что из-за скриптов и триггеров.  Выкинуть к чёртовой
матери, потому как уже давно есть поиск зависимостей в
пост-установочных скриптах.

 172 PreReq: %name
 173 PreReq: %_bindir/vim

Опять засорение базы rpm.  Подобные PreReq были актуальны когда
обновление helptags выполнялось из postinstall скрипта.  С тех
пор как эта процедура перенесена в файлтриггер, необходимость в
подобных зависимостях отпала.

 175 Requires: xxd = %serial:%version-%release

Утилита xxd вынесена из vim-common в отдельный пакет.  Эта
зависимость нужна чтобы не потерять xxd при обновлении пакета
vim-common.  Через несколько лет её можно будет удалить.

 212 %description common
 213 VIM (VIsual editor iMproved) is an updated and improved version of the vi
 214 editor.  Vi was the first real screen-based editor for UNIX, and is still
 215 very popular.  VIM improves on vi by adding new features: multiple windows,
 216 multi-level undo, block highlighting and more.  The vim-common package
 217 contains files which every VIM binary will need in order to run.
 218
 219 If you are installing any version of the VIM editor, you'll also need to
 220 the vim-common package installed.

Большое количество копипасты, да ещё с комментариями в стиле 90-х
"поставьте этот пакет если вы хотите foo".  Только занимает
лишнее место в базе rpm и индексах.

 305 %description console
 ...
 313 Install the vim-console package if you'd like to use a full-featured
 314 VIM, but you don't use X11 or don't want to use GUI version of VIM nor want
 315 to use perl/python/ruby/tcl interface.  You'll also need to install the
 316 vim-common package.

RPM сам знает, что надо поставить vim-common.  Это не шлякварь.

 357 %description X11-athena
 ...
 367 Install the vim-X11 package if you'd like to use a full-featured VIM with both
 368 terminal and X11 Xaw interface.  You'll also need to install the vim-X11
 369 package.

Про копипасту я уже сказал, а тут ещё и vim-X11 вместо
vim-X11-athena.  "И всё у них так" (ц)

 397 %package X11-gtk
 400 PreReq: coreutils

См. выше про скрипты и триггеры.

 401 PreReq: alternatives >= 0.2.0-alt0.7
 402 Requires: gtk+ >= 1.2.3

Алексей Турбин совершенно зря потратил кучу времени пркручивая
версионирование символов к библиотекам.

 555 %add_optflags -DSYS_VIMRC_FILE=\\\"%_sysconfdir/vim/vimrc\\\"
 556 %add_optflags -DSYS_GVIMRC_FILE=\\\"%_sysconfdir/vim/gvimrc\\\"

В этом месте надо быть очень внимательным с кавычками и
экранированием.  If unsure, make patch.

 653 %make_install install DESTDIR=%buildroot -C src

Уже можно заменить на %makeinstall_std -C src .

 661 %strip_executable -p -g %buildroot/bin/vi
 667         %strip_executable -p -g "%buildroot%_bindir/vim-$ui"

С этим не справляется brp-strip?

 690 ln -s -f ../../vim/doc %buildroot%_customdocdir/doc

Лучше использовать relative(1).

 699 pushd %buildroot%_datadir/vim/tools
 700     # i need to make a choice :(.
 701     subst 's|#!/usr/bin/nawk|#!/usr/bin/gawk|' mve.awk
 702     subst 's,#!/bin/csh.*.*,#!/bin/sh,' vim132
 703     chmod a-x vimspell* ref*
 704 popd

Это лучше делать патчем.

 719 cat <<EOF >%buildroot%_rpmmacrosdir/vim
 720 # Global runtime
 721 %%vim_dir       %_datadir/vim

Когда макросы делаются через HEREDOC надо не забывать
экранировать % там где нужно.

 726 %%mkvimspell(L:a)       %%{!-L:%%{!-a:%%{error:mkvimspell: neither language nor -a is specified} }}%%{-L:env LANG="%%{-L*}"} %_bindir/vim-console -E -X -N -n -i NONE -u NONE -U NONE -c 'mkspell! %%{-a:-ascii} %%*' -c q

Макрос использует vim-console, однако rpm-build-vim от него не
зависит.

 768 cat <<EOF >%buildroot%_bindir/update-vimhelp
 774 [ -x "\$VIM" ] || exit 1

Когда шелл-скрипты делаются через HEREDOC надо не забывать
экранировать $ там где нужно.  Лучше подобные вещи делать
отдельным Source.

 886 %triggerpostun minimal -- vim-minimal < 6.0.118

Версия < 6.0.118 была собрана Thu Jan 03 2002.  Уже наверно никто
не сможет обновить подобную систему до current sisyphus.

1076 - Official patches (228)
1077  + (after 7.2.215) BufEnter "cd" autocommand causes problems
...
1083  + cscope is limited to 8 connections

Копировать апстримный changelog в changelog пакета - очень,
очень, очень плохая идея.  Для этого есть docdir.


Автору спека глубоко пофиг на метаданные своих пакетов и он не
любит директиву Source.  Попытка сделать универсальный спек себя
не оправдывает, а только создаёт проблемы, в первую очередь самом
автору.  Надо придерживаться принципа K.I.S.S.

-- 
Regards,
Sir Raorn.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [devel] [spec-lynch] vim.spec
  2009-10-11 13:10 [devel] [spec-lynch] vim.spec Alexey I. Froloff
@ 2009-10-11 14:55 ` Sergey Vlasov
  2009-10-11 15:55   ` Alexey I. Froloff
  0 siblings, 1 reply; 5+ messages in thread
From: Sergey Vlasov @ 2009-10-11 14:55 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 2643 bytes --]

On Sun, Oct 11, 2009 at 05:10:17PM +0400, Alexey I. Froloff wrote:
>   58 %define oname vim
>   59 %define major           7
>   60 %define minor           2
>   61 #define pre
>   62 %define patchlevel      262
>   67 Version: %major.%minor%{?pre:.000.%pre}%{?patchlevel:.%patchlevel}
> 
> Не самый удачный способ кодирования версии.  Во первых такую
> конструкцию не понимает gear, во вторых она не работает как надо.

Да, %{?...} в gear не работает (хотя простая подстановка строк
сработает правильно, за исключением случая, когда используемые там
макросы определяются внутри какого-нибудь %if... - в этом случае gear
не сможет выбрать из нескольких определений макроса нужное и молча
подставит не то, что нужно).

Ещё один способ борьбы с gear - не собирать Version: из компонентов, а
писать в окончательном виде, после чего разбирать на нужные
компоненты, используя что-то типа %( echo %version | sed ... ).

>  401 PreReq: alternatives >= 0.2.0-alt0.7
>  402 Requires: gtk+ >= 1.2.3
> 
> Алексей Турбин совершенно зря потратил кучу времени пркручивая
> версионирование символов к библиотекам.

К ископаемому gtk1 они ещё не прикручивались.  Впрочем, сборка пакета
vim-X11-gtk всё равно отключена с 2006 года; возможно, его стоит
похоронить окончательно.  Ну а alternatives - это совсем отдельный
вопрос; если древние версии этого пакета ещё рано объявлять
несуществующими, возможно, получится хотя бы проставлять эту
зависимость автоматически.

>  719 cat <<EOF >%buildroot%_rpmmacrosdir/vim
>  720 # Global runtime
>  721 %%vim_dir       %_datadir/vim
> 
> Когда макросы делаются через HEREDOC надо не забывать
> экранировать % там где нужно.

И $ (хотя против этого есть средства - см. далее; а вот от %% уже
никуда не деться).

>  726 %%mkvimspell(L:a)       %%{!-L:%%{!-a:%%{error:mkvimspell: neither language nor -a is specified} }}%%{-L:env LANG="%%{-L*}"} %_bindir/vim-console -E -X -N -n -i NONE -u NONE -U NONE -c 'mkspell! %%{-a:-ascii} %%*' -c q
> 
> Макрос использует vim-console, однако rpm-build-vim от него не
> зависит.

С другой стороны, не всем пользователям rpm-build-vim нужен этот
макрос...

>  768 cat <<EOF >%buildroot%_bindir/update-vimhelp
>  774 [ -x "\$VIM" ] || exit 1
> 
> Когда шелл-скрипты делаются через HEREDOC надо не забывать
> экранировать $ там где нужно.  Лучше подобные вещи делать
> отдельным Source.

Можно ещё cat <<'EOF' - тогда от sh ничего экранировать не нужно.
Вариант с отдельным Source не всегда удобен - иногда нужно раскрыть
какие-нибудь %macros в содержимом файла, тогда может быть проще
сделать heredoc, чем плодить sed.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [devel] [spec-lynch] vim.spec
  2009-10-11 14:55 ` Sergey Vlasov
@ 2009-10-11 15:55   ` Alexey I. Froloff
  2009-10-11 16:36     ` Sergey Vlasov
  0 siblings, 1 reply; 5+ messages in thread
From: Alexey I. Froloff @ 2009-10-11 15:55 UTC (permalink / raw)
  To: ALT Devel discussion list

[-- Attachment #1: Type: text/plain, Size: 1070 bytes --]

On Sun, Oct 11, 2009 at 06:55:03PM +0400, Sergey Vlasov wrote:
> >  726 %%mkvimspell(L:a)       %%{!-L:%%{!-a:%%{error:mkvimspell: neither language nor -a is specified} }}%%{-L:env LANG="%%{-L*}"} %_bindir/vim-console -E -X -N -n -i NONE -u NONE -U NONE -c 'mkspell! %%{-a:-ascii} %%*' -c q
> > Макрос использует vim-console, однако rpm-build-vim от него не
> > зависит.
> С другой стороны, не всем пользователям rpm-build-vim нужен этот
> макрос...
Тут выбор полные vs. достаточные зависимости.  В данном случае
чуть более чем 92.7% пользователей пакета rpm-build-vim не
используют этот макрос, поэтому было принято решение эту
зависимость не проставлять.

> Можно ещё cat <<'EOF' - тогда от sh ничего экранировать не нужно.
Уж не башизм ли это?

> Вариант с отдельным Source не всегда удобен - иногда нужно раскрыть
> какие-нибудь %macros в содержимом файла, тогда может быть проще
> сделать heredoc, чем плодить sed.
Именно так.  Но после сборки надо обязательно проверять
результат, я пару раз в этом месте ошибся ;-)

-- 
Regards,
Sir Raorn.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [devel] [spec-lynch] vim.spec
  2009-10-11 15:55   ` Alexey I. Froloff
@ 2009-10-11 16:36     ` Sergey Vlasov
  2009-10-11 19:36       ` Alexey Rusakov
  0 siblings, 1 reply; 5+ messages in thread
From: Sergey Vlasov @ 2009-10-11 16:36 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 997 bytes --]

On Sun, Oct 11, 2009 at 07:55:12PM +0400, Alexey I. Froloff wrote:
> On Sun, Oct 11, 2009 at 06:55:03PM +0400, Sergey Vlasov wrote:
> > Можно ещё cat <<'EOF' - тогда от sh ничего экранировать не нужно.
> Уж не башизм ли это?

Нет:
http://www.opengroup.org/onlinepubs/000095399/utilities/xcu_chap02.html#tag_02_07_04

| If any character in word is quoted, the delimiter shall be formed by
| performing quote removal on word, and the here-document lines shall
| not be expanded. Otherwise, the delimiter shall be the word itself.
| 
| If no characters in word are quoted, all lines of the here-document
| shall be expanded for parameter expansion, command substitution, and
| arithmetic expansion. In this case, the backslash in the input
| behaves as the backslash inside double-quotes (see Double-Quotes).
| However, the double-quote character ( '"' ) shall not be treated
| specially within a here-document, except when the double-quote
| appears within "$()", "``", or "${}".

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [devel] [spec-lynch] vim.spec
  2009-10-11 16:36     ` Sergey Vlasov
@ 2009-10-11 19:36       ` Alexey Rusakov
  0 siblings, 0 replies; 5+ messages in thread
From: Alexey Rusakov @ 2009-10-11 19:36 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 1340 bytes --]

В Вск, 11/10/2009 в 20:36 +0400, Sergey Vlasov пишет:
> On Sun, Oct 11, 2009 at 07:55:12PM +0400, Alexey I. Froloff wrote:
> > On Sun, Oct 11, 2009 at 06:55:03PM +0400, Sergey Vlasov wrote:
> > > Можно ещё cat <<'EOF' - тогда от sh ничего экранировать не нужно.
> > Уж не башизм ли это?
> 
> Нет:
> http://www.opengroup.org/onlinepubs/000095399/utilities/xcu_chap02.html#tag_02_07_04
> 
> | If any character in word is quoted, the delimiter shall be formed by
> | performing quote removal on word, and the here-document lines shall
> | not be expanded. Otherwise, the delimiter shall be the word itself.
> | 
> | If no characters in word are quoted, all lines of the here-document
> | shall be expanded for parameter expansion, command substitution, and
> | arithmetic expansion. In this case, the backslash in the input
> | behaves as the backslash inside double-quotes (see Double-Quotes).
> | However, the double-quote character ( '"' ) shall not be treated
> | specially within a here-document, except when the double-quote
> | appears within "$()", "``", or "${}".
Какие интересные подробности. Большое спасибо за информацию.

-- 
  Alexey "Ktirf" Rusakov
  GNOME Project
  ALT Linux Team

[-- Attachment #2: Эта часть сообщения подписана цифровой подписью --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-10-11 19:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-11 13:10 [devel] [spec-lynch] vim.spec Alexey I. Froloff
2009-10-11 14:55 ` Sergey Vlasov
2009-10-11 15:55   ` Alexey I. Froloff
2009-10-11 16:36     ` Sergey Vlasov
2009-10-11 19:36       ` Alexey Rusakov

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git