#7 Addon to PR#1, adds srpm devel build script and minor py3/epel7 fixes
Merged 3 years ago by bstinson. Opened 3 years ago by jamesantill.
centos/ jamesantill/centpkg builds  into  develop

file modified
+1
@@ -2,6 +2,7 @@ 

  dist

  *.egg-info

  *.pyc

+ *.src.rpm

  .ropeproject

  .pytest_cache

  test.conf

file added
+40
@@ -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

file modified
+36 -41
@@ -1,56 +1,54 @@ 

- %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}

+ Name:           centpkg

+ 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

+ Source0:        https://git.centos.org/centos/centpkg/archive/%{version}/centpkg-%{version}.tar.gz

+ BuildArch:      noarch

+ 

+ BuildRequires:  python3-devel

+ %if 0%{?rhel} > 0 && 0%{?rhel} < 8

+ BuildRequires:  python-setuptools

+ %else

+ BuildRequires:  %{py3_dist setuptools}

+ %endif

  

- Name:		centpkg

- Version:	0.4.6

- Release:	1%{?dist}

- Summary:	CentOS utility for working with dist-git

- 

- Group:	    Applications/System

- License:	GPLv2+

- URL:		https://git.centos.org/summary/centpkg.git

- Source0:	centpkg-%{version}.tar.gz

- BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root%(%{__id_u} -n)

- 

- # CentOS Distributed Packages

- Requires:   redhat-rpm-config	

- Requires:   python-pycurl

- 

- # EPEL Distributed Packages

- Requires:   pyrpkg >= 1.17 

- Requires:   koji 

+ %description

+ Provides the centpkg command for working with dist-git

  

- BuildArch:  noarch

  

- # CentOS Distributed build-requires

- BuildRequires: python-devel, python-setuptools

+ %package sig

+ Summary:        CentOS SIG utility for working with dist-git

+ Requires:       %{name} = %{version}-%{release}

  

- # EPEL Distributed build-requires

- BuildRequires: pyrpkg

  

- %description

- Provides the centpkg and centpkg-sig commands for working with dist-git

+ %description sig

+ Provides the centpkg-sig command for working with dist-git.

  

  %prep

- %setup -q -c

+ %autosetup

  

  

  %build

- %{__python} setup.py build

+ %py3_build

  

- %install

- %{__python} setup.py install -O1 --skip-build --root %{buildroot}

  

- %clean

- rm -rf %{buildroot}

+ %install

+ %py3_install

  

  

  %files

- %defattr(-,root,root,-)

- %doc README.md COPYING

- %config %{_sysconfdir}/rpkg/centpkg.conf

- %config %{_sysconfdir}/rpkg/centpkg-sig.conf

+ %license COPYING

+ %doc README.md

+ %config(noreplace) %{_sysconfdir}/rpkg/centpkg.conf

  %{_bindir}/%{name}

- %{python_sitelib}/*

+ %{python3_sitelib}/%{name}*

+ 

+ 

+ %files sig

+ %{_bindir}/%{name}-sig

+ %config(noreplace) %{_sysconfdir}/rpkg/centpkg-sig.conf

  

  

  %changelog
@@ -80,7 +78,4 @@ 

  - Update readme and add exception checking when running toplevel commands

  

  * Sat Jul 05 2014 Brian Stinson bstinson@ksu.edu - 0.1-1

- - Local builds and mockbuilds work 

- 

- 

- 

+ - Local builds and mockbuilds work

file modified
+3 -1
@@ -1,2 +1,4 @@ 

+ pycurl

+ pyOpenSSL

  rpkg

- rpm

+ six

file modified
+5 -2
@@ -1,3 +1,6 @@ 

+ 

+ from __future__ import print_function

+ 

  import os

  from OpenSSL import crypto

  import urlgrabber
@@ -40,10 +43,10 @@ 

      delta = datetime.datetime.now() + datetime.timedelta(days=21)

      warn = datetime.datetime.strftime(delta, dateFmt)

  

-     print 'cert expires: %s-%s-%s' % (valid_until[:4], valid_until[4:6], valid_until[6:8])

+     print('cert expires: %s-%s-%s' % (valid_until[:4], valid_until[4:6], valid_until[6:8]))

  

      if valid_until < warn:

-         print 'WARNING: Your cert expires soon.'

+         print('WARNING: Your cert expires soon.')

  

  

  def certificate_expired():

The resolves the latest conflicts with Carl's PR#1 and adds a build script to generate srpms quickly, then some minor fixes to resolve problems so it builds on epel7 to eln9.

Pull-Request has been merged by bstinson

3 years ago