DarkMatter in Cyberspace
  • Home
  • Categories
  • Tags
  • Archives

Package File Watcher entr to RPM


See dsnote "RPM Packaging Notes" for setup the toolchain if you haven't.

List files from existing package

As we don't know which files should be packaged into the final RPM file, run the following command on a host installed entr to list the files:

$ dpkg -L entr
/.
/usr
/usr/local
/usr/local/bin
/usr/local/bin/entr
/usr/local/share
/usr/local/share/man
/usr/local/share/man/man1
/usr/local/share/man/man1/entr.1.gz
/usr/share
/usr/share/doc
/usr/share/doc/entr
/usr/share/doc/entr/LICENSE
/usr/share/doc/entr/NEWS
/usr/share/doc/entr/README.md

So we have the file list of entr package.

Build Package

Create a new RPM spec file and build it:

$ cd ~/rpmbuild/SPECS
$ cat << EOF > entr.spec
Name:           entr
Version:        4.5
Release:        1%{?dist}
Summary:        Run arbitrary commands when files change

License:        ISC
URL:            http://eradman.com/%{name}project/
Source0:        http://eradman.com/%{name}project/code/%{name}-%{version}.tar.gz

BuildRequires:  gcc
BuildRequires:  make

%description
A file watcher, which can run specified commands
when target files change.

%global debug_package %{nil}

%prep
%setup -q

%build
./configure
make

%install
%make_install
mkdir -p %{buildroot}/%{_docdir}/%{name}
cp LICENSE %{buildroot}/%{_docdir}/%{name}/
cp README.md %{buildroot}/%{_docdir}/%{name}/
cp NEWS %{buildroot}/%{_docdir}/%{name}


%check
make test

%files
/usr/local/bin/entr
/usr/local/share/man/man1/entr.1
%dir %{_docdir}/%{name}
%{_docdir}/%{name}/LICENSE
%{_docdir}/%{name}/NEWS
%{_docdir}/%{name}/README.md


%changelog
* Fri Jun 1 2020 Leo <leechau@126.com> - 4.5-1
- First entr package
EOF

$ rpmlint entr.spec
$ rpmbuild -bs entr.spec
$ rpmbuild -bb entr.spec


Published

Jun 1, 2020

Last Updated

Jun 11, 2020

Category

Tech

Tags

  • entr 1
  • rpm 2

Contact

  • Powered by Pelican. Theme: Elegant by Talha Mansoor