Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passwd Refactor #1031

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions 10.9-libcxx/stable/main/finkinfo/base/passwd-amqp.info
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
Package: passwd-amqp
Version: 20131113
Version: 20230717
Revision: 1
Description: User/group for AMQP messaging daemon
Type: nosource
License: Public Domain
Maintainer: Fink Core Group <[email protected]>
Depends: passwd-core (>= 20130103-1)
Depends: passwd-core (>= 20230717-1)
CompileScript: <<
### Get the docfiles from passwd-core
cp -p %p/share/doc/passwd-core/README* .
<<
InstallScript: /usr/bin/true
DocFiles: README README.removing-users
DocFiles: README.md README.removing-users.md
PostInstScript: <<
### <script> username 'Real Name' home shell groupname 'Group membership string'
%p/sbin/update-passwd amqp 'AMQP Messaging Daemon' /dev/null /dev/null amqp amqp
### <script> -n 'username' -i 'Real Name' -h 'home' -s 'shell' -g 'groupname' -m 'Group membership string'
%p/sbin/update-passwd -n 'amqp' -i 'AMQP Messaging Daemon' -g 'amqp' -m 'amqp'
<<
DescDetail: <<
This package adds administrative user and group entries for the
Expand Down
10 changes: 5 additions & 5 deletions 10.9-libcxx/stable/main/finkinfo/base/passwd-avahi.info
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
Package: passwd-avahi
Version: 20131113
Version: 20230717
Revision: 1
Description: User/group for service-discovery daemon
Type: nosource
License: Public Domain
Maintainer: Fink Core Group <[email protected]>
Depends: passwd-core (>= 20130103-1)
Depends: passwd-core (>= 20230717-1)
CompileScript: <<
### Get the docfiles from passwd-core
cp -p %p/share/doc/passwd-core/README* .
<<
InstallScript: /usr/bin/true
DocFiles: README README.removing-users
DocFiles: README.md README.removing-users.md
PostInstScript: <<
### <script> username 'Real Name' home shell groupname 'Group membership string'
%p/sbin/update-passwd avahi 'Service Discovery Daemon' /dev/null /dev/null avahi avahi
### <script> -n 'username' -i 'Real Name' -h 'home' -s 'shell' -g 'groupname' -m 'Group membership string'
%p/sbin/update-passwd -n 'avahi' -i 'Service Discovery Daemon' -g 'avahi' -m 'avahi'
<<
DescDetail: <<
This package adds administrative user and group entries for the
Expand Down
10 changes: 5 additions & 5 deletions 10.9-libcxx/stable/main/finkinfo/base/passwd-canna.info
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
Package: passwd-canna
Version: 20131113
Version: 20230717
Revision: 1
Description: User/group for Canna Japanese input server
Type: nosource
License: Public Domain
Maintainer: Fink Core Group <[email protected]>
Depends: passwd-core (>= 20130103-1)
Depends: passwd-core (>= 20230717-1)
CompileScript: <<
### Get the docfiles from passwd-core
cp -p %p/share/doc/passwd-core/README* .
<<
InstallScript: /usr/bin/true
DocFiles: README README.removing-users
DocFiles: README.md README.removing-users.md
PostInstScript: <<
### <script> username 'Real Name' home shell groupname 'Group membership string'
%p/sbin/update-passwd canna 'Canna Japanese Input Server' /dev/null /dev/null canna canna
### <script> -n 'username' -i 'Real Name' -h 'home' -s 'shell' -g 'groupname' -m 'Group membership string'
%p/sbin/update-passwd -n 'canna' -i 'Canna Japanese Input Server' -g 'canna' -m 'canna'
<<
DescDetail: <<
This package adds administrative user and group entries for the
Expand Down
40 changes: 0 additions & 40 deletions 10.9-libcxx/stable/main/finkinfo/base/passwd-configs.info

This file was deleted.

