Fedora:Packaging

Shared Libraries

 * http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html
 * http://www.cprogramming.com/tutorial/shared-libraries-linux-gcc.html

Creating a Shared Library
./config --prefix=/home/musinsky/OPENSSL_TMP  # compile without shared library (default for openssl-0.9.8)

[musinsky@musinsky OPENSSL_TMP]$ ls -1sh bin/openssl 2.1M bin/openssl [musinsky@musinsky OPENSSL_TMP]$ ls -1sh lib/lib* 3.4M lib/libcrypto.a 580K lib/libssl.a [musinsky@musinsky OPENSSL_TMP]$ ldd bin/openssl linux-vdso.so.1 => (0x00007fff401ff000) libdl.so.2 => /lib64/libdl.so.2 (0x0000003db2400000) libc.so.6 => /lib64/libc.so.6 (0x0000003db1c00000) /lib64/ld-linux-x86-64.so.2 (0x0000003db1800000)

./config --prefix=/home/musinsky/OPENSSL_TMP shared  # compile with shared library [musinsky@musinsky OPENSSL_TMP]$ ls -1sh bin/openssl 476K bin/openssl [musinsky@musinsky OPENSSL_TMP]$ ls -1sh lib/lib* 3.2M lib/libcrypto.a   0 lib/libcrypto.so 1.8M lib/libcrypto.so.0.9.8 588K lib/libssl.a   0 lib/libssl.so 372K lib/libssl.so.0.9.8 [musinsky@musinsky OPENSSL_TMP]$ ldd bin/openssl linux-vdso.so.1 => (0x00007fffce2e7000) libssl.so.0.9.8 => /home/musinsky/OPENSSL_TMP/lib/libssl.so.0.9.8 (0x00007ffd113b8000) libcrypto.so.0.9.8 => /home/musinsky/OPENSSL_TMP/lib/libcrypto.so.0.9.8 (0x00007ffd11027000) libdl.so.2 => /lib64/libdl.so.2 (0x0000003db2400000) libc.so.6 => /lib64/libc.so.6 (0x0000003db1c00000) /lib64/ld-linux-x86-64.so.2 (0x0000003db1800000)

Using a Shared Library
[musinsky@musinsky OPENSSL_TMP]$ ldconfig -p | grep ssl libssl3.so (libc6,x86-64) => /lib64/libssl3.so        libssl.so.10 (libc6,x86-64) => /lib64/libssl.so.10 libssl.so.10 (libc6) => /lib/libssl.so.10 libssl.so (libc6,x86-64) => /lib64/libssl.so        libevent_openssl-2.0.so.5 (libc6,x86-64) => /lib64/libevent_openssl-2.0.so.5 [musinsky@musinsky OPENSSL_TMP]$ export | grep LD_LIBRARY_PATH declare -x LD_LIBRARY_PATH="/cern/openssl/lib/:/cern/root/lib:/cern/xrootd/lib64"

[musinsky@musinsky OPENSSL_TMP]$ ldd bin/openssl  # openssl compile with prefix, shared library and -rpath option libssl.so.0.9.8 => /home/musinsky/OPENSSL_TMP/lib/libssl.so.0.9.8 (0x00007f000dd76000) libcrypto.so.0.9.8 => /home/musinsky/OPENSSL_TMP/lib/libcrypto.so.0.9.8 (0x00007f000d9e5000) [musinsky@musinsky OPENSSL_TMP]$ mv lib lib_tmp [musinsky@musinsky OPENSSL_TMP]$ ldd bin/openssl libssl.so.0.9.8 => /cern/openssl/lib/libssl.so.0.9.8 (0x00007f2b8037f000) libcrypto.so.0.9.8 => /cern/openssl/lib/libcrypto.so.0.9.8 (0x00007f2b7ffee000) [musinsky@musinsky OPENSSL_TMP]$ unset LD_LIBRARY_PATH [musinsky@musinsky OPENSSL_TMP]$ ldd bin/openssl libssl.so.0.9.8 => not found libcrypto.so.0.9.8 => not found

