Yes, that's my spec
[alessio@localhost nethserver-fetchmail]$ cat nethserver-fetchmail.spec
%define fetchmail_home /var/lib/nethserver/fetchmail
Name: nethserver-fetchmail
Version: 1.1.5
Release: 1%{?dist}
Summary: NethServer fetchmail
Group: Networking/Daemons
License: GPLv2
Source0: %{name}-%{version}.tar.gz
URL: %{url_prefix}/%{name}
BuildArch: noarch
BuildRequires: nethserver-devtools
Requires: nethserver-mail-server > 1.8.2-1
Requires: fetchmail
%description
Fetchmail add-on for NethServer
%prep
%setup
%build
%{makedocs}
perl createlinks
%install
rm -rf %{buildroot}
(cd root ; find . -depth -print | cpio -dump %{buildroot})
%{genfilelist} %{buildroot} > %{name}-%{version}-%{release}-filelist
echo "%doc COPYING" >> %{name}-%{version}-%{release}-filelist
%clean
rm -rf $RPM_BUILD_ROOT
%pre
if ! getent passwd fetchmail >/dev/null; then
# Add the "fetchmail" user
useradd -r -U -s /sbin/nologin -d %{fetchmail_home} -c "Fetchmail user" fetchmail
elif ! [ -d %{fetchmail_home} ]; then
# Stop any running instance:
service fetchmail status &>/dev/null && service fetchmail stop
# Create the primary group, if not exists:
groupadd -f -g `id -u fetchmail` -r fetchmail
# Fix the home dir path and move the existing DB to the new path:
usermod -m -d %{fetchmail_home} -g fetchmail fetchmail
mkdir -m 0750 %{fetchmail_home}
mv -n /var/run/fetchmail/.fetchids %{fetchmail_home}/.fetchids &>/dev/null
chown -Rf fetchmail.fetchmail %{fetchmail_home}
fi
exit 0
%files -f %{name}-%{version}-%{release}-filelist
%defattr(-,root,root)
%dir %{_nseventsdir}/%{name}-update
%changelog
* Tue Sep 29 2015 Davide Principi <davide.principi@nethesis.it> - 1.1.5-1
- Make Italian language pack optional - Enhancement #3265 [NethServer]