Commit 9e367d9c authored by jehan's avatar jehan

finish cmake base rpm build

parent 60cf1e2a
...@@ -189,7 +189,7 @@ if(ENABLE_DOC) ...@@ -189,7 +189,7 @@ if(ENABLE_DOC)
) )
add_custom_target(ortp-html-doc ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/doc/html/index.html") add_custom_target(ortp-html-doc ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/doc/html/index.html")
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/doc/html" install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/doc/html"
DESTINATION "${CMAKE_INSTALL_DATADIR}/doc/oRTP-${ORTP_VERSION}") DESTINATION "${CMAKE_INSTALL_DATADIR}/doc/ortp-${ORTP_VERSION}")
endif() endif()
endif() endif()
...@@ -206,8 +206,6 @@ set(ORTPDEPS_LIBS ) ...@@ -206,8 +206,6 @@ set(ORTPDEPS_LIBS )
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ortp.pc.in ${CMAKE_CURRENT_BINARY_DIR}/ortp.pc) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ortp.pc.in ${CMAKE_CURRENT_BINARY_DIR}/ortp.pc)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ortp.pc DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ortp.pc DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ortp.spec.cmake ${CMAKE_CURRENT_SOURCE_DIR}/ortp.spec)
include(CMakePackageConfigHelpers) include(CMakePackageConfigHelpers)
write_basic_package_version_file( write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/ORTPConfigVersion.cmake" "${CMAKE_CURRENT_BINARY_DIR}/ORTPConfigVersion.cmake"
...@@ -232,3 +230,8 @@ install(FILES ...@@ -232,3 +230,8 @@ install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/ORTPConfigVersion.cmake" "${CMAKE_CURRENT_BINARY_DIR}/ORTPConfigVersion.cmake"
DESTINATION ${CONFIG_PACKAGE_LOCATION} DESTINATION ${CONFIG_PACKAGE_LOCATION}
) )
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/README"
"${CMAKE_CURRENT_SOURCE_DIR}/ChangeLog"
"${CMAKE_CURRENT_SOURCE_DIR}/COPYING"
"${CMAKE_CURRENT_SOURCE_DIR}/AUTHORS"
DESTINATION "${CMAKE_INSTALL_DATADIR}/doc/ortp-${ORTP_VERSION}")
...@@ -52,6 +52,10 @@ In which application oRTP is being used ? ...@@ -52,6 +52,10 @@ In which application oRTP is being used ?
How to compile my program using ortp ? How to compile my program using ortp ?
************************************** **************************************
with cmake, use find_package(ORTP)
with pkgconfig:
gcc -o myprogram `pkg-config --cflags ortp` myprogram.c \ gcc -o myprogram `pkg-config --cflags ortp` myprogram.c \
`pkg-config --libs ortp` `pkg-config --libs ortp`
...@@ -60,4 +64,11 @@ What about Windows port ? ...@@ -60,4 +64,11 @@ What about Windows port ?
************************* *************************
There are instructions and Microsoft Visual C++ project files in build/win32native/oRTP. There are instructions and Microsoft Visual C++ project files in build/win32native/oRTP.
Rpm packaging
************************
ortp rpm can be generated with cmake3 using the following command:
mkdir WORK
cd WORK
cmake3 ../
make package_source
rpmbuild -ta --clean --rmsource --rmspec ortp-<version>-<release>.tar.gz
...@@ -48,7 +48,7 @@ string(COMPARE GREATER "${GIT_VERSION_STRING}" "1.7.10" GIT_REV_LIST_HAS_COUNT) ...@@ -48,7 +48,7 @@ string(COMPARE GREATER "${GIT_VERSION_STRING}" "1.7.10" GIT_REV_LIST_HAS_COUNT)
if (GIT_REV_LIST_HAS_COUNT) if (GIT_REV_LIST_HAS_COUNT)
set(GIT_REV_LIST_COMMAND "${GIT_EXECUTABLE}" "rev-list" "--count" "${PROJECT_VERSION}..HEAD") set(GIT_REV_LIST_COMMAND "${GIT_EXECUTABLE}" "rev-list" "--count" "${PROJECT_VERSION}..HEAD")
set(WC_COMMAND echo) #nop set(WC_COMMAND "more") #nop
else() else()
set(GIT_REV_LIST_COMMAND "${GIT_EXECUTABLE}" "rev-list" "${PROJECT_VERSION}..HEAD") set(GIT_REV_LIST_COMMAND "${GIT_EXECUTABLE}" "rev-list" "${PROJECT_VERSION}..HEAD")
set(WC_COMMAND "${WC}" "-l") set(WC_COMMAND "${WC}" "-l")
...@@ -69,6 +69,7 @@ endif() ...@@ -69,6 +69,7 @@ endif()
message("Package file name is ${CPACK_PACKAGE_FILE_NAME}" ) message("Package file name is ${CPACK_PACKAGE_FILE_NAME}" )
endif() endif()
set(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME}) set(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/rpm/ortp.spec.cmake ${CMAKE_CURRENT_SOURCE_DIR}/../ortp.spec)
include(CPack) include(CPack)
...@@ -22,10 +22,10 @@ ...@@ -22,10 +22,10 @@
%ifarch %ix86 %ifarch %ix86
%define ortp_cpu pentium4 %define ortp_cpu pentium4
%endif %endif
%define build_number %(git describe --tags --abbrev=40 | sed -rn 's/^.*-([0-9]+)-g[a-z0-9]{40}$/\1/p' || echo '1') %define build_number @PROJECT_VERSION_BUILD@
Summary: Real-time Transport Protocol Stack Summary: Real-time Transport Protocol Stack
Name: %pkg_name Name: %pkg_name
Version: @ORTP_PKGCONFIG_VERSION@ Version: @PROJECT_VERSION@
Release: %build_number%{?dist} Release: %build_number%{?dist}
#to be alined with redhat which changed epoc to 1 for an unknown reason #to be alined with redhat which changed epoc to 1 for an unknown reason
Epoch: 1 Epoch: 1
...@@ -71,14 +71,14 @@ develop programs using the oRTP library. ...@@ -71,14 +71,14 @@ develop programs using the oRTP library.
%setup -n %{name}-%{version}-%build_number %setup -n %{name}-%{version}-%build_number
%build %build
%cmake . %cmake3 .
make %{?_smp_mflags} make %{?_smp_mflags}
%install %install
make install DESTDIR=%{buildroot} make install DESTDIR=%{buildroot}
%check %check
ctest -V %{?_smp_mflags} ctest3 -V %{?_smp_mflags}
%clean %clean
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
...@@ -94,11 +94,14 @@ rm -rf $RPM_BUILD_ROOT ...@@ -94,11 +94,14 @@ rm -rf $RPM_BUILD_ROOT
%files devel %files devel
%defattr(-,root,root,-) %defattr(-,root,root,-)
%doc %{_docdir}/ortp-%{version}/html/* %doc %{_docdir}/ortp-%{version}/html/*
%{_libdir}/*.la
%{_libdir}/*.a %{_libdir}/*.a
%{_libdir}/*.so %{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc %{_libdir}/pkgconfig/*.pc
%{_includedir}/* %{_includedir}/*
%{_datadir}/oRTP/cmake/ORTPConfig.cmake
%{_datadir}/oRTP/cmake/ORTPConfigVersion.cmake
%{_datadir}/oRTP/cmake/ORTPTargets-noconfig.cmake
%{_datadir}/oRTP/cmake/ORTPTargets.cmake
%changelog %changelog
* Tue Oct 25 2005 Francois-Xavier Kowalski <fix@hp.com> * Tue Oct 25 2005 Francois-Xavier Kowalski <fix@hp.com>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment