Skip to content

Instantly share code, notes, and snippets.

@op-ct
Created March 11, 2018 00:54
Show Gist options
  • Select an option

  • Save op-ct/e675ebb652b0625316a73b7044b192b4 to your computer and use it in GitHub Desktop.

Select an option

Save op-ct/e675ebb652b0625316a73b7044b192b4 to your computer and use it in GitHub Desktop.
Simple test: does `rpmbuild` require single-digit days in `%changelog`?
[build_user@6d76bec03a81 ~]$ rpmlint -i foo.spec
foo.spec: W: no-buildroot-tag
The BuildRoot tag isn't used in your spec. It must be used in order to allow
building the package as non root on some systems. For some rpm versions (e.g.
rpm.org >= 4.6) the BuildRoot tag is not necessary in specfiles and is ignored
by rpmbuild; if your package is only going to be built with such rpm versions
you can ignore this warning.
0 packages and 1 specfiles checked; 0 errors, 1 warnings.
[build_user@6d76bec03a81 ~]$ rpm --version
RPM version 4.8.0
[build_user@6d76bec03a81 ~]$ rpmbuild -ba foo.spec &> /dev/null && echo worked || echo failed
worked
[build_user@6d76bec03a81 ~]$ rpm -qp /home/build_user/rpmbuild/RPMS/x86_64/foo-1.0.0-1.el6.x86_64.rpm --changelog
* Thu Mar 01 2018 Foo F. McFoobody <foo@foofoo.foo>
- foo
[build_user@cdde26d09721 ~]$ rpmlint foo.spec
0 packages and 1 specfiles checked; 0 errors, 0 warnings.
[build_user@cdde26d09721 ~]$ rpmbuild -ba foo.spec &> /dev/null && echo worked || echo failed
worked
[build_user@cdde26d09721 ~]$ rpm -qp /home/build_user/rpmbuild/RPMS/x86_64/foo-1.0.0-1.el7.centos.x86_64.rpm --changelog
* Thu Mar 01 2018 Foo F. McFoobody <foo@foofoo.foo>
- foo
Name: foo
Version: 1.0.0
Release: 1%{?dist}
Summary: foo
License: foo
%description
foo
%build
%prep
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}
echo foo > %{buildroot}/foo
%clean
rm -rf %{buildroot}/foo
%files
%attr(-, root, root) /foo
%changelog
* Thu Mar 1 2018 Foo F. McFoobody <foo@foofoo.foo>
- foo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment