Tips for rebuilding your own packages

With rpmbuild you build an rpm for the architecture you are using. Do so and test the package you obtain from compilation and don’t care about other architecture at this stage. You will not upload the rpm package but only the source(s), the .spec and patch files so an rpm for all architecture will be build on ABF directly.

As explain by @TPG %_smp_mflags should be removed from .rpmmacros. It was an error from mine. About %__arch_install_post macro I’m not sure OpenMandirva has /usr/lib/rpm/check-buildroot and /usr/lib/rpm/check-rpaths so it may cause a fault.

:+1: great! You may upload you work online by following this guide or just make a pull request on github repo.

Sorry for naive questions, what will I upload or make a pull request?

I have
rpmbuild/BUILD/texstudio2.12.4 <= a directory likely to be the result of tar -xf texstudio-2.14.4.tar.gz
rpmbuild/SRPMS/texstudio-2.12.4-1.src.rpm <=The src.rpm just created
rpmbuild/RPMS/x86_64/texstudio-2.12.4-1-omv2015.0.x86_64.rpm <=The binary rpm just created
rpmbuild/SPECS/texstudio/texstudio.spec <= The spec file

I also have

rpmbuild/BUILDROOT/var/lib/rpm with various files:
__db.001 __db.003 __db.005 log/ Providename
__db.002 __db.004 __db.006 Packages

As explained in the other guide you forked the texstudio repo you push there the spec file and, eventually, all patches you use then you make the pull request. Also you have to upload the source on file-store (eventually you may use abf put for this).

btw: rpmbuild is able to download the Source* for you

rpmbuild -bf texstudio.tex

Sure I’m messing something. I was able to upload the spec file, the source (tar.gz) was said to be to big and could not be uploaded … I really don’t know what I’m doing. I’ll try again later. I guess I have to read more carefully the tutorial https://forum3.openmandriva.org/t/how-to-use-abf-to-build-rpms/460/4.

Who said that? Where are you trying to upload and what?

After uploading the texstudio.spec file, I was trying to upload the source texstudio-2.12.4.tar.gz here,
Upload files · adhefe/texstudio · GitHub

and got the error message,

Yowza, that’s a big file. Try again with a file smaller than 25MB.

You should upload on github repository only .spec and .patch files. Files listed in Source* field(s) in .spec file should be uploaded on file-store, as explained in the guide I linked above. An exception could be done for very small sources (for instance single configuration file or single icon file). This process could be automatize if you put all the sources in the same directory of .spec file and use abf put command (note: this command uploads the sources on file-store and updates the .abf.yml file at once).

Ok. About abf put, which directory is It to be used?

The one you got after git clone.

