From fa131590a10322dbdeaf70f5aec152c7d99c2e784c496564c425d96d0a89dbaf Mon Sep 17 00:00:00 2001 From: Dirk Stoecker Date: Wed, 18 Aug 2021 08:42:22 +0000 Subject: [PATCH] Accepting request 912799 from home:badshah400:branches:science Add gnuastro-cfitsio-version-format-change.patch -- accounts for 3 number version string for CFITSIO; patch taken from upstream commit. OBS-URL: https://build.opensuse.org/request/show/912799 OBS-URL: https://build.opensuse.org/package/show/science/gnuastro?expand=0&rev=17 --- gnuastro-cfitsio-version-format-change.patch | 26 ++++++++++++++++++++ gnuastro.changes | 7 ++++++ gnuastro.spec | 4 ++- 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 gnuastro-cfitsio-version-format-change.patch diff --git a/gnuastro-cfitsio-version-format-change.patch b/gnuastro-cfitsio-version-format-change.patch new file mode 100644 index 0000000..310610f --- /dev/null +++ b/gnuastro-cfitsio-version-format-change.patch @@ -0,0 +1,26 @@ +diff --git a/lib/fits.c b/lib/fits.c +index ef559759..5fe11bd6 100644 +--- a/lib/fits.c ++++ b/lib/fits.c +@@ -2138,8 +2138,19 @@ gal_fits_key_write_version_in_ptr(gal_fits_list_key_t **keylist, char *title, + /* Print 'Versions and date' title. */ + gal_fits_key_write_title_in_ptr("Versions and date", fptr); + +- /* Set the version of CFITSIO as a string. */ +- sprintf(cfitsioversion, "%-.2f", CFITSIO_VERSION); ++ /* Set the version of CFITSIO as a string: before version 4.0.0 of ++ CFITSIO, there were only two numbers in the version (for example ++ '3.49' and '3.48'), but from the 4th major release, there are three ++ numbers in the version string. The third number corresponds to a new ++ 'CFITSIO_MICRO' macro. So if it doesn't exist, we'll just print two ++ numbers, otherwise, we'll print the three. */ ++#ifdef CFITSIO_MICRO ++ sprintf(cfitsioversion, "%d.%d.%d", CFITSIO_MAJOR, ++ CFITSIO_MINOR, CFITSIO_MICRO); ++#else ++ sprintf(cfitsioversion, "%d.%d", CFITSIO_MAJOR, ++ CFITSIO_MINOR); ++#endif + + /* Write all the information: */ + fits_write_date(fptr, &status); diff --git a/gnuastro.changes b/gnuastro.changes index 7ba3f94..3319176 100644 --- a/gnuastro.changes +++ b/gnuastro.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Aug 18 02:39:19 UTC 2021 - Atri Bhattacharya + +- Add gnuastro-cfitsio-version-format-change.patch -- accounts for + 3 number version string for CFITSIO; patch taken from upstream + commit. + ------------------------------------------------------------------- Wed Jun 2 07:37:06 UTC 2021 - Andreas Stieger diff --git a/gnuastro.spec b/gnuastro.spec index a2dd28f..d3fe4ad 100644 --- a/gnuastro.spec +++ b/gnuastro.spec @@ -27,6 +27,8 @@ URL: https://www.gnu.org/software/gnuastro/ Source: https://ftp.gnu.org/pub/gnu/gnuastro/%{name}-%{version}.tar.gz Source2: https://ftp.gnu.org/pub/gnu/gnuastro/%{name}-%{version}.tar.gz.sig Source3: https://akhlaghi.org/public-pgp-key.txt#/%{name}.keyring +# PATCH-FIX-UPSTREAM gnuastro-cfitsio-version-format-change.patch badshah400@gmail.com -- accounts for 3 number version string for CFITSIO; patch taken from upstream commit +Patch0: gnuastro-cfitsio-version-format-change.patch BuildRequires: libtool BuildRequires: pkgconfig BuildRequires: pkgconfig(cfitsio) @@ -81,7 +83,7 @@ BuildArch: noarch Bash command line completion support for %{name} %prep -%setup -q +%autosetup -p1 %build %configure \