Skip to content

RSE porting guide

andy diller edited this page Jan 16, 2023 · 5 revisions

Unxmaal contributed this short concise port guide at some point. I've updated it for fresh porting in 2023. There is only 007.

Before You Begin

Make sure have all the RPM structure setup and RSE 007 installed and working. Your sugshell should be working. You should sort of know what sugshell is doing.

Finding SRCRPMS

If you find your package in there your are 80% of the way already. Take that SRCRPM and use it as the basis of your port to RSE.

Setup Structure

In your homedir:

~/rpmbuild
~/sgug-rse.git #cloned from sgidev/sgug-rse

On Github:

  • fork sgug-rse.git to your own repo
  • clone it to some sgi machine with 007 (RSE 007 should have working ssh and git)
  • cd sgug-rse
  • git checkout -b wip-testing
  • touch a file, git add and commit it, git push origin wip-testing
  • From Github, create a pull request to merge the upstream sgidev/sgug-rse.git wip-testing branch into your fork's wip-testing branch
  • on your local repo, git pull origin wip-testing

Making a new port

cd ~/rpmbuild
rpm -Uvh http://fedora.mirrors.pair.com/linux/releases/31/Everything/source/tree/Packages/a/auto-destdir-1.11-16.fc31.src.rpm
  • Now try to build it!

rpmbuild -ba --undefine=_disable_source_fetch -ba SPECS/auto-destdir.spec

  • If it builds, sudo install it:

sudo rpm -Uvh /usr/people/edodd/rpmbuild/RPMS/mips/auto-destdir*.rpm

Adding a working spec to wip-testing

  • On my non-SGI workstation, in sgug-rse/
git checkout wip-testing
git checkout -b auto-destdir
  • On my SGI scp SPECS/auto-destdir.spec me@myhost:/Users/me/projects/github/mygit/sgug-rse/packages/auto-destdir/SPECS/.

  • On my workstation

git add SPECS/auto-destdir.spec
git commit -m "added auto-destdir"
git push origin wip-testing 
  • On github, my fork
  • Create a Pull Request, across forks, from your repo's auto-destdir branch into sgidev/sgug-rse's wip branch

Failure Scenario 1: something's wrong in the spec

First, copy the official FC31 spec file to ".spec.origfedora" . Include this with your fixed spec.

Typically this happens when you're missing a dep. If you know you have a dep and it's named differently, comment the BuildDep line out; don't delete it.

There could also be a Linuxism, or some other problem.

Generally, please don't delete lines. Comment them out.

Failure Scenario 2: the source needs to be patched.

  • cd ~/rpmbuild/SOURCES
  • extract foo-bar.1.0.0.tar.gz
  • cp -Ra foo-bar.1.0.0 foo-bar.1.0.0.orig
  • cd foo-bar.1.0.0/
  • Play some code golf!
  • cd ~/rpmbuild/SOURCES
  • diff -Naur foo-bar.1.0.0.orig foo-bar.1.0.0 > foo-bar.irixfixes.patch

In the spec file, we start our patch numbers at 100:

Patch100: foo-bar.irixfixes.patch

You can look at other specs to see how to patch.

I prefer the lazy %autosetup -p1 .

Write out the spec file, then try to rpmbuild per above. If it works, great!

scp the patch and the spec, then git add, commit and push per above.