Skip to content

Instantly share code, notes, and snippets.

@larrycai
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save larrycai/1ffe134bce1860f1cf87 to your computer and use it in GitHub Desktop.
Save larrycai/1ffe134bce1860f1cf87 to your computer and use it in GitHub Desktop.
rpmbuild for auto-create buildroot

rpmbuild

Check how to build the rpm package from existing packages

$ tar -zcvf ~/wget.tar.gz /usr/bin/wget
$ rpm -bb wget.spec

I got message like below, my questions is why line mkdir /home/larry/rpmbuild/BUILDROOT/wget-1.12-1.x86_64 is executed automatically

Since in the redhat 6.4 docker container, the folder will not be created automatically

+ rpmbuild -bb wget.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.VNDZg4
+ umask 022
+ cd /home/larry/rpmbuild/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.S8koPW
+ umask 022
+ cd /home/larry/rpmbuild/BUILD
+ '[' /home/larry/rpmbuild/BUILDROOT/wget-1.12-1.x86_64 '!=' / ']'
+ rm -rf /home/larry/rpmbuild/BUILDROOT/wget-1.12-1.x86_64
++ dirname /home/larry/rpmbuild/BUILDROOT/wget-1.12-1.x86_64
+ mkdir -p /home/larry/rpmbuild/BUILDROOT
+ mkdir /home/larry/rpmbuild/BUILDROOT/wget-1.12-1.x86_64
+ LANG=C
+ export LANG
+ unset DISPLAY
+ tar xf /home/larry/wget.tar.gz -C /home/larry/rpmbuild/BUILDROOT/wget-1.12-1.x86_64/
+ /usr/lib/rpm/check-buildroot
... (it is successful)
# This is a sample spec file for wget
%define name wget
%define release 1
%define version 1.12
Summary: GNU wget
License: GPL
Name: %{name}
Version: %{version}
Release: %{release}
Group: Development/Tools
%description
The GNU wget program downloads files from the Internet using the command-line.
%prep
%install
tar xf ~/wget.tar.gz -C %{buildroot}/
%files
%defattr(-,root,root)
/usr/bin/wget
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment