SlideShare ist ein Scribd-Unternehmen logo
1 von 26
Downloaden Sie, um offline zu lesen
RPM BUILDING 101:
A LAZY ADMIN'S GUIDE FOR BUILDING
SOFTWARE TO DEPLOY
Created by /
Brian Stinson @bstinsonmhk
http://kan.st/1G9
AGENDA:
Setup
What is an RPM?
The Spec File
The Building Blocks (rpmbuild)
Intermediate Tools (mock)
SETUP
$ y
u
m i
n
s
t
a
l
l r
p
m
d
e
v
t
o
o
l
s
$ e
c
h
o '
%
_
t
o
p
d
i
r /
h
o
m
e
/
b
s
t
i
n
s
o
n
/
r
p
m
b
u
i
l
d
' > ~
/
.
r
p
m
m
a
c
r
o
s
$ r
p
m
d
e
v
­
s
e
t
u
p
t
r
e
e
WHAT IS AN RPM?
Headers/Metadata
CPIO archive
name-version-release.arch.rpm
python-dateutil-1.5-7.el7.noarch.rpm
$ r
p
m
2
c
p
i
o <
y
o
u
r
_
p
a
c
k
a
g
e
>
.
r
p
m | c
p
i
o ­
i
v
m
d
THE SPEC FILE
STRUCTURE : METADATA
N
a
m
e
: p
y
t
h
o
n
­
d
a
t
e
u
t
i
l
V
e
r
s
i
o
n
: 1
.
5
R
e
l
e
a
s
e
: 7
%
{
?
d
i
s
t
}
S
u
m
m
a
r
y
: P
o
w
e
r
f
u
l e
x
t
e
n
s
i
o
n
s t
o t
h
e s
t
a
n
d
a
r
d d
a
t
e
t
i
m
e m
o
d
u
l
e
G
r
o
u
p
: D
e
v
e
l
o
p
m
e
n
t
/
L
a
n
g
u
a
g
e
s
L
i
c
e
n
s
e
: P
y
t
h
o
n
U
R
L
: h
t
t
p
:
/
/
l
a
b
i
x
.
o
r
g
/
p
y
t
h
o
n
­
d
a
t
e
u
t
i
l
S
o
u
r
c
e
0
: h
t
t
p
:
/
/
l
a
b
i
x
.
o
r
g
/
d
o
w
n
l
o
a
d
/
%
{
n
a
m
e
}
/
%
{
n
a
m
e
}
­
%
{
v
e
r
s
i
o
n
}
.
t
a
r
.
g
z
P
a
t
c
h
0
: p
y
t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
r
t
­
c
i
r
c
u
i
t
] ­
b
c S
P
E
C
S
/
p
y
t
h
o
n
­
d
a
t
e
u
t
i
l
.
s
p
e
c
%
b
u
i
l
d
%
{
_
_
p
y
t
h
o
n
} s
e
t
u
p
.
p
y b
u
i
l
d
WORKING WITH RPMBUILD
$ r
p
m
b
u
i
l
d [
­
­
s
h
o
r
t
­
c
i
r
c
u
i
t
] ­
b
i S
P
E
C
S
/
p
y
t
h
o
n
­
d
a
t
e
u
t
i
l
.
s
p
e
c
%
i
n
s
t
a
l
l
%
{
_
_
p
y
t
h
o
n
} s
e
t
u
p
.
p
y i
n
s
t
a
l
l ­
­
s
k
i
p
­
b
u
i
l
d ­
­
r
o
o
t $
R
P
M
_
B
U
I
L
D
_
R
O
O
T
WORKING WITH RPMBUILD
Build a Binary RPM
$ r
p
m
b
u
i
l
d ­
b
b
Build a Source RPM
$ r
p
m
b
u
i
l
d ­
b
s
Build both Binary and Source RPMs
$ r
p
m
b
u
i
l
d ­
b
a
THAT WAS A LOT OF WORK...
PROBLEMS WITH RPMBUILD
Lots of BuildRequires packages
Only one distro-version at a time
$ r
p
m ­
q
a | w
c ­
l
8
7
4
5
MOCK TO THE RESCUE!
$ y
u
m i
n
s
t
a
l
l e
p
e
l
­
r
e
l
e
a
s
e
$ y
u
m i
n
s
t
a
l
l m
o
c
k
$ u
s
e
r
m
o
d ­
a ­
G m
o
c
k b
s
t
i
n
s
o
n &
& n
e
w
g
r
p m
o
c
k
Configs for distros/arches are in /etc/mock
BUILDING WITH MOCK
Build an SRPM from our Spec File
$ c
d ~
/
r
p
m
b
u
i
l
d &
& r
p
m
b
u
i
l
d ­
b
s S
P
E
C
S
/
p
y
t
h
o
n
­
d
a
t
e
u
t
i
l
.
s
p
e
c
BUILDING WITH MOCK
Give Mock our SRPM
$ m
o
c
k ­
r c
e
n
t
o
s
­
7
­
x
8
6
_
6
4 ­
­
r
e
b
u
i
l
d ~
/
r
p
m
b
u
i
l
d
/
S
R
P
M
S
/
p
y
t
h
o
n
­
d
a
t
e
u
t
i
l
­
1
.
5
­
7
.
e
l
7
BUILD LOGS AND FINAL RPMS
/
v
a
r
/
l
i
b
/
m
o
c
k
/
c
e
n
t
o
s
­
7
­
x
8
6
_
6
4
/
r
e
s
u
l
t
MORE MOCK
$ m
o
c
k ­
r c
e
n
t
o
s
­
7
­
x
8
6
_
6
4 ­
­
i
n
i
t
$ m
o
c
k ­
r c
e
n
t
o
s
­
7
­
x
8
6
_
6
4 ­
­
i
n
s
t
a
l
l .
.
.
$ m
o
c
k ­
r c
e
n
t
o
s
­
7
­
x
8
6
_
6
4 ­
­
n
o
­
c
l
e
a
n ­
­
r
e
b
u
i
l
d .
.
.
$ m
o
c
k ­
r c
e
n
t
o
s
­
7
­
x
8
6
_
6
4 ­
­
s
h
e
l
l
FURTHER READING
Package Guidelines (Fedora & EPEL):
Koji (builds on top of mock):
CentOS Community Build System:
Your Own Local Yum Repo:
https://fedoraproject.org/wiki/Packaging:Guidelines
http://www.fedorahosted.org/koji
http://wiki.centos.org/HowTos/CommunityBuildSystem
http://createrepo.baseurl.org/

