Aegis RPM won't build on RHEL 6.0 or Fedora 12 and above

Cal Webster <[email protected]>
Newsgroups gmane.comp.version-control.aegis.user
Message-ID <1312407804.12338.31.camel@kc130ssa>
This issue was originally discussed in the thread: "[Aegis] [ANN] Aegis
4.24.3 released".

Sorry, I should have opened a new thread when I first realized there was
a problem.


[Status]

** Success! This problem has been resolved! **

RPM's successfully build on all 5 platforms tested using a patched
aegis.spec file. Also, confirmed that RPM's fail to build on CentOS 6.0
x86_64, Fedora 12 x86_64, and Fedora 14 x86_64 using the original,
un-patched aegis.spec file. I have a personal i386 laptop running Fedora
14 that I can test this on too if requested. However, I'm fairly
confident the build with original spec file will also fail there as I
believe the underlying problem originated in changes to the "rpm" and
"rpm-build" facilities.

[/Status]


[Problem Description]

Attempting to build RPM's from aegis-4.24.3.tar.gz fails with fatal
errors. The two main problems, both in the aegis.spec file, were (1) use
of the depreciated 'BuildPrereq' tag instead of 'BuildRequires' and, (2)
the aegis shared state directories '%_prefix/com' and '%
_prefix/com/aegis' were not being created in '%{buildroot}'.


[/Problem Description]


[Solution]

I changed the aegis.spec file and spec.sh as outlined below. I've
included the patches between -cut- lines. Made a copy of the expanded
tar-ball and modified aegis.spec and etc/spec.sh to generate the
patches. Then I repackaged the tar-ball and used it to test bare
tar-ball rpmbuild on all platforms.

=================
What was changed:
=================

1. Changed all 3 occurances of 'BuildPrereq' to 'BuildRequires'

    Why: 'BuildPrereq' is depreciated and causes fatal errors in newest
rpmbuild. Our oldest Red Hat systems (RHEL 4.9) had no problems with the
replacement either.

2. Removed explicit 'rm -rf %{buildroot}' from %install section

    Why: This explicit command is redundant and not required.

3. Added explicit command to create Aegis shared state dirs in %install
section

    Why: There are apparently no make install rules to create these
directories. Newer rpmbuild fails without this. 

    Note: This command may be removed from the %install section if
someone later adds "install" rules in the Makefile to create these empty
directories.


========
Patches:
========


# etc/spec.sh patch:

----------cut here----------
--- aegis-4.24.3/etc/spec.sh    2010-03-08 12:36:28.000000000 -0500
+++ aegis-4.24.3.new/etc/spec.sh        2011-08-03 13:43:51.533086466
-0400
@@ -48,9 +48,9 @@
 # Note: on RedHat-like systems, libmagic stuff is in the "file"
package.
 # e2fsprogs is used for UUID.
 #
-BuildPrereq: bison, curl-devel, diffutils, gawk, gettext >= 0.11.4
-BuildPrereq: groff >= 1.15, perl, libxml2-devel >= 1.8.17, tk
-BuildPrereq: zlib-devel, bzip2-devel, e2fsprogs-devel, file >= 4
+BuildRequires: bison, curl-devel, diffutils, gawk, gettext >= 0.11.4
+BuildRequires: groff >= 1.15, perl, libxml2-devel >= 1.8.17, tk
+BuildRequires: zlib-devel, bzip2-devel, e2fsprogs-devel, file >= 4
 
 %description
 Aegis is a transaction-based software configuration management system.
@@ -83,7 +83,7 @@
 make
 
 %install
-rm -rf %{buildroot}
+mkdir -p $RPM_BUILD_ROOT/%_prefix/com/aegis
 make DESTDIR=%{buildroot} install
 # If rpmbuild does not strip your binaries, consider adding
 #   INSTALL_PROGRAM='/usr/bin/install -s'
----------cut here----------


# aegis.spec patch:

----------cut here----------
--- aegis-4.24.3/aegis.spec     2010-03-08 12:36:28.000000000 -0500
+++ aegis-4.24.3.new/aegis.spec 2011-08-03 16:57:36.000000000 -0400
@@ -23,9 +23,9 @@
 # Note: on RedHat-like systems, libmagic stuff is in the "file"
package.
 # e2fsprogs is used for UUID.
 #
-BuildPrereq: bison, curl-devel, diffutils, gawk, gettext >= 0.11.4
-BuildPrereq: groff >= 1.15, perl, libxml2-devel >= 1.8.17, tk
-BuildPrereq: zlib-devel, bzip2-devel, e2fsprogs-devel, file >= 4
+BuildRequires: bison, curl-devel, diffutils, gawk, gettext >= 0.11.4
+BuildRequires: groff >= 1.15, perl, libxml2-devel >= 1.8.17, tk
+BuildRequires: zlib-devel, bzip2-devel, e2fsprogs-devel, file >= 4
 
 %description
 Aegis is a transaction-based software configuration management system.
