Package rpminstall-tests: Specfile

Name: rpminstall-tests
Version: 1.1.3
Release: alt0.M70T.4

Summary: Tests for rpm: how it interprets packages when installing

License: %gpl2plus
Group: Development/Tools
Url: http://git.altlinux.org/people/imz/packages/rpminstall-tests.git

BuildArch: noarch

Requires: make rpm-build

Source: %name-%version.tar

BuildRequires(pre): rpm-build-licenses

%description
Tests for rpm: how it interprets packages when installing.

Now, it tests how various forms of constraints (Requires, Conflicts, Obsoletes)
are interpreted when they are installed together with packages with
various forms of matching Provides.

More tests can appear.

%package checkinstall
Summary: Immediately run %name when installing this package
Group: Other
Requires(pre): %name

%description checkinstall
Immediately run %name when installing this package.

They test rpm (applied to the results of rpm-build).

%prep
%setup

%install
mkdir -p %buildroot%_datadir/%name
install -m0644 Makefile HELPER *.mk -t %buildroot%_datadir/%name/
install -m0755 makeme.sh -t %buildroot%_datadir/%name/

%check

# Obsoleting works differently (simpler) in rpm-4.0.4:
%global opts SKIP_RPM_OBSOLETE_IN_TRANSACTION=1

# To pass the usual parallelism flags etc:
%global _make_bin ./makeme.sh
%make_build %opts
# Also test with "Epoch: 0" instead of no Epoch:
%make_build %opts clean
%make_build %opts minimal_epoch=0

%files
%_datadir/%name

%files checkinstall

%pre checkinstall
# --pidfile doesn't exist and makes it always start.
/sbin/start-stop-daemon --start --pidfile /var/empty/no.pid \
--chuid nobody:nobody \
--startas /bin/sh -- -ec \
'export TMPDIR=/tmp; \
. /usr/lib/rpm/tmpdir.sh; \
cd  "$tmpdir"; \
%_datadir/%name/makeme.sh %opts; \
%_datadir/%name/makeme.sh %opts clean; \
%_datadir/%name/makeme.sh %opts minimal_epoch=0; \
'

%changelog
* Thu Mar 14 2019 Ivan Zakharyaschev <imz@altlinux.org> 1.1.3-alt0.M70T.4
- Don't skip tests that need rpmbuild that produces Provides: N = E:V-R:D.
  (So all cases are tested now.)
- The reasons of the currently XFAILing tests (with 4.0.4-alt100.77.M70P.4.M70C.1) are
  the same as below for 1.1.3-alt0.M70T.3 (with 4.0.4-alt100.77.M70P.3.M70C.2).

* Wed Mar 13 2019 Ivan Zakharyaschev <imz@altlinux.org> 1.1.3-alt0.M70T.3
- New tests for disttag comparison with the obsolete (.) and current format (+)
  (Correct comparison would rely on a fix or a new feature in rpm:
  %%_priority_distbranch.)
- New tests for the %%_priority_distbranch feature in normal situation.
- The reasons of the currently XFAILing tests (with 4.0.4-alt100.77.M70P.3.M70C.2):
  1. upgrade w.r.t. disttag fails in non-standard configuration without honor_buildtime;
  2. mishandled elusive dep with a release but no epoch.
- Tests are skipped that:
  1. require rpmbuild to generate Provides with :DISTTAG postfix.

* Mon Mar  4 2019 Ivan Zakharyaschev <imz@altlinux.org> 1.1.2-alt0.M80P.3
- Unmarked XFAIL: non-critical unrealistic obsoleting a specific disttag.

* Mon Mar  4 2019 Ivan Zakharyaschev <imz@altlinux.org> 1.1.2-alt0.M80P.2
- Build for p8, c8.
- Some tests skipped because the current rpmbuild doesn't produce
  Provides: N = E:V-R:D. (But we are still able to test how deps with disttags
  are satisfied with the help of virtual Provides.)
- The strict upgradability order is assumed to work correctly in all cases
  (so removed the XFAIL marks).

* Thu Feb 28 2019 Ivan Zakharyaschev <imz@altlinux.org> 1.1.2-alt1
- Tests for upgradability according to the disttag. (XFAIL: incorrect
  behavior in rpm-4.13.0.1-alt5, but different in 4.0.4-alt101.M80P.5;
  XFAIL: fails in non-standard configuration without honor_buildtime.)
- Extended the tests for the overlapping of constraints and packages
  with cases of "elusive deps" (a dependency with a release, but no epoch:
  should it match any epoch? Marked XFAIL for now.)

* Wed Feb 27 2019 Ivan Zakharyaschev <imz@altlinux.org> 1.1.1-alt1
- More complete set of tests of the upgradability order
  (for different releases and buildtimes, not yet disttags).

* Mon Feb 25 2019 Ivan Zakharyaschev <imz@altlinux.org> 1.1-alt1
- Test the upgradable order
  (a package can be upgraded only to a more fresh release or buildtime).
- Marked one of the new tests XFAIL: strict buildtime-based
  upgradability order is broken at least in rpm-4.13.0.1-alt5.

* Thu Feb 21 2019 Ivan Zakharyaschev <imz@altlinux.org> 1.0-alt4
- In disttag, use xxx (instead of zzz), because rpm-build-4.0.4-alt127
  now uses z as the "maximal" disttag. This makes the tests more
  appropriate for testing an "old" disttag-unaware rpm with packages
  built by the "new" rpm-build.

* Mon Feb 11 2019 Ivan Zakharyaschev <imz@altlinux.org> 1.0-alt3
- Unmarked XFAIL: cases with underspecified Provides
  (the error should be gone with rpm-4.13-alt6).
- Marked XFAIL: non-critical unrealistic cases when obsoleting an exact disttag.
 (Of course, this requires a fix, but this is not critical.)

* Sun Feb 10 2019 Ivan Zakharyaschev <imz@altlinux.org> 1.0-alt2
- Additionally test the same things, but provided as virtual Provides
  (dummy = ...).
- Implemented a checkinstall subpackage that runs these tests immediately.
- Fixed running the tests from another working dir.

* Tue Feb  5 2019 Ivan Zakharyaschev <imz@altlinux.org> 1.0-alt1
- initial build for ALT Linux Sisyphus.