On Wed, Mar 8, 2017 at 1:39 PM, Carlos E. R.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
On 2017-03-08 19:31, Luiz Fernando Ranghetti wrote:
Hi,
I'm wondering whats the difficult in create a .spec file, especially the part of don't know where to put files. Just do it whitout the %files, it will display the files that are not owned, so you put this files in %files sections...
What will display that list?
Even a noob like me (no knowledge on any programming language, incapable of create a single script) can do some packaging in OBS
Well, I do write scripts, and programs. I can't create specs.
I see lists of files. I see defines. I see macros. I see... No, it is bewildering. :-(
Carlos, At least take 10 minutes and see what it's like: 1) Use you bugzilla credential to log into https://build.opensuse.org/ (that does some one time setup stuff the first time). 2) Install osc (zypper in osc) 3) Create a new working directory tree area to work in. I use ~/obs mkdir ~/obs; cd ~obs 4) Check-out a package from OBS. This will get dc3dd from Leap 42.1 osc co openSUSE:Leap:42.1:Update dc3dd 5) Hop into the directory that now has the files needed to do a local build. cd i~/obs/openSUSE:Leap:42.1:Update/dc3dd 6) Confirm you can do a local build (--local is needed for this because the tarball is no longer on line where it was) osc build --local That causes a chroot jail to be built with a new set of RPMs downloaded from OBS. Inside the jail the build pre-reqs are installed and the build performed. The last few lines of the above tell you where to find the RPMs. You can install the RPMs or copy them to some local repo if you like. 7) Scream and shout that you have built your first set of RPMs via the OBS/osc mechanism 8) Break the spec file by deleting the lines immediately following %files near the end of the spec file vi *.spec (and comment out these 4 lines from the %files section # %doc ChangeLog COPYING NEWS THANKS # %doc *.txt # %{_bindir}/dc3dd # %{_mandir}/man1/dc3dd.1%{ext_man} 9) Try to build again, but note that you get errors at the end of the output: osc build --local [ 39s] Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/abuild/rpmbuild/BUILDROOT/dc3dd-7.2.0-0.x86_64 [ 39s] error: Installed (but unpackaged) file(s) found: [ 39s] /usr/bin/dc3dd [ 39s] /usr/lib/debug/.build-id/1b/4095a17a0d90380f46f99d989398e0f8d95563 [ 39s] /usr/lib/debug/.build-id/1b/4095a17a0d90380f46f99d989398e0f8d95563.debug [ 39s] /usr/lib/debug/usr/bin/dc3dd.debug [ 39s] /usr/share/man/man1/dc3dd.1.gz [ 39s] [ 39s] [ 39s] RPM build errors: [ 39s] Installed (but unpackaged) file(s) found: [ 39s] /usr/bin/dc3dd [ 39s] /usr/lib/debug/.build-id/1b/4095a17a0d90380f46f99d989398e0f8d95563 [ 39s] /usr/lib/debug/.build-id/1b/4095a17a0d90380f46f99d989398e0f8d95563.debug [ 39s] /usr/lib/debug/usr/bin/dc3dd.debug [ 39s] /usr/share/man/man1/dc3dd.1.gz [ 39s] [ 39s] Thermaltake failed "build dc3dd.spec" at Wed Mar 8 19:19:29 UTC 2017. [ 39s] 10) Now the actual tricky part Note that several of the unpackaged files are debug files. Ignore them. Look at the files you don't have included and at the lines you commented out. Note the correlation and uncomment these two: %{_bindir}/dc3dd %{_mandir}/man1/dc3dd.1%{ext_man} 11) Try the build again osc build --local Success again! 12) Compare what you have with what's in OBS osc diff %files %defattr(-,root,root) -%doc ChangeLog COPYING NEWS THANKS -%doc *.txt +# %doc ChangeLog COPYING NEWS THANKS +# %doc *.txt %{_bindir}/dc3dd %{_mandir}/man1/dc3dd.1%{ext_man} So you're removed the inclusion of some doc files, but at least for building, that didn't break anything. If you tried to issue an SR to do that, you would get blocked. Either by automation or a juman review. 12) Restore you spec file to virgin rm dc3dd.spec osc up ============ And that's the first basics, Admittedly there is a lot more to learn, but it is doable and the ability to checkout working packages as a reference really simplifies the learning curve. Greg -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org