@@ -57,7 +57,7 @@
 make
 
 %install
-rm -rf %{buildroot}
+mkdir -p $RPM_BUILD_ROOT/%_prefix/com/aegis
 make DESTDIR=%{buildroot} install
 # If rpmbuild does not strip your binaries, consider adding
 #   INSTALL_PROGRAM='/usr/bin/install -s'
----------cut here----------


[/Solution]



[Test Results]

#====================#
# Patched aegis.spec #
#====================#

I can confirm successful builds from both the tar-ball alone (rpmbuild
-ta SOURCES/aegis-4.24.3.tar.gz) and a previously generated SRPM
(rpmbuild -ba SPECS/aegis.spec) on all the below platforms using my
patched aegis.spec file.


a) Intel(R) Xeon(TM) CPU 2.00GHz under RHEL 4.9

	Produced aegis-4.24.3-1.i386.rpm and friends with no fatal errors

b) Intel(R) Pentium(R) 4 CPU 2.40GHz under CentOS 5.6

	Produced aegis-4.24.3-1.i386.rpm and friends with no fatal errors

c) Intel(R) Xeon(R) CPU X5650  @ 2.67GHz under CentOS 6.0

	Produced aegis-4.24.3-1.x86_64.rpm and friends with no fatal errors

d) Intel(R) Core(TM)2 Duo CPU E6550  @ 2.33GHz under Fedora 12

	Produced aegis-4.24.3-1.x86_64.rpm and friends with no fatal errors

e) Intel(R) Core(TM)2 Duo CPU E6550  @ 2.33GHz under Fedora 14

	Produced aegis-4.24.3-1.x86_64.rpm and friends with no fatal errors



Commands to edit and rebuild tar-ball:

cd SOURCES
tar xzvf aegis-4.24.3.tar.gz 
mv aegis-4.24.3.tar.gz aegis-4.24.3.tar.gz.orig
vi aegis-4.24.3/aegis.spec 
vi aegis-4.24.3/etc/spec.sh 
tar czvf aegis-4.24.3.tar.gz aegis-4.24.3
cd ..
rpmbuild -ta SOURCES/aegis-4.24.3.tar.gz



#=====================#
# Original aegis.spec #
#=====================#


a) Intel(R) Xeon(TM) CPU 2.00GHz under RHEL 4.9

rpm -q --whatprovides `which rpmbuild`
--------------------------------------
rpm-build-4.3.3-32_nonptl
--------------------------------------

Build succeeds:
===============
...
extracting debug info from /var/tmp/aegis-4.24.3-1-root/usr/bin/aetar
cpio: aegis-4.24.3/<internal>: No such file or directory
cpio: aegis-4.24.3/y.tab.c: No such file or directory
cpio: aegis-4.24.3/y.tab.h: No such file or directory
12450 blocks
+ /usr/lib/rpm/redhat/brp-compress
+ /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/redhat/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump
Processing files: aegis-4.24.3-1
warning: File listed twice: /usr/bin/aegis
warning: File listed twice: /usr/bin/aeimport
warning: File listed twice: /usr/bin/aelock
warning: File listed twice: /usr/share/aegis/icon/64x64.png
warning: File listed twice: /usr/share/aegis/icon/aegis.gif
warning: File listed twice: /usr/share/aegis/icon/bigger.png
warning: File listed twice: /usr/share/aegis/icon/rss.gif
Requires(interp): /bin/sh
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires(post): /bin/sh
Requires: /bin/sh /usr/bin/perl libbz2.so.1 libc.so.6
libc.so.6(GLIBC_2.0) libc.so.6(GLIBC_2.1) libc.so.6(GLIBC_2.1.3)
libc.so.6(GLIBC_2.2) libc.so.6(GLIBC_2.3.4) libcrypt.so.1
libcrypt.so.1(GLIBC_2.0) libcurl.so.3 libgcc_s.so.1
libgcc_s.so.1(GCC_3.0) libm.so.6 libm.so.6(GLIBC_2.0) libmagic.so.1
libstdc++.so.6 libstdc++.so.6(CXXABI_1.3) libstdc++.so.6(GLIBCXX_3.4)
libuuid.so.1 libxml2.so.2 libz.so.1 perl >= 0:5.004 perl(Getopt::Long)
perl(strict)
Processing files: aegis-txtdocs-4.24.3-1
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Processing files: aegis-psdocs-4.24.3-1
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Processing files: aegis-debuginfo-4.24.3-1
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Checking for unpackaged
file(s): /usr/lib/rpm/check-files /var/tmp/aegis-4.24.3-1-root
Wrote: /usr/src/redhat/SRPMS/aegis-4.24.3-1.src.rpm
Wrote: /usr/src/redhat/RPMS/i386/aegis-4.24.3-1.i386.rpm
Wrote: /usr/src/redhat/RPMS/i386/aegis-txtdocs-4.24.3-1.i386.rpm
Wrote: /usr/src/redhat/RPMS/i386/aegis-psdocs-4.24.3-1.i386.rpm
Wrote: /usr/src/redhat/RPMS/i386/aegis-debuginfo-4.24.3-1.i386.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.73010
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd aegis-4.24.3
+ rm -rf /var/tmp/aegis-4.24.3-1-root
+ exit 0
===============


