Rpm

From Attie's Wiki
(Difference between revisions)
Jump to: navigation, search
m
m
Line 12: Line 12:
 
Create a *.spec file using the following template:
 
Create a *.spec file using the following template:
 
<source lang="text">
 
<source lang="text">
Summary: C library to aid the use of Digi XBee radios in API mode
+
Summary: Test library
Name: libxbee3
+
Name: mylib
Version: 3.0.6
+
Version: 1.0.1
 
Release: 1
 
Release: 1
 
License: LGPL
 
License: LGPL
#BuildRequires: make, gcc, binutils, coreutils, gzip, man2html
+
#BuildRequires: make, gcc, binutils, coreutils, gzip
 
Group: System/Libraries
 
Group: System/Libraries
Source: libxbee3-3.0.6.tgz
+
Source: mylib-1.0.1.tgz
  
 
BuildRoot: /ver/tmp/${name}-buildroot
 
BuildRoot: /ver/tmp/${name}-buildroot
  
 
%description
 
%description
C library to aid the use of Digi XBee radios in API mode
+
Test library
  
 
%prep
 
%prep
Line 37: Line 37:
 
mkdir -p $RPM_BUILD_ROOT/usr/include
 
mkdir -p $RPM_BUILD_ROOT/usr/include
 
mkdir -p $RPM_BUILD_ROOT/usr/lib
 
mkdir -p $RPM_BUILD_ROOT/usr/lib
mkdir -p $RPM_BUILD_ROOT/usr/share/man/man3
 
 
sudo SYS_ROOT=$RPM_BUILD_ROOT make install
 
sudo SYS_ROOT=$RPM_BUILD_ROOT make install
  
Line 44: Line 43:
  
 
%files
 
%files
/usr/lib/libxbee.a
+
/usr/lib/libmy.a
/usr/lib/libxbee.a.3.0.6
+
/usr/lib/libmy.a.1.0.1
/usr/lib/libxbee.so
+
/usr/lib/libmy.so
/usr/lib/libxbee.so.3.0.6
+
/usr/lib/libmy.so.1.0.1
/usr/lib/libxbee.so.3.0.6.dbg
+
/usr/lib/libmy.so.1.0.1.dbg
/usr/share/man/man3/libxbee_revision.3.gz
+
/usr/include/my.h
/usr/share/man/man3/xbee_pktDataGet.3.gz
+
/usr/share/man/man3/xbee_conSleepGet.3.gz
+
/usr/share/man/man3/xbee_conInfoGet.3.gz
+
/usr/share/man/man3/libxbee.3.gz
+
/usr/share/man/man3/xbee_logLevelGet.3.gz
+
/usr/share/man/man3/xbee_conPurge.3.gz
+
/usr/share/man/man3/xbee_conCallbackGet.3.gz
+
/usr/share/man/man3/xbee_log.3.gz
+
/usr/share/man/man3/xbee_conNew.3.gz
+
/usr/share/man/man3/xbee_pkt.3.gz
+
/usr/share/man/man3/xbee_errorToStr.3.gz
+
/usr/share/man/man3/xbee_modeGetList.3.gz
+
/usr/share/man/man3/xbee_netStart.3.gz
+
/usr/share/man/man3/xbee_attachEOFCallback.3.gz
+
/usr/share/man/man3/xbee_conRx.3.gz
+
/usr/share/man/man3/xbee_conDataGet.3.gz
+
/usr/share/man/man3/xbee_pktValidate.3.gz
+
/usr/share/man/man3/xbee_setup.3.gz
+
/usr/share/man/man3/xbee_conSettings.3.gz
+
/usr/share/man/man3/xbee_conGetTypes.3.gz
+
/usr/share/man/man3/xbee_conTx.3.gz
+
/usr/share/man/man3/xbee_conAddress.3.gz
+
/usr/include/xbee.h
+
  
 
%changelog
 
%changelog

Revision as of 17:28, 30 May 2012

Building an RPM package

Create the following directory structure:

mkdir -p ~/rpmbuild/SOURCES ~/rpmbuildrpm/SPECS

Create a tar file containing the source code, named like so: <packagename>-<version>.tgz

tar -cavf ~/rpmbuild/SOURCES/mylib-1.0.1.tgz --transform='#^#mylib-1.0.1/#s' *.c *.h makefile

Create a *.spec file using the following template:

Summary: Test library
Name: mylib
Version: 1.0.1
Release: 1
License: LGPL
#BuildRequires: make, gcc, binutils, coreutils, gzip
Group: System/Libraries
Source: mylib-1.0.1.tgz
 
BuildRoot: /ver/tmp/${name}-buildroot
 
%description
Test library
 
%prep
%setup -q
 
%build
make configure
make
 
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/usr/include
mkdir -p $RPM_BUILD_ROOT/usr/lib
sudo SYS_ROOT=$RPM_BUILD_ROOT make install
 
%clean
rm -rf $RPM_BUILD_ROOT
 
%files
/usr/lib/libmy.a
/usr/lib/libmy.a.1.0.1
/usr/lib/libmy.so
/usr/lib/libmy.so.1.0.1
/usr/lib/libmy.so.1.0.1.dbg
/usr/include/my.h
 
%changelog
* Wed May 30 2012 Attie Grande <attie@attie.co.uk>
- created RPM build infrastructure
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox