Blob Blame History Raw
%global nameserver omniNames

%if 0%{?rhel} > 6
%global with_systemd 1
%endif

# openssl enabled by default, add conditional --without openssl
%bcond_without openssl

Name:           omniORB
Version:        4.2.2
Release:        5%{?dist}
Summary:        A robust high performance CORBA ORB for C++ and Python

License:        LGPLv2+
URL:            http://omniorb.sourceforge.net
Source0:        http://downloads.sourceforge.net/project/omniorb/%{name}/%{name}-%{version}/%{name}-%{version}.tar.bz2
Source1:        omniORB-nameserver.init
Source2:        omniORB-nameserver.logrotate
Source3:        omniORB.cfg
Source4:        omniNames.service

BuildRequires:  python3-devel
BuildRequires:  byacc
%{!?_without_openssl:BuildRequires:  openssl-devel}
%if 0%{?with_systemd}
BuildRequires: systemd
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
%else
Requires(post): chkconfig
Requires(preun): chkconfig
Requires(pre):  shadow-utils
# This is for /sbin/service
Requires(postun): initscripts
%endif

# we don't want to provide private python extension libs
%{?filter_setup:
%filter_provides_in %{python3_sitearch}/.*\.so$
%filter_setup
}

%description
omniORB is a robust high performance CORBA ORB for C++ and Python.
omniORB is a certified CORBA 2.1 implementation and largely CORBA 2.6
compliant.


%package        devel
Summary:        Development files for %{name}
License:        LGPLv2+
Requires:       %{name}%{?_isa} = %{version}-%{release}

%description    devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.

%package        doc
Summary:        Documentation files for %{name}
BuildArch:      noarch
Requires:       %{name} = %{version}-%{release}

%description    doc
The %{name}-doc package contains documentation files for
developing and administrating applications that use %{name}.

%package        servers
Summary:        OmniORB naming service
Group:          System Environment/Daemons
License:        GPLv2+
Requires:       %{name}%{?_isa} = %{version}-%{release}

%description    servers
The %{name}-servers package contains omniNames naming server.

%package        utils
Summary:        Development files for %{name}
License:        GPLv2+
Requires:       %{name}%{?_isa} = %{version}-%{release}

%description    utils
The %{name}-utils package contains supplementary command line tools for
developing applications that use %{name}.


%prep
%setup -q

%build
# Per guidelines: if the same functionality is provided regardless of the interpreter version, only the python 3 version should be packaged
export PYTHON=%{__python3}
%configure --disable-static %{?with_openssl:--with-openssl=%{_prefix}}
%make_build



