File DLS.spec of Package DLS
#
# This file is part of the Data Logging Service (DLS).
#
# DLS 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 3 of the License, or (at your option) any later
# version.
#
# DLS 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 DLS. If not, see <http://www.gnu.org/licenses/>.
#
# vim: tw=78 spelllang=en
#
Name: dls
Version: 0 # set by set_version service
Release: 1
%define libver 8
%define data_dir /var/dls_data
Summary: Data Logging Service
License: GPL-3.0-or-later
Vendor: Ingenieurgemeinschaft IgH GmbH
Group: Productivity/Scientific/Other
Url: https://etherlab.org/dls
Source0: %{name}-%{version}.tar.bz2
Source1: dls-rpmlintrc
Requires(pre): shadow
Requires: desktop-file-utils
BuildRequires: fftw3-devel
BuildRequires: fltk-devel
BuildRequires: fontconfig-devel
BuildRequires: gcc-c++
BuildRequires: libXext-devel
BuildRequires: libXft-devel
BuildRequires: libXinerama-devel
BuildRequires: xorg-x11-proto-devel
BuildRequires: shared-mime-info
BuildRequires: desktop-file-utils
BuildRequires: libpdcom5-devel
BuildRequires: protobuf-devel
BuildRequires: libxml2-devel
BuildRequires: cmake
BuildRequires: pkg-config
BuildRequires: pcre2-devel
BuildRequires: git
BuildRequires: hdf5-devel
%if 0%{?suse_version}
PreReq: permissions
Requires(post): %fillup_prereq
BuildRequires: liburiparser-devel
%if 0%{?suse_version} > 1500
BuildRequires: abseil-cpp-devel
BuildRequires: libfltk1_3
%else
BuildRequires: libfltk1
%endif
BuildRequires: libqt5-linguist-devel
BuildRequires: libqt5-qtbase-common-devel
BuildRequires: libQt5Core-devel
BuildRequires: libQt5Network-devel
BuildRequires: libQt5Widgets-devel
BuildRequires: libqt5-qtsvg-devel
BuildRequires: libQt5Test-devel
BuildRequires: libQt5Svg-devel
BuildRequires: libqt5-qttools-devel
BuildRequires: libQt5PrintSupport-devel
%else
# Fedora
BuildRequires: glibc-all-langpacks
BuildRequires: uriparser-devel
BuildRequires: fltk-devel
BuildRequires: fltk-fluid
BuildRequires: qt5-qtbase-devel
BuildRequires: qt5-qtsvg-devel
BuildRequires: qt5-qttools-devel
%undefine _hardened_build
%endif
BuildRequires: systemd-rpm-macros
%{?systemd_requires}
%if ! %{defined _fillupdir}
%define _fillupdir /var/adm/fillup-templates
%endif
%description
DLS is a process data logging service, capable of capturing high-frequency
data over a long time and storing it in a compressed way. The aim is to allow
the user unlimited high-performance access to the data at any time. Be it a
year's overview or a small signal peak in fractions of a second.
%package -n dls-devel
Summary: Development files for data logging service
Summary(de): Entwickungsdateien für den DLS
Group: Development/Libraries/C and C++
Requires: %name = %version
Requires: fftw3-devel
Requires: zlib-devel
%description -n dls-devel
The %name-devel package contains the static libraries and header files
needed for development with %name.
%prep
%setup -n %{name}-%{version}
# Write revision information (known here though set_version to file, so that
# revision.sh can find it.
echo %{version} >> revision
%build
%cmake -DCMAKE_INSTALL_SYSCONFDIR=%{_sysconfdir} -DVERSION=%{Version} \
-DDLSD_INSTALL_SERVICE=%{_unitdir}/
%cmake_build
%install
%cmake_install
# apply settings to sysconfig file
sed -i s:#DLS_DIR=/vol/dls_data:DLS_DIR=%{data_dir}: \
${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/dls
sed -i s:#DLS_USER=dls:DLS_USER=dls: \
${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/dls
%if "%{_vendor}" == "suse"
install -d ${RPM_BUILD_ROOT}%{_sbindir}
install -d ${RPM_BUILD_ROOT}%{_fillupdir}
mv ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/dls \
${RPM_BUILD_ROOT}%{_fillupdir}/sysconfig.dls
%else
rm ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/dls
%endif
%if "%{_vendor}" == "suse"
ln -s service ${RPM_BUILD_ROOT}%{_sbindir}/rcdls
%endif
%verifyscript
%verify_permissions -e %{_bindir}/dls_ctl
%verify_permissions -e %{_bindir}/dls_view
%verify_permissions -e %{_bindir}/dlsgui
%pre
%service_add_pre dls.service
%service_add_pre dls_quota.timer
getent group dls >/dev/null || groupadd -r dls
getent passwd dls >/dev/null || useradd -r -g dls -d %{data_dir} \
-s /sbin/nologin -c "DLS user" dls
exit 0
%post
%{fillup_only dls}
%service_add_post dls.service
%service_add_post dls_quota.timer
%set_permissions %{_bindir}/dls_ctl
%set_permissions %{_bindir}/dls_view
%set_permissions %{_bindir}/dlsgui
/sbin/ldconfig
if ! test -d %{data_dir}; then
mkdir -p %{data_dir}
mkdir %{data_dir}/spool
echo 100 > %{data_dir}/id_sequence
chown -R dls:dls %{data_dir}
fi
%{_bindir}/update-mime-database /usr/share/mime
touch /usr/share/icons/hicolor
%{_bindir}/update-desktop-database
%preun
%service_del_preun dls.service
%service_del_preun dls_quota.timer
%postun
%service_del_postun dls.service
%service_del_postun dls_quota.timer
/sbin/ldconfig
%{_bindir}/update-mime-database /usr/share/mime
touch /usr/share/icons/hicolor
%{_bindir}/update-desktop-database
%restart_on_update dls
%files
%defattr(-,root,root)
%doc AUTHORS COPYING NEWS
%config %{_sysconfdir}/profile.d/dls.sh
%if "%{_vendor}" == "suse"
%{_fillupdir}/sysconfig.dls
%endif
%{_unitdir}/dls.service
%{_unitdir}/dls_quota.service
%{_unitdir}/dls_quota.timer
%{_bindir}/dls
%attr(4755, root, root) %{_bindir}/dls_ctl
%{_bindir}/dlsd
%{_bindir}/dlsgui
%{_bindir}/dls_quota
%{_bindir}/dls_status
%{_bindir}/dls_view
%if "%{_vendor}" == "suse"
%{_sbindir}/rcdls
%endif
%{_datadir}/applications/*.desktop
%{_datadir}/mime/packages/*.xml
%{_datadir}/icons/hicolor
%{_libdir}/libdls.so.%{libver}.0.0
%{_libdir}/libDlsWidgets.so
%files -n dls-devel
%defattr(-,root,root,755)
%dir %{_includedir}/DlsWidgets
%{_includedir}/DlsWidgets/DlsTypes.h
%{_includedir}/DlsWidgets/Graph.h
%{_includedir}/DlsWidgets/Layer.h
%{_includedir}/DlsWidgets/Model.h
%{_includedir}/DlsWidgets/Scale.h
%{_includedir}/DlsWidgets/Section.h
%{_includedir}/DlsWidgets/Translator.h
%{_includedir}/DlsWidgets/ValueScale.h
%{_includedir}/DlsWidgets/export.h
%dir %{_includedir}/LibDLS
%{_includedir}/LibDLS/Channel.h
%{_includedir}/LibDLS/ChannelPreset.h
%{_includedir}/LibDLS/Chunk.h
%{_includedir}/LibDLS/Data.h
%{_includedir}/LibDLS/Dir.h
%{_includedir}/LibDLS/Exception.h
%{_includedir}/LibDLS/Export.h
%{_includedir}/LibDLS/Job.h
%{_includedir}/LibDLS/JobPreset.h
%{_includedir}/LibDLS/Time.h
%{_includedir}/LibDLS/globals.h
%{_libdir}/libdls.so.%{libver}
%{_libdir}/libdls.so
%dir %{_libdir}/qt5/plugins/designer
%{_libdir}/qt5/plugins/designer/libDlsWidgetsPlugin.so
%{_libdir}/cmake/dls
%{_libdir}/cmake/DlsWidgets
%changelog
* Thu Mar 4 2025 fp@igh.de
- Removed cron job, added quota timer
* Thu Oct 12 2023 vh@igh.de
- Use PdCom5
* Thu Mar 16 2023 vh@igh.de
- Switch to CMake
* Tue Mar 27 2018 fp@igh.de
- Fixed cron file variables.
* Mon Mar 26 2018 fp@igh.de
- Removed package_version (set by set_version sevice)
- Add user, data directory and cronjob
* Tue Jan 8 2013 fp@igh-essen.com
- Added some BuildRequires
* Thu Jan 26 2012 fp@igh-essen.com
- Used macro dirs
- Added .desktop files
* Mon Jan 23 2012 fp@igh-essen.com
- Improved Url, BuildRoot, Source, BuildRequires.