+++ /dev/null
-#!/bin/bash
-# copy this file to /etc/bash_completion.d/
-# or copy it to your home directory, rename it as .gbs.bash and add '. .gbs.bash' to ~/.bashrc
-
-__gbscomp ()
-{
- local cur_="${3-$cur}"
-
- case "$cur_" in
- --*=)
- COMPREPLY=()
- ;;
- *)
- local IFS=$'\n'
- COMPREPLY=($(compgen -P "${2-}"\
- -W "$(__gbscomp_1 "${1-}" "${4-}")"\
- -- "$cur_"))
- ;;
- esac
-}
-
-__gbscomp_1 ()
-{
- local c IFS=$' \t\n'
- for c in $1; do
- c="$c$2"
- case $c in
- --*=*|*.) ;;
- *) c="$c " ;;
- esac
- printf '%s\n' "$c"
- done
-}
-
-__gbs_main ()
-{
- COMPREPLY=()
- local cur prev cword cfgdir=/usr/share/gbs
- local -a words
- if declare -F _get_comp_words_by_ref &>/dev/null ; then
- _get_comp_words_by_ref cur prev words cword
- else
- cur=$2 prev=$3 words=("${COMP_WORDS[@]}") cword=$COMP_CWORD
- fi
-
- local i c=1 command
- while [ $c -lt $cword ]; do
- i="${words[c]}"
- case "$i" in
- --help) command="help"; break;;
- -c) let c++ ;;
- -*) ;;
- *) command="$i"; break;;
- esac
- let c++
- done
-
- __gbs && return
-}
-
-__gbs_find_on_cmdline ()
-{
- local word subcommand c=1
- while [ $c -lt $cword ]; do
- word="${words[c]}"
- for subcommand in $1; do
- if [ "$subcommand" = "$word" ]; then
- echo "$subcommand"
- return
- fi
- done
- let c++
- done
-}
-
-__gbs ()
-{
- subcommands="
- build remotebuild submit import export changelog chroot clone pull
- "
- common_opts="--upstream-tag= --upstream-branch= --squash-patches-until=
- --packaging-dir= --no-patch-export"
- lb_opts="
- --arch= --repository= --dist= --buildroot= --clean
- --include-all --extra-packs= --spec= --commit= --cache
- --skip-conf-repos --profile= --noinit --keep-packs
- --clean-repos --define --baselibs
- "
- rb_opts="
- --base-obsprj= --target-obsprj= --spec= --commit= --include-all
- --status --buildlog --profile= --arch= --repository=
- "
- sr_opts="
- --msg= --target= --commit= --spec= --sign --user-key= --remote= --tag=
- "
- im_opts="
- --merge --upstream-branch= --author-email= --author-name= --no-pristine-tar
- --packaging-dir= --upstream-vcs-tag= --allow-same-version --native
- --filter= --no-patch-import
- "
- ex_opts="
- --source-rpm --include-all --commit= --spec= --outdir=
- "
- ch_opts="--message= --since= --packaging-dir="
- cr_opts="--root"
- lbex_opts="--no-configure --exclude-from-file= --exclude= --binary-list= --threads=\
- --incremental --overwrite --clean-once --debug --deps --rdeps $lb_opts"
- cl_opts="--upstream-branch= --all --depth="
- pull_opts="--upstream-branch= --force --depth="
-
- subcommand="$(__gbs_find_on_cmdline "$subcommands")"
- if [ -z "$subcommand" ]; then
- case $cur in
- --*)
- __gbscomp "--version --help --verbose --debug"
- ;;
- *)
- __gbscomp "$subcommands"
- ;;
- esac
- else
- case "${subcommand},$cur" in
- build,--*)
- __gbscomp "$lb_opts $lbex_opts $common_opts"
- ;;
- remotebuild,--*)
- __gbscomp "$rb_opts $common_opts"
- ;;
- import,--*)
- __gbscomp "$im_opts"
- ;;
- export,--*)
- __gbscomp "$ex_opts $common_opts"
- ;;
- submit,--*)
- __gbscomp "$sr_opts"
- ;;
- changelog,--*)
- __gbscomp "$ch_opts"
- ;;
- chroot,--*)
- __gbscomp "$cr_opts"
- ;;
- clone,--*)
- __gbscomp "$cl_opts"
- ;;
- pull,--*)
- __gbscomp "$pull_opts"
- ;;
- *)
- COMPREPLY=()
- ;;
- esac
- fi
-}
-complete -F __gbs_main -o bashdefault -o default -o nospace gbs
--- /dev/null
+#!/bin/bash
+# copy this file to /etc/bash_completion.d/
+# or copy it to your home directory, rename it as .gbs.bash and add '. .gbs.bash' to ~/.bashrc
+
+__gbscomp ()
+{
+ local cur_="${3-$cur}"
+
+ case "$cur_" in
+ --*=)
+ COMPREPLY=()
+ ;;
+ *)
+ local IFS=$'\n'
+ COMPREPLY=($(compgen -P "${2-}"\
+ -W "$(__gbscomp_1 "${1-}" "${4-}")"\
+ -- "$cur_"))
+ ;;
+ esac
+}
+
+__gbscomp_1 ()
+{
+ local c IFS=$' \t\n'
+ for c in $1; do
+ c="$c$2"
+ case $c in
+ --*=*|*.) ;;
+ *) c="$c " ;;
+ esac
+ printf '%s\n' "$c"
+ done
+}
+
+__gbs_main ()
+{
+ COMPREPLY=()
+ local cur prev cword cfgdir=/usr/share/gbs
+ local -a words
+ if declare -F _get_comp_words_by_ref &>/dev/null ; then
+ _get_comp_words_by_ref cur prev words cword
+ else
+ cur=$2 prev=$3 words=("${COMP_WORDS[@]}") cword=$COMP_CWORD
+ fi
+
+ local i c=1 command
+ while [ $c -lt $cword ]; do
+ i="${words[c]}"
+ case "$i" in
+ --help) command="help"; break;;
+ -c) let c++ ;;
+ -*) ;;
+ *) command="$i"; break;;
+ esac
+ let c++
+ done
+
+ __gbs && return
+}
+
+__gbs_find_on_cmdline ()
+{
+ local word subcommand c=1
+ while [ $c -lt $cword ]; do
+ word="${words[c]}"
+ for subcommand in $1; do
+ if [ "$subcommand" = "$word" ]; then
+ echo "$subcommand"
+ return
+ fi
+ done
+ let c++
+ done
+}
+
+__gbs ()
+{
+ subcommands="
+ build remotebuild submit import export changelog chroot clone pull
+ "
+ common_opts="--upstream-tag= --upstream-branch= --squash-patches-until=
+ --packaging-dir= --no-patch-export"
+ lb_opts="
+ --arch= --repository= --dist= --buildroot= --clean
+ --include-all --extra-packs= --spec= --commit= --cache
+ --skip-conf-repos --profile= --noinit --keep-packs
+ --clean-repos --define --baselibs
+ "
+ rb_opts="
+ --base-obsprj= --target-obsprj= --spec= --commit= --include-all
+ --status --buildlog --profile= --arch= --repository=
+ "
+ sr_opts="
+ --msg= --target= --commit= --spec= --sign --user-key= --remote= --tag=
+ "
+ im_opts="
+ --merge --upstream-branch= --author-email= --author-name= --no-pristine-tar
+ --packaging-dir= --upstream-vcs-tag= --allow-same-version --native
+ --filter= --no-patch-import
+ "
+ ex_opts="
+ --source-rpm --include-all --commit= --spec= --outdir=
+ "
+ ch_opts="--message= --since= --packaging-dir="
+ cr_opts="--root"
+ lbex_opts="--no-configure --exclude-from-file= --exclude= --binary-list= --threads=\
+ --incremental --overwrite --clean-once --debug --deps --rdeps $lb_opts"
+ cl_opts="--upstream-branch= --all --depth="
+ pull_opts="--upstream-branch= --force --depth="
+
+ subcommand="$(__gbs_find_on_cmdline "$subcommands")"
+ if [ -z "$subcommand" ]; then
+ case $cur in
+ --*)
+ __gbscomp "--version --help --verbose --debug"
+ ;;
+ *)
+ __gbscomp "$subcommands"
+ ;;
+ esac
+ else
+ case "${subcommand},$cur" in
+ build,--*)
+ __gbscomp "$lb_opts $lbex_opts $common_opts"
+ ;;
+ remotebuild,--*)
+ __gbscomp "$rb_opts $common_opts"
+ ;;
+ import,--*)
+ __gbscomp "$im_opts"
+ ;;
+ export,--*)
+ __gbscomp "$ex_opts $common_opts"
+ ;;
+ submit,--*)
+ __gbscomp "$sr_opts"
+ ;;
+ changelog,--*)
+ __gbscomp "$ch_opts"
+ ;;
+ chroot,--*)
+ __gbscomp "$cr_opts"
+ ;;
+ clone,--*)
+ __gbscomp "$cl_opts"
+ ;;
+ pull,--*)
+ __gbscomp "$pull_opts"
+ ;;
+ *)
+ COMPREPLY=()
+ ;;
+ esac
+ fi
+}
+complete -F __gbs_main -o bashdefault -o default -o nospace gbs
Section: devel
Priority: extra
Maintainer: Jian-feng Ding <jian-feng.ding@intel.com>
-Build-Depends: debhelper (>= 7.0.15), python-dev
+Build-Depends: debhelper, python (>= 2.6), python-support
Standards-Version: 3.8.0
-X-Python-Version: >= 2.7
+X-Python-Version: >= 2.6
Homepage: http://www.tizen.org
Package: gbs
depanneur (>= 0.6),
pristine-tar (>= 1.26)
Recommends: librpm-tizen (>= 4.11.0.1.tizen20130304-tizen20130307)
-Description: The command line tools for Tizen package developers
+Description: Command line tools for Tizen package developers
The command line tools for Tizen package developers will
be used to do packaging related tasks.
--- /dev/null
+usr/lib/python*/*packages/gitbuildsys/__init__.py
+usr/lib/python*/*packages/gitbuildsys/oscapi.py
+usr/lib/python*/*packages/gitbuildsys/errors.py
+usr/lib/python*/*packages/gitbuildsys/log.py
+usr/lib/python*/*packages/gitbuildsys/safe_url.py
+usr/lib/python*/*packages/gitbuildsys/utils.py
+usr/lib/python*/*packages/gbs-*.egg-info
--- /dev/null
+usr/lib/python*/*packages/gitbuildsys/cmd_*.py
+usr/lib/python*/*packages/gitbuildsys/conf.py
+usr/lib/python*/*packages/gitbuildsys/parsing.py
+usr/bin/*
+etc/bash_completion.d/*
#!/usr/bin/make -f
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-GBS =$(shell pwd)/debian/gbs
-build: build-stamp
-build-stamp:
- dh_testdir
- python setup.py build
+%:
+ dh $@
-clean:
- dh_testdir
- dh_testroot
- rm -f build-stamp
- dh_clean
+override_dh_auto_install:
+ python setup.py install --root=debian/tmp --prefix=/usr
-install: build
- dh_testdir
- dh_testroot
- dh_clean -k
- dh_installdirs
- # Installing package
- mkdir -p '$(GBS)' '$(GBS)'/usr/bin '$(GBS)'/usr/share/doc/gbs
- install -m644 docs/RELEASE_NOTES '$(GBS)'/usr/share/doc/gbs
- # Bash completion
- install -d -m0755 '$(GBS)'/etc/bash_completion.d
- install -m0644 data/gbs-completion.bash \
- '$(GBS)'/etc/bash_completion.d/gbs
- python setup.py install --root=$(GBS) --prefix=/usr --install-layout=deb
-
-binary-indep: build install
- dh_testdir
- dh_testroot
- dh_installchangelogs
- dh_installdocs
- dh_install
- dh_installman
- dh_link
- dh_strip
- dh_compress
- dh_fixperms
- dh_installdeb
- dh_shlibdeps
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-
-binary-arch: build install
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install
+override_dh_auto_test:
+ @echo 'Skipping autotests'
+++ /dev/null
-Source: gbs
-Section: devel
-Priority: extra
-Maintainer: Jian-feng Ding <jian-feng.ding@intel.com>
-Build-Depends: debhelper (>= 7.0.15), python-dev
-Standards-Version: 3.8.0
-Homepage: http://www.tizen.org
-
-Package: gbs
-Architecture: all
-Depends: ${misc:Depends}, ${python:Depends},
- git-core,
- osc (>= 0.131),
- build (>= 2011.10.10),
- rpm,
- qemu-arm-static (>= 0.14.1) | qemu-user-static,
- binfmt-support,
- sudo,
- git-buildpackage-rpm,
- python-pycurl
-Description: The command line tools for Tizen package developers
- The command line tools for Tizen package developers will
- be used to do packaging related tasks.
+++ /dev/null
-This work was packaged for Debian by:
-
- Ding Jianfeng <jian-feng.ding@intel.com> on Fri, 02 Dec 2011 13:00:35 +0800
-
-It was downloaded from:
-
- http://www.tizen.org
-
-Upstream Authors:
-
- Intel Inc.
-
-Copyright:
-
- Copyright (C) 2011 Intel Inc.
+++ /dev/null
-README.rst
+++ /dev/null
-#!/usr/bin/make -f
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-build: build-stamp
-build-stamp:
- dh_testdir
- python setup.py build
-
-clean:
- dh_testdir
- dh_testroot
- rm -f build-stamp
- dh_clean
-
-install: build
- dh_testdir
- dh_testroot
- dh_clean -k
- dh_installdirs
- # Installing package
- mkdir -p $(CURDIR)/debian/gbs /usr/bin
- #make DESTDIR=$(CURDIR)/debian/gbs installman
- #make DESTDIR=$(CURDIR)/debian/gbs installconf
- #make DESTDIR=$(CURDIR)/debian/gbs installsymlinks
- python setup.py install --root=$(CURDIR)/debian/gbs --prefix=/usr --install-layout=deb
-
-binary-indep: build install
- dh_testdir
- dh_testroot
- dh_installchangelogs
- dh_installdocs
- dh_install
- dh_installman
- dh_link
- dh_strip
- dh_compress
- dh_fixperms
- dh_installdeb
- dh_shlibdeps
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-
-binary-arch: build install
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install
+++ /dev/null
-[general]
-; general settings
-tmpdir = /var/tmp
-
-[build]
-; settings for build subcommand
-build_server = https://api.tizen.org
-user = my_user_id
-passwd = pass_in_plaintxt
+++ /dev/null
-Format: 1.0
-Source: gbs
-Version: 0.9
-Binary: gbs
-Maintainer: Jian-feng Ding <jian-feng.ding@intel.com>
-Architecture: all
-Standards-Version: 3.7.1
-Build-Depends: debhelper (>= 4.0.0), python-dev
+++ /dev/null
-%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
-%{!?python_version: %define python_version %(%{__python} -c "import sys; sys.stdout.write(sys.version[:3])")}
-Name: gbs
-Summary: The command line tools for Tizen package developers
-Version: 0.15
-Release: 1
-Group: Development/Tools
-License: GPLv2
-BuildArch: noarch
-URL: http://www.tizen.org
-Source0: %{name}_%{version}.tar.gz
-Requires: python >= 2.6
-Requires: python-pycurl
-Requires: sudo
-Requires: osc >= 0.139.0
-Requires: tizen-gbp-rpm >= 20130308
-Requires: depanneur >= 0.6
-Requires: tizen-pristine-tar >= 1.26-tizen20130122
-
-%if "%{?python_version}" < "2.7"
-Requires: python-argparse
-%endif
-%if ! 0%{?tizen_version:1}
-Requires: librpm-tizen >= 4.11.0.1.tizen20130304-tizen20130307
-%endif
-Requires: %{name}-api = %{version}
-
-BuildRequires: python-devel
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
-
-%description
-The command line tools for Tizen package developers will
-be used to do packaging related tasks.
-
-%package api
-Summary: GBS APIs
-Conflicts: gbs < 0.15
-Requires: python
-Requires: python-pycurl
-Requires: osc >= 0.139.0
-Requires: git-buildpackage-rpm
-
-%description api
-This package contains gbs APIs, which can be used by
-external software.
-
-%prep
-%setup -q -n %{name}-%{version}
-
-
-%build
-CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
-
-
-%install
-rm -rf $RPM_BUILD_ROOT
-%if 0%{?suse_version}
-%{__python} setup.py install --root=$RPM_BUILD_ROOT --prefix=%{_prefix}
-%else
-%{__python} setup.py install --root=$RPM_BUILD_ROOT -O1
-%endif
-mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d
-install -pm 644 data/gbs-completion.bash %{buildroot}%{_sysconfdir}/bash_completion.d/gbs.sh
-
-#mkdir -p %{buildroot}/%{_prefix}/share/man/man1
-#install -m644 doc/gbs.1 %{buildroot}/%{_prefix}/share/man/man1
-
-%files
-%defattr(-,root,root,-)
-%doc README.rst docs/RELEASE_NOTES
-#%{_mandir}/man1/*
-%{python_sitelib}/gitbuildsys/cmd_*.py*
-%{python_sitelib}/gitbuildsys/conf.py*
-%{python_sitelib}/gitbuildsys/parsing.py*
-%{_bindir}/*
-%{_sysconfdir}/bash_completion.d
-
-%files api
-%defattr(-,root,root,-)
-%dir %{python_sitelib}/gitbuildsys
-%{python_sitelib}/gitbuildsys/__init__.py*
-%{python_sitelib}/gitbuildsys/oscapi.py*
-%{python_sitelib}/gitbuildsys/errors.py*
-%{python_sitelib}/gitbuildsys/log.py*
-%{python_sitelib}/gitbuildsys/safe_url.py*
-%{python_sitelib}/gitbuildsys/utils.py*
-%{python_sitelib}/gbs-*-py*.egg-info
Maintainer: Jian-feng Ding <jian-feng.ding@intel.com>
Architecture: all
Standards-Version: 3.7.1
-Build-Depends: debhelper (>= 4.0.0), python-dev
+Build-Depends: debhelper, python-support
Files:
574996dfeeb001e70f20239a0e621daf 2457861 gbs_0.15.tar.gz
+++ /dev/null
-../distfiles/gbs.spec
\ No newline at end of file
--- /dev/null
+%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
+%{!?python_version: %define python_version %(%{__python} -c "import sys; sys.stdout.write(sys.version[:3])")}
+Name: gbs
+Summary: The command line tools for Tizen package developers
+Version: 0.15
+Release: 1
+Group: Development/Tools
+License: GPLv2
+BuildArch: noarch
+URL: http://www.tizen.org
+Source0: %{name}_%{version}.tar.gz
+Requires: python >= 2.6
+Requires: python-pycurl
+Requires: sudo
+Requires: osc >= 0.139.0
+Requires: tizen-gbp-rpm >= 20130308
+Requires: depanneur >= 0.6
+Requires: tizen-pristine-tar >= 1.26-tizen20130122
+
+%if "%{?python_version}" < "2.7"
+Requires: python-argparse
+%endif
+%if ! 0%{?tizen_version:1}
+Requires: librpm-tizen >= 4.11.0.1.tizen20130304-tizen20130307
+%endif
+Requires: %{name}-api = %{version}
+
+BuildRequires: python-devel
+BuildRoot: %{_tmppath}/%{name}-%{version}-build
+
+%description
+The command line tools for Tizen package developers will
+be used to do packaging related tasks.
+
+%package api
+Summary: GBS APIs
+Conflicts: gbs < 0.15
+Requires: python
+Requires: python-pycurl
+Requires: osc >= 0.139.0
+Requires: git-buildpackage-rpm
+
+%description api
+This package contains gbs APIs, which can be used by
+external software.
+
+%prep
+%setup -q -n %{name}-%{version}
+
+
+%build
+%{__python} setup.py build
+
+%install
+%{__python} setup.py install --prefix=%{_prefix} --root=%{buildroot}
+
+#mkdir -p %{buildroot}/%{_prefix}/share/man/man1
+#install -m644 doc/gbs.1 %{buildroot}/%{_prefix}/share/man/man1
+
+%clean
+rm -rf %{buildroot}
+
+%files
+%defattr(-,root,root,-)
+%doc README.rst docs/RELEASE_NOTES
+#%{_mandir}/man1/*
+%{python_sitelib}/gitbuildsys/cmd_*.py*
+%{python_sitelib}/gitbuildsys/conf.py*
+%{python_sitelib}/gitbuildsys/parsing.py*
+%{_bindir}/*
+%{_sysconfdir}/bash_completion.d
+
+%files api
+%defattr(-,root,root,-)
+%dir %{python_sitelib}/gitbuildsys
+%{python_sitelib}/gitbuildsys/__init__.py*
+%{python_sitelib}/gitbuildsys/oscapi.py*
+%{python_sitelib}/gitbuildsys/errors.py*
+%{python_sitelib}/gitbuildsys/log.py*
+%{python_sitelib}/gitbuildsys/safe_url.py*
+%{python_sitelib}/gitbuildsys/utils.py*
+%{python_sitelib}/gbs-*-py*.egg-info
path = os.path.join(mod_name, "__init__.py")
if not os.path.isfile(path):
print 'No %s version file found' % path
- return
+ sys.exit(1)
content = open(path).read()
match = re.search(r'^__version__\s*=\s*[\x22\x27]([^\x22\x27]+)[\x22\x27]',
return match.group(1)
print 'Unable to find version in %s' % path
-
-
-VERSION = get_version(MOD_NAME)
-if not VERSION:
sys.exit(1)
-# HACK!!! --install-layout=deb must be used in debian/rules
-# "--install-layout=deb" is required for pyver>2.5 in Debian likes
-if sys.version_info[:2] > (2, 5):
- if len(sys.argv) > 1 and 'install' in sys.argv:
- import platform
- # for debian-like distros, mods will be installed to
- # ${PYTHONLIB}/dist-packages
- if platform.linux_distribution()[0] in ('debian', 'Ubuntu'):
- sys.argv.append('--install-layout=deb')
-
setup(name='gbs',
- version=VERSION,
+ version=get_version(MOD_NAME),
description='The command line tools for Tizen package developers',
author='Jian-feng Ding, Huaxu Wan',
author_email='jian-feng.ding@intel.com, huaxu.wan@intel.com',
url='https://git.tizen.org/',
scripts=['tools/gbs'],
+ data_files = [('/etc/bash_completion.d/', ['data/gbs.sh'])],
packages=[MOD_NAME],
)