%install
%make_install
find %{buildroot} -name '*.la' -exec rm -f {} ';'
# fix rpmlint warnings: unstripped-binary-or-object
chmod 0755 %{buildroot}%{_libdir}/*.so.*
chmod 0755 %{buildroot}%{python3_sitearch}/*.so.*
# fix rpmlint errors: non-standard-dir-perm
chmod 0755 %{buildroot}%{_includedir}/{omnithread,COS}
chmod 0755 %{buildroot}%{_includedir}/omniORB4/{,internal}
chmod 0755 %{buildroot}%{_datadir}/idl/%{name}/COS
chmod 0755 %{buildroot}%{python3_sitelib}/omniidl
chmod 0755 %{buildroot}%{python3_sitelib}/omniidl_be
chmod 0755 %{buildroot}%{python3_sitelib}/omniidl_be/cxx/{,skel,impl,dynskel,header}
# fix rpmlint error: non-executable-script
chmod +x %{buildroot}%{python3_sitelib}/omniidl/main.py
%if 0%{?with_systemd}
# install systemd unit
mkdir -p %{buildroot}%{_unitdir}
install -m 0644 %{SOURCE4} %{buildroot}%{_unitdir}
%else
# install service init script
mkdir -p %{buildroot}%{_initddir}
install -m 0755 %{SOURCE1} %{buildroot}%{_initddir}/%{nameserver}
mkdir -p %{buildroot}%{_sharedstatedir}/%{name}
mkdir -p %{buildroot}%{_localstatedir}/run/%{name}
%endif
# install server configuration stuff
mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d/
install -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{nameserver}
mkdir -p %{buildroot}%{_sysconfdir}/
install -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/%{name}.cfg
mkdir -p %{buildroot}%{_localstatedir}/log/%{name}
# install man pages
pushd man
mkdir -p %{buildroot}%{_mandir}/man1
install -m 0644 man1/* %{buildroot}%{_mandir}/man1/
mkdir -p %{buildroot}%{_mandir}/man8
install -m 0644 man8/* %{buildroot}%{_mandir}/man8/
popd

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%pre servers
getent group %{name} >/dev/null || groupadd -r %{name}
getent passwd %{name} >/dev/null || \
useradd -r -g %{name} -d %{_sharedstatedir}/%{name} -s /sbin/nologin \
-c "OmniNames Naming Service" %{name}
exit 0

%if 0%{?with_systemd}
%post servers
%systemd_post omniNames.service

%preun servers
%systemd_preun omniNames.service

%postun servers
%systemd_postun omniNames.service

%else
%post servers
/sbin/chkconfig --add %{nameserver}

%preun servers
if [ $1 = 0 ] ; then
  /sbin/service  stop >/dev/null 2>&1
  /sbin/chkconfig --del  %{nameserver}
fi

%postun servers
if [ $1 -ge 1 ] ; then
    /sbin/service  %{nameserver} condrestart >/dev/null 2>&1 || :
fi
%endif

%files
%license COPYING.LIB
%doc README.FIRST.txt README.unix.txt
%{_libdir}/libCOS4.so.2*
%{_libdir}/libCOSDynamic4.so.2*
%{_libdir}/libomniCodeSets4.so.2*
%{_libdir}/libomniConnectionMgmt4.so.2*
%{_libdir}/libomniDynamic4.so.2*
%{_libdir}/libomniORB4.so.2*
%{_libdir}/libomniZIOP4.so.2*
%{_libdir}/libomniZIOPDynamic4.so.2*
%{_libdir}/libomnisslTP4.so.2*
%{_libdir}/libomnithread.so.4*

%files servers
%if 0%{?with_systemd}
%{_unitdir}/omniNames.service
%else
%{_initddir}/%{nameserver}
%dir %attr(0755, %{name}, root) %{_sharedstatedir}/%{name}
%dir %attr(0755, %{name}, root) %{_localstatedir}/run/%{name}
%endif
%config(noreplace) %{_sysconfdir}/%{name}.cfg
%config(noreplace) %{_sysconfdir}/logrotate.d/%{nameserver}
%dir %attr(0755, %{name}, root) %{_localstatedir}/log/%{name}
%{_bindir}/omniMapper
%{_bindir}/%{nameserver}
%{_mandir}/man8/*

%files devel
%doc doc/
%{_bindir}/omniidl
%{_bindir}/omniidlrun.py
%{_bindir}/omnicpp
%{_bindir}/omkdepend
%{_includedir}/*
%{_libdir}/*.so
%{_libdir}/pkgconfig/*
%{_datadir}/idl/%{name}/*
%{python3_sitelib}/*
%{python3_sitearch}/*
%{_mandir}/man1/omniidl.1.gz
%{_mandir}/man1/omnicpp.1.gz

%files doc
%doc doc/

%files utils
%license COPYING
%{_bindir}/catior
%{_bindir}/convertior
%{_bindir}/genior
%{_bindir}/nameclt
%{_mandir}/man1/catior.1.gz
%{_mandir}/man1/convertior.1.gz
%{_mandir}/man1/genior.1.gz
%{_mandir}/man1/nameclt.1.gz


%changelog
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.2.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Fri Aug 04 2017 Sandro Mani <manisandro@gmail.com> - 4.2.2-4
- Build against python3

* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.2.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.2.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Tue Jul 11 2017 Sandro Mani <manisandro@gmail.com> - 4.2.2-1
- Update to 4.2.2

* Fri Jul 07 2017 Igor Gnatenko <ignatenko@redhat.com> - 4.2.1-6
- Rebuild due to bug in RPM (RHBZ #1468476)

* Sun Feb 19 2017 Sandro Mani <manisandro@gmail.com> - 4.2.1-5
- Add patch to fix build against OpenSSL-1.1

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.2.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.2.1-3
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 4.2.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Mon Oct 05 2015 Sandro Mani <manisandro@gmail.com> - 4.2.1-1
- Update to 4.2.1
- Modernize spec

* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.2.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sat Apr 11 2015 Sandro Mani <manisandro@gmail.com> - 4.2.0-4
- Add patch for bug #1210340 (omniORB loses SSL peer information), thanks Alexey Kosilin

* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.2.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.2.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Thu May 08 2014 Sandro Mani <manisandro@gmail.com> - 4.2.0-1
- upstream 4.2.0

* Tue Sep 10 2013 Haïkel Guémar <hguemar@fedoraproject.org> - 4.1.7-1
- upstream 4.1.7 (RHBZ #1005607)
- macroized systemd scriptlets (RHBZ #850239)

* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.1.6-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.1.6-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.1.6-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Mon Feb 20 2012 Haïkel Guémar <hguemar@fedoraproject.org> - 4.1.6-2
- enable openssl support
- fix typo in omniNames.service

* Wed Jul 13 2011 Haïkel Guémar <hguemar@fedoraproject.org> - 4.1.6-1
- upstream 4.1.6
- use systemd for fedora >= 15

* Sun May 08 2011 Haïkel Guémar <hguemar@fedoraproject.org> - 4.1.5-2
- spec cleanup

* Sun Jan 09 2011 Haïkel Guémar <hguemar@fedoraproject.org> - 4.1.5-1
- upstream 4.1.5

* Wed Nov 24 2010 Haïkel Guémar <hguemar@fedoraproject.org> - 4.1.4-1
- initial packaging