The original words of Phanes, tirelessly carved into a slab of "No'".

Legacy Packaging

A more readable journal can be found here.

[ phanes@prime.surroindustries.lan ] << ~ >>

[- cat 2017-09-20_rpm-build.txt 
@@@ rpm build instructions
@@ build an SRPM

@ 2017-09-21

/*  Note:

    An SRPM is a .src.rpm file that contains the SOURCE for an RPM
    in most situations this will also include source code for the 
    application and this is compiled during RPM generation. 

    Pipeline for an SRPM:
	$PROGRAM SOURCE, SPEC FILE -(rpmbuild)> $PROGRAM.src.rpm -(mock)> $PROGRAM.rpm


$ sudo dnf install fedora-packager rpmdevtools
$ rpmdev-setuptree
$ cd ~/rpmbuild/SOURCES
$ git clone
$ cd .. && mv Marco/ Marco-1.0 && tar  cvzf Marco-1.0.tgz Marco-1.0/
$ cd ~/rpmbuild/SPECS
$ rpmdev-newspec --macros Marco.spec
/* output
Marco.spec created; type minimal, rpm version >= 4.13.

/*  Note:
    Creating the spec file is actually careful work that is error-prone and requires training and testing.
    You are advised to read the rpm documentation, particularly pertaining to SPEC file SECTIONS and MACROS.

    This is much easier with a build system, either as a result of a cmake build or in a larger system like Koji.

$ vim Marco.spec
Name:           Marco
Version:        1.0
Release:        1%{?dist}
Summary:        An HTTP echo service.  Returns the request it received to an HTTP client in a consumable format.
License:        GPLv3+
Source0:        %{name}-%{version}.tgz

BuildRequires:  cmake boost-devel
Requires:       boost-devel

SURRO Industries' HTTP echo service.  Listens on port 1999, and replays requests to the requesting browser.


%cmake .



* Thu Sep 21 2017 Phanes <>
- Initial version of the package


$ cd ~/rpmbuild/SPECS/
$ rpmbuild -ba Marco.spec

/* compiles and bundles into an SRPM */

@@ Build the SRPM into an RPM

/* initial mock setup */

$ sudo dnf install mock mock-scm
$ sudo usermod -a -G mock Phanes
$ newgrp mock

/* end initial mock setup */

$ rpmbuild -bs Marco.spec

/* Note:
   At this point you've got an RPM and an SRPM for Fedora since I'm on a Fedora system. 
   Probably not desired.
   Mock allows you to compile for other systems.

$ mock -r  <Tab complete for system profiles>
$ mock -r epel-6-x86_64 ~/rpmbuild/SRPMS/Marco-1.0-1.fc25.src.rpm

/* Note:
   Tons and tons and tons of loading.  That's expected.  It's creating a mock build environment for the
   compile so that you're getting a clean package that's aware of the profile of the system it's intended for.
   These packages are not installed on your driver.

   Due to a transition from yum to DNF for RH upstream, which has not yet hit EL6 and EL7, you will need
   a newer version of mock that fixes a bug caused by that change.  It is in the updates-testing repo.

	sudo vim /etc/yum.repos.d/fedora-testing-updates.repo

   Enable it, then `sudo dnf -y update && sudo dnf update mock` 
   Note:  I also had to install the undocumented package yum-utils to bring the /usr/bin/yum-builddep tool back.

   At this point I had to reduce the boost requirement to 1.4 to compile on EL6 which won't compile without a
   full rewrite of my solution since it heavily uses the boost libraries.  EL6 is old.  Trying EL7.

$ mock -r epel-7-x86_64 ~/rpmbuild/SRPMS/Marco-1.0-1.fc25.src.rpm

/* EL7 is also too old for the version of boost used in the application code.  Will have to revisit this for EL distros. */
@ 2017-09-21_2

/* Let's go ahead and bundle the boost dependency too. */

$ cd ~/rpmbuild/SRPMS
$ wget

/* generates a spec file */
$ rpm -i boost*rpm

/* compile to FC package */
$ rpmbuild -ba  boost.spec

/* yay, more dependencies: 
[ phanes@prime.surroindustries.lan ] << ~/rpmbuild/SPECS >>

[- rpmbuild -ba boost.spec 
error: Failed build dependencies:
	libproxy-devel is needed by boost-1.63.0-1.9.fc25.x86_64
	openmpi-devel is needed by boost-1.63.0-1.9.fc25.x86_64

$ cd ~/rpmbuild/SRPMS && wget

$ wget

$ rpm -i libproxy-0.4.15-2.fc26.src.rpm 
$ rpm -i openmpi-1.10.7-1.fc24.src.rpm 

[ phanes@prime.surroindustries.lan ] << ~/rpmbuild/SPECS >>[ phanes@prime.surroindustries.lan ] << ~/rpmbuild/SPECS >>
[- rpmbuild -ba libproxy.spec error: Failed build dependencies: libmodman-devel >= 2.0.1 is needed by libproxy-0.4.15-2.fc25.x86_64 pkgconfig(javascriptcoregtk-4.0) is needed by libproxy-0.4.15-2.fc25.x86_64 pkgconfig(libnm) is needed by libproxy-0.4.15-2.fc25.x86_64 pkgconfig(mozjs-38) is needed by libproxy-0.4.15-2.fc25.x86_64 python3-devel is needed by libproxy-0.4.15-2.fc25.x86_64


There’s a better way to do this I was just hoping to have a clean build tree for boost.  I’m just too fucking tired, I’ll have to carry this over to a third day until I can get some time to myself.

Next Post

Previous Post

Leave a Reply

© 2024 Phanes' Canon

The Personal Blog of Chris Punches