3
0
forked from pool/system-users

Accepting request 457440 from home:kukuk:sysusers

RPM to create the system users

OBS-URL: https://build.opensuse.org/request/show/457440
OBS-URL: https://build.opensuse.org/package/show/Base:System/system-users?expand=0&rev=1
This commit is contained in:
Marcus Meissner 2017-02-15 14:49:13 +00:00 committed by Git OBS Bridge
commit 612b56b22d
13 changed files with 285 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

View File

@ -0,0 +1,6 @@
# Type Name ID GECOS [HOME]
g xok -
g floppy -
g modem -
g public -
g console -

View File

@ -0,0 +1,2 @@
# Type Name ID GECOS [HOME]
g trusted -

4
system-user-bin.conf Normal file
View File

@ -0,0 +1,4 @@
# Type Name ID GECOS [HOME]
g bin 1
m daemon bin
u bin 1 bin /bin

3
system-user-daemon.conf Normal file
View File

@ -0,0 +1,3 @@
# Type Name ID GECOS [HOME]
g daemon 2
u daemon 2 Daemon /sbin

3
system-user-games.conf Normal file
View File

@ -0,0 +1,3 @@
# Type Name ID GECOS [HOME]
g games -
u games - "Games account" /var/games

3
system-user-man.conf Normal file
View File

@ -0,0 +1,3 @@
# Type Name ID GECOS [HOME]
g man 62
u man 13 "Manual pages viewer" /var/cache/man

3
system-user-news.conf Normal file
View File

@ -0,0 +1,3 @@
# Type Name ID GECOS [HOME]
g news -
u news - "News system" /etc/news

3
system-user-uucp.conf Normal file
View File

@ -0,0 +1,3 @@
# Type Name ID GECOS [HOME]
g uucp -
u uucp - "Unix-to-Unix CoPy system" /etc/uucp

41
system-users.changes Normal file
View File

@ -0,0 +1,41 @@
-------------------------------------------------------------------
Sat Jan 21 15:58:17 UTC 2017 - kukuk@suse.de
- Add subpackages for obsolete groups and trusted group
-------------------------------------------------------------------
Sat Jan 21 06:38:26 UTC 2017 - kukuk@suse.de
- Add subpackages for bin, daemon, news and man
-------------------------------------------------------------------
Fri Jan 20 14:50:39 CET 2017 - kukuk@suse.de
- Adjust to new sysuser-tools
-------------------------------------------------------------------
Thu Dec 22 12:17:19 UTC 2016 - lnussel@suse.de
- Use automatic provides and generate %pre with a script
- fix uids and add also groups
-------------------------------------------------------------------
Tue Dec 20 10:26:24 CET 2016 - kukuk@suse.de
- Create users in %pre install section
-------------------------------------------------------------------
Thu Oct 27 13:01:06 CEST 2016 - kukuk@suse.de
- Add /etc/uucp to filelist of system-user-uucp
-------------------------------------------------------------------
Wed Oct 26 14:36:14 CEST 2016 - kukuk@suse.de
- Add system account games
-------------------------------------------------------------------
Wed Oct 26 12:59:07 CEST 2016 - kukuk@suse.de
- Initial version with system account uucp

187
system-users.spec Normal file
View File

