In the words "Automake: from C to make", I started with a C language source code file and made a standard tar package.
How do I make an RPM package with a bar bag?
I have learned how to make RPM packages by referring to Linuxfans.org's article, "the RPM package principle (update 2010.11.22)". The following will show the process. establish a development environment first need software such as compilers
Yum Groupinstall "Development Tools"
and then do a little bit of the RPM configuration
Echo '%_topdir/home/lophyxp/rpm ' >> ~/.rpmmacros
echo '%debug_package%{nil} ' >> ~/.rpmmacros
Building a directory tree
MKDIR-VP ~/rpm/{sources,specs,build,rpms/x86_64,srpms}
Preparing source code
Enter the Automake: from C to make in the directory, generate the TAR package, and copy to the sources directory
CD Hello
./configure make make
dist-xz
mv Hello/hello-0.01.tar.xz rpm/sources/
Prepare spec file
VI rpm/specs/hello.spec
====hello.spec============
#hello. Spec
Summary:hello World rpm package.
Name:hello
version:0.0.1
release:1
Source:%{name}-%{version}.tar.xz
LICENSE:GPL
Packager:lophyxp
group:applications/system
buildroot:%{_tmppath}/%{name}-%{version}-%{relase}- buildroot-% (%{__id_u}-N)%description this are
a software say hello world.
%prep
%setup-n%{name}-%{version}
%configure
%build make
%{?_smp_mflags} optimize= "%{optflags } "
%install
%makeinstall
%clean
%{__rm}-rf%{buildroot}%{__rm}-rf
%{_builddir}/%{name}" -%{version}
%files
%defattr (-,root,root)
%{_bindir}/hello
%changelog
* Sat Oct 08 2016 Lophyxp
-0.0.1-1-
==========================================
Making RPM Packages
Rpmbuild-ba rpm/specs/hello.spec
ls rpm/rpms/x86_64
ls Rpm/srpms
Get the RPM package and src.rpm package.