b) Intel(R) Pentium(R) 4 CPU 2.40GHz under CentOS 5.6

rpm -q --whatprovides `which rpmbuild`
--------------------------------------
rpm-build-4.4.2.3-22.el5
--------------------------------------

Build succeeds:
===============
...
extracting debug info
from /var/tmp/aegis-4.24.3-1-root/usr/bin/aemeasure
cpio: aegis-4.24.3/y.tab.c: No such file or directory
cpio: aegis-4.24.3/y.tab.h: No such file or directory
15677 blocks
+ /usr/lib/rpm/redhat/brp-compress
+ /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/redhat/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump
+ /usr/lib/rpm/brp-python-bytecompile
+ /usr/lib/rpm/redhat/brp-java-repack-jars
Processing files: aegis-4.24.3-1
warning: File listed twice: /usr/bin/aegis
warning: File listed twice: /usr/bin/aeimport
warning: File listed twice: /usr/bin/aelock
warning: File listed twice: /usr/share/aegis/icon/64x64.png
warning: File listed twice: /usr/share/aegis/icon/aegis.gif
warning: File listed twice: /usr/share/aegis/icon/bigger.png
warning: File listed twice: /usr/share/aegis/icon/rss.gif
Requires(interp): /bin/sh
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires(post): /bin/sh
Requires: /bin/sh /usr/bin/perl libbz2.so.1 libc.so.6
libc.so.6(GLIBC_2.0) libc.so.6(GLIBC_2.1) libc.so.6(GLIBC_2.1.3)
libc.so.6(GLIBC_2.2) libc.so.6(GLIBC_2.3.4) libc.so.6(GLIBC_2.4)
libcrypt.so.1 libcrypt.so.1(GLIBC_2.0) libcurl.so.3 libgcc_s.so.1
libgcc_s.so.1(GCC_3.0) libm.so.6 libm.so.6(GLIBC_2.0) libmagic.so.1
libstdc++.so.6 libstdc++.so.6(CXXABI_1.3) libstdc++.so.6(GLIBCXX_3.4)
libuuid.so.1 libxml2.so.2 libz.so.1 perl >= 0:5.004 perl(Getopt::Long)
perl(strict) rtld(GNU_HASH)
Processing files: aegis-txtdocs-4.24.3-1
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Processing files: aegis-psdocs-4.24.3-1
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Processing files: aegis-debuginfo-4.24.3-1
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Checking for unpackaged
file(s): /usr/lib/rpm/check-files /var/tmp/aegis-4.24.3-1-root
Wrote: /home/cwebster/rpmbuild/SRPMS/aegis-4.24.3-1.src.rpm
Wrote: /home/cwebster/rpmbuild/RPMS/i386/aegis-4.24.3-1.i386.rpm
Wrote: /home/cwebster/rpmbuild/RPMS/i386/aegis-txtdocs-4.24.3-1.i386.rpm
Wrote: /home/cwebster/rpmbuild/RPMS/i386/aegis-psdocs-4.24.3-1.i386.rpm
Wrote: /home/cwebster/rpmbuild/RPMS/i386/aegis-debuginfo-4.24.3-1.i386.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.66054
+ umask 022
+ cd /home/cwebster/rpmbuild/BUILD
+ cd aegis-4.24.3
+ rm -rf /var/tmp/aegis-4.24.3-1-root
+ exit 0
===============


c) Intel(R) Xeon(R) CPU X5650  @ 2.67GHz under CentOS 6.0

rpm -q --whatprovides `which rpmbuild`
--------------------------------------
rpm-build-4.8.0-12.el6.x86_64
--------------------------------------

