Here are the steps that I have done to successfully build and install the Apache httpd-2.4.10 and OpenSSL openssl-1.0.1j on Solaris 10.
Download following software
openssl-1.0.1j.tar.gz
httpd-2.4.10.tar.gz
apr-1.5.1.tar.gz
apr-util-1.5.4.tar.gz
pcre-8.36.tar.gz
Verify Make and CC
By default gcc
is at /usr/sfw/bin/gcc
and make
is at /usr/ccs/bin/make
Include following in the PATH
usr/local/ssl/bin:/usr/sfw/bin:/usr/local/bin:/usr/ccs/bin
Include following in the LD_LIBRARY_PATH
/usr/local/lib:/usr/local/ssl/lib
Build and install openssl-1.0.1j
Unzip and un-tar openssl-1.0.1j.tar.gz to /usr/local/openssl-1.0.1j
Execute following commands in order. The shared parameter is very important so that it can be linked with httpd-2.4.10 build for SSL enabling.
$ cd /usr/local/openssl-1.0.1j
$ ./config shared
$ make
$ make test
$ make install
By default it installs openssl at /usr/local/ssl
Install pcre-8.36
Unzip and un-tar pcre-8.36.tar.gz to /usr/local/ pcre-8.36
Execute following commands in order
$ cd /usr/local/ pcre-8.36
$ ./configure
$ make
$ make install
By default, make install
installs the package's commands under
/usr/local/bin
, include files under /usr/local/include
, etc.
Build and install httpd-2.4.10
Unzip and un-tar httpd-2.4.10.tar.gz to /usr/local/httpd-2.4.10
Unzip and un-tar apr-1.5.1.tar.gz to /usr/local/httpd-2.4.10/srclib
Rename /usr/local/apr-1.5.1 to /usr/local/apr
Unzip and un-tar apr-util-1.5.4.tar.gz to /usr/local/httpd-2.4.10/srclib
Rename /usr/local/apr-util to /usr/local/apr-util
Execute following commands in order
$ ./configure --prefix=/usr/local/apache2 --with-included-apr --enable-so –enable-ssl=shared --with-ssl=/usr/local/ssl
$ make
$ make install
It installs it at /usr/local/apache2
The installation is complete. To enable SSL and Proxy, update /usr/local/apache2/conf/httpd.conf
with uncommentting following lines
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
LoadModule proxy_scgi_module modules/mod_proxy_scgi.so
LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_express_module modules/mod_proxy_express.so
LoadModule slotmem_shm_module modules/mod_slotmem_shm.so
LoadModule ssl_module modules/mod_ssl.so
Include conf/extra/httpd-ssl.conf
Now you can work on httpd-ssl.conf as you usually do to complete your configuration
It helps to understand a little about how RPM works here.
RPM will be automatically adding requirements for particular classifications of file that it knows about (eg ELF shared libraries, #! scripts, etc):
http://www.rpm.org/max-rpm-snapshot/s1-rpm-depend-auto-depend.html
What is happening here is that some of the contents of the payload have been picked up with having requirements that are not packaged:
/home/rpmbuild/python/Python-2.6.4-root/usr/bin/python2.6
/usr/local/bin/python2.6
We can verify this by running rpmbuild -bi Python.spec
to run the build up to the install stage. Based on the information supplied above you could search for files:
find /home/rpmbuild/python/Python-2.6.4-root/ -type f -exec grep \ /home/rpmbuild/python/Python-2.6.4-root/usr/bin/python2.6
I'd say you're looking at:
/home/rpmbuild/Python-2.6.4-root/usr/bin/python2.6-config
for the the file that has a shebang that refers to the full buildroot and a bunch of scripts that refer to /usr/local/bin/python2.6
RPM isn't doing anything wrong here, and the details of the right way to fix this up will often be specific to the build of the package you're building.
One approach to fixing this would be to set AutoProvReq: no
in the preamble of the SPEC file, eg directly after Group: Python
. This should give you an installable RPM but you could argue that it's not taking full advantage of RPM's dependency model and you'd have incorrect paths in some of your Python package files.
Lets specifically look at the Python build and try and understand what we could do to fix this in a more comprehensive way.
Your %install section uses the macro %makeinstall which expands by default as:
[pnasrat@centos5 ~]$ rpm -E '%makeinstall'
/usr/bin/make \
prefix=/usr \
exec_prefix=/usr \
bindir=/usr/bin \
sbindir=/usr/sbin \
sysconfdir=/etc \
datadir=/usr/share \
includedir=/usr/include \
libdir=/usr/lib64 \
libexecdir=/usr/libexec \
localstatedir=/var \
sharedstatedir=/usr/com \
mandir=/usr/share/man \
infodir=/usr/share/info \
install
For reference I tend to consult the upstream Fedora SPEC, which is much more complicated but can be made to build (with some modification and a patch for autotools versions IIRC) a parallel python26 package. I'm not going to go into the detail of that right now but if we look at how they install the key line is:
make install DESTDIR=%{buildroot}
I'd strongly recommend doing that rather than disabling AutoProvReq. As Python is a libtool based build that is probably better than the %makeinstall macro as you've already configured prefix. That seems to do the right thing by inspecting here. Note, if you are rebuilding with this change you'll also want to add:
%clean
rm -rf $RPM_BUILD_ROOT
And want a similar rm line at the beginning of the %install
section. This all seems to work for me:
[pnasrat@centos5 RPMS]$ rpm --test -ivh x86_64/Python-2.6.4-1.x86_64.rpm
Preparing... ########################################### [100%]
It might well be worth using a python2.6 package provided elsewhere, I believe IUSCommunity provides packages, as documented here - http://agilesysadmin.net/recent-python-on-rhel-or-centos. These are probably much closer to the fedora packages.
Best Answer
I was missing way to many important items by trying to use my own spec file which caused the problem I was seeing above.
I found the best way to build Apache was to take the httpd.tar.gz file and use the httpd.spec file that is included. I basically followed the steps located here:
http://ramblin-dude.blogspot.com/2013/04/compiling-rpm-for-httpd-on-rhel-57.html
The problem of
libuuid-devel
being unavailable for CentOS 5.5 or 5.7 is also addressed in the blog too. Which is basically usee2fsprogs-devel
and modify httpd.spec file to point to this instead oflibuuid-devel
.Using these directions, I was able to get a rpm built which would install and work without any errors in the log file.