#2 Rework build system (attempt to fix FTBFS bug #1863314)
Closed 2 years ago by jkucera. Opened 2 years ago by jkucera.
rpms/ jkucera/cdparanoia redo-build-system  into  rawhide

@@ -0,0 +1,153 @@ 

+ diff --git a/Makefile.am b/Makefile.am

+ new file mode 100644

+ index 0000000..8b9a2a9

+ --- /dev/null

+ +++ b/Makefile.am

+ @@ -0,0 +1,18 @@

+ +ACLOCAL_AMFLAGS = -I m4

+ +AM_CFLAGS = $(SBPCD_H) $(UCDROM_H)

+ +

+ +SUBDIRS = interface paranoia

+ +

+ +bin_PROGRAMS = cdparanoia

+ +

+ +cdparanoia_SOURCES = \

+ +    buffering_write.c cachetest.c  header.c header.h main.c report.c report.h \

+ +    utils.h version.h

+ +cdparanoia_LDADD = \

+ +    $(top_builddir)/interface/libcdda_interface.la \

+ +    $(top_builddir)/paranoia/libcdda_paranoia.la \

+ +    -lm -lrt

+ +

+ +include_HEADERS = utils.h

+ +

+ +dist_man_MANS = cdparanoia.1

+ diff --git a/autogen.sh b/autogen.sh

+ new file mode 100755

+ index 0000000..98508c7

+ --- /dev/null

+ +++ b/autogen.sh

+ @@ -0,0 +1,20 @@

+ +#!/bin/bash

+ +

+ +set -euxo pipefail

+ +

+ +# Remove legacy build system

+ +rm -vf Makefile.in configure configure.guess configure.in configure.sub \

+ +       interface/Makefile.in paranoia/Makefile.in

+ +

+ +# autoreconf fails if these ones are missing

+ +for file in NEWS AUTHORS ChangeLog; do

+ +  echo "Dummy ${file} file" > ${file}

+ +done

+ +

+ +# autoreconf also tries to copy COPYING

+ +cat COPYING-LGPL COPYING-GPL > COPYING

+ +

+ +autoreconf -vfi -Wall

+ +

+ +# Remove artificially created files

+ +rm -vf NEWS AUTHORS ChangeLog COPYING

+ diff --git a/configure.ac b/configure.ac

+ new file mode 100644

+ index 0000000..e1a6ea1

+ --- /dev/null

+ +++ b/configure.ac

+ @@ -0,0 +1,44 @@

