brno meetr: packaging ruby gems into rpm
DESCRIPTION
Packaging Ruby Gems into RPMTRANSCRIPT
![Page 1: Brno meetr: Packaging Ruby Gems into RPM](https://reader038.vdocument.in/reader038/viewer/2022100500/55703184d8b42a611e8b481e/html5/thumbnails/1.jpg)
Into Fedora RPM packages
Lubomir RintelPresented by
Fedora Package Maintainer
Creative Commons Attribution-ShareAlike license applies.
Packaging Gems
![Page 2: Brno meetr: Packaging Ruby Gems into RPM](https://reader038.vdocument.in/reader038/viewer/2022100500/55703184d8b42a611e8b481e/html5/thumbnails/2.jpg)
Gems and RPM
![Page 3: Brno meetr: Packaging Ruby Gems into RPM](https://reader038.vdocument.in/reader038/viewer/2022100500/55703184d8b42a611e8b481e/html5/thumbnails/3.jpg)
Why use RPM?Consistency simplifies maintenance
Administrative tasks (rpm)
Repository and update management (yum)
Lots existing tooling
Creating Live or JEOS images (livecd-tools)
Reproducible builds (mock, koji)
Security
Package signing (rpm -k)
File verification (rpm -V)
![Page 4: Brno meetr: Packaging Ruby Gems into RPM](https://reader038.vdocument.in/reader038/viewer/2022100500/55703184d8b42a611e8b481e/html5/thumbnails/4.jpg)
Ruby GemsArchive of Ruby code
Ruby library metadata specification
A sane and useful standard
Ruby specific
Guarantees consistent build mechanism
Subset of RPM capabilitiesNaming and versioning
Dependency resolution
Maps well to RPM
![Page 5: Brno meetr: Packaging Ruby Gems into RPM](https://reader038.vdocument.in/reader038/viewer/2022100500/55703184d8b42a611e8b481e/html5/thumbnails/5.jpg)
Wrapping Gems into RPMRespecting both OS and Gem customs
FHS, naming and versioning standards, ...
Gem tooling still worksUse wisely
Can be aided with automated toolsgem2rpm
Available in rubygem-gem2rpm package
![Page 6: Brno meetr: Packaging Ruby Gems into RPM](https://reader038.vdocument.in/reader038/viewer/2022100500/55703184d8b42a611e8b481e/html5/thumbnails/6.jpg)
Wrapping Gems into RPMRespecting both OS and Gem customs
FHS, naming and versioning standards, ...
Gem tooling still worksUse wisely
Can be aided with automated toolsgem2rpm
Available in rubygem-gem2rpm package
Very helpful!
![Page 7: Brno meetr: Packaging Ruby Gems into RPM](https://reader038.vdocument.in/reader038/viewer/2022100500/55703184d8b42a611e8b481e/html5/thumbnails/7.jpg)
RPM basicsBinary package
Installable with rpm -i
Query installed package with rpm -q
Query package file with rpm -q -f
Source package
Wraps source files, patches and build SPEC
Buildable with rpmbuild
rpm -i and rpm -q -p works the same as with binaries
![Page 8: Brno meetr: Packaging Ruby Gems into RPM](https://reader038.vdocument.in/reader038/viewer/2022100500/55703184d8b42a611e8b481e/html5/thumbnails/8.jpg)
RPM packaging basicsSPEC file
Divided into sectionsStarts with header with tags
Metadata: %description, %files, %changelog
Shell scriptlets: %prep, %build, %install, %check, %pre, %post
Macro expansion occurs firstDefines: %{buildroot}, %{_prefix}, %{?dist}
Conditionals: %if .. %endif, %ifarch i386
![Page 9: Brno meetr: Packaging Ruby Gems into RPM](https://reader038.vdocument.in/reader038/viewer/2022100500/55703184d8b42a611e8b481e/html5/thumbnails/9.jpg)
Ruby Gem RPM anatomyGuidelines in Wiki
Defines%{gemname}, %{gemdir}, %{geminstdir}
Name: rubygem-%{gemname}
Usually no rebuild
Source package same as built in Rubygems
Empty %prep and %build sections
![Page 10: Brno meetr: Packaging Ruby Gems into RPM](https://reader038.vdocument.in/reader038/viewer/2022100500/55703184d8b42a611e8b481e/html5/thumbnails/10.jpg)
Questions?
![Page 11: Brno meetr: Packaging Ruby Gems into RPM](https://reader038.vdocument.in/reader038/viewer/2022100500/55703184d8b42a611e8b481e/html5/thumbnails/11.jpg)
Hands-onexercise
![Page 12: Brno meetr: Packaging Ruby Gems into RPM](https://reader038.vdocument.in/reader038/viewer/2022100500/55703184d8b42a611e8b481e/html5/thumbnails/12.jpg)
Adding the packageinto Fedora
![Page 13: Brno meetr: Packaging Ruby Gems into RPM](https://reader038.vdocument.in/reader038/viewer/2022100500/55703184d8b42a611e8b481e/html5/thumbnails/13.jpg)
Fedora infrastructureKoji – Build System
http://koji.fedoraproject.org/koji/
Packages are built here
Maintains package collections for specific releases
Bodhi – Update system
https://admin.fedoraproject.org/updates/
Tells Koji to include packages in Stable (Beta, RC, Gold) repositories
![Page 14: Brno meetr: Packaging Ruby Gems into RPM](https://reader038.vdocument.in/reader038/viewer/2022100500/55703184d8b42a611e8b481e/html5/thumbnails/14.jpg)
Fedora infrastructureBugzilla – Ticket tracking system
https://bugzilla.redhat.com/
New packages are reviewed here
GIT requests are processed here
FAS2 – Fedora Account System
https://admin.fedoraproject.org/accounts/
Need a packager account
![Page 15: Brno meetr: Packaging Ruby Gems into RPM](https://reader038.vdocument.in/reader038/viewer/2022100500/55703184d8b42a611e8b481e/html5/thumbnails/15.jpg)
Packager setupSet up a SSH key in FAS
Install required client software
fedpkg, koji client, bodhi client
yum -y install fedora-packager
Get a certificate for Koji clientfedora-packager-setup
Clone your package and start hackingfedpkg co rubygem-<name>
![Page 17: Brno meetr: Packaging Ruby Gems into RPM](https://reader038.vdocument.in/reader038/viewer/2022100500/55703184d8b42a611e8b481e/html5/thumbnails/17.jpg)
GoodData is hiring!
● Perl, C, SQL, Java, Javascript● Data analysis and visualization
http://www.gooddata.com/about/careers/
![Page 18: Brno meetr: Packaging Ruby Gems into RPM](https://reader038.vdocument.in/reader038/viewer/2022100500/55703184d8b42a611e8b481e/html5/thumbnails/18.jpg)
Useful resourcesWiki: https://fedoraproject.org/wiki/
https://fedoraproject.org/wiki/PackageMaintainers/Join
https://fedoraproject.org/wiki/Packaging/Guidelines
http://fedoraproject.org/wiki/SIGs/Ruby
RPM Packaging
http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/
http://www.rpm.org/max-rpm/
![Page 19: Brno meetr: Packaging Ruby Gems into RPM](https://reader038.vdocument.in/reader038/viewer/2022100500/55703184d8b42a611e8b481e/html5/thumbnails/19.jpg)
Useful resourcesMailing lists
IRC