[Arm-dev] Spec for ARM side libraries

Sat Mar 26 09:49:30 UTC 2016
Hugo De Zela <hdezela at gmail.com>

Hi,

     I haven't seen anything regarding this so here's the one I use for 
my systems in case it helps anyone else. It simply compiles and installs 
the side libraries and executables and optionally symlinks them to 
/usr/bin. Please go ahead and clean it up if necessary, I'm by no means 
a packaging expert.

-H
-------------- next part --------------
/opt/vc/lib
-------------- next part --------------
%global            debug_package %{nil}
# Symlink executables to /usr/bin
%bcond_with        symlinks
Name:              raspberry-userland
Version:           1.0.0
Release:           1%{?dist}
Summary:           Raspberry Pi Userland Libraries
Group:             System Environment/Libraries
License:           BSD
URL:               https://github.com/raspberrypi/userland
Source0:           userland.tar.xz
Source1:           raspberry-userland-ldconfig
BuildRequires:     cmake
BuildRequires:     glibc-devel
BuildRequires:     gcc-c++
BuildRequires:     git
Requires:          %{name}-libs = %{?epoch:%epoch:}%{version}-%{release}
%description
%{summary}.

%package           libs
Summary:	         Libraries for raspberry-userland
Obsoletes:         %{name}-libs
Provides:          %{name}-libs = %{?epoch:%epoch:}%{version}-%{release}
%description       libs
%{summary}.

%package           devel
Summary:	         Libraries and header files for raspberry-userland
Requires:	         %{name} = %{version}-%{release}
Requires:          %{name}-libs = %{?epoch:%epoch:}%{version}-%{release}
Obsoletes:         %{name}-devel
Provides:          %{name}-devel = %{?epoch:%epoch:}%{version}-%{release}
%description       devel
%{summary}.

%package           static
Summary:           Static files for raspberry-userland
Requires:          %{name}-libs = %{?epoch:%epoch:}%{version}-%{release}
Obsoletes:         %{name}-static
Provides:          %{name}-static = %{?epoch:%epoch:}%{version}-%{release}
%description       static
%{summary}.

%package           example
Summary:           Hello Pi example sources
Requires:          %{name} = %{?epoch:%epoch:}%{version}-%{release}
Requires:          %{name}-libs = %{?epoch:%epoch:}%{version}-%{release}
Requires:          %{name}-devel = %{?epoch:%epoch:}%{version}-%{release}
Requires:          %{name}-static = %{?epoch:%epoch:}%{version}-%{release}
%description       example
%{summary}.

%prep
%setup -q -n userland

%build
mkdir -p _build
cd _build

%cmake .. \
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_SKIP_RPATH=YES \

# If cross-compiling, the -DCMAKE_TOOLCHAIN_FILE=toolchain_file.cmake should be added to %cmake

make -j4 %{?_smp_mflags}

%install
cd _build

make install DESTDIR=%{buildroot}

# Install supplementary ldconfig conf
install -D %{SOURCE1} %{buildroot}%{_sysconfdir}/ld.so.conf.d/vmcs.conf

%if %{?with_symlinks:1}
# Symlink executables to /usr/bin
%{__mkdir_p} $RPM_BUILD_ROOT/%{_bindir}
ln -sf /opt/vc/bin/containers_datagram_sender $RPM_BUILD_ROOT%{_bindir}/containers_datagram_sender
ln -sf /opt/vc/bin/containers_dump_pktfile $RPM_BUILD_ROOT%{_bindir}/containers_dump_pktfile
ln -sf /opt/vc/bin/containers_rtp_decoder $RPM_BUILD_ROOT%{_bindir}/containers_rtp_decoder
ln -sf /opt/vc/bin/containers_stream_client $RPM_BUILD_ROOT%{_bindir}/containers_stream_client
ln -sf /opt/vc/bin/containers_stream_server $RPM_BUILD_ROOT%{_bindir}/containers_stream_server
ln -sf /opt/vc/bin/containers_test $RPM_BUILD_ROOT%{_bindir}/containers_test
ln -sf /opt/vc/bin/containers_test_bits $RPM_BUILD_ROOT%{_bindir}/containers_test_bits
ln -sf /opt/vc/bin/containers_test_uri $RPM_BUILD_ROOT%{_bindir}/containers_test_uri
ln -sf /opt/vc/bin/containers_uri_pipe $RPM_BUILD_ROOT%{_bindir}/containers_uri_pipe
ln -sf /opt/vc/bin/mmal_vc_diag $RPM_BUILD_ROOT%{_bindir}/mmal_vc_diag
ln -sf /opt/vc/bin/raspistill $RPM_BUILD_ROOT%{_bindir}/raspistill
ln -sf /opt/vc/bin/raspivid $RPM_BUILD_ROOT%{_bindir}/raspivid
ln -sf /opt/vc/bin/raspividyuv $RPM_BUILD_ROOT%{_bindir}/raspividyuv
ln -sf /opt/vc/bin/raspiyuv $RPM_BUILD_ROOT%{_bindir}/raspiyuv
ln -sf /opt/vc/bin/tvservice $RPM_BUILD_ROOT%{_bindir}/tvservice
ln -sf /opt/vc/bin/vcgencmd $RPM_BUILD_ROOT%{_bindir}/vcgencmd
ln -sf /opt/vc/bin/vchiq_test $RPM_BUILD_ROOT%{_bindir}/vchiq_test
ln -sf /opt/vc/bin/vcmailbox $RPM_BUILD_ROOT%{_bindir}/vcmailbox
ln -sf /opt/vc/bin/vcsmem $RPM_BUILD_ROOT%{_bindir}/vcsmem
ln -sf /opt/vc/bin/containers_check_frame_int $RPM_BUILD_ROOT%{_bindir}/containers_check_frame_int
ln -sf /opt/vc/bin/containers_datagram_receiver $RPM_BUILD_ROOT%{_bindir}/containers_datagram_receiver
%endif

