%global shortver 3.9 %global mediumver %{shortver}.1 Name: cmu-ipc Version: %{mediumver}a Release: 1%{?dist} Summary: flexible, efficient message passing between processes License: BSD URL: http://www.cs.cmu.edu/~IPC/ Source0: http://www.cs.cmu.edu/afs/cs/project/TCA/ftp/ipc-%{version}.tar.gz patch0: fixes.patch #fix problems that fails the build, waiting for the reply from upstream patch1: fedora2.patch patch2: ppc64le.patch patch3: buildjar.patch #Distribution specific patch BuildRequires: perl BuildRequires: dnf grep gawk gcc gcc-c++ %description IPC provides high-level support for connecting processes using TCP/IP sockets and sending data between processes. It takes care of opening sockets, registering messages, and sending and receiving messages, including both anonymous publish/subscribe and client/server type messages. The IPC library contains functions to marshall (serialize) and unmarshall (de-serialize) data, handles data transfer between machines with different Endian conventions, invoke user-defined handlers when a message is received, and invoke user-defined callbacks at set intervals. IPC uses the more efficient Unix sockets when processes are on the same processor, and does byte-swapping only when necessary. IPC now supports multi-threaded applications. %package devel Summary: IPC development files Requires: %{name}%{?_isa} = %{version}-%{release} %description devel IPC development files. %package python2 Summary: IPC python API BuildRequires: swig BuildRequires: python2-devel Requires: %{name}%{?_isa} = %{version}-%{release} %description python2 IPC python interface %package java Summary: IPC java API BuildRequires: java-1.8.0-openjdk-devel Requires: %{name}%{?_isa} = %{version}-%{release} %description java IPC java interface %package xdrgen Summary: IPC XDR data structure specification parser BuildRequires: bison BuildRequires: flex Requires: %{name}%{?_isa} = %{version}-%{release} %description xdrgen Xdrgen parses an XDR data structure specification (similar to a list of C type definitions), and generates a C header which includes both type definitions and macros defining the IPC format strings. %prep %setup -q -n ipc-%{mediumver} %patch0 -p2 %patch1 -p2 %ifarch ppc64le %patch2 -p2 %endif sed -e 's|@libpath@|%{_libdir}|' %{PATCH3} | %{__patch} -p2 -F 0 %build echo 'thismachine' uname -m export RPMOPTFLAGS='%{optflags}' export RPMLDFLAGS='%{?__global_ldflags}' export JAVA_JNI_H_DIR=$(dnf repoquery *openjdk-devel -l -C |grep jni.h | sed 's|\/jni.h||' | tail -1) export JAVA_JNI_MD_HDIR=$(dnf repoquery *openjdk-devel -l -C |grep jni_md.h | sed 's|\/jni_md.h||' | tail -1) #find java header location cd src %make_build install -S #libpic.so will be accessed at the "installed" location when building other components. cd .. %make_build install -S %install mkdir -p %{buildroot}%{_bindir} install -p -m 755 bin/Linux*/central %{buildroot}%{_bindir} install -p -m 755 bin/Linux*/xdrgen %{buildroot}%{_bindir} mkdir -p %{buildroot}%{_libdir} mkdir -p %{buildroot}%{_libdir}/java-ipc/libipcjava.so; install -p -m 755 lib/Linux*/libipc.so.%{shortver} %{buildroot}%{_libdir}/libipc.so.%{shortver} ln -s ./libipc.so.%{shortver} %{buildroot}%{_libdir}/libipc.so install -p -m 755 lib/Linux*/libipcjava.so.%{shortver} %{buildroot}%{_libdir}/java-ipc/libipcjava.so.%{shortver} ln -s ./libipc.so.%{shortver} %{buildroot}%{_libdir}/java-ipc/libipcjava.so mkdir -p %{buildroot}%{python2_sitearch} install -p -m 755 lib/Linux*/_IPC.so %{buildroot}%{python2_sitearch} for f in formatters.p* IPC.p* primFmttrs.p*; do install -p -m 755 python/$f %{buildroot}%{python2_sitearch} done #They are supposed to be byte compiled automatically. export PYTHONPATH=$PYTHONPATH:%{buildroot}%{python2_sitelib} mkdir -p %{buildroot}%{_includedir} install -p -m 644 include/ipc.h %{buildroot}%{_includedir}/ipc.h mkdir -p %{buildroot}%{_jnidir} install -p -m 755 java/ipc.jar %{buildroot}%{_jnidir} %files %doc doc/IPC_Manual.pdf # Adobe Makerfile documents were not included because no application on Fedora can open them. %license LICENSE.TXT %{_bindir}/central %{_libdir}/libipc.so.%{shortver} %files devel %{_includedir}/ipc.h %{_libdir}/libipc.so %files python2 %{python2_sitearch}/* %files java %{_libdir}/java-ipc %{_jnidir}/ipc.jar %files xdrgen %doc doc/xdrgen.html %{_bindir}/xdrgen %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %post java -p /sbin/ldconfig %postun java -p /sbin/ldconfig %changelog * Mon Aug 14 2017 yecheng <18969068329@163.com> - 3.9.1a-1 Initial packaging -