e2guardian.spec file for RHEL-based distrs
15 June, 2024
что-то не попалось в интернете готового .spec файла для сборки RPM-пакета e2guardian. Нашел только от Suse linux. на основании него выпилил свой.
# spec file for package e2guardian
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2024 Wholesome Software LLC, Russia.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
%define dg_user e2guardian
%define dg_group e2guardian
Name: e2guardian
Version: 5.5.5r
Release: 0
Summary: Content filtering web proxy
License: GPL-2.0-or-later
Group: Productivity/Networking/Web/Proxy
URL: http://e2guardian.org/cms/index.php
Source0: %{name}-%{version}.tar.bz2
Source1: %{name}.logrotate
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: gcc-c++
BuildRequires: fdupes
BuildRequires: pkgconfig
BuildRequires: systemd-rpm-macros
BuildRequires: pkgconfig(libpcre)
BuildRequires: pkgconfig(zlib)
Requires: coreutils
Recommends: logrotate
%{?systemd_requires}
%description
DansGuardian is a web filtering engine that checks the content within
the page itself in addition to the more traditional URL filtering.
DansGuardian is a content filtering proxy. It filters using multiple methods,
including URL and domain filtering, content phrase filtering, PICS filtering,
MIME filtering, file extension filtering, POST filtering.
%prep
%setup -q
%build
export CXXFLAGS="%{optflags} -fno-strict-aliasing"
chmod a-x AUTHORS COPYING NEWS ChangeLog
ln -s README.md README
autoreconf -fiv
%configure \
--enable-pcre \
--enable-email \
--enable-dnsauth \
--enable-lfs \
--with-piddir="%{_localstatedir}/run/" \
--with-logdir="%{_localstatedir}/log/%{name}/" \
--with-proxyuser="%{dg_user}" \
--with-proxygroup="%{dg_group}"
perl -pi.orig -e '
s|^(CHKCONFIG) =.*$|$1 = :|;
s|^\tchown|#\tchown|;
s|%{_prefix}/lib|%{_libdir}|g;
' Makefile
make %{?_smp_mflags}
%install
install -d %{buildroot}%{_localstatedir}/cache/%{name}/
install -d %{buildroot}%{_localstatedir}/log/%{name}/
%make_install
install -D -m0644 data/scripts/%{name}.service %{buildroot}%{_unitdir}/%{name}.service
ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}
# save some space, link identical files
%fdupes -s %{buildroot}%{_datadir}/%{name}/languages/
install -D -m0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
# remove obsolete scripts
rm -rf %{buildroot}%{_datadir}/%{name}/scripts
# fix execute rights
chmod +x %{buildroot}%{_datadir}/%{name}/%{name}.pl
%pre
getent group %{dg_group} >/dev/null || groupadd -r %{dg_group}
getent passwd %{dg_user} >/dev/null || useradd -r -g %{dg_group} \
-d %{_localstatedir}/log/%{name} -s /sbin/nologin -c "User for %{name}" %{dg_user}
%post
%systemd_post %{name}.service
%preun
%systemd_preun %{name}.service
%postun
%systemd_postun_with_restart %{name}.service
%files
%doc AUTHORS ChangeLog NEWS README
%license COPYING
%{_mandir}/man?/*
%doc %{_datadir}/doc/%{name}
%dir %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/*
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%{_datadir}/%{name}/
%{_sbindir}/%{name}
%{_unitdir}/%{name}.service
%{_sbindir}/rc%{name}
%attr(0640, %{dg_user}, %{dg_group}) %dir %{_localstatedir}/cache/%{name}
%attr(0755, %{dg_user}, %{dg_group}) %dir %{_localstatedir}/log/%{name}
%changelog
There are no published comments.
New comment