13:35:33 #startmeeting 13:35:33 Meeting started Fri Apr 16 13:35:33 2010 UTC. The chair is mether. Information about MeetBot at http://wiki.debian.org/MeetBot. 13:35:34 Useful Commands: #action #agreed #halp #info #idea #link #topic. 13:35:47 #topic 13:35:57 #meetingtopic RPM Packaging Workshop 13:36:13 #meetingname RPM Packaging Workshop 13:36:14 The meeting name has been set to 'rpm_packaging_workshop' 13:36:34 #chair mether 13:36:35 Current chairs: mether 13:37:13 Hello everyone. I am Rahul Sundaram, a Fedora contributor and will be leading the RPM packaging workshop today 13:37:36 I will be basing this workshop on https://fedoraproject.org/wiki/A_Short_RPM_Tutorial 13:37:47 #link https://fedoraproject.org/wiki/A_Short_RPM_Tutorial 13:37:52 We will be packaging the classic GNU Hello program 13:37:58 ok 13:38:07 As a first step, download http://ftp.gnu.org/gnu/hello/hello-2.5.tar.gz 13:38:18 #link http://ftp.gnu.org/gnu/hello/hello-2.5.tar.gz 13:38:45 done 13:38:45 done ! 13:38:46 I assume you already have fedora-packager package installed on your system if not 13:38:48 done 13:38:52 done 13:38:55 yum install fedora-packager 13:39:04 mether: yes already installed ! 13:39:04 done 13:39:05 done 13:39:13 #info As a first step, download http://ftp.gnu.org/gnu/hello/hello-2.5.tar.gz 13:39:22 #info yum install fedora-packager 13:39:45 You are free to ask questions in between and I encourage that but please ask one at a time 13:39:59 ok 13:40:00 mether: :) okay ! 13:40:14 please put your hand up "!" when you want to ask a question :) 13:40:32 ok 13:40:38 open up a terminal 13:40:42 and in your home directory 13:40:43 run 13:40:58 rpmdev-setuptree 13:41:16 #info rpmdev-setuptree 13:41:38 you should have now have a directory called rpmbuild in your home directory 13:42:18 with a bunch of sub directories - BUILD SPECS SRPMS RPMS and so on 13:42:38 these are all empty directories and just a environment for you to build the packages 13:42:54 you will have have a configuration file called .rpmmacros in your home directory 13:43:04 cat .rpmmacros to take a look at it 13:43:11 mether: yes 13:43:26 mether: yeah 13:43:39 yes ! 13:43:47 mv the source file (ie) hello-2.5.tar.gz to rpmbuild/SOURCES 13:44:16 once you have done that 13:44:35 untar it 13:44:41 mether: done 13:45:00 tar xvf hello-2.5.tar.gz 13:45:02 mether: am lale to the party 13:45:03 mether: done 13:45:08 dine 13:45:13 s/dine/done 13:45:19 franciscod, pass fridayblue the log so far 13:45:47 okay 13:46:06 what we have here is a simple hello world program but it is not entirely trivial because it uses autotools so that you can do the standard configure;make;make install dance to build the binary 13:46:17 it also has the translations and other files inside the archive 13:46:38 now that you have seen what is inside the archive 13:46:42 the next step 13:46:47 hi. just got home from a test. logging on to this irc class :-) 13:46:51 is to create a RPM package 13:47:05 franciscod, pass salvachn and narendra the logs please 13:47:07 mether, we've to download the tarball and look into it? 13:47:26 salvachn, franciscod will give you the log and you can follow on 13:47:39 ok. 13:47:45 i am in,, 13:47:49 mether: hmm 13:47:54 logs http://fpaste.org/75ty/ 13:47:59 mether, thanks 13:48:02 we build a RPM package using what is called a spec file 13:48:18 it is a simple text file 13:48:38 cd ~/rpmbuild/SPECS 13:48:54 meejan_, after untaring it will we get "hello-2.5 hello-2.5.tar.gz libguestfs-1.0.75 libguestfs-1.0.75.tar.gz" 13:48:54 you can either run rpmdev-newspec hello or even simple vi hello.spec 13:49:13 sorry mether after untaring it will we get "hello-2.5 hello-2.5.tar.gz libguestfs-1.0.75 libguestfs-1.0.75.tar.gz" 13:49:48 yevlempy, you have older tarballs in the same space. hello-2.5 is the directory that contains the files from the archive hello-2.5.tar.gz., Rest are irrelevant 13:50:10 everyone ran vi hello.spec? 13:50:14 ok 13:50:34 cd ~/rpmbuild/SPECS and vi hello.spec 13:50:42 mether: done ! 13:50:48 done 13:50:53 mether: yeah but when we run using vi hello.spec only a clean file open nothing there. 13:51:05 yea 13:51:08 praveenkumar, did you have fedora-packager installed? 13:51:20 praveenkumar: try rpmdev-newspec hello 13:51:49 if vi hello.spec doesnt show you a spec file what nmudgal suggests should work 13:51:50 mether: yeah second one right for me. 13:51:54 alright 13:51:57 so lets go with that 13:52:01 * franciscod notes 13:52:13 this is a empty spec file for us to fill in the details 13:52:29 there are multiple sections in the spec file as you can see for yourself 13:52:34 mether: yes ! 13:52:42 Name to description is what is called the RPM meta data section 13:53:08 then prep build install clean files and changelog 13:53:14 lets fill in the details one by one 13:53:26 mether: ok 13:53:26 Name: is the name of the software we are trying to package 13:53:29 what is that? 13:53:42 hello 13:53:46 right 13:53:46 mether, ! 13:53:50 so just fill in 13:53:52 mether: i.e. hello 13:53:57 Name : hello 13:54:00 rtnpro, shoot 13:54:14 mether, what does the % sign mean in .spec file, comment? 13:54:25 rtnpro, we will get to that later 13:54:30 mether, ok 13:54:52 basically it indicates the section or the macro name 13:55:09 after you fill in the name 13:55:13 abhijain: logs -> http://meetbot.fedoraproject.org/fedora-india/2010-04-16/rpm_packaging_workshop.2010-04-16-13.35.log.txt 13:55:19 mether: what ? %sign ? 13:55:19 next is Version 13:55:19 mether, caught up now. 13:55:33 nmudgal, %description for example 13:55:52 Version: is just the version number of the archive 13:55:56 in our case 2.5 13:56:09 Release should be pre-filled in 13:56:14 you can leave it as it is 13:56:21 mether: ok 13:56:22 mether: ok 13:56:29 Summary: is a short description of our software 13:56:32 ok 13:56:36 ok 13:56:44 ok 13:56:54 ok 13:57:00 GNU hello program can be the Summary 13:57:09 mether, ! 13:57:15 salvachn, shoot 13:57:34 mether, we can copy the summary from README for almost all source packages, right? 13:57:49 yes or just write down your own 13:58:01 * nmudgal raise hand 13:58:09 for aesthetic reasons the first letter of the summary should be capitalized 13:58:13 nmudgal, ask 13:58:18 mether, I once tried creating a rpm with just images but the spec went awry. 13:58:29 salvachn, that would probably be the description rather than the summary ? 13:58:37 what's it means in release %{?dist} 13:58:50 salvachn, lets deal with this example and if you have doubts about other spec files you can ask later 13:58:59 mether, ok :-) 13:59:21 nmudgal, I will get to that in the end but the default value is good for us now. 13:59:30 mether: okay 13:59:34 just leave it as it is 13:59:38 mether:ok 13:59:39 and I will explain it 13:59:46 Group: 13:59:57 is RPM grouping 14:00:22 mether, ! 14:00:25 since distribution repositories tends to be filled with thousands of programs, grouping them is one way of managing them 14:00:27 salvachn, ask 14:00:30 mether, as in yum -v grouplist ? 14:00:39 I am coming to that 14:00:43 salvachn: "yum search frogs" 14:00:56 In the past, we have used Groups: tag to define the different groups 14:01:01 for the pictures example, have a look later 14:01:17 in Fedora, we have switched to use comps which is a xml file that defines the different groups and yum uses that instead 14:01:41 The reason why we define it externally is because you can edit comps to redefine the groups without having to rebuild the package 14:01:48 hello 14:01:57 mether: for installing like via groupinstall ? 14:02:08 logs for late comers -> http://meetbot.fedoraproject.org/fedora-india/2010-04-16/rpm_packaging_workshop.2010-04-16-13.35.log.txt 14:02:09 nmudgal, correct. that uses comps 14:02:19 * hakmn thanks franciscod 14:02:41 mether: ok 14:02:50 so in Fedora and most RPM distributions, the group tag is deprecated and in new versions can be omitted completely even but lets define one since it does not hurt anything 14:03:09 mether , ! 14:03:14 RPM valid groups are listed at /usr/share/doc/rpm-/GROUPS 14:03:30 nmudgal, ask 14:03:36 mether: what replaced group tag then ? 14:04:14 nmudgal, comps.xml - refer to http://fedoraproject.org/wiki/How_to_use_and_edit_comps.xml_for_package_groups 14:04:29 lets pick a group 14:04:36 mether: ok 14:04:49 since this is a text or command line application 14:04:57 the appropriate group is Applications/Text 14:05:05 so Group: Applications/Text 14:05:07 ? 14:05:13 skbohra, shoot 14:05:14 Applications/System ? 14:05:16 mether: ok 14:05:21 mether: https://bugzilla.redhat.com/show_bug.cgi?id=582931 I got review 14:05:25 mether: ok 14:05:43 mether: few things are not clear :) 14:05:48 skbohra, middle of a meeting. I have seen the review. If you have doubts ask later 14:06:07 morpheuss, applications/system is usually used for core system utilities 14:06:09 mether: ok 14:06:14 our hello program is not one 14:06:18 mether: ok 14:06:26 so Applications/Text is more suitable 14:06:28 Applications/File 14:06:41 but like I said we dont really use the group value 14:06:42 right /Text too 14:06:43 in any place 14:06:48 so it is not very relevant 14:06:51 just pick one 14:07:00 License is our next tag 14:07:18 open a different terminal or tab 14:07:29 mether: ok 14:07:35 and cd ~/rpmbuild/SOURCES/hello-2.5 14:07:37 mether: ok 14:07:58 ok 14:08:00 The usual standard is a file called COPYING 14:08:13 mether: yeah 14:08:18 ok 14:08:20 a quick look confirms that is GPLv3 license 14:08:43 but to really confirm you will have to read the source header 14:08:54 there is a sub directory called src 14:08:59 go into there 14:09:06 mether, i could not get this "The usual standard is a file called COPYING" 14:09:12 less hello.c 14:09:22 ls 14:09:29 yevlempy, you should see a file called COPYING that defines the license 14:09:30 sorry 14:09:31 yevlempy: file with the name COPYING should be there 14:09:45 ok 14:09:48 as you can see is less hello.c 14:09:54 there is a copyright notice 14:09:57 mether: yeah 14:10:05 FSF has written this program 14:10:05 yes 14:10:26 This program is free software: you can redistribute it and/or modify 14:10:27 it under the terms of the GNU General Public License as published by 14:10:27 the Free Software Foundation, either version 3 of the License, or 14:10:27 (at your option) any later version. 14:10:42 So it is not simply GPLv3 14:10:42 mether: yes 14:10:47 but GPLv3 or later license 14:11:24 we have a exhaustive list of licenses and their tags in http://fedoraproject.org/wiki/Licensing 14:11:33 In our case the tag for GPLv3 or later 14:11:38 is GPLv3+ 14:11:46 mether: yes 14:11:50 mether: yes 14:12:01 so fill in that 14:12:13 done ! 14:12:16 mether: done 14:12:26 Note that Fedora only allows free and open source applications and we treat licenses very carefully 14:12:57 alright 14:12:59 lets move on 14:13:12 next is Source: 14:13:17 sorry i am late... 14:13:26 this is simply the location of the tarball 14:13:30 where did you download it from 14:13:40 mether: its URL before source 14:13:41 mether, URL? 14:13:41 In our case 14:13:43 http://ftp.gnu.org/gnu/hello/hello-2.5.tar.gz 14:13:46 logs for late comers -> http://meetbot.fedoraproject.org/fedora-india/2010-04-16/rpm_packaging_workshop.2010-04-16-13.35.log.txt 14:13:46 http://ftp.gnu.org/gnu/hello/hello-2.6.tar.gz 14:13:52 shakti: ^ 14:13:54 can i start now?? 14:14:04 mether, difference between source and URL ? 14:14:06 URL: http://ftp.gnu.org/gnu/hello 14:14:06 URL is http://ftp.gnu.org/gnu/hello/hello-2.6.tar.gz ? 14:14:18 Source is the complete path 14:14:23 franciscod, maybe we can set the topic for the channel as the log url until this session ends? 14:14:44 * franciscod goes to tiny the url 14:14:49 URL is the home page of the project 14:14:57 Source is the source archive location 14:14:59 mether: ok 14:15:03 got it? 14:15:11 mether: yeah 14:15:12 yes 14:15:15 good 14:15:16 lets move on 14:15:24 %description 14:15:27 yes 14:15:27 is our next section 14:15:44 Basically a extended verison of Summary: that we filled up earlier 14:15:57 the README file in the source archive usually provides that 14:16:10 I have filled up 14:16:11 The "Hello World" program, done with all bells and whistles of a proper FOSS 14:16:11 project, including configuration, build, internationalization, helpfiles, etc. 14:16:20 ok ! 14:16:30 It is just a plain simple description of what the software is 14:16:45 alright 14:16:52 whats next? 14:16:58 % prep 14:17:08 right 14:17:10 mether , do we have to replace the "%description" with the actually description or place it below that 14:17:18 gotunandan, below 14:17:26 ok, done 14:17:39 done 14:17:47 ok 14:17:47 each tag/macro should be in seperate line right ? 14:17:48 so you all must be familiar with how we build a binary from a source 14:17:54 yes 14:18:11 usually the first is to untar the tarball 14:18:12 right 14:18:17 tar xvf foo.tar.gz 14:18:23 or tar.bz2 or whatever 14:18:40 %setup is a nice and simple RPM macro 14:18:43 or a shortcut 14:18:46 to simplify that step 14:19:04 it takes care of extracting the source 14:19:08 mether: that step ? 14:19:10 whether it is a gzipped tarball 14:19:17 or a bzip2 tarball 14:19:28 or many other formats like zip and LZMA 14:19:30 %setup 14:19:33 understands them all 14:19:40 and knows how to extract them 14:19:42 quite handy 14:19:45 ok 14:20:04 since %setup is smart and knows how to exact the tarball 14:20:09 we can just leave it as it is 14:20:19 you might notice the -q parameter 14:20:29 that is to keep it quiet 14:20:39 alright 14:20:40 lets move on 14:20:42 ok 14:20:44 mether: ok 14:20:51 mether, so not mandatory to place the extracting command under %prep? 14:20:52 * nmudgal_ raise hand 14:20:52 next step is %build 14:21:07 salvachn, no %setup is what does the extraction. 14:21:22 mether, so %prep can be empty? 14:21:27 salvachn, you can remove %setup and run tar xvf yourself but that is unnecessary 14:21:38 mether, okay 14:21:44 %prep section contains the macro called %setup 14:21:45 mether: what you mean by to keep it quiet ? 14:21:51 setup is not a separate section 14:21:55 * franciscod notes that it is always advised to use whatever macros are available 14:22:05 nmudgal_, no verbose output on terminal 14:22:09 rather than commands themselves 14:22:16 salvachn: ok 14:22:24 alright 14:22:26 franciscod, point taken. will remember. 14:22:28 everyone clear on %prep 14:22:38 yup 14:22:40 lets move to %build section 14:22:43 yup 14:22:54 after extracting the tarball 14:22:56 you usually run 14:23:00 configure command 14:23:03 ./configure 14:23:04 right 14:23:07 yes 14:23:10 instead of that command 14:23:12 yes 14:23:12 right ! 14:23:14 we have %configure macro 14:23:30 again the macro is a shortcut 14:23:36 and takes care of a number of details for us 14:24:15 * franciscod rpm --eval %configure 14:24:16 got it ! 14:24:22 where to install the binary 14:24:39 where to place the locale or translation files 14:24:42 all that is taken care of 14:24:46 by %configure macro 14:24:47 okay. 14:24:58 ok 14:25:07 ok 14:25:08 ohk 14:25:24 rpm --eval shows you exactly 14:25:28 what each macro does 14:25:45 and it is useful to understand what they do behind the scenes 14:25:56 but in our case, the macro does the right thing 14:26:03 and we need not worry about it 14:26:10 ok 14:26:11 next is make 14:26:22 instead of just calling make 14:26:25 we call 14:26:26 make %{?_smp_mflags} 14:27:08 mether: what is %{?_smp_mflags} ? 14:27:09 SMP stands for Symmetric multiprocessing 14:27:23 just a fancy way of saying use whatever CPU's are available 14:27:29 so if there is more than one 14:27:37 & what is mflags ? 14:27:41 use them all to build the binary 14:27:47 i just explained that 14:28:18 ok 14:28:24 Modern systems come with more than CPU 14:28:33 and using them all is more effective 14:28:37 than using a single one 14:28:44 make only uses one by default 14:28:47 hmm 14:28:54 the macro makes sure we use whatever is available on the system 14:29:12 next comes the %install section 14:29:13 ohk 14:29:23 ok 14:29:24 https://fedoraproject.org/wiki/Packaging/Guidelines#Parallel_make <- look up later 14:29:38 we have run make 14:29:43 next step is make install 14:29:48 but there is a bit of twist 14:30:17 we only want the software to be installed when we run rpm or yum 14:30:25 at this point we are simply trying to build a package 14:30:36 if you look under ~/rpmbuild 14:31:03 you will see a BUILDROOT directory 14:31:17 got it 14:31:31 we are going to tell make install 14:31:32 mether: that is empty 14:31:36 to install to that directory 14:31:41 when the package is being built 14:31:55 and we specify that using make install DESTDIR=$RPM_BUILD_ROOT 14:32:10 DESTDIR meaning destination directory 14:32:23 so everything that gets installed via rpm or yum is installed int BUILD directory ? 14:32:25 ok 14:32:26 and build root is a environmental variable 14:32:37 nmudgal_, when we build it, yes 14:32:43 it is a temporary place 14:32:57 you might also notice 14:32:58 rm -rf $RPM_BUILD_ROOT 14:32:59 mether: ok 14:33:15 ok 14:33:27 we dont want to leftovers from previous builds interrupting the current one 14:33:30 so we clean that 14:33:34 and then install into that 14:33:51 mether: ok 14:33:59 make sense? 14:34:08 mether, yup it does 14:34:13 yes 14:34:15 %install 14:34:15 rm -rf $RPM_BUILD_ROOT 14:34:15 make install DESTDIR=$RPM_BUILD_ROOT 14:34:17 okay. all is clear 14:34:26 this is how your %install section looks like 14:34:27 correct 14:34:27 surely it does 14:34:29 ok 14:34:39 ok 14:34:41 whats the next section 14:34:42 ok 14:34:50 %clean 14:34:52 %clean 14:34:53 %clean 14:34:57 %clean 14:35:01 post 14:35:04 right 14:35:05 clean 14:35:11 we are simply cleaning the build root again 14:35:26 ok 14:35:28 we really want the build root to be empty before and after the build 14:35:37 so that we are building in a pristine place 14:35:52 next is %files 14:36:02 ok 14:36:18 it is simply a list of all the files 14:36:22 that should be part of the package 14:36:31 we will come to that later 14:36:39 %changelog 14:36:45 is the next section 14:36:52 yes 14:37:04 we are going to describe what we have changed today 14:37:09 what is the date 14:37:10 yes 14:37:26 what is today's date 14:37:38 16th april 14:37:38 mether: apr 16,2010 14:37:39 16 April '10 14:37:41 mether: 16-04-2010 14:37:43 yep 14:37:47 mether: Fri 16 Apr 2010 14:37:50 so the format we need to fill is 14:38:37 * Fri Apr 16 2010 Full Name 14:38:44 mether: ok 14:38:48 followed by the version number 14:39:02 - 2.5-1 14:39:06 so it looks like 14:39:34 % Fri Apr 16 2010 Rahul Sundaram - 2.5-1 14:39:35 ok 14:39:38 2.5 is the version 14:39:43 1 is the release number 14:39:52 mether, ? 14:39:56 bamachrn, yes 14:40:02 mether` why % here ? 14:40:16 % is how we note that section 14:40:23 sorry 14:40:25 not percentage 14:40:27 * ? 14:40:28 * 14:40:43 Simply a standard way of writing a changelog 14:40:43 mether` ohk 14:40:50 mether: okay 14:40:52 mether, what will be mailme? 14:40:53 mether, I guess every changelog entry should start with a '*' right ? 14:41:07 bamachrn, thats just a example email address 14:41:08 mether, ok 14:41:13 gotunandan, correct 14:41:26 mether, ok got it 14:41:39 mether` ! 14:41:44 hakmn, yes 14:41:57 mether` why is '-' between .org> & version 14:42:20 again just a way of writing it. it is not strictly that format 14:42:22 its a standard changelog format 14:42:28 ohk 14:42:35 we are merely following a standard convention 14:42:43 ok 14:42:54 the next line 14:42:58 we describe 14:43:03 what we have actually done in this date 14:43:06 something like 14:43:19 - Initial Build 14:43:21 https://fedoraproject.org/wiki/Packaging:Guidelines#Changelogs <- refer later 14:43:32 done? 14:43:38 yp 14:43:42 done 14:43:45 now save the spec file 14:43:48 and exit 14:43:49 done 14:43:49 done 14:43:57 done 14:44:11 mether` ! 14:44:16 hakmn, yes 14:44:28 explain BuildRoot 14:44:46 done 14:45:03 BuildRoot is a temporary directory in which a package is being built 14:45:03 done 14:45:25 In the spec file a default value 14:45:26 is there 14:45:40 & how to change $RPM_BUILD_ROOT 14:45:45 Recent versions of RPM actually use 14:45:59 mether so it does define it ? BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) 14:46:02 rpmbuild/BUILDROOT by default 14:46:13 and completely ignores what is defined in the spec file 14:46:22 so you can delete that line entirely 14:46:27 and it wont make any difference 14:46:46 mether` but where to view this env var ? 14:46:49 nmudgal_, thats the default value, yes 14:47:06 rpmbuild will set that while it is building a package 14:47:20 ohk, gotta 14:47:33 rpmbuild is the command 14:47:42 we will be using to build a RPM package from a spec file 14:47:50 there are two different rpms of RPM's 14:47:53 Source and Binary 14:48:03 Source RPM's end with .srpm extension 14:48:11 Binary RPM's end with .rpm extension 14:48:24 Source RPM is basically the upstream source archive + your spec file 14:48:37 In some cases, it might also have patches in it 14:48:38 mether: isnt source .src.rpm now 14:49:22 yep 14:49:34 it goes into the directory SRPM still 14:49:53 mether` upstream' source archive ? 14:49:53 rpmbuild can build both these 14:49:54 packages 14:50:12 Upstream = place where you downloaded the source from 14:50:14 in our case 14:50:27 http://www.gnu.org/software/hello/ 14:50:32 mether: ok got it ! 14:50:44 oh 14:50:50 is that clear? 14:50:55 okay. 14:50:55 yeah 14:50:57 mether: yes 14:50:58 yup, 14:51:01 mether` ! 14:51:06 hakmn, ask 14:51:17 what to do with BuildRequires & Requires ? 14:51:24 I will come to that 14:51:31 lets actually try to build the package 14:51:35 using rpmbuild 14:51:35 ok 14:51:44 ok 14:51:46 dont be surprised. it will not work yet 14:51:56 :) 14:52:16 you run the command 14:52:21 rpmbuild -ba hello.spec 14:52:26 -ba = build all 14:52:36 meaning build both the binary and source 14:52:50 run that 14:53:01 mether, error: line 12: Empty tag: BuildRequires: 14:53:04 shall i comment out build requers ? 14:53:08 yep 14:53:11 mether: it show error line 12: Empty tag: BuildRequires: 14:53:12 requires* 14:53:26 add a # in front of both BuildRequires and Requires 14:53:27 yes 14:53:38 we are merely commenting it out 14:53:43 telling rpmbuild 14:53:45 to ignore it 14:53:51 by adding a # in front of it 14:53:54 mether: and require too? 14:53:54 done? 14:53:57 yes 14:53:58 both 14:53:59 done 14:54:02 ok done 14:54:04 ok 14:54:04 mether: oops I mes up my time.Is there anyway to join now? sorry. 14:54:07 try running rpmbuild again 14:54:26 balachandarkm, see /topic for the logs 14:54:28 done 14:54:37 what do we get this time 14:54:53 error: %changelog entries must start with * 14:54:55 mether: i get error: File /root/rpmbuild/SOURCES/hello-2.6.tar.gz: No such file or directory when run command 14:55:04 no errors 14:55:11 nmudgal_, what version did you download 14:55:14 mether: error: no description in %changelog 14:55:15 i am using 2.5 14:55:21 done :) 14:55:29 * yevlempy is also done 14:55:33 gotunandan, show me your spec file 14:55:36 it is 2.1.1 mether 14:55:40 gotunandan: 2.6 14:55:48 2.5 is what i am using 14:55:52 2.6 should also work fine 14:55:57 but what you have downloaded 14:55:59 should match 14:56:03 what you specify in the spec file 14:56:10 stick to one version 14:56:10 mether, I get "error: Installed (but unpackaged) file(s) found" 14:56:12 mether:http://ftp.gnu.org/gnu/hello/hello-2.6.tar.gz 14:56:20 we gave this link earlier 14:56:25 mether` ! 14:56:27 morpheuss, you did, yes 14:56:31 hakmn, ask 14:56:32 error: bad date in %changelog: Fri 16 Apr 2010 14:56:39 mether: yeah.. 14:56:41 Apr 16 14:56:43 not 16 Apr 14:56:45 hakmn, you forgot the * in front 14:56:57 ? 14:57:09 mether: rpmlint on spec? later? 14:57:14 mether, 16 Apr spewed an error for me. 14:57:19 franciscod, one thing at time. patience 14:57:30 mether. here http://pastie.org/923260 14:57:41 * Fri Jun 23 2006 Jesse Keating - 0.6-4 <- example 14:57:44 salvachn, yes the order is important 14:57:55 mether ! error: File ~/rpmbuild/SOURCES/hello-2.5.tar.gz: No such file or directory 14:58:07 mether, I get this one: "error: Installed (but unpackaged) file(s) found" 14:58:15 salvachn, thats the right error 14:58:15 done 14:58:23 mether, :-) 14:58:29 BANSAL, you need to download the source 14:58:49 and move it into rpmbuild/SOURCES 14:58:59 mether, I am using hello-2.5 14:58:59 BANSAL, you seemed to have missed that step 14:59:06 gotunandan, you forgot to describe 14:59:09 what you have done 14:59:10 mether i have done that ... 14:59:10 i am pasting my hello.spec file for reference "http://fpaste.org/tGyV/" i got things dome right 14:59:11 on that date 14:59:14 erro/error 14:59:14 mether: now i m using 2.5 but still same erro 14:59:19 s/dome/done 14:59:24 i have hello2.5 directory there ... 14:59:27 one at a time folks 14:59:44 gotunandan, let me answer you first 14:59:47 BANSAL: you have the tar in ther too right? 14:59:50 you need to add a description 14:59:56 - Initial build 15:00:03 after the date 15:00:07 next line 15:00:18 franciscod: under SOURCE ? 15:00:20 mether : yes... right, that was daft :) 15:00:30 gotunandan, do that and run rpmbuild again 15:00:36 BANSAL: yes, you need to have the tar in the SOURCE directory too, 15:00:42 if you get the same error as salvachn we are good for the next step 15:00:46 not just the untarred directory 15:00:50 franciscod: ohhh.. ok.. 15:01:00 nmudgal_: same as BANSAL 15:01:05 ? 15:01:19 franciscod: no i have tar extracted in SOURCES/ 15:01:20 rpmbuild says 15:01:31 nmudgal_: do you have the tar too? 15:01:42 it cannot access ~/rpmbuild/SOURCES/hello-2.5.tar.gz 15:01:47 franciscod: no ! 15:01:50 run ll against that location 15:01:53 mether, yes got it : RPM build errors: Installed (but unpackaged) file(s) found: 15:01:56 you need the tarball 15:01:59 rpmbuild does not use the untarred direcrtory, it has to have the tar too 15:02:07 gotunandan, correct. we have the right error :-) 15:02:48 BANSAL, and nmudgal_ the unextracted tarball needs to be in ~/rpmbuild/SOURCES 15:02:58 extracted directory is not enough 15:03:03 we are building from the tarball 15:03:06 franciscod: but it stuck on same error i have now tar too in the dir 15:03:06 not a directory 15:03:13 mether done !! 15:03:23 BANSAL, what error do you get now? 15:03:47 mether nothing !! i have done that .. 15:03:58 BANSAL, run rpmbuild -ba on the spec file 15:04:01 nmudgal_: ls SOURCES/ | fpaste 15:04:15 mether: why this if i am doing with v2.5 ? /root/rpmbuild/SOURCES/hello-2.6.tar.gz: No such file or directory 15:04:24 i build that without error after that no package in SRPMS and RPMS ? am i done some wrong step? 15:04:26 nmudgal_, show me your spec file 15:04:41 praveenkumar, we are not done yet. there is still some things to be done 15:04:52 if you are running rpmbuild -ba hello.spec 15:04:56 do you get any output 15:04:56 mether: ok 15:04:57 at all 15:05:14 mether: i have run the command ... no errors .. 15:05:24 BANSAL, show me your spec file 15:05:29 mether: http://fpaste.org/2c8M/ 15:05:57 mether: i also run command and no error occur 15:05:59 nmudgal_, i spotted your mistake 15:06:09 praveenkumar, show your spec as well 15:06:12 mether: what ? 15:06:15 nmudgal_, see if you can 15:06:17 where is 2.6 15:06:20 in that spec file 15:06:34 mether: no 2.6 15:06:35 why is rpmbuild looking for 2.6 15:06:39 mether http://www.fpaste.org/TW5Y/ 15:06:43 there is certainly one instance of 2.6 15:06:49 nmudgal_, search again 15:07:16 * morpheuss nods 15:07:52 BANSAL: rpm -ba right? 15:07:54 mether: yes source url ! 15:07:55 not bs? 15:08:04 nmudgal_, yep. fix it 15:08:11 franciscod, ba correct 15:08:22 BANSAL, are you running rpmbuild -ba hello.spec 15:08:28 you too praveenkumar 15:08:30 what does it say when you run that? 15:08:42 mether: after running rpmdev-setuptree I don't get the dir structure. 15:08:47 mether: i have run it already !! 15:08:58 BANSAL: and? 15:09:04 mether: is it compulsary to run in home dir 15:09:08 mether: okay but with no error 15:09:13 mether: yeah i run rpmbuild -ba hello.spec 15:09:25 balachandarkm: ls ~/ | fpaste 15:09:37 http://www.fpaste.org/utvE/ 15:09:54 franciscod: it's not showing any error .. just executed .... 15:10:16 franciscod: yes no error & execution ! 15:10:18 franciscod: i send you the result ~!! 15:10:23 franciscod : fpaste command not found. 15:10:46 balachandarkm: yum install fpaste 15:10:49 balachandarkm: er.. please paste the file contents to fpaste.org 15:10:51 fransiscod: do I need to install any other than fedora-packager 15:11:03 balachandarkm, what version of fedora? 15:11:12 mether: fedora 11 15:11:15 BANSAL: tell me the output of the command, whatever it says 15:11:19 yum install fpaste then 15:11:24 fedora 12 installs it by default 15:11:34 nmudgal_: you too, 15:11:35 i am having the same file what bansal has but still i am getting the error (what mether is saying that "we supposed to get that error") 15:11:38 franciscod: http://www.fpaste.org/2OW7/ 15:11:39 mether: i got no error like others do ! & clear execution ! 15:12:00 nmudgal_, please show us the output 15:12:11 BANSAL: rpm -q gcc | fpaste 15:12:34 mether: he doenst have gcc installed looks like :) 15:12:45 mether: http://fpaste.org/36id/ 15:13:03 mether: after build we have show the output also if we got no error? 15:13:08 nmudgal_, you do have that error 15:13:22 nmudgal_, scroll up a bit 15:13:24 and you will see 15:13:25 RPM build errors: 15:13:26 Installed (but unpackaged) file(s) found: 15:13:27 nmudgal_: line 448 15:13:29 see that? 15:13:39 franciscod:you are right .. i don't have ... 15:13:46 BANSAL, do install it 15:13:49 quick way to do it 15:13:50 is 15:13:55 mether: doing .. 15:13:58 mether: okay 15:13:59 BANSAL: yum groupinstall "Development Tools" 15:13:59 yum install @development-tools 15:14:01 methor: I got no error after executing rpmdev-setuptree 15:14:03 done ! 15:14:09 mether: no dirs too 15:14:12 mether` !, just got after elec failed 15:14:22 hakmn, what 15:14:23 balachandarkm: you wont get an error, 15:14:30 error: no description in %changelog 15:14:40 ls ~/ | fpaste 15:14:40 hakmn, you too have missed the last line 15:14:46 - Initial build 15:14:55 that should be the very last line 15:15:08 mether` * Fri Apr 16 2010 Ayush Maheshwari - 2.5-1 15:15:16 hakmn, add a line after that 15:15:20 - Initial build 15:15:23 mether: ok i also got same error "RPM build errors: Installed (but unpackaged) file(s) found:" now what we do? 15:15:29 ok 15:15:40 praveenkumar, congratulations. now wait :-) 15:15:48 hakmn: a change log is to tell people why this change was made, in this case, its a new rpm, 15:15:49 mether: ok 15:15:50 let everyone get the same error 15:15:55 so the description is necessary 15:16:00 and we can move to the next step 15:16:01 mether: ls ~/ | fpaste What this command will do ?? 15:16:07 yup success 15:16:12 mether: ok 15:16:13 hakmn, same error 15:16:14 ok 15:16:22 same error for everyone at this point 15:16:29 balachandarkm: it will pste the contents of ls ~/ to fpaste.org so i can see it 15:16:32 yep 15:16:43 other than balachandarkm everyone is on the same step? 15:16:45 yes mether 15:16:53 salvachn, 15:17:02 gotunandan, 15:17:11 mether, yup 15:17:16 fransiscod : is it compulsory to do it in home directory ? 15:17:16 alright good 15:17:28 balachandarkm, preferable 15:17:29 balachandarkm: no , i dont recall that requirement 15:17:33 is there a problem with that 15:17:42 run it in any directory 15:17:53 it will just create a rpmbuild directory 15:17:57 where you run that command 15:18:10 balachandarkm, i will come to you later 15:18:13 lets move on 15:18:19 why are we getting that error 15:18:21 any ideas? 15:18:27 what does it mean 15:18:34 * franciscod hint : error description ;) 15:18:37 mether: because we just have spec file ? 15:18:40 translations... 15:18:58 exactly as nmudgal_ 15:19:02 nmudgal_,we only need a spec file to build the package 15:19:06 the error is 15:19:13 error: Installed (but unpackaged) file(s) found: 15:19:19 * franciscod hints again : error *description* 15:19:24 what rpmbuild is trying to tell you 15:19:25 is this 15:19:34 you didnt fill in the %files section yet 15:19:44 ohh 15:19:50 ok 15:19:50 oh 15:19:52 :( 15:20:01 but which files ? 15:20:18 all the files that are part of the compilation 15:20:18 doc readme copying etc., 15:20:20 all the files mentioned there i guess ? 15:20:25 rpmbuild is listing them all 15:20:34 /usr/bin/hello 15:20:34 /usr/share/info/dir 15:20:34 /usr/share/info/hello.info.gz 15:20:34 /usr/share/locale/bg/LC_MESSAGES/hello.mo 15:20:34 /usr/share/locale/ca/LC_MESSAGES/hello.mo 15:20:35 /usr/share/locale/da/LC_MESSAGES/hello.mo 15:20:36 /usr/share/locale/de/LC_MESSAGES/hello.mo 15:20:38 /usr/share/locale/el/LC_MESSAGES/hello.mo 15:20:42 /usr/share/locale/en@boldquot/LC_MESSAGES/hello.mo 15:20:44 /usr/share/locale/en@quot/LC_MESSAGES/hello.mo 15:20:46 /usr/share/locale/eo/LC_MESSAGES/hello.mo 15:20:48 /usr/share/locale/es/LC_MESSAGES/hello.mo 15:20:50 /usr/share/locale/et/LC_MESSAGES/hello.mo 15:20:52 /usr/share/locale/eu/LC_MESSAGES/hello.mo 15:20:54 /usr/share/locale/fa/LC_MESSAGES/hello.mo 15:20:56 /usr/share/locale/fi/LC_MESSAGES/hello.mo 15:20:58 /usr/share/locale/fr/LC_MESSAGES/hello.mo 15:21:00 /usr/share/locale/ga/LC_MESSAGES/hello.mo 15:21:02 /usr/share/locale/gl/LC_MESSAGES/hello.mo 15:21:04 /usr/share/locale/he/LC_MESSAGES/hello.mo 15:21:06 /usr/share/locale/hr/LC_MESSAGES/hello.mo 15:21:08 /usr/share/locale/hu/LC_MESSAGES/hello.mo 15:21:12 /usr/share/locale/id/LC_MESSAGES/hello.mo 15:21:14 /usr/share/locale/it/LC_MESSAGES/hello.mo 15:21:16 /usr/share/locale/ja/LC_MESSAGES/hello.mo 15:21:18 /usr/share/locale/ka/LC_MESSAGES/hello.mo 15:21:20 /usr/share/locale/ko/LC_MESSAGES/hello.mo 15:21:22 /usr/share/locale/lv/LC_MESSAGES/hello.mo 15:21:24 /usr/share/locale/ms/LC_MESSAGES/hello.mo 15:21:26 /usr/share/locale/nb/LC_MESSAGES/hello.mo 15:21:28 /usr/share/locale/nl/LC_MESSAGES/hello.mo 15:21:30 /usr/share/locale/nn/LC_MESSAGES/hello.mo 15:21:32 /usr/share/locale/pl/LC_MESSAGES/hello.mo 15:21:34 /usr/share/locale/pt/LC_MESSAGES/hello.mo 15:21:36 /usr/share/locale/pt_BR/LC_MESSAGES/hello.mo 15:21:37 mether : ok I ll follow the log files. 15:21:38 /usr/share/locale/rm/LC_MESSAGES/hello.mo 15:21:42 /usr/share/locale/ro/LC_MESSAGES/hello.mo 15:21:44 /usr/share/locale/ru/LC_MESSAGES/hello.mo 15:21:46 /usr/share/locale/sk/LC_MESSAGES/hello.mo 15:21:48 /usr/share/locale/sl/LC_MESSAGES/hello.mo 15:21:50 /usr/share/locale/sr/LC_MESSAGES/hello.mo 15:21:52 /usr/share/locale/sv/LC_MESSAGES/hello.mo 15:21:54 /usr/share/locale/th/LC_MESSAGES/hello.mo 15:21:56 /usr/share/locale/tr/LC_MESSAGES/hello.mo 15:21:58 /usr/share/locale/uk/LC_MESSAGES/hello.mo 15:22:00 /usr/share/locale/vi/LC_MESSAGES/hello.mo 15:22:02 /usr/share/locale/zh_C 15:22:04 mether: did you paste the entire error output?? 15:22:04 Sorry for the long output 15:22:06 I should have used fpaste 15:22:08 here you go 15:22:10 my bad, man pages 15:22:12 http://fpaste.org/k0Mb/ 15:22:14 everyone seeing that? 15:22:16 balachandarkm, yes. please follow it from the start and we will get to the portion 15:22:18 mether: we are building it through tarball then it have all the files in that then why need it seperately ? 15:22:20 ok 15:22:34 nmudgal_, we are not necessarily going to include everything 15:22:42 nmudgal_: the files are lying in the buildroot directory, ready to be put into the rpm :) 15:23:03 %files section 15:23:10 has a few different important attributes 15:23:15 it specifies not just a list of files 15:23:20 franciscod: ok seen ! 15:23:20 but also what permissions they have 15:23:31 and which files are documentation 15:23:37 etc 15:23:54 you see in http://fpaste.org/k0Mb/ 15:24:04 a long list 15:24:09 lets break them one by one 15:24:20 whats the file line 15:24:24 first line 15:24:45 in the long list of files 15:24:49 what is the very first file 15:24:55 yes 15:25:03 mether, the hello executable 15:25:05 binary of hello 15:25:08 yep 15:25:12 /usr/bin/hello 15:25:16 yes 15:25:19 we are going to be using some macros 15:25:24 to simplify things once more 15:25:41 * salvachn is back from partially eating, and part looking at the conversation 15:25:52 right after 15:25:55 %defattr 15:25:59 add 15:26:02 %{_bindir}/hello 15:26:14 the bindir macro stands for /usr/bin 15:26:34 the list of standard macros are at http://fedoraproject.org/wiki/Packaging/RPMMacros 15:26:44 salvachn, you got unpackaged files error. correct? 15:26:52 salvachn, i am just telling how to fix that 15:26:54 mether, yes 15:27:06 everyone added 15:27:09 [Ankur1@localhost ~]$ rpm --eval %{_bindir} 15:27:09 /usr/bin 15:27:13 I was looking here during dinner. 15:27:16 mether: yes 15:27:19 mether: yes added 15:27:21 whats the next file 15:27:49 /usr/share/info/dir is next 15:27:50 /usr/share/info/dir 15:28:03 /usr/share/info/dir 15:28:10 yes 15:28:12 and after that 15:28:30 /usr/share/info/hello.info.gz 15:28:33 yep 15:28:38 anyone knows what that is? 15:28:43 what is a info file? 15:29:04 --info page 15:29:14 yep 15:29:18 it is show the information the packge is intalled or not or version info 15:29:24 info foo 15:29:31 GNU uses info files to describe what a particular software does 15:29:36 similar to man pages 15:29:42 but more descriptive 15:29:43 alright 15:29:48 so it is part of documentation 15:29:48 mether: hmm 15:29:50 yep 15:29:53 we need to tell RPM that 15:30:00 we use the %doc attribute for that 15:30:05 so add 15:30:06 %doc %{_mandir}/man1/hello.1.gz 15:30:11 * hakmn eating while building :) 15:30:14 oops 15:30:16 wrong line 15:30:17 %doc %{_infodir}/%{name}.info.gz 15:30:29 add %doc %{_infodir}/%{name}.info.gz 15:30:37 right after bindir 15:30:50 we are telling RPM hey 15:30:55 mether, %doc is empty in the default spec file. 15:30:55 below it or just a space 15:30:59 info file is part of our documentation 15:31:06 mether: please add the entire log file to your blog once the class is over.I should have come earlier.Bye. 15:31:08 salvachn, yes fill it up 15:31:14 balachandarkm, sure 15:31:33 done? 15:31:35 mether: should i overwrite %doc? 15:31:37 everyone added 15:31:39 %doc %{_infodir}/%{name}.info.gz 15:31:40 yes 15:31:40 yeah 15:31:46 ok 15:32:10 you see a very large list 15:32:14 of .mo files 15:32:16 after that 15:32:20 right? 15:32:22 yeah 15:32:25 right 15:32:26 we will come to that later 15:32:29 what is the very last file 15:32:33 after all the mo files? 15:32:37 mether and man page file at the end 15:32:40 yep 15:32:44 just like a info file 15:32:49 man page is also part of the documentation 15:32:55 so we need to tell rpm that as well 15:32:59 yes ! 15:33:02 /usr/share/man/man1/hello.1.gz 15:33:04 add 15:33:05 %doc %{_mandir}/man1/hello.1.gz 15:33:26 added 15:33:26 again we are using macros instead of the direct path 15:33:29 done 15:33:36 only thing left is translation files 15:33:40 the .mo files 15:33:43 mether, yup 15:33:44 yes 15:34:15 yep 15:34:22 yes 15:34:25 mether, mo files are what we get after compiling portable object (po) files, right? 15:34:36 salvachn, yep. exactly 15:34:43 po files are the text files 15:34:45 mo 15:34:55 is the result 15:34:56 mether: i din't get salvachn please elaborate ! 15:35:00 after compiling the po files 15:35:32 PO (portable object) is the text format 15:35:34 translators 15:35:54 use to translate a software in linux 15:36:04 essentially we extract all the strings 15:36:09 that should be translated 15:36:12 into a separate file 15:36:15 and give that to translators 15:36:23 who fill it up 15:36:43 does that make sense? 15:36:49 mether: yes 15:36:55 yup 15:37:10 mether` ! 15:37:13 we use what is called the gnu gettext library 15:37:15 for doing this 15:37:21 pretty much all the linux programs 15:37:25 use this library 15:37:32 mether` whats the command 15:37:39 hakmn, what command 15:37:48 for doing this translation 15:38:25 there are multiple editors 15:38:54 like ? 15:38:57 kbabel 15:39:00 gtranslator 15:39:01 poedit 15:39:03 and others 15:39:28 we will do a separate workshop on L10N (localization) later 15:39:30 lets get back 15:39:33 to building our package 15:39:45 mether: okay ! 15:39:49 we have a long list of mo files 15:39:50 yes 15:39:54 yes 15:40:20 yes 15:40:29 yes 15:40:37 we can use something like /usr/share/locale/*/LC_MESSAGES/hello.mo 15:40:45 to catch them all 15:40:49 but there is a even better 15:40:50 ok 15:40:51 shortcut 15:40:59 macro ? 15:41:15 must be ! :) 15:41:21 again use macro ? 15:41:40 described 15:41:41 at 15:41:42 https://fedoraproject.org/wiki/Packaging:Guidelines#Handling_Locale_Files 15:41:45 yep 15:41:49 a macro as usual :-) 15:42:01 as I said earlier 15:42:08 we are using the gnu gettext library 15:42:15 so we need to add a dependency 15:42:23 we need it to build the package 15:42:28 not run the package 15:42:40 so it is BuildRequires: gettext 15:42:48 there are two types of dependencies 15:42:50 %BuildRequires comes into play ? 15:42:53 rihgt ok 15:42:54 what we need to compile the package 15:42:59 what we need to run the package 15:43:12 for example you need a compile to build a package 15:43:19 you dont need it while running the binary 15:43:24 so we have BuildRequires: 15:43:28 and Requires 15:43:37 BuildRequires: gettext 15:43:40 means 15:43:51 we need that library 15:44:01 to handle the translation parts of the hello program 15:44:05 which are called locale files 15:44:10 clear? 15:44:15 everyone added that? 15:44:16 so mether is it installed already in fedora ? 15:44:17 yep 15:44:20 yea 15:44:31 nmudgal_, yes 15:44:35 yes 15:44:42 so 15:44:43 mether: i need to go out to eat dinner, mess etc will close other wise. 15:44:44 next step 15:44:49 franciscod, go ahead 15:45:08 in the %install section 15:45:10 add 15:45:12 %find_lang %{name} 15:45:21 find the language or locale files 15:45:27 from the package name which is hello 15:45:33 thats what the macro means 15:45:37 clear? 15:45:46 clear ! 15:45:55 that has a counter part in the files section 15:45:56 yes 15:46:01 %files -f %{name}.lang 15:46:20 add -f %{name}.lang 15:46:24 to the %files line 15:46:27 done? 15:46:31 done 15:46:35 why counter ? 15:46:54 find_lang collects the files 15:47:11 %{name}.lang 15:47:16 adds it to %files section 15:47:27 so find all the locale files 15:47:32 and add it to %files 15:47:39 is what we are telling rpmbuild 15:47:42 via the macro 15:47:43 clear? 15:47:49 ok 15:47:51 yup 15:47:52 ok 15:47:57 nmudgal_, does that make sense? 15:48:04 mether: yup 15:48:14 so instead of specifying a long long list 15:48:16 of mo files 15:48:27 the %files section is just -f ..... or %files -f .... ? 15:48:33 we simply use a smart macro 15:48:44 gotunandan, whats the diff 15:48:55 it is the latter 15:49:13 so the line should look 15:49:13 %files -f %{name}.lang 15:49:15 done? 15:49:17 everyone? 15:49:19 ok 15:49:21 done 15:49:21 done 15:49:22 yup 15:49:24 yup 15:49:26 yeah 15:49:32 lets get our baby building again 15:49:34 one more time 15:49:39 ok 15:49:40 rpmbuild -ba hello.spec 15:49:43 ok 15:50:00 * yevlempy is sorry had to go urgent 15:50:10 go ahead 15:50:14 you can read the logs later 15:50:20 mether: error again 15:50:25 what error this time 15:50:32 /usr/share/info/dir is not found 15:50:38 mether: error 15:50:39 everyone getting the same error? 15:50:48 Installed (but unpackaged) file 15:50:51 info file error 15:51:04 mether, add this one too to %doc ? 15:51:04 mether: nopes 15:51:05 /usr/share/info/hello.info.gz not found 15:51:20 man error too 15:51:24 hakmn, %doc %{_infodir}/%{name}.info.gz 15:51:26 is it ? http://fpaste.org/1ay1/ 15:51:28 "error: Bad exit status from /var/tmp/rpm-tmp.Rc4h9o (%install)" 15:51:32 %doc %{_mandir}/man1/hello.1.gz 15:51:40 hakmn, you forgot 15:51:56 praveenkumar, clear the files as root and then try 15:51:59 nmudgal_, you also forgot 15:52:31 the %files section should look like this 15:52:32 %files -f %{name}.lang 15:52:32 %defattr(-,root,root,-) 15:52:32 %{_bindir}/hello 15:52:32 %doc %{_mandir}/man1/hello.1.gz 15:52:32 %doc %{_infodir}/%{name}.info.gz 15:52:43 salvachn: using yum clean all ? 15:52:47 salvachn, nmudgal_ praveenkumar make sure of that 15:52:49 mether: no i didn't 15:52:51 praveenkumar, no. 15:53:06 praveenkumar, did u run rpmbuild as root? 15:53:40 mether, those four lines are in verbatim in my spec file. 15:53:41 i dont think we need to be root for any of this ? 15:53:48 we never should be 15:53:50 root 15:53:52 salvachn: nopes normal user mode 15:53:54 gotunandan, we dont need be 15:53:56 while building a package 15:54:17 /usr/share/info/dir is not found 15:54:20 is the right error 15:54:20 praveenkumar, remove all files in BUILDROOT directory under rpmbuils 15:54:24 mether` now 1 error or /info/dir only :) 15:54:27 everyone getting it? 15:54:32 one error : RPM build errors: Installed (but unpackaged) file(s) found: /usr/share/info/dir 15:54:33 yes 15:54:33 sure 15:54:33 salvachn: ok 15:54:42 praveenkumar, you check too 15:54:50 mether: checking 15:54:59 gotunandan, correct 15:55:02 mether: http://fpaste.org/1ay1/ these are my errors 15:55:26 nmudgal_, show your spec 15:55:38 so we forgot to specify a directory 15:55:39 nmudgal_` %files -f %{name}.lang 15:55:39 %defattr (-,root,root,-) 15:55:39 %{_bindir}/hello 15:55:39 %doc %{_infodir}/%{name}.info.gz 15:55:39 %doc %{_mandir}/man1/hello.1.gz 15:55:50 mether: http://fpaste.org/JamD/ 15:55:51 we shouldnt be including that in our package at all 15:55:57 we need to remove it 15:56:06 praveenkumar, delete files under BUILD and BUILDROOT directories. 15:56:07 because it is common across all software with info files 15:56:11 and will conflict with other packages 15:56:16 how do we remove it? 15:56:17 simple 15:56:37 to the %install section 15:56:38 add 15:56:39 rm -f $RPM_BUILD_ROOT%{_infodir}/dir 15:56:46 everyone do that 15:56:51 salvachn: same error 15:57:11 praveenkumar, check your %install section 15:57:25 nmudgal_, you have two %files 15:57:37 nmudgal_, you need to replace the first instance with the second instance 15:57:42 so instead of %files 15:57:45 yeah 15:57:46 at the top 15:57:55 replace it with 15:57:56 %files -f %{name}.lang 15:58:05 nmudgal_, do that 15:58:08 and also add 15:58:14 rm -f $RPM_BUILD_ROOT%{_infodir}/dir 15:58:19 to the %install section 15:58:22 everyone done? 15:58:27 done 15:58:28 yeah 15:58:34 yup 15:58:40 rpmbuild -ba again 15:58:50 can anyone help me with whats the support channel 15:58:59 dilipkhanolkar, #fedora 15:59:03 salvachn: http://www.fpaste.org/u6qD/ 15:59:13 mether, generated binary and source rpms :-) 15:59:27 everyone able to get binary and source rpms?? 15:59:49 yes 16:00:00 mether: now this http://fpaste.org/XxJV/ 16:00:02 praveenkumar, add the lines to %install. 16:00:03 anyone still has errors? 16:00:11 the empty section throws errors 16:00:14 same error 16:00:22 salvachn: which one 16:00:28 mether` exit 0 :) 16:00:34 praveenkumar, one sec 16:00:34 nmudgal_, you forgot find_lang macro 16:00:37 in your spec file 16:00:44 salvachn: ok 16:00:55 nmudgal_, your %install section should have %find_lang %{name} 16:01:02 nmudgal_, add that please 16:01:18 praveenkumar, http://www.fpaste.org/xyhb/ 16:01:21 anyone else has errors? 16:01:37 mether : http://fpaste.org/Teog/ 16:01:57 gotunandan, any errors? 16:02:00 RPM build errors: Installed (but unpackaged) file(s) found: /usr/share/info/dir 16:02:12 rm rm -f $RPM_BUILD_ROOT%{_infodir}/dir 16:02:16 should be after make install 16:02:17 mether: still error same as gotunandan 16:02:18 not before it 16:02:36 praveenkumar, edit your %install section 16:02:36 ok 16:02:39 because the directory is getting created by make install 16:02:42 if you remove it 16:02:47 make will add it again 16:02:53 and we are back to square one :-) 16:02:57 the order is important 16:02:58 salvachn: ok 16:03:06 everyone fix that 16:03:15 and you will finally able to build the rpm 16:03:21 mether: my spec http://fpaste.org/Z5Y8/ 16:03:46 mether, built 16:03:57 mether, built rpms. 16:04:02 nmudgal_, you are still getting it wrong 16:04:15 nmudgal_: %files -f %{name}.lang <-- remove thsi line from install 16:04:15 nmudgal_, you see a %files line? 16:04:31 replace that with 16:04:32 %files -f %{name}.lang 16:04:40 mether: please clearify ! 16:04:41 remove it from %install 16:05:02 praveenkumar, whats your status 16:05:21 mether: "File not found: /home/daredevil/rpmbuild/BUILDROOT/hello-2.6-1.fc12.i386/usr/bin.info.gz}/hello" 16:05:37 mether, praveenkumar's spec uses hello 2.6 16:05:40 praveenkumar, show me your spec. it has a typo 16:05:59 { missing i guess 16:06:02 you are mixing up two lines 16:06:06 definitely 16:06:14 or }} double 16:06:22 praveenkumar, show me your spec 16:06:26 mether: should i add %files line in %files section ? 16:06:29 nmudgal_, you fixed it? 16:06:40 salvachn, show nmudgal_ your spec file 16:06:43 praveenkumar, remove .bin.info.gz from bin_dir 16:06:48 nmudgal_: replace %file with %files -f %{name}.lang 16:06:59 * salvachn pointd nmudgal_ to http://www.fpaste.org/xyhb/ 16:06:59 remove %files -f %{name}.lang from %install 16:07:18 nmudgal_, check your spec againstwhat salvachn has provided and fix it 16:07:54 everyone except praveenkumar and nmudgal_ got the rpms? 16:08:03 mether: http://www.fpaste.org/hALq/ 16:08:12 mether: done 16:08:18 yeah done 16:08:30 praveenkumar, you messed up %{_bindir}.info.gz}/hello 16:08:38 it should 16:08:54 praveenkumar, change line 40 16:08:56 %{_bindir}/hello 16:09:00 remove .info.gz 16:09:00 mether: i was getting you wrong ! :) 16:09:09 nmudgal_, yeah. i understood that 16:09:25 praveenkumar, you are close. just fix that line and you are with everyone else 16:09:38 now folks. just because you got the binary rpms 16:09:40 doesnt mean 16:09:43 you got it right 16:09:46 we need to check 16:09:49 lint? 16:09:52 mether: done 16:09:56 in fact all of you have to fix one important thing 16:10:02 praveenkumar, able to build 16:10:09 info files go into a info database 16:10:10 mether: what is that ? 16:10:17 and there is a command 16:10:17 mether: yeah got roms 16:10:19 install-info 16:10:20 cd .. 16:10:20 for that 16:10:28 we need to make some more modifications 16:10:34 to handle 16:10:44 this time info is a run time requirement for hello program 16:10:46 meaning 16:10:51 if you want to see the info pages 16:10:57 you need the info software 16:10:59 so 16:11:02 Requires 16:11:03 * salvachn thinks a video tour of building a rpm will be great for new users. 16:11:18 compare 16:11:21 what you all already have 16:11:23 with 16:11:24 https://fedoraproject.org/wiki/A_Short_RPM_Tutorial 16:11:27 the spec in 16:11:41 first it adds 16:11:42 Requires(post): info 16:11:42 Requires(preun): info 16:11:48 everyone do that 16:12:01 then 16:12:06 after the %install section 16:12:08 you see 16:12:09 %post 16:12:09 /sbin/install-info %{_infodir}/%{name}.info %{_infodir}/dir || : 16:12:09 %preun 16:12:09 if [ $1 = 0 ] ; then 16:12:09 /sbin/install-info --delete %{_infodir}/%{name}.info %{_infodir}/dir || : 16:12:11 fi 16:12:21 these two modifications 16:12:29 handle the info files appropriately 16:12:40 i will explain it a bit more in detail 16:12:44 but just do it for now 16:12:51 and rebuild your spec file 16:13:03 anyone done that already? 16:13:06 add these lines mether 16:13:13 yes 16:13:36 everyone copy paste that 16:13:45 requires and %post and %preun 16:13:54 once you are done 16:13:58 mether, done 16:14:00 run rpmbuild again 16:14:01 built 16:14:05 you get binary and source rpms 16:14:11 congrats 16:14:21 you managed to build your first perfect package 16:14:30 :) 16:14:32 how do we know it actually works 16:14:38 one simple way is to install 16:14:39 it 16:14:54 mether, rpmlint ? 16:14:56 sudo rpm -ivh 16:15:02 salvachn, i am coming to that 16:15:06 but lets install and check it 16:15:07 works 16:15:08 first 16:15:09 okay. 16:15:20 after you install 16:15:21 it 16:15:22 run 16:15:23 mether, it works. am installing the rpm to a VM just in case :-) 16:15:23 hello 16:15:30 salvachn, thats good 16:15:51 everyone built and installed? 16:16:22 mether: done :) 16:16:25 run 16:16:26 hello 16:16:29 mether` done 16:16:31 mether, does everyone use sudo? I prefer su -c 16:16:37 done. ran and it works. 16:16:38 Hello, world! 16:16:38 salvachn, whatever works for you 16:16:41 type hello & you get hello world is it mether 16:16:41 not important 16:16:43 ? 16:16:48 yep 16:16:52 everyone gets that? 16:17:03 rpm -e hello 16:17:07 will remove the package 16:17:11 if you run hello again 16:17:16 you will get command not found 16:17:28 quick check is done 16:17:47 yup done 16:17:51 done 16:17:55 yes done 16:18:30 now there is a command called rpmlint 16:18:35 that catches common mistakes 16:18:41 to really verify that 16:18:44 done 16:18:46 you have run rpmlint 16:18:50 against the spec file 16:18:53 and binary 16:19:08 and source packages 16:19:34 i talked about binary and source 16:19:40 there is a third package as well though 16:19:46 called debuginfo 16:19:49 mether, I get "name-repeated-in-summary" warning on the source and binary rpms. 16:19:52 everyone saw that? 16:20:04 yeah 16:20:14 yes 16:20:17 salvachn, rpmlint -I will tell you what that means 16:20:21 yes 16:20:34 mether` ! 16:20:36 this contains the debug information for the software 16:20:42 it is useful 16:20:45 for example 16:20:48 when there is a crash 16:20:51 and you want to know 16:20:51 why 16:20:55 run rpmlint against spec, srpm,rpm ? 16:21:06 you have to run rpmlint against debug info package 16:21:07 as well 16:21:28 hakmn, yes. spec binary, source and debuginfo packages 16:21:34 run rpmlint against all of them 16:21:47 rpmlint will show warnings and errors at times 16:21:59 yes 16:22:00 and rpmlint -I will explain what those means 16:22:12 you can fix them usually by understanding what it means 16:22:18 salvachn, what did you get 16:22:22 mether, I did it. 16:22:22 by running 16:22:33 rpmlint -I name-repeated-in-summary 16:22:40 Program name was repeated in summary. so it might have looked awkward 16:22:42 did you understand what it means 16:22:46 correct 16:22:47 http://fpaste.org/AyGU/ 16:22:52 every thing running fine no error 16:23:13 gotunandan, perfect 16:23:20 salvachn, you fixed yourrs? 16:23:23 * salvachn got "The name of the package is repeated in its summary. This is often redundant 16:23:23 information and looks silly in various programs' output. Make the summary 16:23:23 brief and to the point without including redundant information in it. 16:23:23 " 16:23:35 what was the summary before 16:23:40 and how did you fix it 16:23:41 mether, yes. fixed. rpmlint shows no errors or warnings now. 16:24:03 mether, edited Summary: 16:24:08 from what to what 16:24:14 i am just asking for everyone to learn 16:24:17 from your mistake 16:24:43 "The sample GNU Hello program" to "A sample rpm test program" 16:24:48 so does everyone have no rpmlint warnings 16:24:53 no 16:25:03 no errors 16:25:06 everyone is good 16:25:09 yeah 16:25:14 everyone has hello package installed 16:25:16 ? 16:25:22 lets play with it a little bit 16:25:26 yeah no error or no warning 16:25:33 mether: sure :) 16:25:43 run rpm -qi hello 16:25:47 rpm -qd hello 16:25:52 rpm -ql hello 16:26:21 -qi = query information 16:26:32 which is straight out of the first section of your spec file 16:26:36 you see that? 16:26:38 next is 16:26:43 query documentation 16:26:44 qd 16:26:54 which shows the files you have marked as documentation 16:26:58 -qd: doc files, -ql: l10n files. 16:27:08 cool 16:27:08 rpm -ql 16:27:10 query list 16:27:15 which will list all the files 16:27:27 RPM uses a database to store all that information 16:27:35 * salvachn remembers to use less for large output 16:27:39 and it knows all that because you provided the data in your spec file 16:27:50 there are minor tweaks possible 16:27:52 in this spec 16:27:56 but we are pretty good 16:27:58 at this point 16:28:14 congrats everyone for sitting through with me for 3 hours on this session 16:28:27 :) 16:28:29 and learning to build a pretty good and fairly complex program 16:28:30 mether, thanks. I learnt quite a lot. 16:28:40 thanks mether 16:28:42 thanx mether 16:28:44 mether: thank 16:28:45 despite the pretty boring output 16:28:46 :-) 16:28:53 :D 16:28:55 the package is fairly complex 16:29:02 because of L10N files 16:29:04 it was brilliant :) 16:29:04 info files 16:29:05 man page 16:29:06 it was quite interesting :) 16:29:07 and binary 16:29:14 mether: ! 16:29:18 morpheuss, shoot 16:29:40 As a package maintainer we are going to package different kind of stuff 16:29:44 yes 16:29:52 from games to applications etc., 16:29:56 yes 16:30:05 whats the best way to approach the packaging 16:30:17 meaning? 16:30:33 since each kind of package will have different kind of working and configurations 16:30:33 the general approach I take 16:30:43 is to build the binary 16:30:44 from source 16:30:48 without using rpm 16:30:57 ok 16:30:57 understand how it actually builds first 16:31:02 read the configure --help 16:31:05 read the make file 16:31:10 and go through the sources quickly 16:31:11 just a glance 16:31:15 ok 16:31:21 mether, I once tried creating a spec for songbird for three days, and finally gave up. For such programs, is there any way? 16:31:22 and then fill in the sections one by one 16:31:29 and repeatedly run rpmbuild 16:31:32 trial and error 16:31:34 to fix the mistakes 16:31:36 and gaps 16:31:48 mether: ok 16:32:00 salvachn, that was a very messy package and songbird dropped linux support. program got forked as well 16:32:04 there is a long review request 16:32:06 * nmudgal is checking logs due to internet connection problem dc 16:32:08 for songbird 16:32:12 in google 16:32:14 search for 16:32:22 fedora package review songbird 16:32:23 mether: thanks :) 16:32:30 for learning what was done with it 16:32:32 will keep that in mind 16:32:41 you need a lot of patience 16:32:41 mether, the spec I found on rutgers.rdu for songbird was very long winded. 16:32:57 salvachn, yeah. it was a very complex piece of software 16:33:05 not everything is a hello world program 16:33:07 obviously 16:33:23 if the software is complex, the spec file will reflect its complexity 16:33:27 rpm has lots of macros 16:33:31 to handle common cases 16:33:33 mether, what were the two additions "post and preun 16:33:37 and fedora has extensive guidelines 16:33:40 at 16:33:40 mether, I hope packaging gnome applets and kde plasmoids will not be that hard. 16:33:59 https://fedoraproject.org/wiki/Packaging:Guidelines 16:34:06 mether, the official docs for fedora are the best for any OS I've used. 16:34:14 salvachn, nope. you can cheat 16:34:22 the best way to actually write spec files 16:34:27 is not write them from scratch 16:34:32 but find a close match 16:34:34 and modify it 16:34:40 so if you are packaging a gnome applet 16:34:45 take a look at the spec file 16:34:49 or an existing applet 16:34:50 mether: so is there any way of judging how complex packaging gonna be for a particular source (apart from size ;) ) 16:34:52 that is packaged 16:35:04 morpheuss, difficult. comes with experience 16:35:17 morpheuss, just like the hello world program 16:35:17 mether: oh i see 16:35:20 things that look simple 16:35:23 are not necessarily 16:35:24 mether, the fundamental philosophy of free software :-) find a file, edit it for ur use, and mention the original author 16:35:25 simple 16:35:27 mether: let's say i try for assualt cube a game building rpm package then it needs seperate dependecies to install from source files then how to add those depedency into spec just name like we did in hello or what ? 16:35:37 nmudgal, yep 16:35:40 same concepts 16:35:52 Fedora spec files are all at 16:35:52 cvs.fedoraproject.org/viewvc/rpms 16:36:03 #link http://cvs.fedoraproject.org/viewvc/rpms 16:36:13 there are thousands and thousands of spec files 16:36:23 i am sure you can find one that is close to what you want 16:36:26 just reuse it 16:36:33 and mention that in your changelog 16:36:45 - modified spec from foo 16:36:47 you are good to go 16:36:50 mether` but how to determine dependencies for a source ? 16:37:00 good question 16:37:07 we used rpmbuild now 16:37:12 but that is not the best way 16:37:20 because we dont know whether it is picking up 16:37:21 dependencies 16:37:24 mether: then we need to download those dependecy & install seperately or spec will see it on it's own just by mentioning name in it ? 16:37:28 from what is already installed on your sytem 16:37:33 there is a tool called mock 16:37:38 which builds the rpm 16:37:40 in a chroot 16:37:45 and will fail 16:37:49 if the dependencies 16:37:53 are not strictly defined 16:37:57 for example 16:38:11 rpmbuild succeeded for you folks 16:38:22 despite not specifying the BuildRequires 16:38:26 in the first instance 16:38:30 yes 16:38:33 what was our BuildRequires? 16:38:35 yes 16:38:39 gettext 16:38:41 gettext 16:38:43 correct 16:38:45 why? 16:38:53 because gettext was already installed in your systems 16:38:54 cuz of info,man pages 16:39:06 it is translator library we need 16:39:06 if it is not then mether ? 16:39:13 it would have failed 16:39:16 so how do we know 16:39:26 that use has gettext on his/her system 16:39:31 if we did not specify it? 16:39:34 mock uses a chroot 16:39:36 and will fail 16:39:46 if the dependencies are not explicit 16:39:52 that is why we recommend using it 16:39:56 instead of rpmbuild 16:40:16 i am not going to covering mock now 16:40:21 but it is all described at 16:40:22 http://fedoraproject.org/wiki/Projects/Mock 16:40:25 but user has to install dependency if no is there seperately ? 16:40:29 and the rpm tutorial linked earlier 16:40:30 ohk, 16:40:37 also has mentioned it 16:40:40 please go through that 16:40:43 and try using it 16:40:48 if you have any problems come and ask me 16:40:53 i am usually in this channel 16:41:09 everyone who attended this workshop 16:41:12 please drop me a email 16:41:13 to 16:41:18 sundaram@fedoraproject.org 16:41:26 so that i can follow up with you folks later on 16:41:34 nmudgal, that is why we use yum 16:41:40 yum will download 16:41:43 dependencies 16:41:46 when requires 16:41:49 and install them 16:41:51 automatically 16:42:00 as long as you have done the packaging properly 16:42:06 mether` yum uses mock ? 16:42:14 no no 16:42:14 mether, yum does not allow me to install this hello rpm package, because it is unsigned ? 16:42:17 mether: let's say we have no internet & only want to use rpm then ? 16:42:21 mock is for building a package 16:42:28 and yum is for installing a package 16:42:33 mock uses yum internally 16:42:36 not viceversa 16:42:39 mether` yes 16:42:56 gotunandan, yeah you got to use --nogpgcheck to install it 16:43:05 all Fedora packages are signed by default 16:43:19 yum will check for gpg sign and will fail by default 16:43:21 for security reasons 16:43:29 since you built that package locally 16:43:36 you can use --nogpgcheck 16:43:38 to install it 16:43:56 mether` i can make local repo & put this hello.rpm there 16:43:59 nmudgal, in that case there are other solutions like packagekit service packs and running your own repository 16:44:06 out of scope for this workshop 16:44:13 yum install hello --nogpgcheck 16:44:16 i will maybe cover all that in a different workshop 16:44:21 mether, any resources for packagekit service packs? 16:44:30 salvachn, google? :-) 16:44:40 mether: ohhk means rpm packages doesn't handles dependency problem actually ? :) 16:44:43 hakmn, yeah that would work 16:44:45 mether, yeah, (s)he is our best friend. 16:45:01 nmudgal, rpm is a low level tool. yum is what you would normally use 16:45:07 rpm specifies the dependencies 16:45:12 yum downloads them 16:45:13 mether, ahh thanks ! 16:45:20 mether` rpm is not the solution for dependency resolving 16:45:32 rpm is a package manager 16:45:45 yum is a dependency resolver using rpm internally 16:45:49 as long as your spec file 16:45:53 has the build requires 16:45:55 and requires 16:46:00 specified correctly 16:46:04 your packages will work fine 16:46:18 good packages = yum does the right job 16:46:19 mether` you said that mock will check for BuildRequires ! 16:46:27 means we can't install vlc even without yum through rpm if we have dependecy problem 16:46:27 hakmn, yes 16:46:48 but how will we know what does BUild Requires should consist of ? 16:47:02 hakmn, you look at the error message 16:47:03 nmudgal: install dependency one by one then install vlc :) 16:47:07 hakmn: use mock ! i think isn't it mether ? 16:47:08 and figure it out 16:47:14 depndencies* 16:47:24 nmudgal, no. again. mock is for building packages 16:47:29 yum is for installing them 16:48:02 mether: go to go now,thanks for the great class :) 16:48:04 a good quality repository will have all the packages and dependencies together 16:48:07 morpheuss: ok got it ! 16:48:09 alright 16:48:12 installing dependencies one by one is fun... haha ! 16:48:17 if anyone else has any questions 16:48:20 about hello package 16:48:22 ask 16:48:23 otherwise 16:48:29 i am ending this session now 16:48:33 we can still continue talking later 16:48:43 any last minute questions? 16:48:55 or shall i end? 16:48:56 no, just last minute thanxgiving 16:49:08 mether: thanks for the great session :) 16:49:10 thanx for conducting mether 16:49:14 mether, post and preun ? 16:49:19 alright. thanks everyone for attending. hope to see good quality packages from you all 16:49:23 gotunandan, yes 16:49:31 let me explain that briefly 16:49:31 or later ? 16:49:42 preun 16:49:43 stands 16:49:46 i'll mail you , you can reply back.... 16:49:49 for preuninstall 16:49:53 which means do 16:49:54 this job 16:49:59 before installing the package 16:50:03 %post 16:50:07 is post installation 16:50:08 mether` whats diff between build requires & requires ? 16:50:12 cleanup jobs 16:50:15 do this job 16:50:19 after installation 16:50:28 %post installs the info file 16:50:34 scripts 16:50:34 and post install would be something to setup after installing that particular rpm 16:50:39 and preu 16:50:46 removes the info file from the info db 16:50:50 like a new kernel would want to run update-grub ? 16:50:52 and then rpm will remove the entire package 16:50:57 gotunandan, precisely 16:51:06 gotunandan, take a look at grub spec 16:51:13 and you will see a parallel 16:51:18 fedora-cvs grub 16:51:26 and it will download it for you 16:51:29 all the branches 16:51:31 take a look 16:51:35 fedora-cvs 16:51:42 ok 16:51:43 hakmn, i explained that earlier 16:51:47 build requires 16:51:53 is what you need to compile the package 16:52:01 requires is what you need to run the package 16:52:12 compiling in this case requires gettext library 16:52:16 to convert po files 16:52:19 to mo files 16:52:28 but gettext is not needed to run the package 16:52:31 so gettext 16:52:37 here is a build requirement 16:52:42 and info is a run time requirement 16:52:49 hakmn, understood? 16:53:19 not further questions? 16:53:46 ok 16:53:49 ending the meeting 16:53:50 none :), thanks a lot 16:53:50 in 16:53:52 5 16:53:53 4 16:53:55 3 16:53:56 2 16:53:57 1 16:54:00 #endmeeting