Adrian Schröter 2024-07-16 11:53:21 +00:00 committed by Git OBS Bridge
commit 959384f847
18 changed files with 4155 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

23
PKGBUILD Normal file
View File

@ -0,0 +1,23 @@
pkgname=osc
pkgver=1.8.3
pkgrel=0
pkgdesc="Command-line client for the Open Build Service"
arch=('x86_64')
url="https://www.github.com/openSUSE/osc"
license=('GPL-2.0+' 'GPL-2.0')
groups=('base-devel')
depends=('python-cryptography' 'python-urllib3')
makedepends=('python>=3.6' 'python-cryptography' 'python-setuptools' 'python-urllib3')
source=(osc-${pkgver}.tar.gz)
md5sums=('SKIP')
build() {
cd "${srcdir}"/osc-${pkgver}
python setup.py build
}
package() {
msg "Installing osc ..."
cd "${srcdir}"/osc-${pkgver}
python setup.py install --root="${pkgdir}/" --optimize=1 --prefix=/usr
}

4
_service Normal file
View File

@ -0,0 +1,4 @@
<services>
<service name="download_files" mode="manual"/>
<service name="set_version" mode="manual"/>
</services>

36
appimage.yml Normal file
View File

@ -0,0 +1,36 @@
app: osc
build:
packages:
- linuxdeployqt
ingredients:
packages:
- build
- osc
- obs-scm-bridge
- obs-service-download_files
- obs-service-format_spec_file
- obs-service-obs_scm
- obs-service-recompress
- obs-service-set_version
- obs-service-tar_scm
- obs-service-verify_file
- openSUSE-release
- openSUSE-release-ftp
- rsync
script:
- mkdir -p $BUILD_APPDIR/usr/share/pixmaps
- cp /usr/share/pixmaps/appimage.png $BUILD_APPDIR/usr/share/pixmaps
- mkdir -p $BUILD_APPDIR/usr/share/applications
- echo "[Desktop Entry]" > $BUILD_APPDIR/usr/share/applications/osc.desktop
- echo "Name=osc" >> $BUILD_APPDIR/usr/share/applications/osc.desktop
- echo "Exec=osc" >> $BUILD_APPDIR/usr/share/applications/osc.desktop
- echo "Icon=appimage" >> $BUILD_APPDIR/usr/share/applications/osc.desktop
- echo "Categories=Development" >> $BUILD_APPDIR/usr/share/applications/osc.desktop
- echo "Type=Application" >> $BUILD_APPDIR/usr/share/applications/osc.desktop
# /usr/bin/python3 would run system python3 with libs from the appimage
# while /usr/bin/env python3 uses the correct binary from the appimage
- sed -i -e 's,^#!/usr/bin/python3,#!/usr/bin/env python3,' $BUILD_APPDIR/usr/bin/osc
- linuxdeployqt $BUILD_APPDIR/usr/share/applications/*.desktop -bundle-non-qt-libs -verbose=2

5
debian.changelog Normal file
View File

@ -0,0 +1,5 @@
osc (1.8.3-0) unstable; urgency=low
* Placeholder
-- Adrian Schroeter <adrian@suse.de> Wed, 05 Apr 2023 12:34:56 +0000

1
debian.compat Normal file
View File

@ -0,0 +1 @@
10

34
debian.control Normal file
View File

@ -0,0 +1,34 @@
Source: osc
Priority: optional
Maintainer: Adrian Schroeter <adrian@suse.de>
Build-Depends:
debhelper (>= 10),
dh-python,
python3-all (>=3.6),
python3-argparse-manpage,
python3-cryptography,
python3-setuptools,
python3-urllib3
Standards-Version: 3.7.1
Section: devel
Package: osc
Section: devel
Architecture: any
Depends:
${shlibs:Depends},
${misc:Depends},
${python3:Depends},
python3-cryptography,
python3-urllib3,
build | obs-build
Recommends:
bash-completion,
python3-progressbar,
python3-rpm,
python3-keyring,
python3-keyring-keyutils,
sudo,
xdg-utils
Description: Command-line client for the Open Build Service
OpenSUSE Commander is a command-line client for the Open Build Service.

17
debian.copyright Normal file
View File

@ -0,0 +1,17 @@
This package was debianized by J.H.M. Dassen (Ray) <jdassen@debian.org> on
Fri, 12 May 2006 14:12:04 +0200.
It was downloaded from www.opensuse.org
Upstream Author: Peter Poeml <poeml@suse.de>
Copyright Holder: Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
License:
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
osc itself is GPL, for the full text of the GPL see /usr/share/common-licenses/GPL

3
debian.dirs Normal file
View File

@ -0,0 +1,3 @@
usr/bin
usr/sbin
usr/share/man

1
debian.docs Normal file
View File

@ -0,0 +1 @@
README.md

1
debian.lintian-overrides Normal file
View File

@ -0,0 +1 @@
osc: shell-script-fails-syntax-check *

1
debian.manpages Normal file
View File

@ -0,0 +1 @@
osc.1

28
debian.rules Normal file
View File

@ -0,0 +1,28 @@
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1
export PYBUILD_NAME=osc
%:
dh $@ --with python3 --buildsystem=pybuild
override_dh_auto_build:
dh_auto_build
PYTHONPATH=. argparse-manpage \
--output=osc.1 \
--module=osc.commandline \
--function=get_parser \
--project-name=osc \
--author="Contributors to the osc project. See the project's GIT history for the complete list." \
--url="https://github.com/openSUSE/osc/"
override_dh_auto_install:
dh_auto_install
install -Dm0644 contrib/complete.csh debian/osc/etc/profile.d/osc.csh
install -Dm0644 contrib/complete.sh debian/osc/etc/bash_completion.d/osc.sh
install -Dm0755 contrib/osc.complete debian/osc/usr/lib/osc/complete
override_dh_auto_test:
echo "skipping test"

3
osc-1.8.3.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:833efb2701718b4ec17adc6d621799e8169d4490774c33e2abd089194c0c1505
size 395483

3705
osc.changes Normal file

File diff suppressed because it is too large Load Diff

15
osc.dsc Normal file
View File

@ -0,0 +1,15 @@
Format: 1.0
Source: osc
Version: 1.8.3-0
Binary: osc
Maintainer: Adrian Schroeter <adrian@suse.de>
Architecture: any
Standards-Version: 3.7.1
Build-Depends:
debhelper (>= 10),
dh-python,
python3-all (>=3.6),
python3-argparse-manpage,
python3-cryptography,
python3-setuptools,
python3-urllib3

254
osc.spec Normal file
View File

@ -0,0 +1,254 @@
#
# spec file for package osc
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define use_python python3
%define use_python_pkg python3
%if 0%{?suse_version} && 0%{?suse_version} < 1500
# use python36 on SLE 12 and older
%define use_python python3.6
%define use_python_pkg python36
%endif
%define completion_dir_bash %{_datadir}/bash-completion/completions
%define completion_dir_csh %{_sysconfdir}/profile.d
%define completion_dir_fish %{_datadir}/fish/vendor_completions.d
%define completion_dir_zsh %{_datadir}/zsh/functions/Completion
%define osc_plugin_dir %{_prefix}/lib/osc-plugins
# need to override python_sitelib because it is not set as we would expect on many distros
%define python_sitelib %(RPM_BUILD_ROOT= %{use_python} -Ic "import sysconfig; print(sysconfig.get_path('purelib'))")
# generate manpages on distros where argparse-manpage >= 3 and python3-Sphinx are available
# please note that RHEL build requires packages from CRB and EPEL repositories
%if 0%{?suse_version} > 1500 || 0%{?fedora} >= 37 || 0%{?rhel} >= 9
%bcond_without man
%else
%bcond_with man
%endif
# whether to use fdupes to deduplicate python bytecode
%if 0%{?suse_version} || 0%{?fedora} || 0%{?rhel} >= 8 || 0%{?amzn}
%bcond_without fdupes
%else
%bcond_with fdupes
%endif
# the macro exists only on openSUSE based distros
%if %{undefined python3_fix_shebang}
%define python3_fix_shebang %nil
%endif
%define argparse_manpage_pkg argparse-manpage
%define obs_build_pkg obs-build
%define ssh_add_pkg openssh-clients
%define ssh_keygen_pkg openssh
%define sphinx_pkg %{use_python_pkg}-sphinx
%if 0%{?suse_version}
%define argparse_manpage_pkg %{use_python_pkg}-argparse-manpage
%define obs_build_pkg build
%define ssh_keygen_pkg openssh-common
%define sphinx_pkg %{use_python_pkg}-Sphinx
%endif
Name: osc
Version: 1.8.3
Release: 0
Summary: Command-line client for the Open Build Service
License: GPL-2.0-or-later
Group: Development/Tools/Other
URL: https://github.com/openSUSE/osc
Source: https://github.com/openSUSE/osc/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz
%if 0%{?debian}
Source1: debian.dirs
Source2: debian.docs
%endif
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if %{with man}
BuildRequires: %{argparse_manpage_pkg}
BuildRequires: %{sphinx_pkg}
%endif
BuildRequires: %{use_python_pkg}-cryptography
BuildRequires: %{use_python_pkg}-devel >= 3.6
BuildRequires: %{use_python_pkg}-rpm
BuildRequires: %{use_python_pkg}-setuptools
BuildRequires: %{use_python_pkg}-urllib3
BuildRequires: diffstat
%if %{with fdupes}
BuildRequires: fdupes
%endif
# needed for git scm tests
BuildRequires: git-core
Requires: %{use_python_pkg}-cryptography
Requires: %{use_python_pkg}-rpm
Requires: %{use_python_pkg}-urllib3
# needed for showing download progressbars
Recommends: %{use_python_pkg}-progressbar
# needed for setting the default editor by distro
Recommends: %{use_python_pkg}-distro
# needed for storing credentials in kwallet/gnome-keyring
Recommends: %{use_python_pkg}-keyring
Recommends: %{use_python_pkg}-keyring-keyutils
Recommends: %{obs_build_pkg}
Recommends: ca-certificates
Recommends: diffstat
Recommends: powerpc32
Recommends: sudo
# needed for building from git
Recommends: git-core
Recommends: git-lfs
# needed for `osc add <URL>`
Recommends: obs-service-recompress
Recommends: obs-service-download_files
Recommends: obs-service-format_spec_file
Recommends: obs-service-obs_scm
Recommends: obs-service-set_version
Recommends: obs-service-source_validator
Recommends: obs-service-tar_scm
Recommends: obs-service-verify_file
# needed for `osc updatepacmetafromspec` that calls rpmspec to get values with expanded macros
Recommends: rpm-build
# needed for ssh signature auth
Recommends: %{ssh_add_pkg}
Recommends: %{ssh_keygen_pkg}
# needed for `osc browse` that calls xdg-open
Recommends: xdg-utils
Provides: %{use_python_pkg}-osc
%description
openSUSE Commander is a command-line client for the Open Build Service.
See http://en.opensuse.org/openSUSE:OSC, as well as
http://en.opensuse.org/openSUSE:Build_Service_Tutorial
for a general introduction.
%prep
%autosetup -p1
%build
%{use_python} setup.py build
# write rpm macros
cat << EOF > macros.osc
%%osc_plugin_dir %{osc_plugin_dir}
EOF
# build man pages
%if %{with man}
PYTHONPATH=. argparse-manpage \
--output=osc.1 \
--format=single-commands-section \
--module=osc.commandline \
--function=get_parser \
--project-name=osc \
--prog=osc \
--description="openSUSE Commander" \
--author="Contributors to the osc project. See the project's GIT history for the complete list." \
--url="https://github.com/openSUSE/osc/"
sphinx-build -b man doc .
%endif
%install
%{use_python} setup.py install -O1 --skip-build --force --root %{buildroot} --prefix %{_prefix}
# create plugin dirs
install -d %{buildroot}%{osc_plugin_dir}
install -d %{buildroot}%{_sharedstatedir}/osc-plugins
# install completions
install -Dm0755 contrib/osc.complete %{buildroot}%{_datadir}/osc/complete
install -Dm0644 contrib/complete.csh %{buildroot}%{completion_dir_csh}/osc.csh
install -Dm0644 contrib/complete.sh %{buildroot}%{completion_dir_bash}/osc.bash
install -Dm0644 contrib/osc.fish %{buildroot}%{completion_dir_fish}/osc.fish
install -Dm0644 contrib/osc.zsh %{buildroot}%{completion_dir_zsh}/osc.zsh
# install rpm macros
install -Dm0644 macros.osc %{buildroot}%{_rpmmacrodir}/macros.osc
# install man page
%if %{with man}
install -Dm0644 osc.1 %{buildroot}%{_mandir}/man1/osc.1
install -Dm0644 oscrc.5 %{buildroot}%{_mandir}/man5/oscrc.5
%endif
%if %{with fdupes}
%fdupes %buildroot
%endif
%python3_fix_shebang
%check
%{use_python} setup.py test
%files
%defattr(-,root,root,-)
# docs
%license COPYING
%doc AUTHORS README.md NEWS
%if %{with man}
%{_mandir}/man*/osc*
%endif
# executables
%{_bindir}/*
# python modules
%{python_sitelib}/osc
%{python_sitelib}/osc-*-info
# rpm macros
%{_rpmmacrodir}/*
# plugins
%dir %{osc_plugin_dir}
%dir %{_sharedstatedir}/osc-plugins
# completions
%dir %{_datadir}/osc
%{_datadir}/osc/complete
%{completion_dir_bash}/*
%config %{completion_dir_csh}/*
%{completion_dir_fish}/*
%dir %{_datadir}/zsh
%dir %{_datadir}/zsh/functions
%dir %{_datadir}/zsh/functions/Completion
%{completion_dir_zsh}/*
# osc owns the dirs to avoid the "directories not owned by a package" build error
%dir %{_datadir}/fish
%dir %{_datadir}/fish/vendor_completions.d
%changelog