Build fails:
============
...
extracting debug info
from /home/cwebster/rpmbuild/BUILDROOT/aegis-4.24.3-1.x86_64/usr/bin/aefinish
cpio: aegis-4.24.3/y.tab.c: Cannot stat: No such file or directory
cpio: aegis-4.24.3/y.tab.h: Cannot stat: No such file or directory
15769 blocks
+ /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/redhat/brp-compress
+ /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/redhat/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump
+ /usr/lib/rpm/brp-python-bytecompile
+ /usr/lib/rpm/redhat/brp-python-hardlink
+ /usr/lib/rpm/redhat/brp-java-repack-jars
Processing files: aegis-4.24.3-1.x86_64
error: File not
found: /home/cwebster/rpmbuild/BUILDROOT/aegis-4.24.3-1.x86_64/usr/com/aegis


RPM build errors:
    line 26: buildprereq is deprecated: BuildPrereq: bison, curl-devel,
diffutils, gawk, gettext >= 0.11.4
    line 27: buildprereq is deprecated: BuildPrereq: groff >= 1.15,
perl, libxml2-devel >= 1.8.17, tk
    line 28: buildprereq is deprecated: BuildPrereq: zlib-devel,
bzip2-devel, e2fsprogs-devel, file >= 4
    File not
found: /home/cwebster/rpmbuild/BUILDROOT/aegis-4.24.3-1.x86_64/usr/com/aegis
============


d) Intel(R) Core(TM)2 Duo CPU E6550  @ 2.33GHz under Fedora 12

rpm -q --whatprovides `which rpmbuild`
--------------------------------------
rpm-build-4.7.2-2.fc12.x86_64
--------------------------------------

Build fails:
============
...
extracting debug info
from /home/cwebster/rpmbuild/BUILDROOT/aegis-4.24.3-1.x86_64/usr/bin/aereport
cpio: aegis-4.24.3/y.tab.c: Cannot stat: No such file or directory
cpio: aegis-4.24.3/y.tab.h: Cannot stat: No such file or directory
15769 blocks
+ /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/redhat/brp-compress
+ /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/redhat/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump
+ /usr/lib/rpm/brp-python-bytecompile
+ /usr/lib/rpm/redhat/brp-python-hardlink
+ /usr/lib/rpm/redhat/brp-java-repack-jars
Processing files: aegis-4.24.3-1.x86_64
error: File not
found: /home/cwebster/rpmbuild/BUILDROOT/aegis-4.24.3-1.x86_64/usr/com/aegis


RPM build errors:
    File not
found: /home/cwebster/rpmbuild/BUILDROOT/aegis-4.24.3-1.x86_64/usr/com/aegis
============


e) Intel(R) Core(TM)2 Duo CPU E6550  @ 2.33GHz under Fedora 14

rpm -q --whatprovides `which rpmbuild`
--------------------------------------
rpm-build-4.7.2-2.fc12.x86_64
--------------------------------------

Build fails:
============
...
extracting debug info
from /home/cwebster/rpmbuild/BUILDROOT/aegis-4.24.3-1.x86_64/usr/bin/find_sizes
cpio: aegis-4.24.3/y.tab.c: Cannot stat: No such file or directory
cpio: aegis-4.24.3/y.tab.h: Cannot stat: No such file or directory
15769 blocks
+ /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/redhat/brp-compress
+ /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/brp-python-bytecompile /usr/bin/python 1
+ /usr/lib/rpm/redhat/brp-python-hardlink
+ /usr/lib/rpm/redhat/brp-java-repack-jars
Processing files: aegis-4.24.3-1.x86_64
error: File not
found: /home/cwebster/rpmbuild/BUILDROOT/aegis-4.24.3-1.x86_64/usr/com/aegis


RPM build errors:
    line 26: buildprereq is deprecated: BuildPrereq: bison, curl-devel,
diffutils, gawk, gettext >= 0.11.4
    line 27: buildprereq is deprecated: BuildPrereq: groff >= 1.15,
perl, libxml2-devel >= 1.8.17, tk
    line 28: buildprereq is deprecated: BuildPrereq: zlib-devel,
bzip2-devel, e2fsprogs-devel, file >= 4
    File not
found: /home/cwebster/rpmbuild/BUILDROOT/aegis-4.24.3-1.x86_64/usr/com/aegis
============


To test rpm builds on Red Hat Linux OS's requires the "Development
Tools" package group (GCC compilers and friends), the "rpm-build"
package, and a RPM build environment setup. Because I'm using the aegis
tar-ball it may take some time to complete. Might be better to use a
simplified tar-ball that produces a small RPM. Assuming development
tools and rpm-build package are installed and your aegis tar-ball is in
your Download/ dir of your home, here's a simple test.

# Change location of 'rpmbuild/' and aegis tar-ball as required.
# rpmbuild will look for .rpmmacros in home directory of whatever user
is running the command.
---------------------------------
mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
echo '%_topdir /home/rpmbuild' > ~/.rpmmacros
cd ~/rpmbuild/
rpmbuild -ta ~/Download/aegis-4.24.3.tar.gz
---------------------------------

[/Test Results]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.