+ +AC_INIT([cdparanoia], [10.2],

+ +    [https://www.xiph.org/paranoia/bugs.html],

+ +    [],

+ +    [https://www.xiph.org/paranoia/index.html],

+ +)

+ +AC_PREREQ([2.65])

+ +AC_CONFIG_AUX_DIR([build-aux])

+ +AC_CONFIG_MACRO_DIR([m4])

+ +AC_CONFIG_SRCDIR([main.c])

+ +AM_INIT_AUTOMAKE([no-define subdir-objects -Wall])

+ +

+ +AC_CANONICAL_HOST

+ +

+ +# Check for programs

+ +AC_PROG_CC

+ +AM_PROG_CC_C_O

+ +AM_PROG_AR

+ +LT_INIT

+ +

+ +AC_C_CONST

+ +

+ +# Check for libraries

+ +AC_CHECK_LIB([rt], [clock_gettime], [],

+ +    [AC_MSG_ERROR([librt was not found on the system!])],

+ +)

+ +

+ +# Check for headers

+ +AC_HEADER_STDC

+ +AC_CHECK_HEADER([linux/sbpcd.h], [SBPCD_H="-DSBPCD_H=1"])

+ +AC_CHECK_HEADER([linux/ucdrom.h], [UCDROM_H="-DUCDROM_H=1"])

+ +

+ +# Check for types

+ +AC_CHECK_TYPE([int16_t], [],

+ +    [AC_MSG_ERROR([No 16 bit type found on this platform!])],

+ +)

+ +AC_CHECK_TYPE([int32_t], [],

+ +    [AC_MSG_ERROR([No 32 bit type found on this platform!])],

+ +)

+ +

+ +AC_SUBST(SBPCD_H)

+ +AC_SUBST(UCDROM_H)

+ +

+ +AC_CONFIG_FILES(Makefile interface/Makefile paranoia/Makefile)

+ +AC_OUTPUT

+ diff --git a/interface/Makefile.am b/interface/Makefile.am

+ new file mode 100644

+ index 0000000..b81dfc6

+ --- /dev/null

+ +++ b/interface/Makefile.am

+ @@ -0,0 +1,21 @@

+ +ACLOCAL_AMFLAGS = -I m4

+ +AM_CFLAGS = $(SBPCD_H) $(UCDROM_H)

+ +

+ +# cdparanoia does not use libtool versioning scheme; since we are migrating to

+ +# GNU Autotools, this dirty trick ensures the .so.0.10.2 suffix

+ +VERSION_INFO = 10:2:10

+ +

+ +lib_LIBRARIES = libcdda_interface.a

+ +lib_LTLIBRARIES = libcdda_interface.la

+ +include_HEADERS = cdda_interface.h

+ +

+ +INTERFACE_SRC = \

+ +    cdda_interface.h common_interface.c common_interface.h cooked_interface.c \

+ +    drive_exceptions.h interface.c low_interface.h scan_devices.c \

+ +    scsi_interface.c smallft.c smallft.h test_interface.c toc.c utils.h

+ +

+ +libcdda_interface_a_SOURCES = $(INTERFACE_SRC)

+ +libcdda_interface_la_SOURCES = $(INTERFACE_SRC)

+ +libcdda_interface_la_CFLAGS = $(AM_CFLAGS) -fpic

+ +libcdda_interface_la_LDFLAGS = -fpic -version-info $(VERSION_INFO)

+ +libcdda_interface_la_LIBADD = -lm -lrt

+ diff --git a/paranoia/Makefile.am b/paranoia/Makefile.am

+ new file mode 100644

+ index 0000000..bbc6d78

+ --- /dev/null

+ +++ b/paranoia/Makefile.am

+ @@ -0,0 +1,20 @@

+ +ACLOCAL_AMFLAGS = -I m4

+ +AM_CFLAGS = $(SBPCD_H) $(UCDROM_H)

+ +

+ +# cdparanoia does not use libtool versioning scheme; since we are migrating to

+ +# GNU Autotools, this dirty trick ensures the .so.0.10.2 suffix

+ +VERSION_INFO = 10:2:10

+ +

+ +lib_LIBRARIES = libcdda_paranoia.a

+ +lib_LTLIBRARIES = libcdda_paranoia.la

+ +include_HEADERS = cdda_paranoia.h

+ +

+ +PARANOIA_SRC = \

+ +    cdda_paranoia.h gap.c gap.h isort.c isort.h overlap.c overlap.h \

+ +    paranoia.c p_block.c p_block.h

+ +

+ +libcdda_paranoia_a_SOURCES = $(PARANOIA_SRC)

+ +libcdda_paranoia_la_SOURCES = $(PARANOIA_SRC)

+ +libcdda_paranoia_la_CFLAGS = $(AM_CFLAGS) -fpic

+ +libcdda_paranoia_la_LDFLAGS = -fpic -version-info $(VERSION_INFO)

+ +libcdda_paranoia_la_LIBADD = $(top_builddir)/interface/libcdda_interface.la

@@ -1,50 +0,0 @@ 

- diff -Naupr cdparanoia-III-10.2.orig/Makefile.in cdparanoia-III-10.2/Makefile.in

- --- cdparanoia-III-10.2.orig/Makefile.in	2008-09-11 22:33:30.000000000 +0200

- +++ cdparanoia-III-10.2/Makefile.in	2008-12-22 22:31:45.578372040 +0100

- @@ -63,28 +63,28 @@ slib:

-  	cd paranoia && $(MAKE) slib

-  

-  install:

- -	$(INSTALL) -d -m 0755 $(BINDIR)

- -	$(INSTALL) -m 755 $(srcdir)/cdparanoia $(BINDIR)

- -	$(INSTALL) -d -m 0755 $(MANDIR)

- -	$(INSTALL) -d -m 0755 $(MANDIR)/man1

- -	$(INSTALL) -m 0644 $(srcdir)/cdparanoia.1 $(MANDIR)/man1

- -	$(INSTALL) -d -m 0755 $(INCLUDEDIR)

- -	$(INSTALL) -m 0644 $(srcdir)/paranoia/cdda_paranoia.h $(INCLUDEDIR)

- -	$(INSTALL) -d -m 0755 $(LIBDIR)

- -	$(INSTALL) -m 0644 $(srcdir)/paranoia/libcdda_paranoia.so.0.$(VERSION) $(LIBDIR)

- -	$(INSTALL) -m 0644 $(srcdir)/paranoia/libcdda_paranoia.a $(LIBDIR)

- -	$(INSTALL) -m 0644 $(srcdir)/interface/cdda_interface.h $(INCLUDEDIR)

- -	$(INSTALL) -m 0644 $(srcdir)/interface/libcdda_interface.so.0.$(VERSION) $(LIBDIR)

- -	$(INSTALL) -m 0644 $(srcdir)/interface/libcdda_interface.a $(LIBDIR)

- -	$(INSTALL) -m 0644 $(srcdir)/utils.h $(INCLUDEDIR)

- +	$(INSTALL) -d -m 0755 $(DESTDIR)$(BINDIR)

- +	$(INSTALL) -m 755 $(srcdir)/cdparanoia $(DESTDIR)$(BINDIR)

- +	$(INSTALL) -d -m 0755 $(DESTDIR)$(MANDIR)

- +	$(INSTALL) -d -m 0755 $(DESTDIR)$(MANDIR)/man1

- +	$(INSTALL) -m 0644 $(srcdir)/cdparanoia.1 $(DESTDIR)$(MANDIR)/man1

- +	$(INSTALL) -d -m 0755 $(DESTDIR)$(INCLUDEDIR)

- +	$(INSTALL) -m 0644 $(srcdir)/paranoia/cdda_paranoia.h $(DESTDIR)$(INCLUDEDIR)

- +	$(INSTALL) -d -m 0755 $(DESTDIR)$(LIBDIR)

- +	$(INSTALL) -m 0755 $(srcdir)/paranoia/libcdda_paranoia.so.0.$(VERSION) $(DESTDIR)$(LIBDIR)

- +	$(INSTALL) -m 0644 $(srcdir)/paranoia/libcdda_paranoia.a $(DESTDIR)$(LIBDIR)

- +	$(INSTALL) -m 0644 $(srcdir)/interface/cdda_interface.h $(DESTDIR)$(INCLUDEDIR)

- +	$(INSTALL) -m 0755 $(srcdir)/interface/libcdda_interface.so.0.$(VERSION) $(DESTDIR)$(LIBDIR)

- +	$(INSTALL) -m 0644 $(srcdir)/interface/libcdda_interface.a $(DESTDIR)$(LIBDIR)

- +	$(INSTALL) -m 0644 $(srcdir)/utils.h $(DESTDIR)$(INCLUDEDIR)

-  	ln -fs libcdda_interface.so.0.$(VERSION) \

- -		$(LIBDIR)/libcdda_interface.so.0

- +		$(DESTDIR)$(LIBDIR)/libcdda_interface.so.0

-  	ln -fs libcdda_interface.so.0.$(VERSION) \

- -		$(LIBDIR)/libcdda_interface.so

- +		$(DESTDIR)$(LIBDIR)/libcdda_interface.so

-  	ln -fs libcdda_paranoia.so.0.$(VERSION) \

- -		$(LIBDIR)/libcdda_paranoia.so.0

- +		$(DESTDIR)$(LIBDIR)/libcdda_paranoia.so.0

-  	ln -fs libcdda_paranoia.so.0.$(VERSION) \

- -		$(LIBDIR)/libcdda_paranoia.so

- +		$(DESTDIR)$(LIBDIR)/libcdda_paranoia.so

-  

-  cdparanoia:	$(OFILES) $(LIBDEP)

-  		$(LD) $(CFLAGS) $(LDFLAGS) $(OFILES) \

@@ -1,24 +0,0 @@ 

- diff -up cdparanoia-III-10.2/interface/Makefile.in.jx cdparanoia-III-10.2/interface/Makefile.in

- --- cdparanoia-III-10.2/interface/Makefile.in.jx	2008-08-21 12:08:54.000000000 -0400

- +++ cdparanoia-III-10.2/interface/Makefile.in	2018-03-07 13:12:53.999947802 -0500

- @@ -46,7 +46,7 @@ libcdda_interface.a: 	$(OFILES)

-  	$(RANLIB) libcdda_interface.a

-  

-  libcdda_interface.so: 	$(OFILES)	

- -	$(CC) -fpic -shared -o libcdda_interface.so.0.$(VERSION) -Wl,-soname -Wl,libcdda_interface.so.0 $(OFILES) $(LIBS)

- +	$(CC) $(LDFLAGS) -fpic -shared -o libcdda_interface.so.0.$(VERSION) -Wl,-soname -Wl,libcdda_interface.so.0 $(OFILES) $(LIBS)

-  	[ -e libcdda_interface.so.0 ] || ln -s libcdda_interface.so.0.$(VERSION) libcdda_interface.so.0

-  	[ -e libcdda_interface.so ] || ln -s libcdda_interface.so.0.$(VERSION) libcdda_interface.so

-  

- diff -up cdparanoia-III-10.2/paranoia/Makefile.in.jx cdparanoia-III-10.2/paranoia/Makefile.in

- --- cdparanoia-III-10.2/paranoia/Makefile.in.jx	2008-09-04 15:02:47.000000000 -0400

- +++ cdparanoia-III-10.2/paranoia/Makefile.in	2018-03-07 13:12:39.352765050 -0500

- @@ -44,7 +44,7 @@ libcdda_paranoia.a: 	$(OFILES)

-  	$(RANLIB) libcdda_paranoia.a

-  

-  libcdda_paranoia.so: 	$(OFILES)	

- -	$(CC) -fpic -shared -o libcdda_paranoia.so.0.$(VERSION) -Wl,-soname -Wl,libcdda_paranoia.so.0 $(OFILES) -L ../interface -lcdda_interface

- +	$(CC) $(LDFLAGS) -fpic -shared -o libcdda_paranoia.so.0.$(VERSION) -Wl,-soname -Wl,libcdda_paranoia.so.0 $(OFILES) -L ../interface -lcdda_interface

-  	[ -e libcdda_paranoia.so.0 ] || ln -s libcdda_paranoia.so.0.$(VERSION) libcdda_paranoia.so.0

-  	[ -e libcdda_paranoia.so ] || ln -s libcdda_paranoia.so.0.$(VERSION) libcdda_paranoia.so

-  

@@ -1,27 +0,0 @@ 

- Index: cdparanoia-III-10.2/configure

- ===================================================================

- --- cdparanoia-III-10.2.orig/configure

- +++ cdparanoia-III-10.2/configure

- @@ -1289,9 +1289,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu

-  

-  

-  

- -cp $srcdir/configure.guess $srcdir/config.guess

- -cp $srcdir/configure.sub $srcdir/config.sub

- -

-  ac_aux_dir=

-  for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do

-    if test -f $ac_dir/install-sh; then

- Index: cdparanoia-III-10.2/configure.in

- ===================================================================

- --- cdparanoia-III-10.2.orig/configure.in

- +++ cdparanoia-III-10.2/configure.in

- @@ -1,8 +1,5 @@

-  AC_INIT(interface/interface.c)

-  

- -cp $srcdir/configure.guess $srcdir/config.guess

- -cp $srcdir/configure.sub $srcdir/config.sub

- -

-  AC_CANONICAL_HOST

-  

-  if test -z "$CC"; then

file modified
+20 -16
@@ -1,7 +1,7 @@ 

  Summary: Compact Disc Digital Audio (CDDA) extraction tool (or ripper)

  Name: cdparanoia

  Version: 10.2

- Release: 33%{?dist}

+ Release: 34%{?dist}

  # the app is GPLv2, everything else is LGPLv2

  License: GPLv2 and LGPLv2

  URL: http://www.xiph.org/paranoia/index.html
@@ -13,13 +13,14 @@ 

  Patch0: cdparanoia-10.2-#463009.patch

  # #466659

  Patch1: cdparanoia-10.2-endian.patch

- Patch2: cdparanoia-10.2-install.patch

- Patch3: cdparanoia-10.2-format-security.patch

- Patch4: cdparanoia-use-proper-gnu-config-files.patch

- Patch5: cdparanoia-10.2-ldflags.patch

+ Patch2: cdparanoia-10.2-format-security.patch

+ Patch3: cdparanoia-10.2-build-system.patch

  

  Requires: %{name}-libs%{?_isa} = %{version}-%{release}

  

+ BuildRequires:  autoconf

+ BuildRequires:  automake

+ BuildRequires:  libtool

  BuildRequires:  gcc

  %description 

  Cdparanoia (Paranoia III) reads digital audio directly from a CD, then
@@ -61,23 +62,21 @@ 

  %setup -q -n cdparanoia-III-%{version}

  %patch0 -p3 -b .#463009

  %patch1 -p1 -b .endian

- %patch2 -p1 -b .install

- %patch3 -p1 -b .fmt-sec

- %patch4 -p1 -b .config

- %patch5 -p1 -b .ldflags

- 

- # Update config.guess/sub for newer architectures

- cp /usr/lib/rpm/redhat/config.* .

+ %patch2 -p1 -b .fmt-sec

+ %patch3 -p1 -b .build-system

+ ./autogen.sh

  

  %build

  %configure --includedir=%{_includedir}/cdda

  # Also remove many warnings which we are aware of

- # Lastly, don't use _smp_mflags since it also makes the build fail

- make OPT="$RPM_OPT_FLAGS -Wno-pointer-sign -Wno-unused" LDFLAGS="%{?__global_ldflags}"

+ %make_build CFLAGS="${CFLAGS} -Wno-pointer-sign -Wno-unused"

  

  

  %install

- make install DESTDIR=$RPM_BUILD_ROOT

+ %make_install

+ 

+ # Remove files we not to wish to install

+ rm %{buildroot}%{_libdir}/*.la

  

  %ldconfig_scriptlets libs

  
@@ -97,6 +96,11 @@ 

  %{_libdir}/*.a

  

  %changelog

+ * Thu Sep 17 2020 Jiri Kucera <jkucera@redhat.com> - 10.2-34

+ - Fix bogus date

+ - Redo build system to meet modern standards

+   Resolves: #1863314

+ 

  * Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 10.2-33

  - Second attempt - Rebuilt for

    https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
@@ -362,7 +366,7 @@ 

  * Wed Jul 12 2000 Prospector <bugzilla@redhat.com>

  - automatic rebuild

  

- * Wed Jun 06 2000 Preston Brown <pbrown@redhat.com>

+ * Tue Jun 06 2000 Preston Brown <pbrown@redhat.com>

  - revert name change

  - use new rpm macro paths

  

Hello,

to make cdparanoia builds not failing, I replaced its legacy configure* and Makefile.in-based build system with a new one. I try to keep it compatible with the old build system as much as possible, but it is still needed to be reviewed, especially please review whether there are differences between old and produced rpms and whether *.so remain compatible. For those who are interested, the patch is here: https://github.com/i386x/fedora-cdparanoia/commit/fef379a7082d253e54902ac2514e020d4bd1809b (I'm not a GNU Autotools guru so any comments are welcomed).

cdparanoia now builds, and FTBFS bug #1863314 has been closed.
If you wish, you can continue with this proposal, but if you do, it will need to be rebased.

Things like this should go thru upstream. I am aware upstream is effectively dead, so forking might be a solution. Also it should handle the 10.2 post-release changes in upstream svn repo like adding the pkgconfig file, which is being added in #3 for our package (because wanted by new grip).

Ok, I am closing it for now.

Pull-Request has been closed by jkucera

2 years ago