Weitere ähnliche Inhalte

Ähnlich wie rpm-building-101.pdf

Org 536 effective business communications portfolio (f) copy
Org 536 effective business communications portfolio (f)   copyOrg 536 effective business communications portfolio (f)   copy
Org 536 effective business communications portfolio (f) copy
YorkCSU
 
Y o u r N a m e L S P 2 0 0 - 3 2 0 ( c o u r s e I .docx
Y o u r  N a m e   L S P  2 0 0 - 3 2 0  ( c o u r s e  I .docxY o u r  N a m e   L S P  2 0 0 - 3 2 0  ( c o u r s e  I .docx
Y o u r N a m e L S P 2 0 0 - 3 2 0 ( c o u r s e I .docx
herminaprocter
 
Y o u r N a m e L S P 2 0 0 - 3 2 0 ( c o u r s e I .docx
Y o u r  N a m e   L S P  2 0 0 - 3 2 0  ( c o u r s e  I .docxY o u r  N a m e   L S P  2 0 0 - 3 2 0  ( c o u r s e  I .docx
Y o u r N a m e L S P 2 0 0 - 3 2 0 ( c o u r s e I .docx
odiliagilby
 

Ähnlich wie rpm-building-101.pdf (20)

Evolving the Android Core with Aspects
Evolving the Android Core with AspectsEvolving the Android Core with Aspects
Evolving the Android Core with Aspects
 
Spring Roo 2.0 Preview at Spring I/O 2016
Spring Roo 2.0 Preview at Spring I/O 2016 Spring Roo 2.0 Preview at Spring I/O 2016
Spring Roo 2.0 Preview at Spring I/O 2016
 
PyData Barcelona - weather and climate data
PyData Barcelona - weather and climate dataPyData Barcelona - weather and climate data
PyData Barcelona - weather and climate data
 
Using Phing for Fun and Profit
Using Phing for Fun and ProfitUsing Phing for Fun and Profit
Using Phing for Fun and Profit
 
Intro to Hackathons (Winter 2015)
Intro to Hackathons (Winter 2015)Intro to Hackathons (Winter 2015)
Intro to Hackathons (Winter 2015)
 
Org 536 effective business communications portfolio (f) copy
Org 536 effective business communications portfolio (f)   copyOrg 536 effective business communications portfolio (f)   copy
Org 536 effective business communications portfolio (f) copy
 
Watkins will ppp_visuals
Watkins will ppp_visualsWatkins will ppp_visuals
Watkins will ppp_visuals
 
Debugging Your CDN - Austin Spires at Fastly Altitude 2015
Debugging Your CDN - Austin Spires at Fastly Altitude 2015Debugging Your CDN - Austin Spires at Fastly Altitude 2015
Debugging Your CDN - Austin Spires at Fastly Altitude 2015
 
InterCon 2016 - Internet of “Thinking” – IoT sem BS com ESP8266
InterCon 2016 - Internet of “Thinking” – IoT sem BS com ESP8266InterCon 2016 - Internet of “Thinking” – IoT sem BS com ESP8266
InterCon 2016 - Internet of “Thinking” – IoT sem BS com ESP8266
 
InterCon 2016 - Blockchain e smart-contracts em Ethereu
InterCon 2016 - Blockchain e smart-contracts em EthereuInterCon 2016 - Blockchain e smart-contracts em Ethereu
InterCon 2016 - Blockchain e smart-contracts em Ethereu
 
Data Science Festival - Beginners Guide to Weather and Climate Data
Data Science Festival - Beginners Guide to Weather and Climate DataData Science Festival - Beginners Guide to Weather and Climate Data
Data Science Festival - Beginners Guide to Weather and Climate Data
 
FedCM - OpenID TechNight vol.19
FedCM - OpenID TechNight vol.19FedCM - OpenID TechNight vol.19
FedCM - OpenID TechNight vol.19
 
Behler Richard PPP
Behler Richard PPPBehler Richard PPP
Behler Richard PPP
 
톰캣 #05+b-root-deployment
톰캣 #05+b-root-deployment톰캣 #05+b-root-deployment
톰캣 #05+b-root-deployment
 
How to put more Media in your Social
How to put more Media in your SocialHow to put more Media in your Social
How to put more Media in your Social
 
Fab Labs: a global network for local entrepreneurship
Fab Labs: a global network for local entrepreneurshipFab Labs: a global network for local entrepreneurship
Fab Labs: a global network for local entrepreneurship
 
Y o u r N a m e L S P 2 0 0 - 3 2 0 ( c o u r s e I .docx
Y o u r  N a m e   L S P  2 0 0 - 3 2 0  ( c o u r s e  I .docxY o u r  N a m e   L S P  2 0 0 - 3 2 0  ( c o u r s e  I .docx
Y o u r N a m e L S P 2 0 0 - 3 2 0 ( c o u r s e I .docx
 
Y o u r N a m e L S P 2 0 0 - 3 2 0 ( c o u r s e I .docx
Y o u r  N a m e   L S P  2 0 0 - 3 2 0  ( c o u r s e  I .docxY o u r  N a m e   L S P  2 0 0 - 3 2 0  ( c o u r s e  I .docx
Y o u r N a m e L S P 2 0 0 - 3 2 0 ( c o u r s e I .docx
 
Hallaran robert 4.4
Hallaran robert 4.4Hallaran robert 4.4
Hallaran robert 4.4
 
AVID Community Service Dilemma
AVID Community Service DilemmaAVID Community Service Dilemma
AVID Community Service Dilemma
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 

rpm-building-101.pdf

  • 1. RPM BUILDING 101: A LAZY ADMIN'S GUIDE FOR BUILDING SOFTWARE TO DEPLOY Created by / Brian Stinson @bstinsonmhk http://kan.st/1G9
  • 2. AGENDA: Setup What is an RPM? The Spec File The Building Blocks (rpmbuild) Intermediate Tools (mock)
  • 3. SETUP $ y u m i n s t a l l r p m d e v t o o l s $ e c h o ' % _ t o p d i r / h o m e / b s t i n s o n / r p m b u i l d ' > ~ / . r p m m a c r o s $ r p m d e v ­ s e t u p t r e e
  • 4. WHAT IS AN RPM? Headers/Metadata CPIO archive name-version-release.arch.rpm python-dateutil-1.5-7.el7.noarch.rpm $ r p m 2 c p i o < y o u r _ p a c k a g e > . r p m | c p i o ­ i v m d
  • 5. THE SPEC FILE STRUCTURE : METADATA N a m e : p y t h o n ­ d a t e u t i l V e r s i o n : 1 . 5 R e l e a s e : 7 % { ? d i s t } S u m m a r y : P o w e r f u l e x t e n s i o n s t o t h e s t a n d a r d d a t e t i m e m o d u l e G r o u p : D e v e l o p m e n t / L a n g u a g e s L i c e n s e : P y t h o n U R L : h t t p : / / l a b i x . o r g / p y t h o n ­ d a t e u t i l S o u r c e 0 : h t t p : / / l a b i x . o r g / d o w n l o a d / % { n a m e } / % { n a m e } ­ % { v e r s i o n } . t a r . g z P a t c h 0 : p y t h o n ­ d a t e u t i l ­ 1 . 5 ­ s y s t e m ­ z o n e i n f o . p a t c h
  • 6. THE SPEC FILE STRUCTURE : METADATA B u i l d A r c h : n o a r c h B u i l d R e q u i r e s : p y t h o n ­ d e v e l , p y t h o n ­ s e t u p t o o l s R e q u i r e s : t z d a t a % d e s c r i p t i o n T h e d a t e u t i l m o d u l e p r o v i d e s p o w e r f u l e x t e n s i o n s t o t h e s t a n d a r d d a t e t i m e m o d u l e a v a i l a b l e i n P y t h o n 2 . 3 + .
  • 7. THE SPEC FILE STRUCTURE : SCRIPTS % p r e p % s e t u p ­ q % p a t c h 0 ­ p 1 i c o n v ­ ­ f r o m = I S O ­ 8 8 5 9 ­ 1 ­ ­ t o = U T F ­ 8 N E W S > N E W S . n e w m v N E W S . n e w N E W S % b u i l d % { _ _ p y t h o n } s e t u p . p y b u i l d % i n s t a l l % { _ _ p y t h o n } s e t u p . p y i n s t a l l ­ ­ s k i p ­ b u i l d ­ ­ r o o t $ R P M _ B U I L D _ R O O T
  • 8. THE SPEC FILE STRUCTURE : SCRIPTS UNMENTIONED % p r e # J u s t b e f o r e t h e p a c k a g e i s i n s t a l l e d % p o s t # J u s t a f t e r t h e p a c k a g e i s i n s t a l l e d % p r e u n # J u s t b e f o r e t h e p a c k a g e i s r e m o v e d % p o s t u n # J u s t a f t e r t h e p a c k a g e i s r e m o v e d
  • 9. THE SPEC FILE STRUCTURE : FILE MANIFEST % f i l e s % d o c e x a m p l e . p y L I C E N S E N E W S R E A D M E % { p y t h o n _ s i t e l i b } / d a t e u t i l / % e x c l u d e % { p y t h o n _ s i t e l i b } / d a t e u t i l / z o n e i n f o / z o n e i n f o ­ 2 0 1 0 g . t a r . g z % { p y t h o n _ s i t e l i b } / * . e g g ­ i n f o
  • 10. THE SPEC FILE STRUCTURE : CHANGELOG % c h a n g e l o g * F r i D e c 2 7 2 0 1 3 D a n i e l M a c h < d m a c h @ r e d h a t . c o m > ­ 1 . 5 ­ 7 ­ M a s s r e b u i l d 2 0 1 3 ­ 1 2 ­ 2 7
  • 11. MACROS $ r p m ­ ­ e v a l ' % { _ _ p y t h o n } ' / u s r / b i n / p y t h o n
  • 12. MACROS % p r e p % s e t u p ­ q % p a t c h 0 ­ p 1 i c o n v ­ ­ f r o m = I S O ­ 8 8 5 9 ­ 1 ­ ­ t o = U T F ­ 8 N E W S > N E W S . n e w m v N E W S . n e w N E W S % b u i l d % { _ _ p y t h o n } s e t u p . p y b u i l d % i n s t a l l % { _ _ p y t h o n } s e t u p . p y i n s t a l l ­ ­ s k i p ­ b u i l d ­ ­ r o o t $ R P M _ B U I L D _ R O O T
  • 13. MACROS : EXPANDED % p r e p % s e t u p ­ q % p a t c h 0 ­ p 1 i c o n v ­ ­ f r o m = I S O ­ 8 8 5 9 ­ 1 ­ ­ t o = U T F ­ 8 N E W S > N E W S . n e w m v N E W S . n e w N E W S % b u i l d / u s r / b i n / p y t h o n s e t u p . p y b u i l d % i n s t a l l / u s r / b i n / p y t h o n s e t u p . p y i n s t a l l ­ ­ s k i p ­ b u i l d ­ ­ r o o t $ R P M _ B U I L D _ R O O T
  • 14. LET'S BUILD! $ c d ~ / r p m b u i l d / S O U R C E S & & s p e c t o o l ­ g . . / S P E C S / p y t h o n ­ d a t e u t i l . s p e c N a m e : p y t h o n ­ d a t e u t i l V e r s i o n : 1 . 5 . . . S o u r c e 0 : h t t p : / / l a b i x . o r g / d o w n l o a d / % { n a m e } / % { n a m e } ­ % { v e r s i o n } . t a r . g z
  • 15. WORKING WITH RPMBUILD $ r p m b u i l d ­ b p S P E C S / p y t h o n ­ d a t e u t i l . s p e c % p r e p % s e t u p ­ q % p a t c h 0 ­ p 1 i c o n v ­ ­ f r o m = I S O ­ 8 8 5 9 ­ 1 ­ ­ t o = U T F ­ 8 N E W S > N E W S . n e w m v N E W S . n e w N E W S
  • 16. WORKING WITH RPMBUILD $ r p m b u i l d [ ­ ­ s h o r t ­ c i r c u i t ] ­ b c S P E C S / p y t h o n ­ d a t e u t i l . s p e c % b u i l d % { _ _ p y t h o n } s e t u p . p y b u i l d
  • 17. WORKING WITH RPMBUILD $ r p m b u i l d [ ­ ­ s h o r t ­ c i r c u i t ] ­ b i S P E C S / p y t h o n ­ d a t e u t i l . s p e c % i n s t a l l % { _ _ p y t h o n } s e t u p . p y i n s t a l l ­ ­ s k i p ­ b u i l d ­ ­ r o o t $ R P M _ B U I L D _ R O O T
  • 18. WORKING WITH RPMBUILD Build a Binary RPM $ r p m b u i l d ­ b b Build a Source RPM $ r p m b u i l d ­ b s Build both Binary and Source RPMs $ r p m b u i l d ­ b a
  • 19. THAT WAS A LOT OF WORK...
  • 20. PROBLEMS WITH RPMBUILD Lots of BuildRequires packages Only one distro-version at a time $ r p m ­ q a | w c ­ l 8 7 4 5
  • 21. MOCK TO THE RESCUE! $ y u m i n s t a l l e p e l ­ r e l e a s e $ y u m i n s t a l l m o c k $ u s e r m o d ­ a ­ G m o c k b s t i n s o n & & n e w g r p m o c k Configs for distros/arches are in /etc/mock
  • 22. BUILDING WITH MOCK Build an SRPM from our Spec File $ c d ~ / r p m b u i l d & & r p m b u i l d ­ b s S P E C S / p y t h o n ­ d a t e u t i l . s p e c
  • 23. BUILDING WITH MOCK Give Mock our SRPM $ m o c k ­ r c e n t o s ­ 7 ­ x 8 6 _ 6 4 ­ ­ r e b u i l d ~ / r p m b u i l d / S R P M S / p y t h o n ­ d a t e u t i l ­ 1 . 5 ­ 7 . e l 7
  • 24. BUILD LOGS AND FINAL RPMS / v a r / l i b / m o c k / c e n t o s ­ 7 ­ x 8 6 _ 6 4 / r e s u l t
  • 25. MORE MOCK $ m o c k ­ r c e n t o s ­ 7 ­ x 8 6 _ 6 4 ­ ­ i n i t $ m o c k ­ r c e n t o s ­ 7 ­ x 8 6 _ 6 4 ­ ­ i n s t a l l . . . $ m o c k ­ r c e n t o s ­ 7 ­ x 8 6 _ 6 4 ­ ­ n o ­ c l e a n ­ ­ r e b u i l d . . . $ m o c k ­ r c e n t o s ­ 7 ­ x 8 6 _ 6 4 ­ ­ s h e l l
  • 26. FURTHER READING Package Guidelines (Fedora & EPEL): Koji (builds on top of mock): CentOS Community Build System: Your Own Local Yum Repo: https://fedoraproject.org/wiki/Packaging:Guidelines http://www.fedorahosted.org/koji http://wiki.centos.org/HowTos/CommunityBuildSystem http://createrepo.baseurl.org/