%post libs -p /sbin/ldconfig

%postun libs -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%{_sysconfdir}/init.d/vcfiled
/opt/vc/bin/*
%if %{?with_symlinks:1}
%{_bindir}/*
%endif

%files libs
/opt/vc/lib/*.so
/opt/vc/lib/plugins/*.so
/opt/vc/sbin/vcfiled
/opt/vc/share/install/vcfiled
%{_sysconfdir}/ld.so.conf.d/vmcs.conf

%files devel
/opt/vc/include/bcm_host.h
/opt/vc/include/EGL/*.h
/opt/vc/include/GLES/*.h
/opt/vc/include/GLES2/*.h
/opt/vc/include/IL/*.h
/opt/vc/include/KHR/*.h
/opt/vc/include/VG/*.h
/opt/vc/include/WF/*.h
/opt/vc/include/interface/mmal/*.h
/opt/vc/include/interface/mmal/core/*.h
/opt/vc/include/interface/mmal/util/*.h
/opt/vc/include/interface/mmal/vc/*.h
/opt/vc/include/interface/vchi/common/endian.h
/opt/vc/include/interface/vchi/connections/connection.h
/opt/vc/include/interface/vchi/message_drivers/message.h
/opt/vc/include/interface/vchi/*.h
/opt/vc/include/interface/vchiq_arm/*.h
/opt/vc/include/interface/vcos/generic/*.h
/opt/vc/include/interface/vcos/pthreads/*.h
/opt/vc/include/interface/vcos/*.h
/opt/vc/include/interface/vctypes/*.h
/opt/vc/include/interface/vmcs_host/khronos/IL/*.h
/opt/vc/include/interface/vmcs_host/linux/vcfiled/vcfiled_check.h
/opt/vc/include/interface/vmcs_host/linux/vchost_config.h
/opt/vc/include/interface/vmcs_host/*.h
/opt/vc/include/vcinclude/*.h

%files static
/opt/vc/lib/*.a

%files example
/opt/vc/src/hello_pi/CMakeLists.txt
/opt/vc/src/hello_pi/Makefile.include
/opt/vc/src/hello_pi/README
/opt/vc/src/hello_pi/hello_audio/*.*
/opt/vc/src/hello_pi/hello_audio/Makefile
/opt/vc/src/hello_pi/hello_dispmanx/*.*
/opt/vc/src/hello_pi/hello_dispmanx/Makefile
/opt/vc/src/hello_pi/hello_encode/*.*
/opt/vc/src/hello_pi/hello_encode/Makefile
/opt/vc/src/hello_pi/hello_fft/*.*
/opt/vc/src/hello_pi/hello_fft/hex/*.hex
/opt/vc/src/hello_pi/hello_fft/qasm/*.*
/opt/vc/src/hello_pi/hello_fft/makefile
/opt/vc/src/hello_pi/hello_font/*.*
/opt/vc/src/hello_pi/hello_font/Makefile
/opt/vc/src/hello_pi/hello_jpeg/*.*
/opt/vc/src/hello_pi/hello_jpeg/Makefile
/opt/vc/src/hello_pi/hello_teapot/*.*
/opt/vc/src/hello_pi/hello_teapot/Makefile
/opt/vc/src/hello_pi/hello_tiger/*.*
/opt/vc/src/hello_pi/hello_tiger/Makefile
/opt/vc/src/hello_pi/hello_triangle/*.*
/opt/vc/src/hello_pi/hello_triangle/Makefile
/opt/vc/src/hello_pi/hello_triangle2/*.*
/opt/vc/src/hello_pi/hello_triangle2/Makefile
/opt/vc/src/hello_pi/hello_video/*.*
/opt/vc/src/hello_pi/hello_video/Makefile
/opt/vc/src/hello_pi/hello_video/README
/opt/vc/src/hello_pi/hello_videocube/*.*
/opt/vc/src/hello_pi/hello_videocube/Makefile
/opt/vc/src/hello_pi/hello_world/*.*
/opt/vc/src/hello_pi/hello_world/Makefile
/opt/vc/src/hello_pi/libs/ilclient/*.*
/opt/vc/src/hello_pi/libs/ilclient/Makefile
/opt/vc/src/hello_pi/libs/vgfont/*.*
/opt/vc/src/hello_pi/libs/vgfont/Makefile
/opt/vc/src/hello_pi/rebuild.sh

%changelog
* Fri Mar 25 2016 Hugo De Zela <hugodz at winet.com.pe>
- Version 1.0.0
- New spec file