Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37823855
en ru br
ALT Linux repos
5.0: 0.02-alt1
4.1: 0.02-alt1

Group :: Development/Other
RPM: repocop-unittest-post_ldconfig

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

%define testname post_ldconfig

Name: repocop-unittest-%testname
Version: 0.02
Release: alt1
BuildArch: noarch
Packager: Igor Yu. Vlasenko <viy at altlinux.org>

Summary: repocop test for non-executable files in /usr/bin.
Group: Development/Other
License: GPL or Artistic
#Url:
Requires: repocop >= 0.07
Requires: repocop-collector-rpm
Requires: sqlite3

%description
Repocop intergration test for non-executable files in /usr/bin.

%prep

%build
cat > %testname.done <<'EOF'
#!/bin/sh
sqlite3 "$REPOCOP_TEST_TMPDIR/tmp.db" <<EOSQL
attach database '$REPOCOP_TEST_DBDIR/rpm.db' as rpm;
CREATE TEMPORARY TABLE ldconfig_list0 (libpkgid TEXT, lib TEXT, libname TEXT);
INSERT INTO ldconfig_list0 (libpkgid,lib) select pkgid, filename from rpm_files as a where ((a.filename glob '/usr/lib/*.so*' and a.filename not glob '/usr/lib/?*/*.so*') or (a.filename glob '/usr/lib64/*.so*' and a.filename not glob '/usr/lib64/?*/*.so*'));
UPDATE ldconfig_list0 SET libname=substr(lib,length('/usr/lib/')+1,length(lib)-length('/usr/lib/')) WHERE lib glob '/usr/lib/*';
UPDATE ldconfig_list0 SET libname=substr(lib,length('/usr/lib64/')+1,length(lib)-length('/usr/lib64/')) WHERE lib glob '/usr/lib64/*';
CREATE TEMPORARY TABLE ldconfig_list (libpkgid TEXT, lib TEXT);
INSERT INTO ldconfig_list SELECT libpkgid, lib FROM ldconfig_list0,RPM_PROVIDES WHERE RPM_PROVIDES.PKGID=libpkgid AND (RPM_PROVIDES.PROVIDENAME = libname OR RPM_PROVIDES.PROVIDENAME like libname || '(%%');
DROP TABLE ldconfig_list0;
.mode tabs
.output $REPOCOP_TEST_TMPDIR/ldconfig-in.short
select distinct pkgid from ldconfig_list, RPM_SCRIPTS_POSTIN as b where pkgid=libpkgid and b.POSTINPROG not glob '*ldconfig*' and b.POSTIN not glob '*ldconfig*';
-- .output $REPOCOP_TEST_TMPDIR/ldconfig-in.long
-- select libpkgid,lib from ldconfig_list, RPM_SCRIPTS_POSTIN as b where pkgid=libpkgid and b.POSTINPROG not glob '*ldconfig*' and b.POSTIN not glob '*ldconfig*';
.output $REPOCOP_TEST_TMPDIR/ldconfig-un.short
select distinct pkgid from ldconfig_list, RPM_SCRIPTS_POSTUN as b where pkgid=libpkgid and b.POSTUNPROG not glob '*ldconfig*' and b.POSTUN not glob '*ldconfig*';
-- .output $REPOCOP_TEST_TMPDIR/ldconfig-un.long
-- select libpkgid,lib from ldconfig_list, RPM_SCRIPTS_POSTUN as b where pkgid=libpkgid and b.POSTUNPROG not glob '*ldconfig*' and b.POSTUN not glob '*ldconfig*';
DROP TABLE ldconfig_list;
EOSQL
for i in `cat $REPOCOP_TEST_TMPDIR/ldconfig-in.short`; do repocop-test-fail -k $i -t post_ldconfig Package contains shared library, but post_ldconfig call is missing; done
for i in `cat $REPOCOP_TEST_TMPDIR/ldconfig-un.short`; do repocop-test-fail -k $i -t postun_ldconfig Package contains shared library, but postun_ldconfig call is missing; done
rm $REPOCOP_TEST_TMPDIR/*
EOF

touch postun_ldconfig.done

%install

mkdir -p $RPM_BUILD_ROOT%_datadir/repocop/pkgtests/%testname/
%__install -m 755 %testname.done $RPM_BUILD_ROOT%_datadir/repocop/pkgtests/%testname/done

mkdir -p $RPM_BUILD_ROOT%_datadir/repocop/pkgtests/postun_ldconfig/
%__install -m 755 postun_ldconfig.done $RPM_BUILD_ROOT%_datadir/repocop/pkgtests/postun_ldconfig/done

%files
#doc README ChangeLog
%_datadir/repocop/pkgtests/%testname
%_datadir/repocop/pkgtests/postun_ldconfig

%changelog

Full changelog you can see here

 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin