File sc_hardware.spec of Package sc_hardware
#
# spec file for package sc_hardware
#
# Copyright (c) 2002-2003 SuSE AG Nuernberg, Germany
# 2004-2018 dass IT GmbH, Cologne, Germany
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
#
# $Id: sc_hardware.spec 5695 2020-09-01 14:27:46Z joergs $
#
%if 0%{?suse_version} >= 1210
%define initsystem systemd
%define network networkmanager
%else
%define initsystem SysV
%define network legacy
%endif
%if 0%{?suse_version} <= 1210
%define acpid 1
%endif
Name: sc_hardware
License: GPL-2.0-or-later
Group: Applications/SmartClient
Summary: SmartClient: Hardware Detection For Desktop PCs
Version: 1.5.5695
Release: 0
Autoreqprov: on
Url: http://trac.dass-it.de/pub/
BuildArch: noarch
Requires: sc_base perl-SmartClient
Requires: hwinfo lsb-release
#Requires: waltopattach
# sc_nm_wlan.sh
%if 0%{?suse_version} >= 1120 && 0%{?suse_version} < 1210
# before 11.2 networkmanager wasn't used/available,
# in 12.1 nmcli is integrated into NetworkManager
Requires: cnetworkmanager
%endif
%if 0%{?suse_version} <= 1210
Requires: sax2
%endif
Source: sc_hardware_1.5.5695.orig.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: sc_base
BuildRequires: update-desktop-files
%if 0%{?acpid} >= 1
BuildRequires: acpid
%endif
# resmgr: openSUSE 10.0, 10.2
# PolicyKit: openSUSE 10.2, 11.1, 11.2
%if 0%{?suse_version} <= 1020
BuildRequires: resmgr
%else
%if 0%{?suse_version} <= 1210
BuildRequires: PolicyKit
%endif
%endif
%if %{network} == networkmanager
BuildRequires: NetworkManager
%endif
%if %{initsystem} == systemd
BuildRequires: systemd
%endif
%description
detects network (Ethernet, Token-Ring), sound, graphic subsystem (Grafikcard, Monitor, Mouse), CD-recorder and scanner.
Authors:
--------
Fabian Herschel
Holger Mueller
Joerg Steffens
%package ldap2monitor
Summary: SmartClient: Configure Monitor According to LDAP Information
Group: Applications/SmartClient
Requires: sc_hardware >= %{version}
%description ldap2monitor
SmartClient: configure the primary monitor according to LDAP information at boot
%prep
%setup -c
%build
%install
%if 0%{?acpid} >= 1
mkdir -p $RPM_BUILD_ROOT/etc/acpi/events/
install -m 644 etc/acpi/events/acpi_sc_checklid $RPM_BUILD_ROOT/etc/acpi/events/
%endif
%if %{network} == networkmanager
mkdir -p $RPM_BUILD_ROOT/etc/NetworkManager/dispatcher.d/
install -m 755 etc/NetworkManager/dispatcher.d/sc_network_changed.sh $RPM_BUILD_ROOT/etc/NetworkManager/dispatcher.d/sc_network_changed.sh
%endif
mkdir -p $RPM_BUILD_ROOT/etc/smartclient/
install -m 644 etc/smartclient/sc_hardware $RPM_BUILD_ROOT/etc/smartclient/
install -m 644 etc/smartclient/nm_wlan_template $RPM_BUILD_ROOT/etc/smartclient/
mkdir -p $RPM_BUILD_ROOT/etc/smartclient/sc_hardware-templates/default/
mkdir -p $RPM_BUILD_ROOT/etc/smartclient/network-changed/
install -m 755 etc/smartclient/network-changed/10-sc_network_changed.sh $RPM_BUILD_ROOT/etc/smartclient/network-changed/10-sc_network_changed.sh
%if 0%{?suse_version} <= 1020
mkdir -p $RPM_BUILD_ROOT/etc/resmgr.conf.d/
install -m 644 etc/resmgr.conf.d/90-sc_hardware-usb.conf $RPM_BUILD_ROOT/etc/resmgr.conf.d/
%endif
mkdir -p $RPM_BUILD_ROOT/usr/lib/smartclient/
mkdir -p $RPM_BUILD_ROOT/usr/bin/
mkdir -p $RPM_BUILD_ROOT/usr/sbin/
install -m 755 usr/lib/smartclient/sc_hardware.sh $RPM_BUILD_ROOT/usr/lib/smartclient/
mkdir -p $RPM_BUILD_ROOT/etc/init.d/
install -m 755 etc/init.d/sc_hardware_prepare $RPM_BUILD_ROOT/etc/init.d/
ln -sf ../../etc/init.d/sc_hardware_prepare $RPM_BUILD_ROOT/usr/sbin/rcsc_hardware_prepare
install -m 755 etc/init.d/sc_hardware_audio $RPM_BUILD_ROOT/etc/init.d/
ln -sf ../../etc/init.d/sc_hardware_audio $RPM_BUILD_ROOT/usr/sbin/rcsc_hardware_audio
install -m 755 etc/init.d/sc_hardware_cdr $RPM_BUILD_ROOT/etc/init.d/
ln -sf ../../etc/init.d/sc_hardware_cdr $RPM_BUILD_ROOT/usr/sbin/rcsc_hardware_cdr
install -m 755 etc/init.d/sc_hardware_net $RPM_BUILD_ROOT/etc/init.d/
ln -sf ../../etc/init.d/sc_hardware_net $RPM_BUILD_ROOT/usr/sbin/rcsc_hardware_net
install -m 755 etc/init.d/sc_hardware_scanner $RPM_BUILD_ROOT/etc/init.d/
ln -sf ../../etc/init.d/sc_hardware_scanner $RPM_BUILD_ROOT/usr/sbin/rcsc_hardware_scanner
install -m 755 etc/init.d/sc_hardware_lid $RPM_BUILD_ROOT/etc/init.d/
ln -sf ../../etc/init.d/sc_hardware_lid $RPM_BUILD_ROOT/usr/sbin/rcsc_hardware_lid
install -m 755 etc/init.d/sc_hardware_X $RPM_BUILD_ROOT/etc/init.d/
ln -sf ../../etc/init.d/sc_hardware_X $RPM_BUILD_ROOT/usr/sbin/rcsc_hardware_X
mkdir -p $RPM_BUILD_ROOT/etc/X11/
install -m 644 etc/X11/xorg.conf* $RPM_BUILD_ROOT/etc/X11/
install -m 755 usr/bin/nx-session-info $RPM_BUILD_ROOT/usr/bin/
install -m 755 usr/bin/sc_check_net $RPM_BUILD_ROOT/usr/bin/
install -m 755 usr/bin/sc_switchmon $RPM_BUILD_ROOT/usr/bin/
install -m 755 usr/bin/*.sh $RPM_BUILD_ROOT/usr/bin/
install -m 755 usr/sbin/sc_checklid $RPM_BUILD_ROOT/usr/sbin/
install -m 755 usr/sbin/*.pl $RPM_BUILD_ROOT/usr/sbin/
install -m 755 usr/sbin/*.sh $RPM_BUILD_ROOT/usr/sbin/
mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
install -m 644 usr/share/pixmaps/*.xbm $RPM_BUILD_ROOT/usr/share/pixmaps
install -m 644 usr/share/pixmaps/*.png $RPM_BUILD_ROOT/usr/share/pixmaps
%suse_update_desktop_file -i sc_switchmon_on
%suse_update_desktop_file -i sc_switchmon_off
%if %{initsystem} == systemd
mkdir -p $RPM_BUILD_ROOT/%_unitdir/
install -m 644 sc_*.service $RPM_BUILD_ROOT/%_unitdir/
mkdir -p $RPM_BUILD_ROOT//usr/lib/tmpfiles.d/
install -m 644 usr/lib/tmpfiles.d/sc_hardware.conf $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/
%endif
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%doc doc/README doc/sc_hardware_audio.README doc/sc_hardware_cdr.README doc/sc_hardware_scanner.README
%if 0%{?acpid} >= 1
%config(noreplace) /etc/acpi/events/acpi_sc_checklid
%endif
%config(noreplace) /etc/smartclient/sc_hardware
%config(noreplace) /etc/smartclient/nm_wlan_template
/etc/smartclient/sc_hardware-templates/
%dir /etc/smartclient/network-changed/
%config(noreplace) /etc/smartclient/network-changed/10-sc_network_changed.sh
%if 0%{?suse_version} <= 1020
%config(noreplace) /etc/resmgr.conf.d/90-sc_hardware-usb.conf
%endif
%config /etc/X11/xorg.conf-*
/usr/lib/smartclient/sc_hardware.sh
/usr/bin/nx-session-info
/usr/bin/sc_*
/usr/sbin/sc_*
/usr/share/pixmaps/empty.xbm
/usr/share/pixmaps/sc_*.png
%config /etc/init.d/sc_hardware_prepare
/usr/sbin/rcsc_hardware_prepare
%config /etc/init.d/sc_hardware_audio
/usr/sbin/rcsc_hardware_audio
%config /etc/init.d/sc_hardware_cdr
/usr/sbin/rcsc_hardware_cdr
%config /etc/init.d/sc_hardware_net
/usr/sbin/rcsc_hardware_net
%config /etc/init.d/sc_hardware_scanner
/usr/sbin/rcsc_hardware_scanner
%config /etc/init.d/sc_hardware_lid
/usr/sbin/rcsc_hardware_lid
%config /etc/init.d/sc_hardware_X
/usr/sbin/rcsc_hardware_X
/usr/share/applications/sc_switchmon_on.desktop
/usr/share/applications/sc_switchmon_off.desktop
%if %{network} == networkmanager
/etc/NetworkManager/dispatcher.d/sc_network_changed.sh
%endif
%if %{?initsystem} == systemd
%_unitdir/sc_hardware_prepare.service
%_unitdir/sc_hardware_X.service
%_unitdir/sc_net_activation.service
/usr/lib/tmpfiles.d/sc_hardware.conf
%endif
%if %{?initsystem} == systemd
%files ldap2monitor
%defattr(-,root,root)
%_unitdir/sc_ldap2monitor.service
%pre ldap2monitor
%service_add_pre sc_ldap2monitor.service
%post ldap2monitor
%service_add_post sc_ldap2monitor.service
systemctl enable sc_ldap2monitor.service || true
%preun ldap2monitor
%service_del_preun sc_ldap2monitor.service
%postun ldap2monitor
%service_del_postun sc_ldap2monitor.service
%endif