@ -0,0 +1,187 @@
#
# spec file for package system-users
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: system-users
Version: 20161020
Release: 0
Summary: Provide system accounts
License: GPL-2.0+
Group: System/Fhs
Source: tmpfiles-uucp.conf
Source1: system-user-uucp.conf
Source2: system-user-games.conf
Source3: system-user-bin.conf
Source4: system-user-daemon.conf
Source5: system-user-man.conf
Source6: system-user-news.conf
Source7: system-group-trusted.conf
Source8: system-group-obsolete.conf
BuildRequires: systemd
BuildRequires: sysuser-tools
BuildArch: noarch
%description
This package provides various system users and their directories
%package -n system-user-bin
Summary: System user and group 'bin'
#!BuildIgnore: user(daemon)
Requires(pre): user(daemon)
%{sysusers_requires}
%description -n system-user-bin
This package provides the system account and group 'bin'
and their corresponding directories.
%package -n system-user-daemon
Summary: System user and group 'daemon'
%{sysusers_requires}
%description -n system-user-daemon
This package provides the system account and group 'daemon'
and their corresponding directories.
%package -n system-user-man
Summary: System user and group 'man'
%{sysusers_requires}
%description -n system-user-man
This package provides the system account and group 'man'
and their corresponding directories.
%package -n system-user-news
Summary: System user and group 'news'
%{sysusers_requires}
%description -n system-user-news
This package provides the system account and group 'news'
and their corresponding directories.
%package -n system-user-uucp
Summary: System user and group uucp
%{sysusers_requires}
%description -n system-user-uucp
This package provides the system account and group 'uucp'
and their corresponding directories.
%package -n system-user-games
Summary: System user and group games
%{sysusers_requires}
%description -n system-user-games
This package provides the system account and group 'games'.
%package -n system-group-trusted
Summary: System group 'trusted'
%{sysusers_requires}
%description -n system-group-trusted
This package provides the system group 'trusted'.
%package -n system-group-obsolete
Summary: Obsolete system groups
%{sysusers_requires}
%description -n system-group-obsolete
This package provides some obsolete system groups.
%prep
%setup -q -c -T
%build
%sysusers_generate_pre %{SOURCE1} uucp
%sysusers_generate_pre %{SOURCE2} games
%sysusers_generate_pre %{SOURCE3} bin
%sysusers_generate_pre %{SOURCE4} daemon
%sysusers_generate_pre %{SOURCE5} man
%sysusers_generate_pre %{SOURCE6} news
%sysusers_generate_pre %{SOURCE7} trusted
%sysusers_generate_pre %{SOURCE8} obsolete
%install
mkdir -p %{buildroot}%{_sysusersdir}
mkdir -p %{buildroot}%{_tmpfilesdir}
mkdir -p %{buildroot}%{_sysconfdir}/uucp
mkdir -p %{buildroot}%{_sysconfdir}/news
mkdir -p %{buildroot}%{_localstatedir}/games
mkdir -p %{buildroot}%{_localstatedir}/cache/man
install -m 0644 %{SOURCE0} %{buildroot}%{_tmpfilesdir}
install -m 644 %{SOURCE1} %{buildroot}%{_sysusersdir}/system-user-uucp.conf
install -m 644 %{SOURCE2} %{buildroot}%{_sysusersdir}/system-user-games.conf
install -m 644 %{SOURCE3} %{buildroot}%{_sysusersdir}/system-user-bin.conf
install -m 644 %{SOURCE4} %{buildroot}%{_sysusersdir}/system-user-daemon.conf
install -m 644 %{SOURCE5} %{buildroot}%{_sysusersdir}/system-user-man.conf
install -m 644 %{SOURCE6} %{buildroot}%{_sysusersdir}/system-user-news.conf
install -m 644 %{SOURCE7} %{buildroot}%{_sysusersdir}/system-group-trusted.conf
install -m 644 %{SOURCE8} %{buildroot}%{_sysusersdir}/system-group-obsolete.conf
%pre -n system-user-uucp -f uucp.pre
%post -n system-user-uucp
%tmpfiles_create %{_tmpfilesdir}/tmpfiles-uucp.conf
%pre -n system-user-games -f games.pre
%pre -n system-user-bin -f bin.pre
%pre -n system-user-daemon -f daemon.pre
%pre -n system-user-man -f man.pre
%pre -n system-user-news -f news.pre
%pre -n system-group-trusted -f trusted.pre
%pre -n system-group-obsolete -f obsolete.pre
%files -n system-user-uucp
%defattr(-,root,root)
%dir %attr(0750,uucp,uucp) %{_sysconfdir}/uucp
%ghost %dir %{_localstatedir}/spool/uucp/uucp
%ghost %dir %attr(0755,uucp,uucp) %{_localstatedir}/spool/uucp
%{_sysusersdir}/system-user-uucp.conf
%{_tmpfilesdir}/tmpfiles-uucp.conf
%files -n system-user-games
%defattr(-,root,root)
%dir %attr(0755,root,root) %{_localstatedir}/games
%{_sysusersdir}/system-user-games.conf
%files -n system-user-bin
%defattr(-,root,root)
%{_sysusersdir}/system-user-bin.conf
%files -n system-user-daemon
%defattr(-,root,root)
%{_sysusersdir}/system-user-daemon.conf
%files -n system-user-man
%defattr(-,root,root)
%dir %attr(0755,man,root) %{_localstatedir}/cache/man
%{_sysusersdir}/system-user-man.conf
%files -n system-user-news
%defattr(-,root,root)
%dir %attr(0750,news,news) %{_sysconfdir}/news
%{_sysusersdir}/system-user-news.conf
%files -n system-group-trusted
%defattr(-,root,root)
%{_sysusersdir}/system-group-trusted.conf
%files -n system-group-obsolete
%defattr(-,root,root)
%{_sysusersdir}/system-group-obsolete.conf
%changelog

6
tmpfiles-uucp.conf Normal file
View File

@ -0,0 +1,6 @@
# We use tmpfiles for this, since /var/spool is a subvolume
# and not always available during upgrade (transactional upgrades).
#Type Path Mode UID GID Age Argument
d /var/spool/uucp 0755 uucp uucp -
# XXX: does this make sense and is this safe? root owned in user dir
d /var/spool/uucp/uucp 0755 root root -