# Server side packages.server.dep_rewrite file (this has to stay in /etc/entropy/packages)
# Using this file, you can apply arbitrary transformations to
# package dependencies via regular expressions.
# It can be used in case of Source Package Managers not properly
# splitting packages (and thus, dependencies), making possible to
# rewrite dependency strings without forking packages.
#
# PLEASE PRETTY PLEASE NOTE: in Entropy world, there are also conditional
# dependencies, composed by multiple dep strings connected together with logical
# AND or OR operators: ( app-foo/bar & foo-app/rab ) | app-nice/woot
# Please take this into consideration when writing dep rewrites.

# LINE CONSTRUCTION:
# <::pkg::> <::dep_pattern::> <::dep_replace_1::> [<::dep_replace_2::> ...]
# ::pkg:: = package containing dependency to match, or * for catch-all
# ::dep_pattern:: = regexp of dependency to match
# ::dep_replace_1:: = replacement regexp
# ::dep_replace_n:: = additional replacement regexps (producing more deps out
#                     of one initially available)
# This is the function used for dependency rewrite:
# http://docs.python.org/library/re.html#re.sub
# See examples below

# EXAMPLES:

# replace media-sound/bar with media-sound/baz:
#    media-gfx/foo media-sound/bar media-sound/baz

# Some more complex substitutions, change app-text/poppler dependency into
# app-text/poppler-glib maintaining the operator and version parts:
#    media-gfx/pdf2svg (.*)app-text/poppler-(.*)(\[.*\]) \1app-text/poppler-glib-\2
#    kde-base/okular (.*)app-text/poppler-(.*)(\[.*\]) \1app-text/poppler-qt4-\2
#    media-gfx/inkscape (.*)app-text/poppler-(.*)(\[.*\]) \1app-text/poppler-glib-\2

# Some removal examples:
# remove media-sound/bar from media-gfx/foo dependencies:
#    media-gfx/foo media-sound/bar
#
# Note 1: the removal dependency pattern can take advantage of regular
# expressions, of course.
# Note 2: providing no replaces, makes Entropy remove the whole matched dependency
# at <::dep_pattern::> (media-sound/bar) position, if found in media-gfx/foo
# dependencies.

# add a new dependency to media-gfx/foo, called media-sound/bar.
# Moreover, you can specify what kind of dependency you're adding appending
# an id between < and > at the end of the string.
# 1: build dependency
# 2: runtime dependency
# 3: post-dependency
# 4: manual dependency (dependency added by hand, this is the default)
# This is optional.
# If you want to add a conflict, just write something like:
#    media-gfx/foo ++!media-sound/bar
# Generic example:
#    media-gfx/foo ++media-sound/bar<3>

# Secial case, catch-all keyword.
# Apply a dep_rewrite rule to any package being added:
#    * <::dep_pattern::> <::dep_replace_1::> [<::dep_replace_2::> ...]
# In other words, set <::pkg::> to *
