Hi all
I usually rebuild some CentOS rpm packges with some changes I need. I noticed that I obtain slightly larger packages than the ones found in the centOS distribution, even if I rebuild a source rpm without changing anything. I looked in it, and it turned out that my shared libraries are not stripped, where the ones found in your packages are. For example, I just rebuilt the openldap packages, and obtained a package that is about 3 times larger: -rw-r--r-- 1 root root 10899106 Jul 7 22:42 my/openldap-servers-2.3.43-3.el5.lux.2.i386.rpm -rw-r--r-- 1 root root 3202917 Jul 8 16:38 orig/openldap-servers-2.3.43-3.el5.i386.rpm
I extracted the packages with rpm2cpio, and the difference in size are in the shared libraries, for example: # ls -l */usr/lib/libslapd_db-4.4.so -rwxr-xr-x 1 root root 6518365 Jul 8 16:42 my/usr/lib/libslapd_db-4.4.so -rwxr-xr-x 1 root root 1032880 Jan 21 10:00 orig/usr/lib/libslapd_db-4.4.so # file */usr/lib/libslapd_db-4.4.so my/usr/lib/libslapd_db-4.4.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), not stripped orig/usr/lib/libslapd_db-4.4.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), stripped
Maybe the CentOS build system contains some macros that strip libraries, and the distributed macros do not.
I put this in /etc/rpm/macros (the line calling brp-strip-shared was added to the analogous macro taken from /usr/lib/rpm/redhat): %__os_install_post \ /usr/lib/rpm/redhat/brp-compress \ %{!?__debug_package:/usr/lib/rpm/redhat/brp-strip %{__strip}} \ %{!?__debug_package:/usr/lib/rpm/redhat/brp-strip-shared %{__strip}} \ /usr/lib/rpm/redhat/brp-strip-static-archive %{__strip} \ /usr/lib/rpm/redhat/brp-strip-comment-note %{__strip} %{__objdump} \ /usr/lib/rpm/brp-python-bytecompile \ /usr/lib/rpm/redhat/brp-java-repack-jars \ %{nil}
Do you see any problems doing so? Why there is this difference between packages distributed by CentOS and the same packages rebuilt in a CentOS environment?
Thank you
On Wed, 8 Jul 2009, Luigi Iotti wrote:
I usually rebuild some CentOS rpm packges with some changes I need. I noticed that I obtain slightly larger packages than the ones found in the centOS distribution, even if I rebuild a source rpm without changing anything. I looked in it, and it turned out that my shared libraries are not stripped, where the ones found in your packages are. For example, I just rebuilt the openldap packages, and obtained a package that is about 3 times larger: -rw-r--r-- 1 root root 10899106 Jul 7 22:42 my/openldap-servers-2.3.43-3.el5.lux.2.i386.rpm -rw-r--r-- 1 root root 3202917 Jul 8 16:38 orig/openldap-servers-2.3.43-3.el5.i386.rpm
I extracted the packages with rpm2cpio, and the difference in size are in the shared libraries, for example: # ls -l */usr/lib/libslapd_db-4.4.so -rwxr-xr-x 1 root root 6518365 Jul 8 16:42 my/usr/lib/libslapd_db-4.4.so -rwxr-xr-x 1 root root 1032880 Jan 21 10:00 orig/usr/lib/libslapd_db-4.4.so # file */usr/lib/libslapd_db-4.4.so my/usr/lib/libslapd_db-4.4.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), not stripped orig/usr/lib/libslapd_db-4.4.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), stripped
Maybe the CentOS build system contains some macros that strip libraries, and the distributed macros do not.
I put this in /etc/rpm/macros (the line calling brp-strip-shared was added to the analogous macro taken from /usr/lib/rpm/redhat): %__os_install_post \ /usr/lib/rpm/redhat/brp-compress \ %{!?__debug_package:/usr/lib/rpm/redhat/brp-strip %{__strip}} \ %{!?__debug_package:/usr/lib/rpm/redhat/brp-strip-shared %{__strip}} \ /usr/lib/rpm/redhat/brp-strip-static-archive %{__strip} \ /usr/lib/rpm/redhat/brp-strip-comment-note %{__strip} %{__objdump} \ /usr/lib/rpm/brp-python-bytecompile \ /usr/lib/rpm/redhat/brp-java-repack-jars \ %{nil}
Do you see any problems doing so? Why there is this difference between packages distributed by CentOS and the same packages rebuilt in a CentOS environment?
You need to install redhat-rpm-config for building packages, then a lot of additional macros are included by default.
Hi,
On Wed, Jul 8, 2009 at 12:35, Luigi Iotticentos1@iotti.biz wrote:
I usually rebuild some CentOS rpm packges with some changes I need. I noticed that I obtain slightly larger packages than the ones found in the centOS distribution, even if I rebuild a source rpm without changing anything. I looked in it, and it turned out that my shared libraries are not stripped, where the ones found in your packages are.
If you install the "redhat-rpm-config" package the binaries/libraries will be stripped and the stripped debug information will be put on a "-debuginfo" RPM, this will be done automatically for you. I suggest you install that RPM instead of modifying /etc/rpm/macros on your own.
HTH, Filipe
Hi,
Hi,
On Wed, Jul 8, 2009 at 12:35, Luigi Iotticentos1@iotti.biz wrote:
I usually rebuild some CentOS rpm packges with some changes I need. I noticed that I obtain slightly larger packages than the
ones found in the
centOS distribution, even if I rebuild a source rpm without changing anything. I looked in it, and it turned out that my shared libraries
are not stripped,
where the ones found in your packages are.
If you install the "redhat-rpm-config" package the binaries/libraries will be stripped and the stripped debug information will be put on a "-debuginfo" RPM, this will be done automatically for you. I suggest you install that RPM instead of modifying /etc/rpm/macros on your own.
Thank you Filipe and Dag for your answers. I already have installed the redhat-rpm-config package, but nonetheless you suggested the right solution: I disabled the -debuginfo package creation via %debug_package %{nil}. I did not think that il was the macro creating the "-debug" package that strips the libraries.
Thanks Luigi