From Fedora Project Wiki
< Flock | Volunteers
fedora | we're now getting started. | |
---|---|---|
fedora | Speaker is Itamar Preis Peixoto | |
fedora | RPM is a compressed file with metadata information. 99% of Fedora software is delivered in RPM format. | |
fedora | It's a hands-on talk, if you have your laptop and would like to try it's OK. | |
fedora | required software | |
fedora | Most people start talking about writing a spec file, but we'll start talking about the source code and at the end you'll have an RPM file. | |
fedora | development tools required | |
fedora | gcc glibc-devel automake autoconf rpmdevtools mc gedit (or other text editor) | |
fedora | (Pause while people install software...) | |
fedora | next we're going to write a Hello World program | |
fedora | source code follows | |
fedora | #include <stdio.h> | |
fedora | int main(){ | |
fedora | printf("Fedora Flock 2013\n"); | |
fedora | return 0; | |
fedora | } | |
* number80 (~80@fedora/number80) has joined | ||
fedora | save this as flock.c | |
fedora | to compile we'll use gcc | |
fedora | gcc flock.c | |
fedora | you'll have the program with the name a.out | |
fedora | you can run it with ./a.out | |
fedora | should show "Welcome to Flock" | |
fedora | or "Fedora Flock 2013" if you followed what I typed... | |
* qwebirc2558 (9909a8fa@gateway/web/freenode/ip.153.9.168.250) has joined | ||
fedora | now we're going to write a readme.txt file | |
fedora | save the readme.txt file | |
fedora | next we're going to use GNU autotools | |
fedora | first run "autoscan" | |
fedora | (this is in the "flock" directory where you have the flock.c and a.out files) | |
fedora | autoscan will create some files, the most important is configure.scan | |
fedora | going to rename that to configure.ac | |
fedora | question: does autoscan recurse directories? | |
fedora | speaker: "I don't remember now." | |
fedora | open configure.ac with your text editor | |
* qwebirc2558 has quit (Client Quit) | ||
fedora | going to change the FULL-PACKAGE-NAME to flock, change VERSION to 1.0, and leave BUG-REPORT-ADDRESS as-is | |
fedora | save the file | |
fedora | now run "autoheader" | |
fedora | now we're going to create a makefile with gnu autotools | |
fedora | vim Makefile.am | |
fedora | (first letter must be uppercase) | |
fedora | in the file | |
fedora | bin_PROGRAMS=flock | |
fedora | flock_SOURCES=flock.c | |
fedora | now you're going to run "autoreconf -fiv" | |
fedora | make dist | |
fedora | (note that you can use make dist-zip to create zipfiles for other OSes, but that's not necessary for RPMs) | |
fedora | can use make to compile, make clean to remove artifacts... | |
fedora | rpmdev-newspec flock | |
fedora | will create an empty file (spec) for us | |
fedora | open flock.spec w/your text editor | |
fedora | now you need to fill in the "form" with version, summary, | |
fedora | group = x | |
fedora | license = gpl | |
fedora | source0: flock-1.0.tar.gz | |
fedora | BuildRequires: can be left empty | |
fedora | rpmbuiild -ba flock.spec | |
fedora | (Might get an error b/c the source code is not in the right directory.) | |
fedora | you need to have the flock-1.0.tar.gz file in rpmbuild/SOURCES/ | |
fedora | under your home directory | |
fedora | so: /home/user/rpmbuild/SOURCES/ | |
fedora | another error b/c the spec file needs to have the files it creates listed under the %files | |
fedora | after all that's correct, you'll run rpmbuild and you'll get an exit 0 | |
fedora | "in less than 5 minutes we created an RPM" when we process the spec file with rpmbuild, it saves two files, one is the .src and one is the RPM | |
mizmo | is zodbot on | |
mizmo | zodbot, #startmeeting | |
fedora | argh | |
fedora | sorry | |
fedora | :-( | |
mizmo | its okay | |
fedora | we're just wrapping this one up. I can save the log |
Generated by irclog2html.py 2.12.1 by <a href="mailto:marius@pov.lt">Marius Gedminas</a> - find it at <a href="http://mg.pov.lt/irclog2html/">mg.pov.lt</a>!