Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:ighvh:branches:science:EtherLabRealtek
ethercat
ethercat.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File ethercat.spec of Package ethercat
#----------------------------------------------------------------------------- # SPEC file for EtherCAT master #----------------------------------------------------------------------------- # needssslcertforbuild # set by set_version service %define version_unconverted 1.5 %define master_version %{version_unconverted} # move modules to extra module dir so that find-require.ksyms finds them %define module_dir extra/ethercat # some distros have modules in /usr/lib/modules %{!?kernel_module_directory: %define kernel_module_directory /lib/modules} #----------------------------------------------------------------------------- Name: ethercat Version: 1.5 Release: 1 Summary: Master Tools and Utilities Group: System/Daemons License: GPL-2.0 Url: http://www.etherlab.org/en/ethercat Source0: http://www.etherlab.org/download/ethercat/ethercat-%{version}.tar.bz2 Source1: preamble Patch0: openSUSE-Leap-42.3-ndo.patch %{?systemd_requires} %if 0%{?suse_version} %ifarch %ix86 BuildRequires: kernel-pae-devel %else BuildRequires: kernel-default-devel %endif BuildRequires: kernel-syms modutils BuildRequires: %{kernel_module_package_buildreqs} %else BuildRequires: kernel-rpm-macros kernel-devel redhat-rpm-config kernel-rpm-macros elfutils-libelf-devel kmod %global kmodtool_generate_buildreqs 1 %endif %if 0%{?fedora} BuildRequires: glibc-langpack-en %endif BuildRequires: gcc gcc-c++ coreutils module-init-tools doxygen BuildRequires: autoconf automake libtool BuildRequires: autoconf-archive BuildRequires: pesign-obs-integration BuildRequires: pkgconfig BuildRequires: pkgconfig(systemd) # since openSUSE Leap 15.2 SUSE provides an own RT kernel again, but no header # package %if 0%{?sle_version} >= 150200 BuildRequires: kernel-rt-devel %endif %if 0%{?suse_version} %kernel_module_package -c %_sourcedir/_projectcert.crt %else %kernel_module_package %endif %description Master implementation of the EtherCAT protocol; part of the Open-Source Automation Toolkit "EtherLab". #----------------------------------------------------------------------------- %package -n ethercat-doc Summary: Master Documentation Group: System/Libraries %description -n ethercat-doc Doxygen-generated API documentation #----------------------------------------------------------------------------- %package -n libethercat1 Summary: Master Userspace Library Group: System/Libraries %description -n libethercat1 Userspace Library providing the EtherCAT Master API #----------------------------------------------------------------------------- %package -n libethercat-devel Summary: Development files for Master Userspace Library Group: Development/Libraries/C and C++ Requires: libethercat1 = %{version} %description -n libethercat-devel Development and header files for the EtherCAT Master and its user-space library #----------------------------------------------------------------------------- %package bash-completion Summary: Bash Completion for %{name} Group: System/Shells Requires: bash-completion %if 0%{?sle_version} >= 120100 && 0%{?sle_version} <= 120300 && 0%{?is_opensuse} # Binary operators not supported in Leap 42.1-3 %else Supplements: (%{name} and bash) %endif BuildArch: noarch %description bash-completion Bash completions for the EtherCAT tool. #----------------------------------------------------------------------------- %prep %setup -q -n %name-%version # Check for openSUSE Leap 42.3 - it uses a patched # kernel with a more recent networking API. # Apply patch to default kernel build only! echo "Checking for openSUSE version:" echo "sle_version is %{?sle_version}%{!?sle_version:undefined}." %if 0%{?sle_version} == 120300 %patch0 -p1 %endif # Write revision information (known here though set_version) to file, so that # revision hooks can find it. echo %{version} >> revision ./bootstrap for flavor in %flavors_to_build; do kmajorminor=`make -s -C %{kernel_source $flavor} kernelversion | cut -d . --complement -f 3-` echo "using $flavor in version $kmajorminor" KMODSDEF="" for km in 8139too e100; do if [ -f devices/$km-$kmajorminor-ethercat.c ]; then KMODSDEF="$KMODSDEF --enable-$km" else KMODSDEF="$KMODSDEF --disable-$km" fi done for km in e1000 e1000e igb igbvf ixgbevf; do if [ -f devices/$km/$km-$kmajorminor-ethercat.h ]; then KMODSDEF="$KMODSDEF --enable-$km" else KMODSDEF="$KMODSDEF --disable-$km" fi done if [ -f devices/r8169-$kmajorminor-ethercat.c -o \ -f devices/r8169/r8169-$kmajorminor-ethercat.h ]; then KMODSDEF="$KMODSDEF --enable-r8169" else KMODSDEF="$KMODSDEF --disable-r8169" fi mkdir build-$flavor if [ -r source/%{name}-%{version}/devices/devices/genet/bcmgenet-$kmajorminor-ethercat.h ]; then KMODSDEF="$KMODSDEF --enable-genet" else KMODSDEF="$KMODSDEF --disable-genet" fi cp -r source/%{name}-%{version} build-$flavor pushd build-$flavor ln -s ../configure %configure \ --with-linux-dir=%{kernel_source $flavor} \ --enable-sii-assign --disable-rt-syslog \ --with-module-dir=%module_dir \ --enable-generic --enable-ccat $KMODSDEF popd done mkdir userspace && pushd userspace ln -s ../configure %configure --disable-kernel --enable-sii-assign --disable-rt-syslog popd #----------------------------------------------------------------------------- %build for flavor in %flavors_to_build; do pushd build-$flavor make %{?_smp_mflags} modules V=1 popd done pushd userspace make %{?_smp_mflags} all doc popd #----------------------------------------------------------------------------- %install export INSTALL_MOD_PATH=%{buildroot} for flavor in %flavors_to_build; do pushd build-$flavor make %{?_smp_mflags} modules_install CONFIG_MODULE_SIG_ALL=n install Module.symvers %{buildroot}/%kernel_module_directory/`make -s -C %{kernel_source $flavor} kernelrelease`/%module_dir popd done pushd userspace mv doxygen-output/html ../ make install DESTDIR=%{buildroot} ln -sv /usr/sbin/service %{buildroot}/%{_sbindir}/rcethercat rm %{buildroot}%{_sysconfdir}/init.d/ethercat install -d %{buildroot}/usr/lib/udev/rules.d echo KERNEL==\"EtherCAT[0-9]*\", MODE=\"0664\" > %{buildroot}/usr/lib/udev/rules.d/99-EtherCAT.rules rm -rv %{buildroot}%{_sysconfdir}/sysconfig rm %{buildroot}%{_libdir}/*.la popd %if ! 0%{?suse_version} /usr/lib/rpm/brp-suse.d/brp-99-pesign %endif #----------------------------------------------------------------------------- %pre %service_add_pre %{name}.service %post %service_add_post %{name}.service %preun %service_del_preun %{name}.service %postun /bin/systemctl --system daemon-reload &>/dev/null || : %service_del_postun %{name}.service #----------------------------------------------------------------------------- %post -n libethercat1 /sbin/ldconfig %postun -n libethercat1 /sbin/ldconfig #----------------------------------------------------------------------------- %files %defattr(-,root,root,-) %doc AUTHORS COPYING COPYING.LESSER FEATURES.md README.md INSTALL.md CodingStyle.md TODO %config(noreplace) %{_sysconfdir}/ethercat.conf %{_unitdir}/%{name}.service %dir /usr/lib/udev %dir /usr/lib/udev/rules.d /usr/lib/udev/rules.d/99-EtherCAT.rules %{_bindir}/ethercat %{_sbindir}/ethercatctl %{_sbindir}/rcethercat %files -n ethercat-doc %defattr(-,root,root,-) %doc html %files -n libethercat1 %defattr(-,root,root,-) %{_libdir}/libethercat.so.* %files -n libethercat-devel %defattr(-,root,root,-) %dir %{_libdir}/cmake %dir %{_libdir}/pkgconfig %{_includedir}/ecrt.h %{_includedir}/ectty.h %{_libdir}/libethercat.a %{_libdir}/libethercat.so %{_libdir}/cmake/%{name} %{_libdir}/pkgconfig/libethercat.pc %files bash-completion %defattr(-,root,root,-) %{_datadir}/bash-completion/completions/ethercat #----------------------------------------------------------------------------- %changelog * Mon Aug 14 2023 vh@igh.de - Use out-of-tree build directories without copying whole source * Mon May 16 2022 fp@igh.de - Added bash completion * Wed Apr 6 2022 fp@igh.de - Added udev file to grant read permissions to normal users * Mon Dec 6 2021 vh@igh.de - Remove non-systemd option - use kernel_module_package macro * Wed Mar 17 2021 fp@igh.de - Included openSUSE's kernel-rt * Tue Jul 9 2019 fp@igh.de - Separate check for RT kernel Ethernet modules * Wed Feb 28 2018 fp@igh.de - Added option --enable-sii-assign #-----------------------------------------------------------------------------
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor