- Cleanup with spec-cleaner

- Remove the compat for the usrmerge
- Use systemd service files instead of the initscript +
  added extra workaround for argument parsing.
- Remove extra SUSE traball with scripts as we reduced it down to
  one script and unitfile.

OBS-URL: https://build.opensuse.org/package/show/Base:System/quota?expand=0&rev=35
This commit is contained in:
Tomáš Chvátal 2014-05-19 09:24:17 +00:00 committed by Git OBS Bridge
parent 908ece3114
commit 507c5b8932
6 changed files with 88 additions and 94 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e22ee70bfc6fd7b62037ecff19758080dc88ceee94714e0ade9d850feb897c57
size 4321

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Mon May 19 09:22:00 UTC 2014 - tchvatal@suse.com
- Cleanup with spec-cleaner
- Remove the compat for the usrmerge
- Use systemd service files instead of the initscript +
added extra workaround for argument parsing.
- Remove extra SUSE traball with scripts as we reduced it down to
one script and unitfile.
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Jun 13 20:22:56 UTC 2013 - sweet_f_a@gmx.de Thu Jun 13 20:22:56 UTC 2013 - sweet_f_a@gmx.de

View File

@ -1,7 +1,7 @@
# #
# spec file for package quota # spec file for package quota
# #
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -17,26 +17,24 @@
Name: quota Name: quota
BuildRequires: dbus-1-devel
BuildRequires: e2fsprogs-devel
%if 0%{?suse_version} > 1140
BuildRequires: libnl-1_1-devel
%else
BuildRequires: libnl-devel
%endif
BuildRequires: pkg-config
BuildRequires: tcpd-devel
Version: 4.01 Version: 4.01
Release: 0 Release: 0
PreReq: %insserv_prereq %fillup_prereq
Url: http://sourceforge.net/projects/linuxquota/
Summary: Disk Quota System Summary: Disk Quota System
License: GPL-2.0 and BSD-3-Clause License: GPL-2.0 and BSD-3-Clause
Group: System/Filesystems Group: System/Filesystems
Source: %{name}-%{version}.tar.gz Url: http://sourceforge.net/projects/linuxquota/
Source1: %{name}-SUSE.tar.bz2 Source0: %{name}-%{version}.tar.gz
Source1: sysconfig.nfs-quota
Source2: quotad.service
Source3: quotad_env.sh
Patch1: %{name}-4.00-makefile.patch Patch1: %{name}-4.00-makefile.patch
Patch2: %{name}-4.01-warnquota.patch Patch2: %{name}-4.01-warnquota.patch
BuildRequires: dbus-1-devel
BuildRequires: e2fsprogs-devel
BuildRequires: libnl-1_1-devel
BuildRequires: pkg-config
BuildRequires: systemd
BuildRequires: tcpd-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description %description
@ -45,43 +43,23 @@ limits on used space and the number of inodes used for users and
groups. The kernel must be compiled with disk quota support enabled groups. The kernel must be compiled with disk quota support enabled
(SUSE kernels have this support). (SUSE kernels have this support).
Authors:
--------
Marco van Wieringen <mvw@planets.ow.nl>
Johan Ekenberg <johan@ekenberg.nu>
Jan Kara <jack@suse.cz>
%package nfs %package nfs
Summary: Disk Quota System on NFS Summary: Disk Quota System on NFS
Group: System/Filesystems Group: System/Filesystems
Requires: quota = %version
PreReq: %insserv_prereq %fillup_prereq
# Require the services needed to be present for quotad service: portmap, nfsserver, network # Require the services needed to be present for quotad service: portmap, nfsserver, network
Requires: nfs-kernel-server Requires: nfs-kernel-server
%if 0%{?suse_version} >= 1230 Requires: quota = %{version}
Requires: rpcbind Requires: rpcbind
%else
Requires: portmap
%endif
Requires: sysconfig Requires: sysconfig
# Split provides Requires(post): %fillup_prereq
Provides: quota:/etc/init.d/quotad Provides: quota:%{_initddir}/quotad
%{?systemd_requires}
%description nfs %description nfs
The quotad init script, which provides quota support on NFS mounts. The quotad init script, which provides quota support on NFS mounts.
Authors:
--------
Marco van Wieringen <mvw@planets.ow.nl>
Johan Ekenberg <johan@ekenberg.nu>
Jan Kara <jack@suse.cz>
%prep %prep
%setup -q -n quota-tools -a 1 %setup -q -n quota-tools
%patch1 %patch1
%patch2 %patch2
@ -90,70 +68,44 @@ Authors:
--sysconfdir=%{_sysconfdir} \ --sysconfdir=%{_sysconfdir} \
--enable-netlink \ --enable-netlink \
--enable-strip-binaries=no --enable-strip-binaries=no
make make %{?_smp_mflags}
%install %install
install -d -m 755 ${RPM_BUILD_ROOT}/etc/init.d make install ROOTDIR=%{buildroot}
install -d -m 755 ${RPM_BUILD_ROOT}/sbin
install -d -m 755 ${RPM_BUILD_ROOT}/var/adm/fillup-templates
make install ROOTDIR=${RPM_BUILD_ROOT}
#UsrMerge
ln -s %{_sbindir}/{quotacheck,quotaon,quotaoff} ${RPM_BUILD_ROOT}/sbin/
#EndUsrMerge
#installing ldap-scripts #installing ldap-scripts
install -m 755 ldap-scripts/*pl ${RPM_BUILD_ROOT}/usr/sbin/ install -m 755 ldap-scripts/*pl %{buildroot}%{_sbindir}/
install -m 755 ldap-scripts/edquota_editor ${RPM_BUILD_ROOT}/usr/sbin/ install -m 755 ldap-scripts/edquota_editor %{buildroot}%{_sbindir}/
%if 0%{?suse_version} >= 1230
cp SUSE/quotad ${RPM_BUILD_ROOT}/etc/init.d mkdir -p %{buildroot}%{_unitdir}
%else cp %{SOURCE2} %{buildroot}%{_unitdir}/quotad.service
cp SUSE/{quotad,boot.quota} ${RPM_BUILD_ROOT}/etc/init.d ln -s service %{buildroot}%{_sbindir}/rcquotad
%endif # systemd unit file sucks so bash script to work around it is provided
ln -s ../../etc/init.d/quotad ${RPM_BUILD_ROOT}/usr/sbin/rcquotad install -d -m 755 %{buildroot}%{_unitdir}/../scripts/
install -m 755 %{SOURCE3} %{buildroot}%{_unitdir}/../scripts/quotad_env.sh
install -d -m 755 %{buildroot}%{_localstatedir}/adm/fillup-templates
cp %{SOURCE1} %{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.nfs-quota
%find_lang %{name} %find_lang %{name}
cp SUSE/sysconfig.nfs-quota $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.nfs-quota
%clean
rm -rf $RPM_BUILD_ROOT
%if 0%{?suse_version} < 1230
%post
%{fillup_and_insserv -f -y boot.quota}
%endif
%post nfs %post nfs
%{fillup_only -an nfs} %{fillup_only -an nfs}
%service_add_post quotad.service
%if 0%{?suse_version} < 1230
%preun
%stop_on_removal boot.quota
%endif
%preun nfs %preun nfs
%stop_on_removal quotad %service_del_preun quotad.service
%if 0%{?suse_version} < 1230
%postun
%{insserv_cleanup}
%endif
%postun nfs %postun nfs
%{insserv_cleanup} %service_del_postun quotad.service
%files -f %{name}.lang %files -f %{name}.lang
%defattr(-,root,root) %defattr(-,root,root)
%config /etc/quotagrpadmins %config %{_sysconfdir}/quotagrpadmins
%if 0%{?suse_version} < 1230 %config %{_sysconfdir}/quotatab
%config /etc/init.d/boot.quota %config %{_sysconfdir}/warnquota.conf
%endif %doc README.* doc
%config /etc/quotatab
%config /etc/warnquota.conf
%doc SUSE/README.SUSE README.* doc
%doc %{_mandir}/man?/* %doc %{_mandir}/man?/*
#UsrMerge
/sbin/quotacheck
/sbin/quotaoff
/sbin/quotaon
#EndUsrMerge
%{_bindir}/quota %{_bindir}/quota
%{_bindir}/quotasync %{_bindir}/quotasync
%{_sbindir}/applySystemQuotas.pl %{_sbindir}/applySystemQuotas.pl
@ -175,12 +127,13 @@ rm -rf $RPM_BUILD_ROOT
%files nfs %files nfs
%defattr(-,root,root) %defattr(-,root,root)
%config /etc/init.d/quotad
%doc SUSE/README.quotad.SUSE
%{_sbindir}/rpc.rquotad %{_sbindir}/rpc.rquotad
%{_sbindir}/rcquotad %{_sbindir}/rcquotad
%{_unitdir}/quotad.service
%{_unitdir}/../scripts
%{_unitdir}/../scripts/quotad_env.sh
%{_localstatedir}/adm/fillup-templates/sysconfig.nfs-quota %{_localstatedir}/adm/fillup-templates/sysconfig.nfs-quota
# these files conflicts with glibc rpm # these files conflicts with glibc rpm
%exclude /usr/include/rpcsvc/* %exclude %{_includedir}/rpcsvc/*
%changelog %changelog

11
quotad.service Normal file
View File

@ -0,0 +1,11 @@
[Unit]
Description=Quota RPC monitor
After=network.target
[Service]
EnvironmentFile=-/run/sysconfig/quotad
ExecStart=/usr/sbin/rpc.rquotad -F ${RQUOTAD_ARGS}
ExecStartPre=-/usr/lib/systemd/scripts/quotad_env.sh
[Install]
WantedBy=multi-user.target

11
quotad_env.sh Normal file
View File

@ -0,0 +1,11 @@
#!/bin/sh
. /etc/sysconfig/nfs
if [[ -n "${RQUOTAD_PORT}" ]]; then
RQUOTAD_PORT="-p ${RQUOTAD_PORT}"
fi
mkdir -p /run/sysconfig
echo "RQUOTAD_ARGS=\"${RQUOTAD_PORT}\"" > /run/sysconfig/quotad

12
sysconfig.nfs-quota Normal file
View File

@ -0,0 +1,12 @@
## Path: Network/File systems/NFS server
## Description: use fixed port number for rquotad
## Type: integer
## Default: ""
## ServiceRestart: quotad
#
# Only set this if you want to start quotad on a fixed
# port instead of the port assigned by rpc. Only for use
# to export nfs-filesystems through firewalls.
#
RQUOTAD_PORT=""