Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
a167f8d668
!11 【轻量级 PR】:modify description about ypbind
From: @eaglegai 
Reviewed-by: @yanan-rock 
Signed-off-by: @yanan-rock
2022-10-24 06:32:46 +00:00
eaglegai
f59cc33cb7
modify description about ypbind
Signed-off-by: eaglegai <eaglegai@163.com>
2022-10-22 08:47:15 +00:00
openeuler-ci-bot
fc69a1c5fe !5 ypbind delete -S git from %autosetup, and delete BuildRequires git
From: @chenyanpanHW
Reviewed-by: @small_leek
Signed-off-by: @small_leek
2021-08-13 08:51:21 +00:00
chenyanpanHW
229523151c
delete -S git from %autosetup, and delete BuildRequires git 2021-07-30 23:41:40 +08:00
openeuler-ci-bot
091ce7b690 !3 update to ypbind-2.7.2
Merge pull request !3 from lunankun/master
2020-07-29 16:55:47 +08:00
lunankun
509cded78a update to ypbind-mt-2.7.2 2020-07-28 18:21:30 +08:00
openeuler-ci-bot
95f33096e2 !2 add yaml file
Merge pull request !2 from yixiangzhike/master
2020-07-02 22:54:07 +08:00
yixiangzhike
68ed495c52 add yaml file 2020-06-11 19:43:11 +08:00
openeuler-ci-bot
75216e5907 !1 ypbind: init
Merge pull request !1 from openeuler-basic/init
2020-01-01 00:15:11 +08:00
songnannan
f82d618a19 init 2020-01-01 00:13:31 +08:00
9 changed files with 378 additions and 0 deletions

104
nis.sh Normal file
View File

