summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorRichard Hughes <rhughes@redhat.com>2008-06-16 14:43:03 -0400
committerKristian Høgsberg <krh@redhat.com>2008-06-16 15:40:30 -0400
commite967bfd71a068d6c3f5831cfa93de92d78136065 (patch)
tree80484292b4f3e4877853bf14acb7d15e5cbf108f /data
parent614b267207d0caf51c33d5c3e7036195aa0624c4 (diff)
Autoconfify razor.
Diffstat (limited to 'data')
-rw-r--r--data/.gitignore2
-rw-r--r--data/Makefile.am11
-rw-r--r--data/bash-completion.sh47
-rw-r--r--data/razor.pc.in12
4 files changed, 72 insertions, 0 deletions
diff --git a/data/.gitignore b/data/.gitignore
new file mode 100644
index 0000000..16bc098
--- /dev/null
+++ b/data/.gitignore
@@ -0,0 +1,2 @@
+razor.pc
+
diff --git a/data/Makefile.am b/data/Makefile.am
new file mode 100644
index 0000000..9405c68
--- /dev/null
+++ b/data/Makefile.am
@@ -0,0 +1,11 @@
+## Process this file with automake to produce Makefile.in
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = razor.pc
+
+bashcompletiondir = ${SYSCONFDIR}/bash_completion.d
+dist_bashcompletion_DATA = bash-completion.sh
+
+clean-local :
+ rm -f *~
+
diff --git a/data/bash-completion.sh b/data/bash-completion.sh
new file mode 100644
index 0000000..a4e9f4e
--- /dev/null
+++ b/data/bash-completion.sh
@@ -0,0 +1,47 @@
+__razor_commands () {
+ local IFS=$'\n'
+ COMPREPLY=($(IFS=: compgen -S' ' -W "list-requires:list-provides:list-files:list-file-packages:list-package-files:what-requires:what-provides:import-yum:import-rpmdb:validate:update:diff:install:init:download" -- $1))
+}
+
+__razor_packages () {
+ local IFS=$'\n'
+
+ COMPREPLY=($(./razor list --only-names "$1*" | while read p; do echo "$p "; done))
+}
+
+__razor_upstream_packages () {
+ local IFS=$'\n'
+
+ COMPREPLY=($(RAZOR_REPO=rawhide.repo ./razor list --only-names "$1*" | while read p; do echo "$p "; done))
+}
+
+__razor_files() {
+ COMPREPLY=($(./razor list-files "$1*"))
+}
+
+__razor_requires() {
+ COMPREPLY=($(compgen -W "$(./razor list-requires)" -- $1))
+}
+
+__razor_provides() {
+ COMPREPLY=($(compgen -W "$(./razor list-provides)" -- $1))
+}
+
+__razor() {
+ local cur="${COMP_WORDS[COMP_CWORD]}"
+
+ if [ $COMP_CWORD = 1 ]; then
+ __razor_commands $cur
+ else
+ case "${COMP_WORDS[1]}" in
+ list-requires|list-provides|list-package-files)
+ __razor_packages $cur ;;
+ list-files|list-file-packages) __razor_files $cur ;;
+ what-requires) __razor_requires $cur ;;
+ what-provides) __razor_provides $cur ;;
+ install|download) __razor_upstream_packages $cur ;;
+ esac
+ fi
+}
+
+complete -o nospace -F __razor razor
diff --git a/data/razor.pc.in b/data/razor.pc.in
new file mode 100644
index 0000000..ddf0ba0
--- /dev/null
+++ b/data/razor.pc.in
@@ -0,0 +1,12 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: razor
+Description: library for depsolving, installing and removing packages
+Version: @VERSION@
+Requires: expat curl
+Libs: -L${libdir} -lexpat -lz -lcurl
+Cflags: -I${includedir}/razor
+