dalej 2

 * http://fedoraproject.org/wiki/How_to_create_an_RPM_package
 * https://fedoraproject.org/wiki/Packaging/Guidelines
 * https://fedoraproject.org/wiki/Category:Packaging_guidelines


 * http://fedoraproject.org/wiki/PackagingDrafts/EnvironmentModules
 * http://modules.sourceforge.net/


 * Fedora (as of F-10) does not require the presence of the BuildRoot tag in the spec and if one is defined it will be ignored. The provided buildroot will automatically be cleaned before commands in %install are called


 * The %clean section is not required for F-13 and above. Each package for F-12 and below (or EPEL 5) MUST have a %clean section, which contains rm -rf %{buildroot}

- [root@localhost ~]# ldconfig -p | grep ssl libssl3.so (libc6,x86-64) => /lib64/libssl3.so	libssl.so.10 (libc6,x86-64) => /lib64/libssl.so.10 libssl.so.10 (libc6) => /lib/libssl.so.10 libssl.so (libc6,x86-64) => /lib64/libssl.so	libevent_openssl-2.0.so.5 (libc6,x86-64) => /lib64/libevent_openssl-2.0.so.5 [root@localhost ~]#

[root@localhost root]# ldd lib/libNet.so 	linux-vdso.so.1 => (0x00007fff90c8b000) libRIO.so => /cern/root/lib/libRIO.so (0x00007f99f3d7a000) libMathCore.so => /cern/root/lib/libMathCore.so (0x00007f99f3948000) libcrypto.so.0.9.8 => /opt/cern/alice/alice-openssl-0.9.8x/lib/libcrypto.so.0.9.8 (0x00007f99f359d000) libssl.so.0.9.8 => /opt/cern/alice/alice-openssl-0.9.8x/lib/libssl.so.0.9.8 (0x00007f99f334a000) libCore.so => /cern/root/lib/libCore.so (0x00007f99f298a000) libCint.so => /cern/root/lib/libCint.so (0x00007f99f200a000) libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f99f1d07000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f99f1af1000) libc.so.6 => /lib64/libc.so.6 (0x00007f99f173a000) libThread.so => /cern/root/lib/libThread.so (0x00007f99f14e6000) libm.so.6 => /lib64/libm.so.6 (0x00007f99f11ea000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f99f0fe6000) libz.so.1 => /lib64/libz.so.1 (0x00007f99f0dcf000) /lib64/ld-linux-x86-64.so.2 (0x0000003268200000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f99f0bb2000) [root@localhost root]#

[musinsky@musinsky lib]$ ldd libProof.so 	linux-vdso.so.1 =>  (0x00007fff56dff000) libNet.so (0x00007f08b593e000) libTree.so (0x00007f08b5506000) libThread.so (0x00007f08b52b2000) libRIO.so (0x00007f08b4e9e000) libMathCore.so (0x00007f08b4a6c000) libCore.so (0x00007f08b40d8000) libCint.so (0x00007f08b3758000) libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f08b3439000) libm.so.6 => /lib64/libm.so.6 (0x00007f08b313e000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f08b2f29000) libc.so.6 => /lib64/libc.so.6 (0x00007f08b2b71000) libcrypto.so.0.9.8 => not found libssl.so.0.9.8 => not found libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f08b2954000) libz.so.1 => /lib64/libz.so.1 (0x00007f08b273d000) liblzma.so.5 => /lib64/liblzma.so.5 (0x00007f08b2517000) libpcre.so.0 => /lib64/libpcre.so.0 (0x00007f08b22bd000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f08b20b9000) /lib64/ld-linux-x86-64.so.2 (0x0000003db1800000) librt.so.1 => /lib64/librt.so.1 (0x00007f08b1eb0000) [musinsky@musinsky lib]$ [musinsky@musinsky lib]$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/cern/openssl/lib/ [musinsky@musinsky lib]$ ldd libProof.so 	libc.so.6 => /lib64/libc.so.6 (0x00007fd056479000) libcrypto.so.0.9.8 => /cern/openssl/lib/libcrypto.so.0.9.8 (0x00007fd0560e9000) libssl.so.0.9.8 => /cern/openssl/lib/libssl.so.0.9.8 (0x00007fd055e96000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fd055c79000) libz.so.1 => /lib64/libz.so.1 (0x00007fd055a62000)