Forum

Problem with 'USE_SYSTEM_POLARSSL on'.

Mustafa
21 August 2014, 21:21
Hiawatha version: 9.7.b
Operating System: Centos 6

I tried compile hiawatha with 'USE_SYSTEM_POLARSSL on' but fail. Look like the process still looking for /usr/lib/hiawatha (polarssl path).
Hugo Leisink
21 August 2014, 21:29
Is PolarSSL installed on your system?
Mustafa Ramadhan
21 August 2014, 23:03
Yes, installed for polarssl and polarssl-devel.
Hugo Leisink
22 August 2014, 14:06
Can you show me the output of your compilation process?
Mustafa Ramadhan
23 August 2014, 07:51
...
Install the project...
/usr/bin/cmake -P cmake_install.cmake
-- Install configuration: "RelWithDebInfo"
-- Installing: /var/tmp/hiawatha-9.7-1.mr.el5-root-root/usr/sbin/hiawatha
-- Installing: /var/tmp/hiawatha-9.7-1.mr.el5-root-root/usr/sbin/wigwam
-- Installing: /var/tmp/hiawatha-9.7-1.mr.el5-root-root/usr/sbin/cgi-wrapper
-- Installing: /var/tmp/hiawatha-9.7-1.mr.el5-root-root/usr/bin/ssi-cgi
-- Installing: /var/tmp/hiawatha-9.7-1.mr.el5-root-root/etc/hiawatha/cgi-wrapper.conf
-- Installing: /var/tmp/hiawatha-9.7-1.mr.el5-root-root/etc/hiawatha/mimetype.conf
-- Installing: /var/tmp/hiawatha-9.7-1.mr.el5-root-root/etc/hiawatha/error.xslt
-- Installing: /var/tmp/hiawatha-9.7-1.mr.el5-root-root/etc/hiawatha/index.xslt
-- Installing: /var/tmp/hiawatha-9.7-1.mr.el5-root-root/etc/hiawatha/hiawatha.conf
-- Installing: /var/tmp/hiawatha-9.7-1.mr.el5-root-root/usr/share/man/man1/ssi-cgi.1
-- Installing: /var/tmp/hiawatha-9.7-1.mr.el5-root-root/usr/share/man/man1/wigwam.1
-- Installing: /var/tmp/hiawatha-9.7-1.mr.el5-root-root/usr/share/man/man1/cgi-wrapper.1
-- Installing: /var/tmp/hiawatha-9.7-1.mr.el5-root-root/usr/share/man/man1/hiawatha.1
-- Installing: /var/tmp/hiawatha-9.7-1.mr.el5-root-root/var/www/hiawatha/index.html
+ mkdir -p /var/tmp/hiawatha-9.7-1.mr.el5-root-root/var/log/hiawatha
+ install -D -m 644 logrotate.d/hiawatha /var/tmp/hiawatha-9.7-1.mr.el5-root-root/etc/logrotate.d/hiawatha
+ perl -pi -e 's|/usr/var/log/hiawatha/|/var/log/hiawatha/|' /var/tmp/hiawatha-9.7-1.mr.el5-root-root/etc/hiawatha/hiawatha.conf
+ install -D -m 755 /usr/src/redhat/SOURCES/hiawatha-sysvscript /var/tmp/hiawatha-9.7-1.mr.el5-root-root/etc/rc.d/init.d/hiawatha
+ /usr/lib/rpm/brp-compress
+ /usr/lib/rpm/brp-strip
+ /usr/lib/rpm/brp-strip-static-archive
+ /usr/lib/rpm/brp-strip-comment-note
Processing files: hiawatha-9.7-1.mr.el5
error: File not found: /var/tmp/hiawatha-9.7-1.mr.el5-root-root/usr/lib/hiawatha
Checking for unpackaged file(s): /usr/lib/rpm/check-files /var/tmp/hiawatha-9.7-1.mr.el5-root-root


RPM build errors:
File not found: /var/tmp/hiawatha-9.7-1.mr.el5-root-root/usr/lib/hiawatha
Mustafa Ramadhan
23 August 2014, 07:54
hiawatha.spec

## MR -- enable this if want create debuginfo
%define debug_package %{nil}

Summary: An advanced and secure webserver for Unix
Name: hiawatha
Version: 9.7
#Release: 7.2%{?dist}
Release: 1%{?dist}
Source0: http://www.hiawatha-webserver.org/files/%{name}-%{version}.tar.gz
Source1: %{name}-sysvscript
Patch0: hiawatha-maxuploadsize.patch
Patch1000: hiawatha-9.6_fixdirprotect.patch
Patch1001: hiawatha-9.6_fixcgiwrapper.patch
License: GPLv2+
Group: System Environment/Daemons
URL: http://www.hiawatha-webserver.org/

BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires: libxslt-devel
BuildRequires: polarssl-devel
BuildRequires: cmake >= 2.8.4
Requires: polarssl

%description
Hiawatha is an advanced and secure webserver for Unix. It has been written
with 'being secure' as its main goal. This resulted in a webserver which
has for example DoS protection, connection control and traffic throttling.
It has of course also thoroughly been checked and tested for buffer overflows.

%prep
%setup -q
#sed -i -e '/add_subdirectory(polarssl)/d' -e 's| polarssl/include||' -e 's|${POLARSSL_LIBRARY}||' CMakeLists.txt
#sed -i '/^\tpolarssl/d' CMakeFiles.txt

