Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37793067
en ru br
Репозитории ALT
S:0.10-alt1
5.1: 0.09-alt1
4.1: 0.03-alt1
www.altlinux.org/Changes

Группа :: Разработка/Прочее
Пакет: repocop-unittest-library-pkgnames

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

%define testname library-pkgnames

Name: repocop-unittest-%testname
Version: 0.03
Release: alt1
BuildArch: noarch
Packager: Andrey Rahmatullin <wrar at altlinux.ru>

Summary: %testname intergration tests for repocop test platform.
Group: Development/Other
License: GPLv2+

%description
The test warns packages that contain shared libraries, but are not named
appropriately.

%prep

%build

cat > %testname.done <<'EOF'
#!/bin/sh
sqlite3 "$REPOCOP_TEST_TMPDIR/tmp.db" <<EOSQL
attach database '$REPOCOP_TEST_DBDIR/rpm.db' as rpm;
.mode tabs
.output $REPOCOP_TEST_TMPDIR/info
select distinct a.pkgid from rpm_provides as a, rpm_requires as b, rpm as c,rpm as d where a.pkgid=c.pkgid AND b.pkgid=d.pkgid AND a.pkgid!=b.pkgid AND providename glob 'lib*.so*' AND a.pkgid NOT glob 'lib*' AND a.pkgid NOT glob 'glib*' AND c.name NOT glob '*lib' AND providename = requirename AND c.sourceid!=d.sourceid;
EOSQL
for i in `cat $REPOCOP_TEST_TMPDIR/info`; do repocop-test-info -k $i "package contains public library which is used in external packages: name should be lib* according to http://freesource.info/wiki/AltLinux/Policy/Drafts/SharedLibs"; done
rm $REPOCOP_TEST_TMPDIR/*
EOF

cat > %testname-static.done <<'EOF'
#!/bin/sh
sqlite3 "$REPOCOP_TEST_TMPDIR/tmp.db" <<EOSQL
attach database '$REPOCOP_TEST_DBDIR/rpm.db' as rpm;
CREATE TEMPORARY TABLE static_list (alibpkgid TEXT, alib TEXT, soliblikepatt TEXT, alibname TEXT);
INSERT INTO static_list select a.pkgid, filename, substr(a.filename,0,length(a.filename)-2)||'.so*', NAME from rpm_files as a, rpm as b where a.filename glob '*.a' and not a.pkgid glob '*-devel-static-*' and not a.filename glob '/lib/*/*' and not a.filename glob '/usr/lib/*/*' and not a.filename glob '/usr/lib64/*/*' AND a.pkgid=b.pkgid;

CREATE TEMPORARY TABLE dynamic_list (solibpkgid TEXT, solib TEXT, solibname TEXT);
INSERT INTO dynamic_list select a.pkgid, filename, name from rpm_files as a, rpm as b where filename glob '*.so*' AND a.pkgid=b.pkgid;
.mode tabs
.output $REPOCOP_TEST_TMPDIR/warn
-- to view both libraries
-- select alibpkgid,alib,solibpkgid from dynamic_list as a, static_list as b where solib GLOB soliblikepatt AND not solibname IN (SELECT CONFLICTNAME from rpm_conflicts as c WHERE c.pkgid = alibpkgid) AND not alibname IN (SELECT CONFLICTNAME from rpm_conflicts as d WHERE d.pkgid = solibpkgid);
select distinct alibpkgid from dynamic_list as a, static_list as b where solib GLOB soliblikepatt AND not solibname IN (SELECT CONFLICTNAME from rpm_conflicts as c WHERE c.pkgid = alibpkgid) AND not alibname IN (SELECT CONFLICTNAME from rpm_conflicts as d WHERE d.pkgid = solibpkgid);
DROP TABLE static_list;
DROP TABLE dynamic_list;
EOSQL
for i in `cat $REPOCOP_TEST_TMPDIR/warn`; do repocop-test-warn -k $i "package contains static library which has the same name as a shared library in the repository, but neither package name ends with -devel-static according to http://freesource.info/wiki/AltLinux/Policy/Drafts/SharedLibs nor the package explicitly conflicts with the package with .so library"; done
rm $REPOCOP_TEST_TMPDIR/*
EOF


%install
install -pD -m 755 %testname.done %buildroot%_datadir/repocop/pkgtests/%testname/done
install -pD -m 755 %testname-static.done %buildroot%_datadir/repocop/pkgtests/%testname-static/done

%files
%_datadir/repocop/pkgtests/%testname/
%_datadir/repocop/pkgtests/%testname-static/

%changelog

Полный changelog можно просмотреть здесь

 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin