ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: Michael Shigorin <mike@osdn.org.ua>
To: devel@lists.altlinux.org
Subject: [devel] маленькое открытие про %if_enabled и BuildRequires
Date: Thu, 14 May 2009 23:15:55 +0300
Message-ID: <20090514201555.GY15370@osdn.org.ua> (raw)

	Здравствуйте.
Оказывается, в %package работает и BuildRequires -- ниже
"краткий полный пример" использования в collectd.spec:

%def_enable curl

...

%package full
...
%{?_enable_curl:Requires: %name-curl}

...

%if_enabled curl
%package curl
Summary: CURL support module for collectd
Group: Monitoring
Requires: collectd = %version-%release
BuildRequires: libcurl-devel
# ^^^^^^^^^^^^^^^^^^^^^^^^^^

%description curl
This plugin provides CURL (proxy, etc) support for collectd
%endif

...

%configure \
...
        %{subst_enable curl} \
...

%files
...
%_libdir/%name/*.so
%{?_enable_curl:%exclude %_libdir/%name/curl.so}

%if_enabled curl
%files curl
%_libdir/%name/curl.so
%endif

PS: а вообще для таких плагинистых пакетов с высокой степенью
соответствия строчек, которые попадают к %def_enable, %configure,
%package и %files (в данном случае они все тут с подчёркиваниями,
а не минусами, как в mplayer.spec) -- потихоньку хочется какой-то
шаблонный генератор.  Но думать в эту сторону пока лень.

-- 
 ---- WBR, Michael Shigorin <mike@altlinux.ru>
  ------ Linux.Kiev http://www.linux.kiev.ua/


             reply	other threads:[~2009-05-14 20:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-14 20:15 Michael Shigorin [this message]
2009-05-15  0:14 ` Денис Смирнов
2009-05-15 13:28 ` Sergey V Turchin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090514201555.GY15370@osdn.org.ua \
    --to=mike@osdn.org.ua \
    --cc=devel@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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