Dr. Werner Fink 2020-04-06 10:36:45 +00:00 committed by Git OBS Bridge
parent 3284c4671e
commit 354db8310e
5 changed files with 23 additions and 13 deletions

View File

@ -1,3 +0,0 @@
<services>
<service name="format_spec_file"></service>
</services>

15
get_version_number.sh Normal file
View File

@ -0,0 +1,15 @@
#!/bin/bash
# Note: this file is used in the spec file, do not remove it
sourcedir=$1
test -n "${sourcedir}" || sourcedir=$PWD
test -e ${sourcedir}/ncurses.spec || exit 1
version=$(sed -rn '/^Version:[[:space:]]+/{s/^Version:[[:space:]]+([0-9]+\.[0-9]+)(\.[^\.]+)?/\1/p}' ${sourcedir}/ncurses.spec) || exit 1
test -e ${sourcedir}/ncurses-${version}.tar.gz || exit 1
last=($(tar Oxf ${sourcedir}/ncurses-${version}.tar.gz ncurses-${version}/VERSION)) || exit 1
test -e ${sourcedir}/ncurses-${version}-patches.tar.bz2 || echo ${last[2]}
tar --wildcards -tf ${sourcedir}/ncurses-${version}-patches.tar.bz2 '*/*.patch' &> /dev/null || echo ${last[2]}
OFS="$IFS"
IFS=-
last=($(tar -tf ${sourcedir}/ncurses-${version}-patches.tar.bz2 | sed -r 's@\.patch$@@'| sort -t '-' -k 3,3 -n | tail -n 1))
IFS="$OFS"
echo ${last[2]}

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Apr 6 10:31:47 UTC 2020 - Dr. Werner Fink <werner@suse.de>
- Use %() to extract patch date for adding it to version
* add script get_version_number.sh whic his used within the
spec file to determine the actual patch version date
-------------------------------------------------------------------
Mon Apr 6 06:50:14 UTC 2020 - Dr. Werner Fink <werner@suse.de>

View File

@ -31,7 +31,7 @@
%global soname_tinfo tinfow
%endif
%define patchlvl 20200404
%define patchlvl %(%{_sourcedir}/get_version_number.sh %{_sourcedir})
%define basevers 6.2
Name: ncurses

View File

@ -1,9 +0,0 @@
#!/bin/bash
version=$(sed -rn '/^Version:[[:space:]]+/{s/^Version:[[:space:]]+([0-9]+\.[0-9]+)(\.[^\.]+)?/\1/p}' ncurses.spec) || exit 1
test -e ncurses-${version}-patches.tar.bz2 || exit 1
OFS="$IFS"
IFS=-
last=($(tar -tf ncurses-${version}-patches.tar.bz2 | sed -r 's@\.patch$@@'| sort -t '-' -k 3,3 -n | tail -n 1))
IFS="$OFS"
patch=${last[2]}
sed -ri "/^%define[[:space:]]+patchlvl/{ s/(^%define[[:space:]]+patchlvl)[[:space:]]+.*/\1 ${patch}/ }" ncurses.spec