142 changes: 35 additions & 107 deletions 10.9-libcxx/stable/main/finkinfo/base/passwd-core.info
Original file line number Diff line number Diff line change
@@ -1,147 +1,75 @@
Package: passwd-core
Version: 20131113
Version: 20230717
Revision: 1

BuildDepends: fink (>= 0.33.0)
Replaces: passwd ( << 20130103-1 )
RuntimeDepends: passwd-configs
BuildDepends: fink (>= 0.33.0), autorevision
Replaces: passwd ( << 20130103-1 ), passwd-configs

Source: https://github.com/fink/passwd/tarball/%v
Source-MD5: 3d2358c4b59f0560f0d59fa141fbfd7c
SourceRename: passwd-%v.tar.gz
SourceDirectory: fink-passwd-2a94113
Source: https://github.com/fink/%n/releases/download/%v/%n-%v.tgz
Source-Checksum: SHA256(141b89ad66c48a463f5c8c9a2be7b0916d09537db9ffa8e6742e2bdfb0012625)
SourceRename: passwd-%v.tgz
SourceDirectory: passwd-%v

PatchScript: <<
sed 's|@PREFIX@|%p|g' <update-passwd.in >update-passwd
sed 's|@PREFIX@|%p|g' <README.in >README
<<
CompileScript: make all DESTDIR=%d prefix=%p

InstallScript: make install DESTDIR=%d prefix=%p
ConfFiles: %p/etc/passwd.conf

CompileScript: <<
echo "No compiling required."
Recommends: <<
bash,
asciidoc-a2x
<<

InstallScript: <<
mkdir -p %i/etc %i/sbin %i/share/%n
install -c -m 755 update-passwd %i/sbin/
install passwd.conf.in %i/share/%n/passwd.conf.in
install passwd.conf.in %i/etc/passwd.conf
SplitOff98: <<
Package: passwd-configs
Depends: passwd-core (>= 20230717-1)
Description: OBSOLETE: use package 'passwd-core' instead
RuntimeDepends: fink-obsolete-packages
DocFiles: README.md README.removing-users.md
<<
ConfFiles: %p/etc/passwd.conf