@ -0,0 +1,104 @@
#!/bin/bash
#
# nis.sh: dhclient-script plugin for NIS settings,
# place in /etc/dhcp/dhclient.d and 'chmod +x nis.sh' to enable
#
# Copyright (C) 2008 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Author(s): David Cantrell <dcantrell@redhat.com>
CONF=/etc/yp.conf
SAVECONF=${SAVEDIR}/${CONF##*/}.predhclient.${interface}
fix_context() {
if [ -x /sbin/restorecon ]; then
/sbin/restorecon ${1} >/dev/null 2>&1
fi
}
save_config_file() {
if [ ! -d ${SAVEDIR} ]; then
mkdir -p ${SAVEDIR}
fi
if [ -e ${CONF} ]; then
# cp+rm instead of mv: preserve SELinux context
# rhbz#509240
# Do not rely on restorecon.
cp -c ${CONF} ${SAVECONF}
rm ${CONF}
else
echo > ${SAVECONF}
# Try restorecon
fix_context ${SAVECONF}
fi
}
nis_config() {
if [ ! "${PEERNIS}" = "no" ]; then
if [ -n "${new_nis_domain}" ]; then
domainname "${new_nis_domain}"
save_config_file
echo '# generated by /sbin/dhclient-script' > ${CONF}
fix_context ${CONF}
if [ -n "${new_nis_servers}" ]; then
for i in ${new_nis_servers} ; do
echo "domain ${new_nis_domain} server ${i}" >> ${CONF}
done
else
echo "domain ${new_nis_domain} broadcast" >> ${CONF}
fi
elif [ -n "${new_nis_servers}" ]; then
save_config_file
echo '# generated by /sbin/dhclient-script' > ${CONF}
fix_context ${CONF}
for i in ${new_nis_servers} ; do
echo "ypserver ${i}" >> ${CONF}
done
fi
# dimainname or servers changed, restart ypbind
if [ "${old_nis_domain}" != "${new_nis_domain}" ] \
|| [ "${old_nis_servers}" != "${new_nis_servers}" ]
then
service ypbind condrestart >/dev/null 2>&1
fi
fi
}
nis_restore() {
if [ ! "${PEERNIS}" = "no" ]; then
if [ -f ${SAVECONF} ]; then
rm -f ${CONF}
# cp+rm instead of mv: preserve SELinux context
# rhbz#509240
cp -c ${SAVECONF} ${CONF}
rm ${SAVECONF}
fix_context ${CONF} # Restorecon again to be sure.
service ypbind condrestart >/dev/null 2>&1
fi
fi
}
# Local Variables:
# indent-tabs-mode: nil
# sh-basic-offset: 4
# show-trailing-whitespace: t
# End:

View File

@ -0,0 +1,12 @@
diff -up ./po/Makevars.gettextdomain ./po/Makevars
--- ./po/Makevars.gettextdomain 2004-01-14 20:25:25.000000000 +0100
+++ ./po/Makevars 2013-05-06 19:07:24.961484803 +0200
@@ -1,7 +1,7 @@
# Makefile variables for PO directory in any package using GNU gettext.
# Usually the message domain is the same as the package name.
-DOMAIN = $(PACKAGE)
+DOMAIN = ypbind
# These two variables depend on the location of this directory.
subdir = po

View File

@ -0,0 +1,10 @@
--- a/configure.ac.gettext_version 2016-03-02 15:10:26.000000000 +0100
+++ b/configure.ac 2017-02-15 13:39:12.295019148 +0100
@@ -59,7 +60,6 @@ JH_CHECK_XML_CATALOG([http://docbook.sou
AM_CONDITIONAL(ENABLE_REGENERATE_MAN, test x$enable_man != xno)
dnl internationalization macros
-AM_GNU_GETTEXT_VERSION([0.19])
AM_GNU_GETTEXT([external])
AC_OUTPUT(Makefile lib/Makefile src/Makefile man/Makefile po/Makefile.in)

BIN
ypbind-mt-2.7.2.tar.gz Normal file

Binary file not shown.

57
ypbind-post-waitbind Normal file
View File

@ -0,0 +1,57 @@
#!/bin/sh
#
# ypbind-domain
#
# description: This is part of former ypbind init script, which is used
# to fix problems with the init scripts continuing even when
# we are really not bound yet to a server, and then things
# that need NIS fail.
#
# NISTIMEOUT should be a multiple of 15 since
# ypwhich has a hardcoded 15sec timeout
[ -z "$NISTIMEOUT" ] && NISTIMEOUT=45
logger -t ypbind $"Binding NIS service"
timeout=$NISTIMEOUT
firsttime=1
rpcbound=0
SECONDS=0
retval=0
while [ $SECONDS -lt $timeout ] || [ $firsttime -eq 1 ] ; do
firsttime=0
if /usr/sbin/rpcinfo -p | LC_ALL=C fgrep -q ypbind
then
rpcbound=1
/usr/bin/ypwhich > /dev/null 2>&1
retval=$?
if [ $retval -eq 0 ]; then
break;
fi
fi
sleep 2
done
logger -t ypbind "Binding took $SECONDS seconds"
if [ $retval -eq 0 ]; then
if [ $rpcbound -eq 0 ]; then
logger -t ypbind \
"NIS domain: `domainname`, ypbind not registered with rpcbind."
else
logger -t ypbind \
"NIS domain: `domainname`, NIS server: `ypwhich 2> /dev/null`"
fi
else
logger -t ypbind \
"NIS server for domain `domainname` is not responding."
logger -t ypbind \
"Killing ypbind with PID $MAINPID."
kill -s 15 $MAINPID || :
logger -t ypbind \
"Try increase NISTIMEOUT in /etc/sysconfig/ypbind"
fi
exit $retval

44
ypbind-pre-setdomain Normal file
View File

@ -0,0 +1,44 @@
#!/bin/sh
#
# ypbind-domain
#
# description: This is part of former ypbind init script, which is used
# to setup proper domainname before starting ypbind daemon
# itself. If $NISDOMAIN is not defined, it reads config file.
#
TIMEOUT=5
DOMAINNAME=`domainname`
if [ "$DOMAINNAME" = "(none)" -o "$DOMAINNAME" = "" ]; then
echo -n $"Setting NIS domain: "
seconds=0
while [ $seconds -lt $TIMEOUT ]; do
if [ -n "$NISDOMAIN" ]; then
domainname $NISDOMAIN
echo $"'$NISDOMAIN' (environment variable)"
break
else # See if the domain is set in config file
NISDOMAIN=`awk '{ if ($1 == "domain") {print $2; exit} }' /etc/yp.conf`
if [ -n "$NISDOMAIN" ]; then
domainname $NISDOMAIN
echo $"'$NISDOMAIN' (/etc/yp.conf)"
break
else
seconds=$(($seconds+1))
sleep 1
fi
fi
done
# Give up if NISDOMAIN is still not set
[ -z "$NISDOMAIN" ] && logger -t ypbind $"domain not found" && exit 1
fi
#/etc/rpc check
grep ypbind /etc/rpc > /dev/null 2>&1
if [ $? -ne 0 ]; then
logger -t ypbind $"Error: Missing ypbind entry in /etc/rpc."
exit 1
fi
echo

22
ypbind.service Normal file
View File

@ -0,0 +1,22 @@
# For details how to adjust this file or change daemon settings, please, read ypbind(8).
[Unit]
Description=NIS/YP (Network Information Service) Clients to NIS Domain Binder
Requires=rpcbind.service
Wants=nss-user-lookup.target network-online.target
After=syslog.target rpcbind.service ypserv.service
Before=systemd-user-sessions.service
Before=nss-user-lookup.target
[Service]
Type=notify
NotifyAccess=all
EnvironmentFile=-/etc/sysconfig/network
EnvironmentFile=-/etc/sysconfig/ypbind
ExecStartPre=/usr/libexec/ypbind-pre-setdomain
ExecStartPre=-/usr/sbin/setsebool allow_ypbind=1
ExecStart=/usr/sbin/ypbind -n $OTHER_YPBIND_OPTS
ExecStartPost=/usr/libexec/ypbind-post-waitbind
PrivateTmp=true
[Install]
WantedBy=multi-user.target

125
ypbind.spec Normal file
View File

@ -0,0 +1,125 @@
Name: ypbind
Epoch: 3
Version: 2.7.2
Release: 3
Summary: NIS binding software
License: GPLv2
URL: http://www.linux-nis.org/nis/ypbind-mt/index.html
Source0: https://github.com/thkukuk/ypbind-mt/archive/v%{version}.tar.gz#/ypbind-mt-%{version}.tar.gz
Source1: nis.sh
Source2: ypbind.service
Source3: ypbind-pre-setdomain
Source4: ypbind-post-waitbind
Patch0: ypbind-1.11-gettextdomain.patch
Patch2: ypbind-2.4-gettext_version.patch
BuildRequires: gcc systemd automake autoconf libxslt
BuildRequires: dbus-glib-devel systemd-devel docbook-style-xsl
BuildRequires: libtirpc-devel libnsl2-devel gettext-devel
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
Requires: rpcbind nss_nis yp-tools >= 4.2.2-2
%description
The Network Information Service (NIS) is a system that provides
network information (login names, passwords, home directories, group
information) to all of the machines on a network. NIS can allow users
to log in on any machine on the network, as long as the machine has
the NIS client programs running and the user's password is recorded in
the NIS passwd database. NIS was formerly known as Sun Yellow Pages
(YP).
This package provides the ypbind daemon. The ypbind daemon binds NIS
clients to an NIS domain. Ypbind must be running on any machines
running NIS client programs.
Install the ypbind package on any machines running NIS client programs
(included in the yp-tools package). If you need an NIS server, you
also need to install the ypserv package to a machine on your network.
%package help
Summary: Doc files for ypbind
Buildarch: noarch
%description help
The help package contains doc files for ypbind.
%prep
%autosetup -n %{name}-mt-%{version} -p1
autoreconf -fiv
%build
export CFLAGS="$RPM_OPT_FLAGS -fpic"
export LDFLAGS="$LDFLAGS -pie -Wl,-z,relro,-z,now"
%configure
%make_build
%install
%make_install
mkdir -p %{buildroot}/%{_libexecdir}
mkdir -p %{buildroot}/%{_unitdir}
mkdir -p %{buildroot}/%{_sysconfdir}/dhcp/dhclient.d
mkdir -p %{buildroot}/%{_localstatedir}/yp/binding
install -m 755 %{SOURCE1} %{buildroot}/%{_sysconfdir}/dhcp/dhclient.d/nis.sh
install -m 644 %{SOURCE2} %{buildroot}/%{_unitdir}/ypbind.service
install -m 755 %{SOURCE3} %{buildroot}/%{_libexecdir}/ypbind-pre-setdomain
install -m 755 %{SOURCE4} %{buildroot}/%{_libexecdir}/ypbind-post-waitbind
install -m 644 etc/yp.conf %{buildroot}/%{_sysconfdir}/yp.conf
%{find_lang} %{name}
%post
%systemd_post %{name}.service
%preun
%systemd_preun %{name}.service
%postun
%systemd_postun_with_restart %{name}.service
%files -f %{name}.lang
%license COPYING
%config(noreplace) %{_sysconfdir}/yp.conf
%{_sysconfdir}/dhcp/dhclient.d/nis.sh
%{_unitdir}/%{name}.service
%{_sbindir}/%{name}
%{_libexecdir}/%{name}*
%dir %{_localstatedir}/yp/binding
%{_datadir}/locale/*
%files help
%doc README NEWS
%{_mandir}/*/*
%changelog
* Sat Oct 22 2022 gaihuiying <eaglegai@163.com> - 3:2.7.2-3
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:modify description about ypbind
* Fri Jul 30 2021 chenyanpanHW <chenyanpan@huawei.com> - 2.7.2-2
- DESC: delete -S git from %autosetup, and delete BuildRequires git
* Tue Jul 28 2020 lunankun <lunankun@huawei.com> - 2.7.2-1
- Type:update
- ID:NA
- SUG:restart
- DESC:update to ypbind-2.7.2
* Tue Dec 31 2019 openEuler Buildteam <buildteam@openeuler.org> - 2.6-3
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:optimization the spec
* Thu Nov 7 2019 openEuler Buildteam <buildteam@openeuler.org> - 2.6-2
- Type:enhancement
- Id:NA
- SUG:NA
- DESC:modify the release
* Mon Sep 9 2019 luhuaxin <luhuaxin@huawei.com> - 2.6-1
- Package init

4
ypbind.yaml Normal file
View File

@ -0,0 +1,4 @@
version_control: github
src_repo: thkukuk/ypbind-mt
tag_prefix: ^v
seperator: .