Skip to content

Instantly share code, notes, and snippets.

@soardex
Created November 28, 2016 18:02
Show Gist options
  • Save soardex/a1282872a7b3f3b49cf45f95cdd79739 to your computer and use it in GitHub Desktop.
Save soardex/a1282872a7b3f3b49cf45f95cdd79739 to your computer and use it in GitHub Desktop.
Create RPMS CentOS
sudo yum install rpm-build
mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS,TMP}
touch ~/.rpmmacros
~~~
%packager ffimusic
%_topdir /home/ffimusic/rpmbuild
%_tmppath /home/ffimusic/rpmbuild/TMP
~~~
note: download source in `SOURCES` directory and put specs in `SPECS` directory.
~~~
Name: sample
Version: 1.0.0
Release: 0
Summary: Sample summary.
Group: Applications/Personal
Source: sample-1.0.tar.gz
License: GPL
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-buildroot
%description
Sample description.
%prep
%setup -q
%build
%install
%clean
rm -rf $RPM_BUILD_ROOT
%post
echo . .
%files
%dir /etc/sample
/etc/sample/backup.sh
~~~
rpm -b or rpmbuild -ba
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment