michael@13: ##
michael@13: ## rpmpopt -- OpenPKG RPM POPT Configuration
michael@428: ## Copyright (c) 2000-2012 OpenPKG GmbH
michael@13: ##
michael@428: ## This software is property of the OpenPKG GmbH, DE MUC HRB 160208.
michael@428: ## All rights reserved. Licenses which grant limited permission to use,
michael@428: ## copy, modify and distribute this software are available from the
michael@428: ## OpenPKG GmbH.
michael@13: ##
michael@428: ## THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
michael@13: ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@13: ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@13: ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@13: ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@13: ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@13: ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@13: ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@13: ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@13: ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@13: ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@13: ## SUCH DAMAGE.
michael@13: ##
michael@428:
michael@428: ##
michael@13: ## The purpose of this configuration file is to extend and override
michael@13: ## the "rpmpopt" directives in the default RPM POPT configuration with
michael@13: ## OpenPKG specific extensions and adjustments.
michael@13: ##
michael@13:
michael@428: # extended short-hand option
michael@428: rpm alias --force --replacepkgs --replacefiles --oldpackage --noparentdirs \
michael@428: --POPTdesc=$"force operation (short hand for --replacepkgs --replacefiles --oldpackage --noparentdirs on installation)"
michael@428:
michael@13: # backward compatibility for old RPM extensions
michael@13: rpm exec --stowaway echo "install \"openpkg-tools\" and use \"openpkg stowaway\" now please."
michael@13: rpm exec --makeproxy echo "install \"openpkg-tools\" and use \"openpkg makeproxy\" now please."
michael@13: rpm exec --fetch echo "install \"openpkg-tools\" and use \"openpkg fetch\" now please."
michael@13:
michael@13: # RPM exentsion: "rpm -bs --[no]restriction"
michael@13: rpm alias --restriction --define "restriction yes" \
michael@13: --POPTdesc=$"exclude %NoSource files in .src.rpm"
michael@13: rpm alias --norestriction --define "restriction no" \
michael@13: --POPTdesc=$"include %NoSource files in .src.rpm"
michael@13:
michael@13: # RPM extension: "rpm --with[out] "
michael@13: rpm alias --with --define "with_!#:+ yes" \
michael@13: --POPTdesc=$"set '%option with_ yes'" \
michael@13: --POPTargs=$""
michael@13: rpm alias --without --define "with_!#:+ no" \
michael@13: --POPTdesc=$"set '%option with_ no'" \
michael@13: --POPTargs=$""
michael@13:
michael@13: # RPM extension: "rpm --option "
michael@13: rpm alias --option --define "!#:+ !#:+" \
michael@13: --POPTdesc=$"set '%option '" \
michael@13: --POPTargs=$" "
michael@13:
michael@13: # RPM extension: "rpm --tag "
michael@13: rpm alias --tag --define "l_tag_fmt !#:+" \
michael@13: --POPTdesc=$"set 'binary package filename tag'" \
michael@13: --POPTargs=$""
michael@13:
michael@13: # RPM extension: "rpm --db-{build,rebuild,cleanup,fixate}"
michael@13: rpm exec --db-build rpmdb --build \
michael@13: --POPTdesc=$"RPM database administration: build new database (destructive operation; you have to know what you are doing)"
michael@428: rpm exec --db-migrate rpmdb --migrate \
michael@428: --POPTdesc=$"RPM database administration: change database format (migration operation; you have to know what you are doing)"
michael@13: rpm exec --db-rebuild rpmdb --rebuild \
michael@13: --POPTdesc=$"RPM database administration: rebuild new from old database (upgrading operation; reasonable after upgrades or on DB corruption)"
michael@13: rpm exec --db-cleanup rpmdb --cleanup \
michael@13: --POPTdesc=$"RPM database administration: cleanup existing database (cleaning operation; reasonable after DB out-of-sync situations)"
michael@13: rpm exec --db-fixate rpmdb --fixate \
michael@13: --POPTdesc=$"RPM database administration: fixate existing database (harmless operation; for fixating files only)"
michael@13:
michael@13: # RPM extension: "rpm --db-private ..."
michael@428: rpm alias --db-private --define "__dbi_private yes" \
michael@13: --POPTdesc=$"operate RPM database in Berkeley-DB DB_PRIVATE mode"
michael@13:
michael@13: # RPM extension: "rpm --track"
michael@13: rpm alias --track -bt \
michael@13: --POPTdesc=$"run package vendor source tracking script (%track)"
michael@13:
michael@13: # RPM extension: "rpm --track-dump"
michael@13: rpm alias --track-dump -bt --define '___track_dump yes' \
michael@13: --POPTdesc=$"dump the vendor source tracking script (%track)"
michael@13:
michael@428: # RPM extension: "rpm --runtime-test"
michael@428: rpm alias --runtime-test -q --qf '%{TEST}\n' \
michael@13: --pipe "grep -v \(none\) | @l_prefix@/lib/openpkg/bash" \
michael@13: --POPTdesc=$"run package run-time test script (%test)"
michael@13:
michael@13: # RPM adjustment: "rpm --setperms ..."
michael@13: rpm alias --setperms -q --qf \
michael@13: '[\[ -h %{FILENAMES:shescape} \] || chmod %7.7{FILEMODES:octal} %{FILENAMES:shescape}\n]' \
michael@13: --pipe "grep -v '(none)' | sed 's/chmod .../chmod /' | @l_prefix@/lib/openpkg/bash" \
michael@13: --POPTdesc=$"set permissions of files in a package"
michael@13:
michael@13: # RPM adjustment: "rpm --setugids ..."
michael@13: rpm alias --setugids -q --qf \
michael@13: '[run %{FILEUSERNAME:shescape} %{FILEGROUPNAME:shescape} %{FILENAMES:shescape}\n]' \
michael@428: --pipe "(echo 'run () { chown -h -- \"$1\" \"$3\"; chgrp -h -- \"$2\" \"$3\"; }'; grep -v '(none)') | @l_prefix@/lib/openpkg/bash" \
michael@13: --POPTdesc=$"set user/group ownership of files in a package"
michael@13:
michael@428: # RPM extension: "rpm -qp --environment"
michael@428: rpm alias --environment --qf '%{Environment}\n' \
michael@428: --pipe "@l_prefix@/lib/openpkg/rpm --eval '%{__environment_to_xml}'" \
michael@428: --POPTdesc=$"query the recursively tracked build environment of a package as XML"
michael@428:
michael@428: # RPM extension: "rpm --marker "
michael@428: rpm alias --mark --define "__marker !#:+" \
michael@428: --POPTdesc=$"mark package with Marker: " \
michael@428: --POPTargs=$""
michael@428:
michael@428: # RPM adjustment: "rpm -bs" implies "--nodeps"
michael@428: rpm alias -bs -bs --nodeps
michael@428:
michael@428: # RPM exentsion: "rpm --no-build{dependency,environment}"
michael@428: rpm alias --no-builddependency --undefine "__autogen_builddependency" \
michael@428: --POPTdesc=$"do not auto-generate BuildDependency tag"
michael@428: rpm alias --no-buildenvironment --undefine "__autogen_buildenvironment" \
michael@428: --POPTdesc=$"do not auto-generate BuildEnvironment tag"
michael@428:
michael@428: # RPM extension: "rpm --layout "
michael@428: rpm alias --layout --define "openpkg_layout basedir=%(pwd) layout=!#:+" \
michael@428: --POPTdesc=$"choose a particular packaging environment layout (global, local, simple, structured, distributed)" \
michael@428: --POPTargs=$""
michael@428:
michael@428: # RPM extension: "rpm --local"
michael@428: rpm alias --local --define "openpkg_layout basedir=%(pwd) layout=local" \
michael@428: --POPTdesc=$"choose the 'local' packaging environment layout based on current directory as the base directory"
michael@428:
michael@13: # RPM adjustment: improved and cleaned up "rpm -i/--info"
michael@428: rpm alias --info --qf '\
michael@13: Name: %-25{NAME} Source RPM: %{SOURCERPM}\n\
michael@13: Version: %-25{VERSION} Signature: %|DSAHEADER?{dsa:%{DSAHEADER:pgpsig}}:{%|RSAHEADER?{rsa:%{RSAHEADER:pgpsig}}:{%|SIGGPG?{gpg:%{SIGGPG:pgpsig}}:{%|SIGPGP?{pgp:%{SIGPGP:pgpsig}}:{%|SIGMD5?{md5:%{SIGMD5}}:{(none)}|}|}|}|}|\n\
michael@13: Release: %-25{RELEASE} Build Host: %{BUILDHOST}\n\
michael@13: Group: %-25{GROUP} Build System: %{ARCH}-%{OS}\n\
michael@13: Class: %-25{CLASS} Build Time: %{BUILDTIME:date}\n\
michael@13: Distrib: %-25{DISTRIBUTION} Install Time: %|INSTALLTIME?{%{INSTALLTIME:date}}:{(not installed)}|\n\
michael@13: License: %-25{LICENSE} Install Size: %{SIZE} bytes\n\
michael@13: Packager: %-25{PACKAGER} Relocations: %|PREFIXES?{[%{PREFIXES} ]}:{(not relocateable)}|\n\
michael@13: Vendor: %{VENDOR}\n\
michael@13: Summary: %{SUMMARY}\n\
michael@13: URL: %{URL}\n\
michael@13: Description:\n%{DESCRIPTION}\n\
michael@13: %|PROVIDENAME?{Provides:\n\
michael@428: [ %{PROVIDENAME}%|PROVIDEFLAGS?{%{PROVIDEFLAGS:depflags}%{PROVIDEVERSION}}:{}|\n]}:{}|\
michael@428: %|CONFLICTNAME?{Conflicts:\n\
michael@428: [ %{CONFLICTNAME}%|CONFLICTFLAGS?{%{CONFLICTFLAGS:depflags}%{CONFLICTVERSION}}:{}|\n]}:{}|\
michael@428: %|OBSOLETENAME?{Obsoletes:\n\
michael@428: [ %{OBSOLETENAME}%|OBSOLETEFLAGS?{%{OBSOLETEFLAGS:depflags}%{OBSOLETEVERSION}}:{}|\n]}:{}|\
michael@428: %|REQUIRENAME?{Requires:\n\
michael@428: [ %{REQUIRENAME}%|REQUIREFLAGS?{%{REQUIREFLAGS:depflags}%{REQUIREVERSION}}:{}|\n]}:{}|\
michael@13: ' --POPTdesc=$"list descriptive information from package(s)"
michael@13: