├── Dockerfile └── tomcat-native.spec /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos:latest 2 | 3 | #======= Install utility for compile package 4 | RUN yum install -y wget tar unzip bind sudo gcc make tar ruby-devel gcc make rpm-build rubygems 5 | 6 | #======== Install openjdk-devel-1.8.0.212 for OpenJDK Development Environment ========= 7 | # java-1.8.0-openjdk-1.8.0.212.b04-0.el7_6 for OpenJDK Runtime Environment 8 | RUN yum install -y java-1.8.0-openjdk-devel-1.8.0.212.b04-0.el7_6 9 | 10 | RUN yum install apr-devel openssl-devel -y 11 | 12 | COPY build.sh /tmp/build.sh 13 | RUN chmod 755 /tmp/build.sh 14 | -------------------------------------------------------------------------------- /tomcat-native.spec: -------------------------------------------------------------------------------- 1 | Name: tomcat-native 2 | Version: 1.2.21 3 | Release: 0 4 | Summary: Tomcat native library 5 | 6 | Group: System Environment/Libraries 7 | License: Apache-2.0 8 | URL: http://tomcat.apache.org/tomcat-8.5-doc/apr.html 9 | Source0: http://www.apache.org/dist/tomcat/tomcat-connectors/native/%{version}/source/%{name}-%{version}-src.tar.gz 10 | Source1: %{name}-rpmlintrc 11 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) 12 | 13 | BuildRequires: java-devel 14 | BuildRequires: jpackage-utils 15 | BuildRequires: libapr1-devel >= 1.2.1 16 | BuildRequires: openssl-devel 17 | # Upstream compatibility: 18 | Provides: tcnative = %{version}-%{release} 19 | 20 | %description 21 | Tomcat can use the Apache Portable Runtime to provide superior 22 | scalability, performance, and better integration with native server 23 | technologies. The Apache Portable Runtime is a highly portable library 24 | that is at the heart of Apache HTTP Server 2.x. APR has many uses, 25 | including access to advanced IO functionality (such as sendfile, epoll 26 | and OpenSSL), OS level functionality (random number generation, system 27 | status, etc), and native process handling (shared memory, NT pipes and 28 | Unix sockets). This package contains the Tomcat native library which 29 | provides support for using APR in Tomcat. 30 | 31 | 32 | %prep 33 | %setup -q -n %{name}-%{version}-src 34 | f=CHANGELOG.txt ; iconv -f iso-8859-1 -t utf-8 $f > $f.utf8 ; mv $f.utf8 $f 35 | 36 | 37 | %build 38 | cd native 39 | %configure \ 40 | --with-apr=%{_bindir}/apr-1-config \ 41 | --with-java-home=%{java_home} \ 42 | --with-java-platform=2 43 | make %{?_smp_mflags} 44 | 45 | 46 | %install 47 | rm -rf $RPM_BUILD_ROOT 48 | make -C native install DESTDIR=$RPM_BUILD_ROOT 49 | # Perhaps a devel package sometime? Not for now; no headers are installed. 50 | rm -f $RPM_BUILD_ROOT%{_libdir}/libtcnative*.*a 51 | rm -rf $RPM_BUILD_ROOT%{_libdir}/pkgconfig 52 | 53 | 54 | %clean 55 | rm -rf $RPM_BUILD_ROOT 56 | 57 | 58 | %post -p /sbin/ldconfig 59 | 60 | %postun -p /sbin/ldconfig 61 | 62 | 63 | %files 64 | %defattr(-,root,root,-) 65 | %doc CHANGELOG.txt LICENSE NOTICE TODO.txt 66 | # Note: unversioned *.so needed here due to how Tomcat loads the lib :( 67 | %{_libdir}/libtcnative*.so* 68 | 69 | 70 | %changelog 71 | --------------------------------------------------------------------------------