From 8f33dd396470a56d18dfa8fed1eb0f715a7a5337 Mon Sep 17 00:00:00 2001 From: James Antill Date: Mar 09 2021 22:44:04 +0000 Subject: Add builder script to make development releases. --- diff --git a/.gitignore b/.gitignore index ba67d7d..163f0a1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ build dist *.egg-info *.pyc +*.src.rpm .ropeproject .pytest_cache test.conf diff --git a/b-srpm.sh b/b-srpm.sh new file mode 100755 index 0000000..325b4c6 --- /dev/null +++ b/b-srpm.sh @@ -0,0 +1,40 @@ +#! /bin/sh -e + +if [ "x$1" = "x" ]; then + echo "Building this way needs a devrel." + exit 1 +fi + +c=centpkg +p=$(pwd) + +echo "%define devrel $1" > c.spec +echo "%define devsnap $(date +'%Y%m%d')git.$(git show -q --format='%h')" >> c.spec +cat centpkg.spec >> c.spec + +ver=$(rpmspec -q \ + --qf '%{name} %{version}\n' \ + c.spec | \ + fgrep "centpkg " | awk '{ print $2 }') + +cd .. +mkdir $c-$ver +cp -a \ + $p/COPYING \ + $p/README.md \ + $p/requirements.txt \ + $p/setup.py \ + $p/src \ + $c-$ver +tar --exclude='*~' -cvf $c-$ver.tar $c-$ver +rm -rf $c-$ver +cd $p +mv ../$c-$ver.tar . +gzip -9 $c-$ver.tar + +rpmbuild \ + --define="_sourcedir $(pwd)" \ + --define="_srcrpmdir $(pwd)" \ + -bs c.spec + +rm $c-$ver.tar.gz c.spec diff --git a/centpkg.spec b/centpkg.spec index 6edc24b..f6603ab 100644 --- a/centpkg.spec +++ b/centpkg.spec @@ -1,6 +1,6 @@ Name: centpkg -Version: 0.4.6 -Release: 1%{?dist} +Version: %{!?devrel:0.4.6}%{?devrel:0.4.7} +Release: %{?devrel:0.%{devrel}%{?devsnap:.%{devsnap}}.}1%{?dist} Summary: CentOS utility for working with dist-git License: GPLv2+ URL: https://git.centos.org/centos/centpkg @@ -40,8 +40,7 @@ Provides the centpkg-sig command for working with dist-git. %doc README.md %config(noreplace) %{_sysconfdir}/rpkg/centpkg.conf %{_bindir}/%{name} -%{python3_sitelib}/%{name} -%{python3_sitelib}/%{name}-%{version}-py%{python3_version}.egg-info +%{python3_sitelib}/%{name}* %files sig