#sed -i ption(USE_SYSTEM_POLARSSL "Use the system's PolarSSL (>=1.3.0) library." off):option(USE_SYSTEM_POLARSSL "Use the system's PolarSSL (>=1.3.0) library." on): CMakeFiles.txt

#%patch0
#%patch1000 -p1
#%patch1001 -p1

%build
%cmake -DENABLE_CHROOT:BOOL=ON \
-DENABLE_MONITOR:BOOL=ON \
-DUSE_PKCS11_HELPER_LIBRARY:BOOL=ON \
-DCMAKE_SKIP_RPATH:BOOL=OFF \
-DCMAKE_INSTALL_LOCALSTATEDIR:PATH=/var \
-DCMAKE_INSTALL_PREFIX:PATH="/usr" \
-DCMAKE_INSTALL_BINDIR:PATH=%{_bindir} \
-DCMAKE_INSTALL_SBINDIR:PATH=%{_sbindir} \
-DCMAKE_INSTALL_SYSCONFDIR:PATH=%{_sysconfdir} \
-DCMAKE_INSTALL_MANDIR:PATH=%{_mandir} \
-DUSE_SYSTEM_POLARSSL:BOOL=ON
make

%install
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

make install DESTDIR=%{buildroot}
#make install INSTALL_ROOT=%{buildroot}

mkdir -p %{buildroot}/var/log/%{name}
install -D -m 644 logrotate.d/%{name} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
perl -pi -e 's|/usr/var/log/hiawatha/|/var/log/hiawatha/|' %{buildroot}%{_sysconfdir}/%{name}/hiawatha.conf
install -D -m 755 %{SOURCE1} %{buildroot}%{_initrddir}/%{name}

%files
%defattr(-,root,root)
%dir /var/log/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/*
%{_sbindir}/%{name}
%{_mandir}/*/*.*
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%{_localstatedir}/www/%{name}/
%{_initrddir}/%{name}
%{_bindir}/ssi-cgi
%{_sbindir}/cgi-wrapper
%{_sbindir}/wigwam
%{_libdir}/%{name}

%changelog
* Sat Aug 23 2014 Mustafa Ramadhan <mustafa@bigraf.com> - 9.7-1
- update to 9.7 (already change MaxUploadSize 2048; URLToolkit in .hiawatha)
- use external polarssl

* Sun Jul 27 2014 Mustafa Ramadhan <mustafa@bigraf.com> - 9.7.b-1
- update to 9.7.b (beta; enable urltoolkit in .hiawatha)

* Thu Jun 21 2014 Mustafa Ramadhan <mustafa@bigraf.com> - 9.6-2
- add fixdirprotect patch

* Sun Jun 01 2014 Mustafa Ramadhan <mustafa@bigraf.com> - 9.6-1
- update to 9.6

* Sat Apr 26 2014 Mustafa Ramadhan <mustafa@bigraf.com> - 9.5-2
- recompile without patch (because compile bnutils 2.24 for Centos 5 64bit)

* Thu Apr 24 2014 Mustafa Ramadhan <mustafa@bigraf.com> - 9.5-1
- update to 9.5 (with patch because the same touble like 9.5 with new polarssl)

* Sun Mar 27 2014 Mustafa Ramadhan <mustafa@bigraf.com> - 9.4-1
- update to 9.4 with patch

* Thu Dec 26 2013 Mustafa Ramadhan <mustafa@bigraf.com> - 9.3.1-1
- update to 9.3.1

* Mon Dec 2 2013 Mustafa Ramadhan <mustafa@bigraf.com> - 9.3-2
- patch maxuploadsize from 100 to 2048MB

* Mon Nov 18 2013 Mustafa Ramadhan <mustafa@bigraf.com> - 9.3-1
- update to 9.3
- make simple release

* Fri Aug 16 2013 Mustafa Ramadhan <mustafa@bigraf.com> - 9.2-7.2
- fix hiawatha init (hiawatha-sysvscript) where change gprinf to 'echo -n'

* Sun Jul 28 2013 Mustafa Ramadhan <mustafa@bigraf.com> - 9.2-7.1
- compile for Centos 5/6
- taken from http://download.opensuse.org/repositories/home:/akauffman/CentOS_CentOS-6/src/
- modified .spec for centos 5 compatilibity

Hugo Leisink
23 August 2014, 08:02
I have no idea what you are doing, but what if you follow these instructions from within an unpacked source directory:
mkdir build
cd build
cmake .. -DUSE_SYSTEM_POLARSSL=on
make
Mustafa Ramadhan
23 August 2014, 08:25
The same result for using '-DUSE_SYSTEM_POLARSSL:BOOL=ON' in cmake and patch to CMakeLists.txt in line '-option(USE_SYSTEM_POLARSSL "Use the system's PolarSSL (>=1.3.0) library."'
Hugo Leisink
23 August 2014, 09:02
I don't understand, because Hiawatha's build system doesn't need /usr/lib/hiawatha to exist. Please follow the command line instructions in my previous post exactly. Does that work?
Mustafa Ramadhan
23 August 2014, 09:27
Your code is work.

In my test using hiawatha.spec from hiawatha source still the same (fail).
Hugo Leisink
23 August 2014, 09:49
Ah, now I understand what you are doing. I'm sorry, but the Red Hat package building files are beta. I'm not familiar with Red Hat, so I've asked many times for people to help me with it. Because I got no response, I started to write some myself. Try executing the script extra/build_redhat_package. If you have experience with building Red Hat packages and you have some ideas to improve the script, please let me know.
Mustafa Ramadhan
23 August 2014, 09:56
Ok, I will try to fix this issue related to compile process.

Thanks
This topic has been closed.