diff options
author | Ken Dreyer <ktdreyer@ktdreyer.com> | 2015-01-29 23:25:22 -0700 |
---|---|---|
committer | Ken Dreyer <ktdreyer@ktdreyer.com> | 2015-01-29 23:25:25 -0700 |
commit | 8e00684f09b3c097c52799d36f74907e9f1665ca (patch) | |
tree | 855b358351a9e53904e632a0a29a814357ff5a80 | |
download | python-slacker-master.tar.gz python-slacker-master.tar.xz python-slacker-master.zip |
-rw-r--r-- | .gitignore | 2 | ||||
-rwxr-xr-x | python-slacker-generate-tests-tarball.sh | 26 | ||||
-rw-r--r-- | python-slacker.spec | 100 | ||||
-rw-r--r-- | sources | 2 |
4 files changed, 130 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1dca3c0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/slacker-0.5.4.tar.gz +/slacker-0.5.4-tests.tar.xz diff --git a/python-slacker-generate-tests-tarball.sh b/python-slacker-generate-tests-tarball.sh new file mode 100755 index 0000000..4b043cf --- /dev/null +++ b/python-slacker-generate-tests-tarball.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +set -e + +VERSION=0.5.4 + +GITHUBURL=https://github.com/os/slacker/archive/v${VERSION}.zip + +# download zipball +if [[ ! -f slacker-$VERSION.zip ]]; then + curl -o slacker-$VERSION.zip -L $GITHUBURL +fi + +# extract zipball +[[ -d slacker-$VERSION ]] && rm -r slacker-$VERSION +unzip slacker-$VERSION.zip + +pushd slacker-$VERSION + # repack + tar -cJvf slacker-$VERSION-tests.tar.xz tests + mv slacker-$VERSION-tests.tar.xz .. +popd + +# Clean up +rm slacker-$VERSION.zip +rm -r slacker-$VERSION diff --git a/python-slacker.spec b/python-slacker.spec new file mode 100644 index 0000000..db2d5ef --- /dev/null +++ b/python-slacker.spec @@ -0,0 +1,100 @@ +%global srcname slacker + +%if 0%{?fedora} +%global with_python3 1 +%endif + +Name: python-%{srcname} +Version: 0.5.4 +Release: 1%{?dist} +Summary: Slack API client + +License: ASL 2.0 +URL: http://pypi.python.org/pypi/%{srcname}/ +Source0: http://pypi.python.org/packages/source/s/%{srcname}/%{srcname}-%{version}.tar.gz +Source1: %{name}-generate-tests-tarball.sh +# To get the tarball in Source2, ensure that the upstream version number is +# correct in the "generate tarball" script above, and then run the script. +Source2: %{srcname}-%{version}-tests.tar.xz +BuildArch: noarch + +Requires: python-requests + +BuildRequires: python2-devel +BuildRequires: python-setuptools +BuildRequires: pytest +BuildRequires: python-mock +BuildRequires: python-requests + +%description +Slacker is a full-featured Python interface for the Slack API. + +%if 0%{?with_python3} +%package -n python3-%{srcname} +Summary: Slack API client +Requires: python3-requests +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pytest +BuildRequires: python3-mock +BuildRequires: python3-requests + +%description -n python3-%{srcname} +Slacker is a full-featured Python interface for the Slack API. +%endif + +%prep +%setup -q -n %{srcname}-%{version} -a 2 + +%if 0%{?with_python3} +rm -rf %{py3dir} +cp -a . %{py3dir} +%endif # with_python3 + + +%build +%{__python2} setup.py build + +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py build +popd +%endif + + +%install +%{__python2} setup.py install --skip-build --root %{buildroot} + +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py install --skip-build --root %{buildroot} +popd +%endif + +%check +export PYTHONPATH=$(pwd) + +py.test-%{python_version} -v tests + +%if 0%{?with_python3} +pushd %{py3dir} +py.test-%{python3_version} -v tests +popd +%endif # with_python3 + + +%files +%doc README.rst +%{python2_sitelib}/%{srcname}/ +%{python2_sitelib}/%{srcname}*.egg-info + +%if 0%{?with_python3} +%files -n python3-%{srcname} +%doc README.rst +%{python3_sitelib}/%{srcname}/ +%{python3_sitelib}/%{srcname}*.egg-info +%endif + +%changelog +* Fri Jan 30 2015 Ken Dreyer <ktdreyer@ktdreyer.com> - 0.5.4-1 +- initial package @@ -0,0 +1,2 @@ +2d5a680c8301a33ef71d06a16b669d2c slacker-0.5.4.tar.gz +14d18e1967edaafdd8bb47f017f75436 slacker-0.5.4-tests.tar.xz |