333e3ff
#grab gofed from https://github.com/gofed/gofed
333e3ff
#follow instructions for install
333e3ff
333e3ff
#choose which version of the repo you want to build. For ignition it was 0.2.6 and the commit was 76107251acd117c6d3e5b4dae2b47f82f944984b
333e3ff
333e3ff
[vagrant@vanilla-f28 ~]$ gofed repo2spec --detect github.com/coreos/ignition --commit 76107251acd117c6d3e5b4dae2b47f82f944984b  --with-extra --with-build -f                                                                                                                                                 
333e3ff
Repo URL: github.com/coreos/ignition
333e3ff
Commit: 76107251acd117c6d3e5b4dae2b47f82f944984b
333e3ff
Name: golang-github-coreos-ignition
333e3ff
333e3ff
(1/4) Checking if the package already exists in PkgDB
333e3ff
(2/4) Collecting data
333e3ff
(3/4) Generating spec file
333e3ff
(4/4) Discovering golang dependencies
333e3ff
Discovering package dependencies
333e3ff
        Class: github.com/ajeddeloh/go-json (golang-github-ajeddeloh-go-json) PkgDB=False                                                             
333e3ff
        Class: github.com/aws/aws-sdk-go (golang-github-aws-aws-sdk-go) PkgDB=True                                                                    
333e3ff
        Class: github.com/coreos/go-semver (golang-github-coreos-go-semver) PkgDB=True                                                                
333e3ff
        Class: github.com/coreos/go-systemd (golang-github-coreos-go-systemd) PkgDB=True                                                              
333e3ff
        Class: github.com/pin/tftp (golang-github-pin-tftp) PkgDB=False
333e3ff
        Class: github.com/sigma/vmw-guestinfo (golang-github-sigma-vmw-guestinfo) PkgDB=False                                                         
333e3ff
        Class: github.com/vincent-petithory/dataurl (golang-github-vincent-petithory-dataurl) PkgDB=False                                             
333e3ff
        Class: github.com/vmware/vmw-ovflib (golang-github-vmware-vmw-ovflib) PkgDB=False                                                             
333e3ff
333e3ff
Discovering test dependencies
333e3ff
        Class: github.com/stretchr/testify (golang-github-stretchr-testify) PkgDB=True                                                                
333e3ff
333e3ff
Spec file golang-github-coreos-ignition.spec at /home/vagrant/golang-github-coreos-ignition         
333e3ff
333e3ff
# spec file now at /home/vagrant/golang-github-coreos-ignition/golang-github-coreos-ignition.spec
333e3ff
333e3ff
# go through and fix things up - see diff
333e3ff
d551c56
# generate bundled provides by copying/using go-mods-to-bundled-provides.py to
d551c56
# the ignition source folder and then running it. copy into spec file
333e3ff
# should be done by gofed at some point - https://github.com/gofed/gofed/issues/42
333e3ff
333e3ff
# grab source tarball
333e3ff
# rpmspec -P ignition.spec | grep Source0
333e3ff
# pushd $HOME/rpmbuild/SOURCES/
333e3ff
# curl -L -O $URL
333e3ff
# popd 
333e3ff
333e3ff
333e3ff
# build RPM
c77c54b
$ rpmbuild -ba ignition.spec
333e3ff
333e3ff
# find a srpm in `$HOME/rpmbuild/SRPMS`
333e3ff
# find a RPM in `$HOME/rpmbuild/RPM/arch/`
333e3ff
# see if the dependencies are proper
333e3ff
333e3ff
$ rpm -qpR $HOME/rpmbuild/RPMS/x86_64/ignition-0.26.0-0.1.git7610725.fc28.x86_64.rpm
333e3ff
333e3ff
333e3ff
# setup to run koji, ref: https://fedoraproject.org/wiki/Using_the_Koji_build_system
333e3ff
$ fedora-packager-setup
333e3ff
$ kinit <username>@FEDORAPROJECT.ORG
333e3ff
333e3ff
333e3ff
# to build it on koji run:
333e3ff
$ koji build --scratch rawhide /path/to/srpm/ignition-0.26.0-0.1.git7610725.fc28.src.rpm