Commit d2aa1508 authored by jehan's avatar jehan

add rpm build description to README.md

parent 8733b60f
......@@ -635,14 +635,4 @@ install(FILES
DESTINATION ${CONFIG_PACKAGE_LOCATION}
)
# CPack settings
set(CPACK_PACKAGE_NAME "mediastreamer")
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
set(CPACK_SOURCE_GENERATOR "TGZ")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
set(CPACK_SOURCE_IGNORE_FILES
"^${CMAKE_BINARY_DIR}"
"/\\\\..+"
)
include(CPack)
add_subdirectory(build)
......@@ -80,6 +80,15 @@ Our CMake scripts may automatically add some paths into research paths of genera
To ensure that the installed binaries are striped of any rpath, use `-DCMAKE_SKIP_INSTALL_RPATH=ON`
while you invoke cmake.
Rpm packaging
mediastremer2 rpm can be generated with cmake3 using the following command:
mkdir WORK
cd WORK
cmake3 ../
make package_source
rpmbuild -ta --clean --rmsource --rmspec mediastreamer-<version>-<release>.tar.gz
Environment variables used by mediastreamer2
--------------------------------------------
......
############################################################################
# CMakeLists.txt
# Copyright (C) 2017 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
############################################################################
if (NOT CPACK_PACKAGE_NAME)
set(CPACK_PACKAGE_NAME "mediastreamer")
ENDIF()
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/../COPYING")
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${PROJECT_VERSION})
set(CPACK_SOURCE_GENERATOR "TGZ")
set(CPACK_SOURCE_IGNORE_FILES
"${CMAKE_BINARY_DIR}"
"^${PROJECT_SOURCE_DIR}/.git*"
)
bc_project_build_version(${PROJECT_VERSION} PROJECT_VERSION_BUILD)
if (PROJECT_VERSION_BUILD)
set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-${PROJECT_VERSION_BUILD}")
endif()
message("-- Package file name is ${CPACK_PACKAGE_FILE_NAME}" )
set(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/rpm/mediastreamer2.spec.cmake ${CMAKE_CURRENT_SOURCE_DIR}/../mediastreamer2.spec)
include(CPack)
# -*- rpm-spec -*-
## rpmbuild options
# These 2 lines are here because we can build the RPM for flexisip, in which
# case we prefix the entire installation so that we don't break compatibility
# with the user's libs.
# To compile with bc prefix, use rpmbuild -ba --with bc [SPEC]
%define pkg_name %{?_with_bc:bc-mediastreamer}%{!?_with_bc:mediastreamer}
%{?_with_bc: %define _prefix /opt/belledonne-communications}
# re-define some directories for older RPMBuild versions which don't. This messes up the doc/ dir
# taken from https://fedoraproject.org/wiki/Packaging:RPMMacros?rd=Packaging/RPMMacros
%define _datarootdir %{_prefix}/share
%define _datadir %{_datarootdir}
%define _docdir %{_datadir}/doc
%define build_number @PROJECT_VERSION_BUILD@
Name: %{pkg_name}
Version: @PROJECT_VERSION@
Release: %build_number%{?dist}
Summary: Audio/Video real-time streaming
Group: Applications/Communications
License: GPL
URL: http://www.mediastreamer.org
Source0: %{name}-%{version}-%{build_number}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
%description
Mediastreamer2 is a GPL licensed library to make audio and video
real-time streaming and processing. Written in pure C, it is based
upon the oRTP library.
%define video %{?_without_video:0}%{!?_without_video:1}
BuildRequires:
%package devel
Summary: Development libraries for mediastreamer
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description devel
This package contains header files and development libraries needed to
develop programs using the mediastreamer2 library.
%if 0%{?rhel} && 0%{?rhel} <= 7
%global cmake_name cmake3
%define ctest_name ctest3
%else
%global cmake_name cmake
%define ctest_name ctest
%endif
%prep
%setup -n %{name}-%{version}-%build_number
%build
%{expand:%%%cmake_name} . -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} -DCMAKE_PREFIX_PATH:PATH=%{_prefix} -DENABLE_VIDEO=%{video}
make %{?_smp_mflags}
%install
make install DESTDIR=%{buildroot}
%check
#%{ctest_name} -V %{?_smp_mflags}
%clean
rm -rf $RPM_BUILD_ROOT
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING NEWS README.md
%{_bindir}/*
%{_libdir}/*.so.*
%{_datadir}/images/nowebcamCIF.jpg
%{_datadir}/locale/??/LC_MESSAGES/mediastreamer.mo
%{_datadir}/locale/??_??/LC_MESSAGES/mediastreamer.mo
%files devel
%{_docdir}
%files
%defattr(-,root,root)
%{_libdir}/*.so.*
%files devel
%defattr(-,root,root,-)
%{_libdir}/*.a
%{_libdir}/*.so
#%{_libdir}/pkgconfig/*.pc
%{_includedir}
%{_datadir}/Mediastreamer2/cmake/Mediastreamer2Config.cmake
%{_datadir}/Mediastreamer2/cmake/Mediastreamer2ConfigVersion.cmake
%{_datadir}/Mediastreamer2/cmake/Mediastreamer2Targets-noconfig.cmake
%{_datadir}/Mediastreamer2/cmake/Mediastreamer2Targets.cmake
%{_datadir}/mediastreamer2_tester/*
%{_bindir}/*
%changelog
* Thu Jul 13 2017 jehan.monnier <jehan.monnier@linphone.org>
- cmake port
* Mon Aug 19 2013 jehan.monnier <jehan.monnier@linphone.org>
- Initial RPM release.
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