PostInstScript: <<
if [ -f %p/etc/passwd.conf ] ; then
reconf="false"
else
reconf=$1
fi
if [ "$reconf" = "configure" ] ; then
# Check for AutoUid: in fink.conf
aucheck=`grep AutoUid: %p/etc/fink.conf`
if [[ $aucheck =~ true ]] || [[ $aucheck =~ 1 ]] ; then
#Auto ID
uidmin=`grep AutoUidMin %p/etc/fink.conf | cut -d: -f2`
uidmax=`grep AutoUidMax %p/etc/fink.conf | cut -d: -f2`
printf "Using AutoUID settings from fink.conf\n"
cp %p/share/%n/passwd.conf.in %p/etc/passwd.conf
printf "AutoUid: true\n" >> %p/etc/passwd.conf
printf "AutoUidMin: %%d\n" $uidmin >> %p/etc/passwd.conf
printf "AutoUidMax: %%d\n" $uidmax >> %p/etc/passwd.conf
printf "UIDs and GIDs will be dynamically allocated when passwd-* users are installed.\n"
printf "To override this behavior, edit %p/etc/passwd.conf as a superuser and change\n"
printf "The AutoUID flag to 'false'.\n"
else
printf "We recommend allocating UIDs and GIDs automatically,\n"
printf "unless you have specific requirements for UIDs and GIDs.\n"
read -p "Set UIDs/GIDs automatically? [Y/n] " answer
answer=`echo $answer | sed 's/^[yY].*$/y/'`
if [ -z "$answer" -o "x$answer" = "xy" ]; then
uidmin=0
uidmax=0
until [ $uidmin -ne 0 ] ; do
read -p "Enter the minimum for the range [600] " test_id
if [ -z "$test_id" ]
then uidmin=600
elif [[ ! $test_id =~ ^[0-9]+$ ]] || [ $test_id -eq 0 ]
then printf "ID must be a positive integer.\n"
else
uidmin=$test_id
fi
done
until [ $uidmax -ne 0 ] ; do
read -p "Enter the maximum for the range [699] " test_id
if [ -z "$test_id" ]
then uidmax=699
elif [[ ! $test_id =~ ^[0-9]+$ ]] || [ $test_id -eq 0 ]
then printf "ID must be a positive integer.\n"
elif [ $test_id -le $uidmin ]
then printf "max ID must be larger than or equal to %%s\n" $uidmin
else
uidmax=$test_id
fi
done
cp %p/share/%n/passwd.conf.in %p/etc/passwd.conf
printf "AutoUid: true\n" >> %p/etc/passwd.conf
printf "AutoUidMin: %%d\n" $uidmin >> %p/etc/passwd.conf
printf "AutoUidMax: %%d\n" $uidmax >> %p/etc/passwd.conf
printf "UIDs and GIDs will be dynamically allocated when\n"
printf "passwd-* users are installed.\n"
else
printf "OK. You should set the UIDs and GIDs in %p/etc/passwd-fink\n"
printf "and %p/etc/group-fink to be processed automatically,\n"
printf "or accept the default values.\n"
cp %p/share/%n/passwd.conf.in %p/etc/passwd.conf
printf "AutoUid: false\n" >> %p/etc/passwd.conf
fi
fi
else
printf "Using existing %p/etc/passwd.conf settings.\n"
printf "If you want to reset them, remove that file and run\n"
printf "'fink reinstall passwd-core'."
fi
<<
SplitOff99: <<
Package: passwd
Depends: passwd-core (>= 20130103-1)
Description: OBSOLETE: use package 'passwd-core' instead
RuntimeDepends: fink-obsolete-packages
DocFiles: README README.removing-users
DocFiles: README.md README.removing-users.md
<<
## New users are added as separate passwd-FOO.info files in the 'base' section.

DocFiles: README README.removing-users
DocFiles: README.md README.removing-users.md README.passwd-configs.md NEWS
#
Description: User and group entries for daemons: core pkg
DescDetail: <<
This package adds several administrative user and group entries to
your user database. These are needed to protect the data of several
This package facilitates the addtions of various administrative user and group
entries to your user database. These are needed to protect the data of several
daemons (e.g. news server, database server).
<<
DescUsage: <<
Packages that require a specific user (@user@), should set Depends: on
'passwd-@user@'. Packages that currently depend on 'passwd' (the legacy
Packages that require a specific user (@user@), should set Depends: on
'passwd-@user@'. Packages that currently depend on 'passwd' (the legacy
non-split package) can be upgraded at will to use their needed passwd-@user@
package.

As of version 20130103, the data required for each user has been migrated into
its own package, rather than relying on a central database from passwd-core.
As of version 20230529, the data required for each user has been migrated into
its own package, rather than relying on a central database from passwd-core.
The format is:

username 'Real Name' home shell groupname 'Group membership string'
update-passwd -n <Short-Name> -g <Group-Name> [-h <Home-Dir>] [-s <Shell>] -i <Info-String> -m <Group-Members>

or

groupname 'Group membership string'
update-passwd -g <Group-Name> -m <Group-Members>

for entries which are only groups.

See the manpage for more details.
<<
DescPackaging: <<
20131113 (nieder):
Each user:group is now controlled by an independent package. Packages that
require a specific user should depend on 'passwd-@user@' and not on the
Each user:group is now controlled by an independent package. Packages that
require a specific user should depend on 'passwd-@user@' and not on the
base package 'passwd'.

Requires extra hoops besides ConfFiles: %p/etc/passwd.conf because we modify that
in the PostInstScript.
<<
License: Public Domain
Maintainer: Fink Core Group <[email protected]>
Expand Down
Loading