Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Simple RPM package production     - Oracle query start with connect by tree (Database)

- Ubuntu Series Installation Docker (Linux)

- ORA-12154: TNS: could not resolve the connect identifier specified solve (Database)

- Linux based serial programming (Programming)

- Sublime Text - Opens the current file in a browser (Linux)

- To install Jetty server configuration in detail (Server)

- User rights management system under Linux (Linux)

- Open Ubuntu system updates (Linux)

- Example of use WebSocket (Programming)

- CentOS7 installed VMware 10 (Linux)

- CentOS static IP network configuration (Linux)

- php performance monitoring module XHProf (Linux)

- CentOS 6.5_x64 install Oracle 11g R2 (Database)

- CentOS / Debian configuration Gitlab 7.1x to build self Git repository (Linux)

- How VMware extend disk without rebooting the system (Linux)

- Multipath configuration under Linux (Linux)

- Ease of use "Explain Shell" script to understand Shell command (Linux)

- CentOS set up FTP server (Server)

- RedHat Linux 5.5 installation process SVN Service Notes (Server)

- Installation Yarock 1.1.4 Music Player in Ubuntu (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
#URL:
Source0:% {name} -% {version} .tar.gz


#BuildRequires:
#Requires:

% 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
rm -rf $ RPM_BUILD_ROOT

% 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
     
         
         
         
  More:      
 
- Under Ubuntu 15.04 installation JDK8 (Linux)
- Let VMware ESXi virtual switch support VLAN (Linux)
- Linux scp remote file copy (Linux)
- cat command uses the Linux redirection merge files (Linux)
- Nginx multi-domain certificate HTTPS (Server)
- Quickly build and install Linux KVM system (Linux)
- Ubuntu Install OpenSSL (Linux)
- Linux dmidecode command detail (Linux)
- How LUKS encrypted disk / partition to perform remote incremental backup (Linux)
- CentOS 7 install Hadoop-cdh-2.6 (Server)
- GNU / Linux system, how to clean up memory space (Linux)
- Java data structures - order linear form of table ArrayList (Programming)
- To install GCC development environment under SUSE11 (Linux)
- Docker build private warehouse (Server)
- Proficient in C / C ++ can also find a very good job (Programming)
- Linux file and directory management - ls, cp, mv (Linux)
- CentOS 6.5 makes the LAN http source (Linux)
- PuTTY Xming achieve the X11 forwarding ssh (Server)
- Java multi-threaded in a three way (inheritance, implementation, anonymous inner classes) (Programming)
- MySQL related statements (CRUD) (SQLyog software) (Database)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.