deepin-pw-check/deepin-pw-check.spec
2022-07-25 14:49:24 +08:00

97 lines
2.9 KiB
RPMSpec

# Run tests in check section
# disable for bootstrapping
%bcond_with check
%global with_debug 1
%if 0%{?with_debug}
%global debug_package %{nil}
%endif
Name: deepin-pw-check
Version: 5.0.20.7
Release: 1
Summary: Used to check password and manager the configuration for password.
License: GPL-3.0
URL: https://github.com/linuxdeepin/%{name}
Source0: %{name}-%{version}.orig.tar.xz
Source1: vendor.tar.gz
BuildRequires: golang
BuildRequires: pam-devel
BuildRequires: pkgconfig(gio-2.0)
BuildRequires: pkgconfig(gdk-3.0)
BuildRequires: deepin-gettext-tools
BuildRequires: cracklib-devel
BuildRequires: iniparser
Patch0: fix-pwd-pam-update-error.patch
Patch1: fix-deepin_pw_check.c-sprintf-error.patch
Requires: polkit
%description
In order to unify the authentication interface,
this interface is designed to adapt to fingerprint, face and other authentication methods.
%package devel
Summary: Header files and libraries used to build deepin-pw-check
Requires: %{name} = %{version}-%{release}
Requires: cracklib-devel iniparser
%description devel
In order to unify the authentication interface,
this interface is designed to adapt to fingerprint, face and other authentication methods.
%prep
%setup -q
patch -p1 < rpm/0001-fix-for-UonioTech.patch
%patch0 -p1
%patch1 -p1
tar -xf %{SOURCE1}
%build
go env -w GO111MODULE=auto
BUILDID="0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')"
export GOPATH=%{_builddir}/%{name}-%{version}/vendor:$GOPATH
%make_build GO_BUILD_FLAGS=-trimpath GOBUILD="go build -compiler gc -ldflags \"-B $BUILDID\""
%post
pwd-conf-update
sed -i "s/pam_pwquality.so/pam_deepin_pw_check.so/g" /etc/pam.d/system-auth
sed -i "s/pam_pwquality.so/pam_deepin_pw_check.so/g" /etc/pam.d/password-auth
%postun
if [ "$1" = "0" ] ; then
sed -i "s/pam_deepin_pw_check.so/pam_pwquality.so/g" /etc/pam.d/system-auth
sed -i "s/pam_deepin_pw_check.so/pam_pwquality.so/g" /etc/pam.d/password-auth
fi
%install
mkdir -p %{buildroot}/%{_sysconfdir}/deepin
export GOPATH=%{_datadir}/gocode
export PKG_FILE_DIR=%{_libdir}/pkgconfig
%make_install PKG_FILE_DIR=%{_libdir}/pkgconfig LIBDIR=lib64 PAM_MODULE_DIR=%{_libdir}/security GOBUILD="go build -compiler gc -ldflags \"-B $BUILDID\""
%find_lang deepin-pw-check
%files -f deepin-pw-check.lang
%doc README.md
%license
%dir %{_sysconfdir}/deepin
%{_bindir}/pwd-conf-update
%{_prefix}/lib/deepin-pw-check/deepin-pw-check
%{_libdir}/libdeepin_pw_check.so.*
%{_libdir}/security/pam_deepin_pw_check.so
%{_datadir}/dbus-1/system-services/*.service
%{_datadir}/dbus-1/system.d/*.conf
%{_datadir}/polkit-1/actions/*.policy
%files devel
%{_libdir}/libdeepin_pw_check.a
%{_libdir}/libdeepin_pw_check.so
%{_libdir}/pkgconfig/libdeepin_pw_check.pc
%{_includedir}/deepin_pw_check.h
%changelog
* Fri Jul 22 2022 konglidong <konglidong@uniontech.com> - 5.0.20.7-1
- package init