Discussion:
Calling into the shell
Philip Prindeville
2007-09-15 16:51:46 UTC
Permalink
I'm trying to take a variable, and perform some substitutions on it
(kind of like $(subst,,,) in gmake).

The variable looks like:

%define builtin_modules mod_tls:mod_lang:mod_readme:...

=====

%description
ProFTPD is an enhanced FTP server with a focus toward simplicity, security,
and ease of configuration. It features a very Apache-like configuration
syntax, and a highly customizable server infrastructure, including support for
multiple 'virtual' FTP servers, anonymous FTP, and permission-based directory
visibility.

The base proftpd package installs standalone support. You can install the
proftpd-inetd package to enable inetd/xinetd support.

Likewise, mod_sql_mysql, mod_ldap, etc. can be installed separately to avoid
unnecessary dependencies.

%{?shared_modules:This package supports DSO (shared) modules.}

Intrinsic static modules: %{eval echo "${builtin_modules}" | sed -e 's/:/, /g'}

Optional static modules: %{eval echo "${static_modules}" | sed -e 's/:/, /g'}

Bundled shared modules: %{eval echo "${shared_modules}" | sed -e 's/:/, /g'}

Unbundled (optional) shared modules: ${eval echo "${unbundled_modules}" | sed -e 's/:/, /g'}


=====


What's the proper way to do this?

Thanks!
Michael Jennings
2007-09-15 16:56:19 UTC
Permalink
On Saturday, 15 September 2007, at 09:51:46 (-0700),
Post by Philip Prindeville
Intrinsic static modules: %{eval echo "${builtin_modules}" | sed -e 's/:/, /g'}
%(echo %{builtin_modules} | sed 's/:/, /g')

Michael
--
Michael Jennings (a.k.a. KainX) http://www.kainx.org/ <***@kainx.org>
Linux Server/Cluster Admin, LBL.gov Author, Eterm (www.eterm.org)
-----------------------------------------------------------------------
"Greater than the death of flesh is the death of hope, the death of
dreams. Against this peril we can never surrender."
-- G'Kar, Babylon 5
Loading...