Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ Simple RPM package production     - Linux boot the system does not display a progress bar setting method (Linux)

- Linux Man Page Installation (Linux)

- Commonly used Linux system camouflage method (Linux)

- The principle Httpclient4.4 (HttpClient Interface) (Programming)

- LogStash log analysis display system (Linux)

- OpenStack image production in the CentOS 6.2 (Linux)

- How to query the role of Linux services (Linux)

- Object Oriented Programming Java reflection (Programming)

- Several start-up mode of Tomcat (Server)

- C ++ Supplements - malloc free and new delete the same and different (Programming)

- Differential test piece using MongoDB performance YCSB (Database)

- Linux System Tutorial: Fix ImportError: No module named wxversion error (Linux)

- Linux / Unix desktops interesting: Christmas tree on the terminal (Linux)

- CentOS installation Percona Server 5.5.42 compiling problem solve one case (Linux)

- About Python default character set (Linux)

- Installation and Configuration ISC DHCP server on Debian Linux (Server)

- Linux System Getting Started Tutorial: Using the Linux common commands (Linux)

- Ubuntu development Nodejs (Linux)

- Python extension module Ganglia 3.1.x (Linux)

- Linux instructions and examples GPG encryption and decryption (Linux)

  Simple RPM package production
  Add Date : 2017-08-31      
  Today, in order to test and build your own yum repository to install the upgrade package, requiring a rpm package to do the test, so I thought of his own to do a simple rpm, just because a test is to do so there is no need to add the compiled file, only uses a shell file output cute Hello World.

1. first need to download and install the rpm package Maker

$ Sudo yum install -y rpm-build rpmdevtools

2. Run rpmdev-setuptree skeleton directory to generate a rpm package

$ Rpmdev-setuptreer

pmdev-setuptree a further command to create a default RPM build root directory structure under the root directory of the current user's ~ / rpmbuild /

3. Generate the source code package

mkdir -p ~ / rpmbuild / SOURCES / helloworld-1.0.0
touch ~ / rpmbuild / SOURCES / helloworld-1.0.0 / helloworld
chmod 755 ~ / rpmbuild / SOURCES / helloworld-1.0.0 / helloworld
echo "#! / bin / sh" >> ~ / rpmbuild / SOURCES / helloworld-1.0.0 / helloworld
echo "echo Hello World!" >> ~ / rpmbuild / SOURCES / helloworld-1.0.0 / helloworld
cd ~ / rpmbuild / SOURCES; tar zcvf helloworld-1.0.0.tar.gz helloworld-1.0.0

4. Under ~ / rpmbuild / SPECS directory with rpmdev-newspec to generate a skeleton file spec

$ Rpmdev-newspec helloworld.spec

Edit helloworld.spec file, as follows

Name: helloworld
Version: 1.0.0
Release: 1% {dist?}
Summary: helloworld

Group: Development / Tools
License: GPL
Source0:% {name} -% {version} .tar.gz


% Description

% Prep
% Setup -q

% Build
mkdir -p $ RPM_BUILD_ROOT / usr / bin
cp $ RPM_BUILD_DIR /% {name} -% {version} / helloworld $ RPM_BUILD_ROOT / usr / bin /

% Install

% Clean

% Files
% Defattr (-, root, root, -)
% Doc
/ Usr / bin / helloworld

% Changelog

5. Packing

rpmbuild -ba SPECS / helloworld.spec

6. Test
6.1 installation and testing

sudo yum install ~ / rpmbuild / RPMS / x86_64 / helloworld-1.0.0-1.el6.x86_64.rpm

6.2 upgrade testing
Modify helloworld.spec file, which will be modified to Release

Release: 2% {dist?}

Then run "rpmbuild -ba SPECS / helloworld.spec" package

Finally, run the following command to upgrade the rpm package

sudo yum update ~ / rpmbuild / RPMS / x86_64 / helloworld-1.0.0-2.el6.x86_64.rpm
- hexdump Linux command (Linux)
- Android developers learning Adapter (data adapter) (Programming)
- Python-- for anomalies and reflection of objects articles (Programming)
- Oracle 12c detailing the new features (Database)
- Linux System Getting Started Learning: The Linux logrotate (Linux)
- Ubuntu 12.04 LTS installation configuration JDK1.6.0_45 (Linux)
- VPS xen openvz kvm (Server)
- Zabbix system email alert Python script (Server)
- Difference Redhat5 and 6 YUM source configuration (Linux)
- Linux argument references and command substitution (Linux)
- Using BBED repair ORA-01190 error (Database)
- Linux, ls command to achieve (Linux)
- How to compile and install wxWidgets in Ubuntu / Debian / Linux Mint (Linux)
- and localhost difference (Server)
- MyEclipse configuration necessary (Linux)
- Actual SSH port forwarding (Linux)
- Oracle 11g user rights management study notes (Database)
- Linux run queue process scheduling (Programming)
- Linux ./configure --prefix command (Linux)
- Search Linux commands and files - which, whereis, locate, find (Linux)
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.