rpmdev
is mostly optional. rpm
is enough. The following describes the minimum steps to package a script program into a RPM file on Debian.
Install rpmbuild
:
apt-get install rpm
Create a helloworld
program:
cat > helloworld <<EOF
#! /bin/bash
printf "Hello World!\n"
EOF
chmod +x helloworld
Create a minimal specification helloworld.spec
:
Name: helloworld
Version: 1.0
Release: 1%{?dist}
Summary: Hello World
License: GPLv3+
BuildArch: noarch
%description
Hello World!
%prep
%build
%install
mkdir -p %{buildroot}/%{_bindir}
install -m 0755 %{name} %{buildroot}/%{_bindir}/%{name}
%files
%{_bindir}/%{name}
%changelog
Build the RPMs:
rpmbuild -ba --build-in-place --define "_topdir $(pwd)/rpm" helloworld.spec
mv rpm/SRPMS/*.rpm .
mv rpm/RPMS/*/*.rpm .
rm -rf rpm
But you will not be able to install it on Debian or Ubuntu. The installation requires Fedora or Red Hat.