Roll your own package, RPM repo, part 1

(This is more a note to myself than anything else. Surely, there are lots of references out there on the net... ;))

Part I. Build the package
  1. Prepare the build environment.
    mkdir -p builds/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
  2. Add the sources to be built.
    mkdir builds/BUILD/this-package-1.0 && cd builds/BUILD
    tar czvf ../SOURCES/this-package-1.0.tgz this-package-1.0
    cd ..
    
  3. Write the spec file using the skeleton below.
    vi SPECS/this-package.spec


  4. Build and sign the package.
    gpg --export -a key-id > KEYS/RPM-GPG-KEY-username
    vi ~/.rpmmacros
    
    %_signature gpg
    %_gpg_path /home/username/.gnupg
    %_gpg_name User Name (key-id) 
    %_gpgbin /usr/bin/gpg
    
    rpmbuild -ba --clean --sign SPECS/this-package.spec
    
  5. Test and verify.
    sudo rpm -ivh ~username/builds/RPMS/noarch/this-package-1.0-0.1.noarch.rpm
    rpm -Vp ~username/builds/RPMS/noarch/this-package-1.0-0.1.noarch.rpm
    

Comments

Popular posts from this blog

Pull files off Android phone