Debian Codegraph @

build/rpm/mediastreamer2.spec.cmake

raw
1 # -*- rpm-spec -*-
2
3 %define _prefix @CMAKE_INSTALL_PREFIX@
4 %define pkg_prefix @BC_PACKAGE_NAME_PREFIX@
5 %define package_name @CPACK_PACKAGE_NAME@-${FULL_VERSION}
6
7 # re-define some directories for older RPMBuild versions which don't. This messes up the doc/ dir
8 # taken from https://fedoraproject.org/wiki/Packaging:RPMMacros?rd=Packaging/RPMMacros
9 %define _datarootdir %{_prefix}/share
10 %define _datadir %{_datarootdir}
11 %define _docdir %{_datadir}/doc
12
13
14 Name: @CPACK_PACKAGE_NAME@
15 Version: ${RPM_VERSION}
16 Release: ${RPM_RELEASE}%{?dist}
17 Summary: Audio/Video real-time streaming
18
19 Group: Applications/Communications
20 License: GPL
21 URL: http://www.mediastreamer.org
22 Source0: %{package_name}.tar.gz
23 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
24
25 Requires: %{pkg_prefix}bctoolbox
26 Requires: %{pkg_prefix}ortp
27
28 %description
29 Mediastreamer2 is a GPL licensed library to make audio and video
30 real-time streaming and processing. Written in pure C, it is based
31 upon the oRTP library.
32
33
34 BuildRequires:
35
36 %package devel
37 Summary: Development libraries for mediastreamer
38 Group: Development/Libraries
39 Requires: %{name} = %{version}-%{release}
40
41 %description devel
42 This package contains header files and development libraries needed to
43 develop programs using the mediastreamer2 library.
44
45 %if 0%{?rhel} && 0%{?rhel} <= 7
46 %global cmake_name cmake3
47 %define ctest_name ctest3
48 %else
49 %global cmake_name cmake
50 %define ctest_name ctest
51 %endif
52
53 # This is for debian builds where debug_package has to be manually specified, whereas in centos it does not
54 %define custom_debug_package %{!?_enable_debug_packages:%debug_package}%{?_enable_debug_package:%{nil}}
55 %custom_debug_package
56
57 %prep
58 %setup -n %{package_name}
59
60 %build
61 %{expand:%%%cmake_name} . -DCMAKE_BUILD_TYPE=@CMAKE_BUILD_TYPE@ -DCMAKE_PREFIX_PATH:PATH=%{_prefix} @RPM_ALL_CMAKE_OPTIONS@
62 make %{?_smp_mflags}
63
64 %install
65 make install DESTDIR=%{buildroot}
66
67 # Dirty workaround to give exec rights for all shared libraries. Debian packaging needs this
68 # TODO : set CMAKE_INSTALL_SO_NO_EXE for a cleaner workaround
69 chmod +x `find %{buildroot} *.so.*`
70
71
72 %check
73 #%{ctest_name} -V %{?_smp_mflags}
74
75 %clean
76 rm -rf $RPM_BUILD_ROOT
77
78 %post -p /sbin/ldconfig
79
80 %postun -p /sbin/ldconfig
81
82 %files
83 %defattr(-,root,root,-)
84 %if @ENABLE_TOOLS@ || @ENABLE_UNIT_TESTS@
85 %{_bindir}/*
86 %endif
87 %{_libdir}/*.so.*
88 %if @ENABLE_VIDEO@
89 %{_datadir}/images/nowebcamCIF.jpg
90 %endif
91
92 %files devel
93 %defattr(-,root,root,-)
94 %if @ENABLE_STATIC@
95 %{_libdir}/*.a
96 %endif
97 %if @ENABLE_SHARED@
98 %{_libdir}/*.so
99 %endif
100 #%{_libdir}/pkgconfig/*.pc
101 %{_includedir}
102 %{_datadir}/Mediastreamer2/cmake/Mediastreamer2Config*.cmake
103 %{_datadir}/Mediastreamer2/cmake/Mediastreamer2Targets*.cmake
104 %if @ENABLE_DOC@
105 %doc %{_docdir}/*
106 %endif
107
108 %changelog
109
110 * Tue Nov 27 2018 ronan.abhamon <[email protected]>
111 - Do not set CMAKE_INSTALL_LIBDIR.
112
113 * Thu Jul 13 2017 jehan.monnier <[email protected]>
114 - cmake port
115
116 * Mon Aug 19 2013 jehan.monnier <[email protected]>
117 - Initial RPM release.