I tried to list a sequence of actions could be useful for your work so it may be more clean:

  1. fork texstudio on github
  2. cd ~/rpmbbuild/SPECS
  3. git clone https://github.com/youraccount/texstudio.git
  4. cd ~/rpmbbuild/SPECS/texstudio
  5. make all your changes
  6. rpmbuild -bf texstudio.spec
  7. sudo urpmi --buildrequires
  8. try to build and eventually fix
  9. when it is all ready copy all the files listed in Source* filed(s) into ~/rpmbbuild/SPECS/texstudio`
  10. 'abf put ’
  11. push the changes on your github account
  12. make a pull request

Mandian,

Many thanks for the list of actions.

But I’m stopped at step 10. And I don’t know how to upload the source at file-store.

The error is:

$ abf put
Uploading texstudio-2.12.4.tar.gz (25.2M)
Traceback (most recent call last):
File “/usr/bin/abf”, line 1748, in
command_line.func()
File “/usr/bin/abf”, line 841, in put
error_count = upload_files(models, min_size, remove_files=not command_line.do_not_remove_files, path=path, upload_all=command_line.upload_all)
File “/usr/lib/python2.7/site-packages/abf/console/misc.py”, line 558, in upload_files
sha_hash = models.jsn.upload_file(source)
File “/usr/lib/python2.7/site-packages/abf/api/jsn.py”, line 286, in upload_file
self.log.error(_(“Could not upload file. HTTP error %(status)s %(reason)s”) % (resp.status, resp.reason))
TypeError: format requires a mapping

Thought it could be a network problem and repeated the command twice with the same output.

Please could you try with verbose output enabled?
abf put -v

Yes, thanks for examining,

$ abf put -v
2017-07-17 21:16:46,992 DEBUG in abf:put:826: PUT started
2017-07-17 21:16:46,992 DEBUG in abf:update_location:1554: Updating project location for /home/adelson/rpmbuild/SPECS/texstudio
2017-07-17 21:16:46,992 DEBUG in misc.py:execute_command:358: Executing command: [‘git’, ‘remote’, ‘show’, ‘origin’, ‘-n’]
2017-07-17 21:16:46,995 DEBUG in misc.py:execute_command:398: Child returncode was: 0
2017-07-17 21:16:46,995 DEBUG in misc.py:upload_files:488: Uploading files for directory /home/adelson/rpmbuild/SPECS/texstudio
2017-07-17 21:16:47,130 DEBUG in misc.py:is_text_file:453: Magic type of file texstudio-2.12.4.tar.gz is application/x-gzip; charset=binary
2017-07-17 21:16:47,131 DEBUG in jsn.py:upload_file:250: Looking for “texstudio-2.12.4.tar.gz” in file-store…
2017-07-17 21:16:47,177 DEBUG in jsn.py:upload_file:252: File hash is 4b1afb4d5eb4b53ed59a154764207b2272d9cd3b
2017-07-17 21:16:47,178 DEBUG in jsn.py:get_url_contents:138: Fetching url http://file-store.openmandriva.org/api/v1/file_stores.json?hash=4b1afb4d5eb4b53ed59a154764207b2272d9cd3b
2017-07-17 21:16:47,178 DEBUG in jsn.py:get_url_contents:158: It was cached! ETag: W/“d751713988987e9331980363e24189ce”
2017-07-17 21:16:47,644 DEBUG in jsn.py:get_url_contents:170: Getting cached result (cache was validated)
2017-07-17 21:16:47,672 INFO in jsn.py:upload_file:275: Uploading texstudio-2.12.4.tar.gz (25.2M)
Traceback (most recent call last):
File “/usr/bin/abf”, line 1748, in
command_line.func()
File “/usr/bin/abf”, line 841, in put
error_count = upload_files(models, min_size, remove_files=not command_line.do_not_remove_files, path=path, upload_all=command_line.upload_all)
File “/usr/lib/python2.7/site-packages/abf/console/misc.py”, line 558, in upload_files
sha_hash = models.jsn.upload_file(source)
File “/usr/lib/python2.7/site-packages/abf/api/jsn.py”, line 286, in upload_file
self.log.error(
(“Could not upload file. HTTP error %(status)s %(reason)s”) % (resp.status, resp.reason))
TypeError: format requires a mapping

That’s strange. Have you a valid account for ABF and file-store? In the case this time you may try to upload the source file texstudio-2.12.4.tar.gz on file-store using the web interface then manually update the file abf.yml (I did so before to learn about abf cli).

Thanks,

I successfully upload using the http://file-store.openmandriva.org/ link.
Still don’t know why can’t I do it using the command abf put …

Anyway, having already uploaded the source and spec files (I did not find and use any patch), what else should I do to make this available to everybody else?

By the way, I’ve seen bero has a new version of texlive package at abf git hub. Why this doesn’t go to regular updates?

I can’t say … maybe your abf is not well configured. Try to remove the configuration file ~/.abfcfg and rebuild a new one. You may also post it here so I can read but absolutely don’t post it here unless you removed the password field, of course.

First you should update the file .abf.yml with the new source. Then you may make a pull request to the official github repository and open a package update request on bugzilla specifying there you have already made a pull request. Also you may try to build the package on ABF a publish it in you personal repo either using the web interface (suggested) or using abf build commands (but you may need to read documentation before to use it properly).

I guess he’s waiting for new release or even new version. Maybe he hasn’t had the time to fix it properly yet.

Mandian,

Many thanks for your tips.

It is not clear to me where I can find the source I’ve upload and how can I manage it to appear at .abf.yml.

At least, using buzilla is something I’m used to.

The sources are stored on file-store but they are re-named using their sha1 sum and the file .abf.yml in github repo keep trace of it. When you build the package on ABF it downloads the source from file-store and check it the sha1 sum is equal to the one in .abf.yml. So to update the file .abf.yml you just need to calculate the sha1sum of texstudio-2.12.4.tar.gz and update in the file .abf.yml.