grimoire

personal wiki
git clone git://git.pyratebeard.net/grimoire.git
Log | Files | Refs

rpm.md (2129B)


      1 # rpm
      2 
      3 ## how to build rpm videos
      4 - [urban pengiun](#ref#3)
      5     - distributing new repo file
      6     - create new 'build' account
      7     - run `rpmdev-setuptree`
      8         - creates 'rpmbuild' dir structure
      9     - create SOURCES dir structure
     10         ```
     11         cd ~/rpmbuild/SOURCES/
     12         mkdir tuprepo-1/etc/yum.repos.d
     13         ```
     14         *'tuprepo-1' is name and version number*
     15     - copy across repo file
     16         ```
     17         cp /tmp/CentOS-Tup.repo !$
     18         ```
     19         *use '!$' for last arg*
     20     - tar zip dir
     21         ```
     22         tar -cvzf tuprepo-1.tar.gz tuprepo-1/
     23         ```
     24     - create spec file
     25         ```
     26         cd ../SPECS/
     27         rpmdev-newspec tuprepo.spec
     28         vi tuprepo.spec
     29         ```
     30         - spec file details
     31             ```
     32             Name:           qradar_bak                                                                                                      
     33             Version:        1
     34             Release:        1%{?dist}
     35             Summary:        Pull backup data and configuration files for QRadar
     36 
     37             License:        GPL
     38             URL:            https://www.ward.ie
     39             Source0:        qradar_bak-1.tgz
     40 
     41             BuildRoot:      %{_tmppath}/%{name}-buildroot
     42 
     43             %description
     44             Pull nightly data backups and weekly configuration files from QRadar master.
     45             Clean up is carried out weekly
     46 
     47 
     48             %prep
     49             %autosetup
     50 
     51             %install
     52             mkdir -p "$RPM_BUILD_ROOT"
     53             cp -R * "$RPM_BUILD_ROOT"
     54 
     55             %clean
     56             rm -rf "$RPM_BUILD_ROOT"
     57 
     58             %files
     59             %defattr(-,root,root,-)
     60             /usr/local/bin/backup_pull
     61             /usr/local/bin/cleanup
     62             /usr/local/etc/config
     63 
     64             %changelog
     65             * Mon Oct 22 2018 rpmbuild
     66             ```
     67     - build rpm
     68         ```
     69         cd $HOME
     70         rpmbuild -v -bb rpmbuild/SPECS/tuprepo.spec
     71         ```
     72 
     73 ## ref
     74 - :1: https://docs.fedoraproject.org/en-US/quick-docs/creating-rpm-packages/index.html
     75 - :2: https://rpm-packaging-guide.github.io/
     76 - :3: https://www.youtube.com/watch?v=364Plv6zuBU