%global axis2c_home %{_libdir}/axis2c
Name: axis2c
Version: 1.6.0
Release: 2%{?dist}
Summary: Web services engine implemented in C
Group: System Environment/Libraries
License: ASL 2.0
URL: http://axis.apache.org/axis2/c
Source0: http://ftp.wayne.edu/apache/ws/axis2/c/1_6_0/axis2c-src-1.6.0.tar.gz
# Fix documentation destdir (fixed upstream)
Patch1: axis2c-1.6.0-destdir.patch
# https://issues.apache.org/jira/browse/AXIS2C-1512
Patch2: axis2c-1.6.0-envpath.patch
# https://issues.apache.org/jira/browse/AXIS2C-1521
Patch3: axis2c-1.6.0-sslctx.patch
# https://issues.apache.org/jira/browse/AXIS2C-1522
Patch4: axis2c-1.6.0-curlinit.patch
# Fix linking DSO issues (is this upstream?)
Patch5: axis2c-1.6.0-dso.patch
# Drop -Werror so type qualifier warnings don't kill builds on Fedora (fixed upstream)
Patch6: axis2c-1.6.0-werror.patch
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: apr-devel
BuildRequires: curl-devel
BuildRequires: dos2unix
BuildRequires: httpd-devel
BuildRequires: libxml2-devel
BuildRequires: openssl-devel
BuildRequires: pkgconfig
BuildRequires: zlib-devel
%description
Apache Axis2/C is a Web services engine implemented in the C programming
language. It is based on the extensible and flexible Axis2 architecture.
Apache Axis2/C can be used to provide and consume WebServices. It has
been implemented with portability and ability to embed in mind, hence
could be used as a Web services enabler in other software.
Apache Axis2/C supports SOAP 1.1 and SOAP 1.2, as well as REST style
of Webservices. A single service could be exposed both as a SOAP style
as well as a REST style service simultaneously. It also has built in
MTOM support, that can be used to exchange binary data.
%package devel
Summary: Development files for %{name}
Group: Development/Libraries
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: pkgconfig
%description devel
The %{name}-devel package contains the libraries and header files
necessary for developing software that works with %{name}.
%package doc
Summary: Documentation for %{name}
Group: Documentation
Requires: %{name} = %{version}-%{release}
%if 0%{!?rhel:1} || 0%{?rhel} > 5
BuildArch: noarch
%endif
%description doc
The %{name}-doc package contains API documentation for %{name}.
%prep
%setup -q -n %{name}-src-%{version}
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
# Some of the source files are +x
find . -type f -perm /u+x \( -name '*.c' -o -name '*.h' \) -print0 | xargs -0 chmod -x
# Fix includedir
find . -name Makefile.in | xargs sed -r -i 's#includedir = $(prefix)/include#includedir = @includedir@#'
# Fix docsdir (not docdir)
# Enable the security filter so people can use Rampart/C
sed -i 's###' samples/server/axis2.xml
dos2unix INSTALL NEWS ChangeLog
%build
# Keep libtool from hardcoding RPATH
find . -name configure -print0 | xargs -0 sed -i.libdir_syssearch -e \
'/sys_lib_dlsearch_path_spec/s|/usr/lib |/usr/lib /usr/lib64 /lib /lib64 |'
# Code that builds against or otherwise uses axis2c assumes that everything is
# laid out in subdirs of a single installation dir. Instead of using the
# %%configure macro, we install in the manner that upstream expects, move things
# into FHS-compliant locations, then add symlinks to stay compatible with code
# that requires this single-dir layout.
#
# Building with the AMQP transport layer results in compilation errors.
# https://issues.apache.org/jira/browse/AXIS2C-1497
export CFLAGS="$RPM_OPT_FLAGS"
./configure --prefix=%{axis2c_home} --libdir=%{_libdir} --with-apache2=%{_includedir}/httpd --with-apr=%{_includedir}/apr-1 --disable-static --with-gnu-ld --with-pic --enable-libcurl --enable-libxml2 --enable-openssl --enable-tcp
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la
rm -f $RPM_BUILD_ROOT/%{axis2c_home}/modules/*/*.la
# Toast docfiles that get %%doc'd from the source tree in the %%files section
for file in AUTHORS COPYING CREDITS INSTALL LICENSE NEWS NOTICE README; do
rm -f $RPM_BUILD_ROOT/%{axis2c_home}/$file
rm -f $RPM_BUILD_ROOT/%{axis2c_home}/bin/tools/*/$file
done
# Libs are dlopened from %%{axis2c_home}/lib
ln -s %{_libdir} $RPM_BUILD_ROOT/%{axis2c_home}/lib
# configure --includedir is ignored, so move the headers ourselves
mkdir -p $RPM_BUILD_ROOT/%{_includedir}
mv $RPM_BUILD_ROOT/%{axis2c_home}/include/* $RPM_BUILD_ROOT/%{_includedir}
rmdir $RPM_BUILD_ROOT/%{axis2c_home}/include
ln -s %{_includedir} $RPM_BUILD_ROOT/%{axis2c_home}/include
# Logs go in /var/log
mkdir -p $RPM_BUILD_ROOT/%{_localstatedir}/log
mv $RPM_BUILD_ROOT/%{axis2c_home}/logs $RPM_BUILD_ROOT/%{_localstatedir}/log/%{name}
ln -s %{_localstatedir}/log/%{name} $RPM_BUILD_ROOT/%{axis2c_home}/logs
# Docs go under /usr/share
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/%{name}
rm $RPM_BUILD_ROOT/%{axis2c_home}/docs/download.cgi
mv $RPM_BUILD_ROOT/%{axis2c_home}/docs $RPM_BUILD_ROOT/%{_datadir}/%{name}/docs
# Server binaries go in bindir
mkdir -p $RPM_BUILD_ROOT/%{_bindir}
for file in axis2_http_server axis2_tcp_server; do
mv $RPM_BUILD_ROOT/%{axis2c_home}/bin/$file $RPM_BUILD_ROOT/%{_bindir}
ln -s %{_bindir}/$file $RPM_BUILD_ROOT/%{axis2c_home}/bin/$file
done
# Auxilary binaries go under libexecdir...
mkdir -p $RPM_BUILD_ROOT/%{_libexecdir}/%{name}
mv $RPM_BUILD_ROOT/%{axis2c_home}/bin/tools $RPM_BUILD_ROOT/%{_libexecdir}/%{name}
ln -s %{_libexecdir}/%{name}/tools $RPM_BUILD_ROOT/%{axis2c_home}/bin/tools
# ...except for WSDL2C.sh, which requires an axis2 Java stack that Fedora
# doesn't have.
# If it gets added then that script should go into a subpackage so
# installing the library doesn't pull in a huge tree of java deps.
# Don't forget to chmod +x the file at that point.
rm -rf $RPM_BUILD_ROOT/%{_libexecdir}/%{name}/tools/wsdl2c
# axis2c.xml is a config file
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}
mv $RPM_BUILD_ROOT/%{axis2c_home}/axis2.xml $RPM_BUILD_ROOT/%{_sysconfdir}
ln -s %{_sysconfdir}/axis2.xml $RPM_BUILD_ROOT/%{axis2c_home}/axis2.xml
# Put the httpd module where httpd can find it
mkdir -p $RPM_BUILD_ROOT/%{_libdir}/httpd/modules
mv $RPM_BUILD_ROOT/%{_libdir}/libmod_axis2.so* $RPM_BUILD_ROOT/%{_libdir}/httpd/modules
# Installations expect this
install -d -m 0755 $RPM_BUILD_ROOT/%{axis2c_home}/services
# Add rpm macros for dependent packages to use
# Dependent software needs to know axis2c_home since it requires a single-dir
# installation.
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/rpm
cat > $RPM_BUILD_ROOT/%{_sysconfdir}/rpm/macros.axis2c << EOF
%%axis2c_home %{axis2c_home}
%%axis2c_version %{version}
EOF
%clean
rm -rf $RPM_BUILD_ROOT
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING CREDITS INSTALL LICENSE NEWS NOTICE README
%{_bindir}/axis2*
%{_libdir}/httpd/modules/*
# .so files are dlopened, so they need to go in the regular package.
%{_libdir}/*.so*
%{_libexecdir}/%{name}
%config(noreplace) %{_sysconfdir}/axis2.xml
%{axis2c_home}
%dir %{_localstatedir}/log/%{name}
%files devel
%defattr(-,root,root,-)
%{_sysconfdir}/rpm/macros.axis2c
%{_includedir}/*
%{_libdir}/pkgconfig/%{name}.pc
%files doc
%defattr(-,root,root,-)
%{_datadir}/%{name}/docs
%changelog
* Fri Jan 13 2012 Garrett Holmstrom - 1.6.0-2
- Dropped WSDL2C.sh
- Dropped download.cgi from docs package
- Fixed docfile line endings
- Made source files non-executable
- Killed off RPATHs
* Thu Sep 1 2011 Garrett Holmstrom - 1.6.0-1
- First build for Fedora